:root {
  color-scheme: light;
  --brand: #07456f;
  --brand-deep: #053454;
  --brand-soft: #e8f4fa;
  --accent: #43b6ca;
  --glow: #7fd7e5;
  --steel: #8eb8c6;
  --success: #12805f;
  --surface: #ffffff;
  --surface-soft: #f5f9fb;
  --line: #d7e3e8;
  --text: #142638;
  --muted: #5c6f7c;
  --shadow: 0 18px 45px rgba(5, 52, 84, 0.1);
  background: #f5f9fb;
  color: var(--text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-soft);
}

button,
input,
textarea,
select {
  font: inherit;
}

select {
  background: #fff;
  border: 1px solid #cbdde4;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 10px;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--success);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  background: #0e684e;
}

.ghost {
  background: #e7f0f4;
  color: var(--brand);
}

.ghost:hover {
  background: #d7e8ef;
}

.app {
  min-height: 100vh;
  padding: 32px;
}

.hidden {
  display: none !important;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  color: #102338;
  font-size: 38px;
  margin-bottom: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 0;
}

.login-form,
.panel,
.metrics article {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.input-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

input,
textarea {
  background: #fff;
  border: 1px solid #cbdde4;
  border-radius: 6px;
  padding: 0 12px;
}

input {
  min-height: 44px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 138, 162, 0.14);
  outline: 0;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

.message {
  color: #b42318;
  min-height: 20px;
}

.login-hero {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(30deg, transparent 0 48%, rgba(127, 215, 229, 0.2) 48% 49%, transparent 49%),
    linear-gradient(150deg, transparent 0 48%, rgba(5, 52, 84, 0.28) 48% 49%, transparent 49%),
    linear-gradient(115deg, rgba(67, 182, 202, 0.16), transparent 36%),
    linear-gradient(285deg, rgba(7, 69, 111, 0.3), transparent 42%),
    linear-gradient(135deg, #f6fbfd 0%, #dfeef4 18%, #0a3048 18.1%, #071522 53%, #0b2638 100%);
  background-size: 76px 76px, 76px 76px, 124px 124px, 124px 124px, auto, auto, auto;
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
  margin: -32px;
  min-height: 100vh;
  overflow: hidden;
  padding: 32px clamp(24px, 5vw, 82px);
  position: relative;
}

.login-hero::before {
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.06) 28%, transparent 45%),
    linear-gradient(278deg, rgba(127, 215, 229, 0.16), transparent 38%);
  bottom: -8%;
  content: "";
  height: 46%;
  left: 0;
  position: absolute;
  right: 0;
}

.login-hero > * {
  position: relative;
  z-index: 1;
}

.login-nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 16px;
}

.brand-lockup img {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(127, 215, 229, 0.36);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(2, 20, 34, 0.18);
  height: 58px;
  object-fit: contain;
  padding: 7px 10px;
  width: 188px;
}

.brand-lockup span,
.nav-pill,
.product-kicker,
.card-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-lockup span {
  color: #f8fcfd;
}

.nav-pill {
  border: 1px solid rgba(127, 215, 229, 0.34);
  border-radius: 999px;
  color: #e4f8fb;
  padding: 9px 12px;
}

.login-stage {
  align-items: center;
  align-self: center;
  display: grid;
  gap: clamp(40px, 7vw, 120px);
  grid-template-columns: minmax(560px, 1.08fr) minmax(360px, 430px);
  justify-self: stretch;
  margin: 42px auto 0;
  max-width: 1340px;
  width: 100%;
}

.login-product {
  max-width: 820px;
}

.product-logo {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(127, 215, 229, 0.32);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(2, 20, 34, 0.28);
  display: block;
  margin-bottom: 30px;
  max-width: min(560px, 100%);
  object-fit: contain;
  padding: 18px 22px;
  width: 560px;
}

.product-kicker,
.card-kicker {
  color: var(--glow);
}

.login-product h1 {
  color: #fff;
  font-size: clamp(44px, 5.7vw, 74px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
  margin: 18px 0 0;
  max-width: 790px;
}

.login-product p {
  color: #d5e1e8;
  font-size: 19px;
  line-height: 1.55;
  margin-top: 22px;
  max-width: 720px;
}

.login-highlights {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 30px;
  max-width: 760px;
}

.login-highlights span {
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-left: 3px solid var(--glow);
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 14px 16px;
}

.login-form {
  background: rgba(7, 17, 31, 0.74);
  border: 1px solid rgba(205, 231, 240, 0.2);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 13px;
  padding: 30px;
  position: relative;
}

.login-form::before {
  background: linear-gradient(90deg, #dff7fb, var(--glow), #43b6ca, #176f98);
  border-radius: 8px 8px 0 0;
  content: "";
  height: 4px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.login-form h2 {
  color: #fff;
  font-size: 30px;
  margin-bottom: 4px;
}

.login-form label {
  color: #e5edf2;
  font-size: 12px;
}

.login-form input {
  background: #e8eef7;
  border-color: transparent;
  color: #07111f;
  font-weight: 700;
}

.login-form input:focus {
  border-color: var(--glow);
  box-shadow: 0 0 0 3px rgba(127, 215, 229, 0.24);
}

.login-form button {
  background: linear-gradient(135deg, #0d5f82, #2598ad);
  color: #fff;
  margin-top: 6px;
}

.login-form button:hover {
  background: linear-gradient(135deg, #0a4d6b, #1d7e92);
}

.login-form .message {
  color: #b9f0f7;
  margin-bottom: 0;
}

.dashboard {
  display: grid;
  gap: 20px;
  margin: 0 auto;
  max-width: 1400px;
}

.topbar,
.panel-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  background: linear-gradient(135deg, #07111f, #0b1d33);
  border: 1px solid rgba(205, 231, 240, 0.16);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(5, 52, 84, 0.2);
  color: #fff;
  padding: 18px 20px;
}

.topbar-brand {
  align-items: center;
  display: flex;
  gap: 18px;
}

.topbar-brand img {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  height: 74px;
  object-fit: contain;
  padding: 8px 10px;
  width: 190px;
}

.topbar h1 {
  color: #fff;
}

.topbar .ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar .ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.panel-subheader {
  align-items: center;
  border-top: 1px solid #e1e8e4;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics article {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.metrics strong {
  color: var(--brand);
  font-size: 30px;
}

.module-tabs {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
}

.module-tabs button {
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  white-space: nowrap;
}

.module-tabs button:hover,
.module-tabs button.active {
  background: linear-gradient(135deg, var(--brand), #0d6385);
  color: #fff;
}

.workspace {
  display: block;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.admin-section {
  display: none;
  gap: 18px;
  grid-template-columns: minmax(360px, 0.85fr) minmax(480px, 1.15fr);
}

.admin-section.active {
  display: grid;
}

.module-section {
  display: none;
}

.module-section.active {
  display: block;
}

.panel {
  min-height: 360px;
  padding: 18px;
}

.editor-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.full-field {
  display: grid;
  gap: 6px;
}

.diagnostic {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f2933;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.rule-rows {
  display: grid;
  gap: 12px;
}

.rule-row {
  background: #fbfdfe;
  border: 1px solid #dfeaf0;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px;
}

.rule-row label {
  display: grid;
  gap: 6px;
}

.rule-row .danger {
  align-self: end;
  background: #f8e8e6;
  color: #8a1f17;
}

.rule-row .danger:hover {
  background: #f2d2ce;
}

.rule-card {
  gap: 14px;
}

.rule-lines {
  display: grid;
  gap: 8px;
}

.rule-line {
  background: #f8fbfd;
  border: 1px solid #dfeaf0;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px;
}

.rule-line span {
  color: var(--muted);
  font-size: 12px;
}

.rule-line b {
  color: #1f2933;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.item {
  background: #fff;
  border: 1px solid #dfeaf0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.item-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  background: var(--brand-soft);
  border-radius: 999px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.build-badge {
  background: #eef7fb;
  border: 1px solid #c9e3ed;
  border-radius: 999px;
  color: #24547a;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
  padding: 5px 9px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.run-success {
  border-left: 4px solid var(--success);
}

.run-failed {
  border-left: 4px solid #b42318;
}

@media (max-width: 820px) {
  .app {
    padding: 18px;
  }

  .login-panel {
    margin-top: 4vh;
  }

  .login-hero {
    margin: -18px;
    padding: 22px;
  }

  .login-nav,
  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-stage,
  .login-highlights {
    grid-template-columns: 1fr;
  }

  .brand-lockup img,
  .product-logo {
    width: min(100%, 320px);
  }

  .product-logo {
    margin-bottom: 22px;
    padding: 14px 16px;
  }

  .login-product h1 {
    font-size: clamp(36px, 11vw, 54px);
  }

  .topbar,
  .topbar-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-brand img {
    width: min(100%, 260px);
  }

  .input-row,
  .metrics,
  .workspace,
  .admin-panel,
  .admin-section,
  .form-grid,
  .rule-row,
  .rule-line {
    grid-template-columns: 1fr;
  }
}
