:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --bg-deep: #070a0c;
  --panel: #12181d;
  --panel-high: #182027;
  --line: #29353d;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f4f6f7;
  --muted: #97a3aa;
  --copper: #f49a5b;
  --copper-dark: #a94e21;
  --green: #33c978;
  --blue: #58aaf4;
  --danger: #ef6b61;
  --radius: 18px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 14%, rgba(135, 62, 30, 0.18), transparent 30%),
    linear-gradient(145deg, var(--bg-deep), var(--bg) 52%, #11171b);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.14;
}
.ambient-one { top: -180px; left: -80px; background: var(--copper); }
.ambient-two { right: -160px; bottom: -180px; background: #537b83; }

.shell { min-height: 100vh; }
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(48px, 9vw, 150px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px;
}

.brand-mark, .compact-mark {
  display: grid;
  place-items: center;
  color: #16100d;
  background: linear-gradient(145deg, #ffc087, var(--copper) 48%, #a4451c);
  box-shadow: 0 16px 45px rgba(244, 154, 91, 0.22),
              inset 0 1px rgba(255, 255, 255, 0.55);
  font-weight: 900;
}
.brand-mark {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  margin-bottom: 42px;
  font-size: 37px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--copper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand-intro h1 {
  margin: 0;
  font-size: clamp(54px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}
.brand-intro h1 span {
  color: transparent;
  background: linear-gradient(90deg, #ffc18e, var(--copper), #c96a37);
  background-clip: text;
}
.intro-copy {
  max-width: 550px;
  margin: 30px 0;
  color: #b5bec3;
  font-size: 18px;
  line-height: 1.65;
}
.security-note {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.security-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(51, 201, 120, 0.75);
}

.login-card, .modal {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(25, 33, 39, 0.98), rgba(13, 18, 22, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}
.login-card {
  padding: 38px;
  border-radius: 24px;
}
.card-heading { margin-bottom: 30px; }
.card-heading h2, .modal h2 {
  margin: 0 0 7px;
  font-size: 28px;
}
.card-heading p:last-child, .surface-copy, .page-heading p {
  color: var(--muted);
  line-height: 1.55;
}
label > span, .login-card > label, legend {
  display: block;
  margin-bottom: 8px;
  color: #d7dcdf;
  font-size: 13px;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #34434d;
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: #11181d;
  padding: 10px 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(244, 154, 91, 0.15);
}
.login-card > input, .password-field { margin-bottom: 20px; }
.login-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f1519;
}
.login-mode {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}
.login-mode.active {
  color: #1b110b;
  background: linear-gradient(135deg, #ffb97d, #e78042);
}
#user-login-fields > label, #recovery-login-fields > label {
  display: block;
  margin: 0 0 8px;
  color: #d7dcdf;
  font-size: 13px;
  font-weight: 700;
}
#user-login-fields > input, #recovery-login-fields > input {
  margin-bottom: 18px;
}
.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.password-field { position: relative; }
.password-field input { padding-right: 58px; }
.password-field .icon-button {
  position: absolute;
  top: 5px;
  right: 5px;
}

.primary-button, .secondary-button, .danger-button, .icon-button {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease;
}
.primary-button {
  color: #1b110b;
  background: linear-gradient(135deg, #ffbb80, var(--copper) 56%, #dd7338);
  box-shadow: 0 10px 25px rgba(228, 115, 56, 0.18);
}
.secondary-button, .icon-button {
  color: var(--text);
  border-color: #3a4953;
  background: #182027;
}
.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #ef776f, #bf3733);
}
.primary-button:hover, .secondary-button:hover, .danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}
.primary-button:disabled, .secondary-button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}
.login-button { width: 100%; margin-top: 8px; }
.icon-button { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.dashboard { min-height: 100vh; }
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 16, 0.9);
  backdrop-filter: blur(18px);
  padding: 0 26px;
}
.compact-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.compact-mark { width: 38px; height: 38px; border-radius: 11px; }
.compact-brand strong, .compact-brand small { display: block; }
.compact-brand strong { font-size: 16px; }
.compact-brand small { color: var(--muted); font-size: 11px; }
.topbar-context { display: flex; align-items: center; gap: 16px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(51, 201, 120, 0.28);
  border-radius: 999px;
  color: #a8e8c4;
  background: rgba(51, 201, 120, 0.08);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.operator-name { color: #cbd2d6; font-size: 13px; }
.compact { min-height: 36px; padding: 6px 11px; font-size: 12px; }

.workspace { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 230px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 26px 15px 18px;
  background: rgba(10, 14, 17, 0.72);
}
.sidebar-label {
  margin: 0 12px 10px;
  color: #69777f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #aeb8bd;
  background: transparent;
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}
.nav-item:hover { color: #fff; background: #151d22; }
.nav-item.active {
  color: #1b110b;
  border-color: #ffb77b;
  background: linear-gradient(135deg, #ffb97d, #e78042);
  box-shadow: 0 8px 22px rgba(201, 92, 39, 0.18);
}
.nav-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid #3c4a52;
  border-radius: 9px;
  color: #ffad70;
  background: #11191e;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 145, 78, 0.28);
}
.nav-item:hover .nav-icon {
  border-color: #6d5749;
  color: #ffc08c;
  background: #1c2429;
}
.nav-item.active .nav-icon {
  border-color: rgba(56, 27, 10, 0.42);
  color: #211208;
  background: rgba(255, 255, 255, 0.28);
  text-shadow: none;
}
.sidebar-spacer { flex: 1; }
.sidebar-status {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #12181d;
  padding: 13px;
}
.sidebar-status span, .sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status span, .sidebar-status small { color: var(--muted); font-size: 10px; }
.sidebar-status strong { margin: 3px 0; font-size: 12px; }

.content { min-width: 0; padding: clamp(24px, 4vw, 54px); }
.panel-view { max-width: 1440px; margin: 0 auto; }
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading h2 { margin: 0; font-size: clamp(30px, 3.5vw, 44px); letter-spacing: -0.035em; }
.page-heading p { margin: 7px 0 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, #192128, #10161a);
  padding: 20px;
}
.metric-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  right: -35px;
  bottom: -50px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(38px);
  opacity: 0.35;
}
.metric-card.copper { --accent: var(--copper); }
.metric-card.green { --accent: var(--green); }
.metric-card.blue { --accent: var(--blue); }
.metric-card.neutral { --accent: #acb8bf; }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card span { font-size: 12px; font-weight: 700; }
.metric-card strong { display: block; margin: 17px 0 5px; font-size: 36px; }
.metric-card small { font-size: 11px; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(440px, 1.2fr);
  gap: 16px;
  margin-top: 16px;
}
.surface-card, .table-card, .release-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(24, 32, 39, 0.94), rgba(14, 19, 23, 0.94));
}
.surface-card { min-height: 280px; padding: 24px; }
.surface-card:first-child {
  background:
    linear-gradient(145deg, rgba(117, 53, 25, 0.28), transparent 60%),
    linear-gradient(155deg, #1b2227, #101519);
}
.surface-card .primary-button { margin-top: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.section-title h3 { margin: 0; font-size: 20px; }
.operational-alerts-card {
  min-height: 0;
  margin-top: 16px;
  background:
    linear-gradient(145deg, rgba(244, 154, 91, 0.08), transparent 55%),
    linear-gradient(155deg, rgba(24, 32, 39, 0.96), rgba(14, 19, 23, 0.96));
}
.operational-alerts-card .surface-copy { margin-bottom: 16px; }
.operational-alert-list { display: grid; gap: 9px; }
.operational-alert {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-left: 3px solid #83929b;
  border-radius: 11px;
  background: rgba(7, 11, 14, 0.46);
  padding: 11px 13px;
}
.operational-alert.critical { border-left-color: #ef6b61; }
.operational-alert.warning { border-left-color: var(--copper); }
.operational-alert.info { border-left-color: var(--green); }
.operational-alert-marker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #f7d5bd;
  background: rgba(244, 154, 91, 0.12);
  font-weight: 900;
}
.operational-alert.critical .operational-alert-marker {
  color: #ffaaa3;
  background: rgba(239, 107, 97, 0.12);
}
.operational-alert-copy { min-width: 0; }
.operational-alert-copy strong,
.operational-alert-copy span,
.operational-alert-copy small { display: block; }
.operational-alert-copy strong { font-size: 12px; }
.operational-alert-copy span {
  margin-top: 2px;
  color: #d6dde0;
  font-size: 11px;
}
.operational-alert-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operational-alert-empty {
  border: 1px dashed rgba(51, 201, 120, 0.34);
  border-radius: 11px;
  color: #a5eac4;
  background: rgba(51, 201, 120, 0.055);
  padding: 17px;
  text-align: center;
}
.text-button {
  border: 0;
  color: var(--copper);
  background: transparent;
  font-weight: 750;
}
.timeline { margin-top: 15px; }
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
}
.timeline-item::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 10px rgba(244, 154, 91, 0.45);
}
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item span, .timeline-item time { color: var(--muted); font-size: 10px; }

.filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 12px;
  margin-bottom: 15px;
}
.table-card { overflow: hidden; }
.data-table { min-width: 800px; }
.table-head, .table-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
}
.activation-table .table-head, .activation-table .table-row {
  grid-template-columns: 1.25fr 0.65fr 1.5fr 1fr 0.8fr 90px;
}
.audit-table .table-head, .audit-table .table-row {
  grid-template-columns: 150px 170px 140px 1fr;
}
.support-table .table-head, .support-table .table-row {
  grid-template-columns: 150px 150px 120px minmax(260px, 1fr) 170px;
}
[data-panel="support"] .table-card + .table-card { margin-top: 16px; }
.configuration-change-detail details { margin-top: 5px; }
.configuration-change-detail summary {
  color: var(--copper); cursor: pointer; font-size: 10px; font-weight: 700;
}
.configuration-diff { display: grid; gap: 5px; margin-top: 7px; }
.configuration-diff-row {
  display: grid; grid-template-columns: minmax(70px, .7fr) 1fr 16px 1fr;
  gap: 5px; font-size: 9px; align-items: start;
}
.configuration-diff-row span { overflow-wrap: anywhere; }
.configuration-diff-row strong { color: var(--muted); }
.configuration-change-note { color: var(--muted); font-size: 9px; margin-top: 6px; }
.user-table .table-head, .user-table .table-row {
  grid-template-columns: 1.25fr 0.7fr 0.65fr 0.9fr minmax(210px, 1fr);
}

.owner-user-table .table-head, .owner-user-table .table-row {
  grid-template-columns: 1.1fr 1.6fr 0.7fr 0.65fr 1fr 150px;
}

.owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scope-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-button {
  width: auto;
  min-height: 36px;
  padding: 8px 12px;
}

.owner-scope-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.owner-scope-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11181d;
}

.owner-scope-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.owner-scope-controls label {
  display: grid;
  gap: 7px;
}

.owner-terminal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.owner-all-terminals-label,
.owner-terminal-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owner-all-terminals-label {
  margin-top: 12px;
  font-weight: 700;
}

.scope-empty {
  padding: 12px 0;
  color: var(--muted);
}
.role-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}
.role-guide span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #11181d;
  padding: 7px 11px;
  font-size: 11px;
}
.role-guide strong { color: var(--text); }
.totp-secret { font-size: clamp(17px, 3vw, 25px); letter-spacing: 0.1em; }
.table-head {
  color: #7f8d95;
  border-bottom: 1px solid var(--line);
  background: #10161a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.table-row {
  min-height: 68px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: rgba(255, 255, 255, 0.018); }
.cell-main strong, .cell-main small { display: block; }
.cell-main small, .module-list, .date-cell, .detail-cell { color: var(--muted); }
.cell-main small { margin-top: 4px; }
.module-list { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.status-pill {
  display: inline-flex;
  width: fit-content;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 800;
}
.status-available { color: #a5eac4; background: rgba(51, 201, 120, 0.08); }
.status-redeemed { color: #9dcdf8; background: rgba(88, 170, 244, 0.08); }
.status-expired { color: #d1a783; background: rgba(209, 167, 131, 0.08); }
.status-revoked { color: #f49a92; background: rgba(239, 107, 97, 0.08); }
.row-button {
  border: 1px solid #3a4953;
  border-radius: 8px;
  color: #dce1e3;
  background: #192127;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 800;
}
.row-button.danger { color: #f49a92; border-color: rgba(239, 107, 97, 0.4); }
.row-button:disabled { opacity: .42; cursor: not-allowed; }
.empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }

.release-board { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 15px; }
.compact-metrics { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.system-health-note {
  margin-bottom: 16px;
  border: 1px solid rgba(244, 154, 91, .32);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(244, 154, 91, .06);
  padding: 12px 15px;
  font-size: 11px;
  line-height: 1.5;
}
.system-health-note strong { color: var(--text); }
.system-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.system-server-card { min-height: 0; }
.system-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}
.system-detail-list div {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(8, 12, 15, .28);
  padding: 11px;
}
.system-detail-list dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.system-detail-list dd { margin: 5px 0 0; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.capacity-track { height: 10px; margin-top: 22px; overflow: hidden; border-radius: 999px; background: #0b1013; }
.capacity-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #41c77a, #f49a5b, #ef6b61); transition: width .2s ease; }
.system-section-title { margin: 28px 0 14px; }
.system-section-title small { max-width: 420px; color: var(--muted); font-size: 10px; text-align: right; }
.database-health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.database-health-card { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #151d22, #0e1418); padding: 17px; }
.database-health-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.database-health-head strong { font-size: 14px; }
.database-health-copy { margin: 5px 0 14px; color: var(--muted); font-size: 10px; }
.database-health-card .capacity-track { margin: 0 0 14px; }
.database-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.database-detail-grid span { color: var(--muted); font-size: 9px; }
.database-detail-grid strong { display: block; margin-top: 3px; color: var(--text); font-size: 11px; }
.database-health-message { margin: 12px 0 0; color: #d1a783; font-size: 9px; line-height: 1.4; }
.customer-storage-table .table-head, .customer-storage-table .table-row { grid-template-columns: 1fr .7fr .8fr 1fr 1.2fr; }
.customer-filter { grid-template-columns: minmax(260px, 520px); }
.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 15px;
}
.customer-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, #151d22, #0f1519);
  padding: 20px;
}
.customer-card.provisional {
  border-color: rgba(244, 154, 91, 0.42);
}
.customer-head, .customer-stats, .customer-contact {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.customer-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.customer-head h3 { margin: 0 0 5px; font-size: 18px; }
.customer-head p, .customer-contact, .customer-code {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.customer-code { font-weight: 800; letter-spacing: 0.08em; }
.customer-stats {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 18px 0;
}
.customer-stat {
  min-width: 92px;
  border-left: 2px solid var(--copper);
  padding-left: 10px;
}
.customer-stat strong, .customer-stat span { display: block; }
.customer-stat strong { font-size: 20px; }
.customer-stat span { color: var(--muted); font-size: 10px; }
.customer-contact {
  justify-content: flex-start;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.customer-licenses {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}
.customer-license {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #10161a;
  padding: 9px 10px;
}
.license-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.customer-license strong, .customer-license span { display: block; }
.customer-license strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
.customer-license div > span, .customer-license-empty {
  color: var(--muted);
  font-size: 9px;
}
.customer-license-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.digital-menu-url {
  margin: 0 0 18px;
  border: 1px solid rgba(184, 115, 51, 0.42);
  border-radius: 11px;
  color: #e6b98f;
  background: rgba(184, 115, 51, 0.08);
  padding: 11px 13px;
  font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
#digital-menu-open { text-decoration: none; }
.provisional-terminal-row {
  border-color: rgba(244, 154, 91, 0.3);
  background: linear-gradient(90deg, rgba(244, 154, 91, 0.07), #10161a 42%);
}
#activation-provisional-terminal + small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.provisioning-editor-field textarea {
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.45;
}
.provisioning-editor-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}
.wide-field { grid-column: 1 / -1; }
.release-card { padding: 22px; }
.release-head { display: flex; justify-content: space-between; gap: 20px; }
.release-card h3 { margin: 0 0 5px; font-size: 20px; }
.release-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.release-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.release-meta div { border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.release-meta span, .release-meta strong { display: block; }
.release-meta span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.release-meta strong { margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }

.modal {
  width: min(700px, calc(100vw - 30px));
  max-height: calc(100vh - 34px);
  border-radius: 22px;
  color: var(--text);
  padding: 28px;
}
.modal::backdrop {
  background: rgba(2, 4, 5, 0.76);
  backdrop-filter: blur(7px);
}
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.close-button { min-width: 36px; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.full-field { grid-column: 1 / -1; }
.modules-fieldset { margin: 0; border: 0; padding: 0; }
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.module-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #11181d;
  padding: 8px 10px;
  color: #dce1e3;
  font-size: 11px;
}
.module-option:has(input:checked) {
  border-color: #a76036;
  background: rgba(244, 154, 91, 0.1);
}
.module-option input { width: 15px; min-height: 15px; accent-color: var(--copper); }
.toggle-field { display: flex; align-items: center; gap: 12px; }
.toggle-field > input { position: absolute; opacity: 0; width: 1px; min-height: 1px; }
.toggle-control {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #354149;
}
.toggle-control::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}
.toggle-field input:checked + .toggle-control { background: var(--copper-dark); }
.toggle-field input:checked + .toggle-control::after { transform: translateX(18px); }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field small { color: var(--muted); font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.activation-code {
  margin: 22px 0 12px;
  border: 1px solid #a95e34;
  border-radius: 13px;
  color: #ffc18e;
  background: #17110e;
  padding: 20px;
  text-align: center;
  font: 800 clamp(19px, 4vw, 30px) ui-monospace, monospace;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}
.result-details { color: var(--muted); font-size: 12px; text-align: center; }
textarea { min-height: 110px; resize: vertical; }

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  border: 1px solid #a45c34;
  border-radius: 12px;
  color: #fff;
  background: #1b2328;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
  padding: 13px 16px;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .login-layout { gap: 55px; padding: 36px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 190px 1fr; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; min-height: auto; padding: 34px 20px; }
  .brand-intro { padding-top: 20px; }
  .brand-mark { margin-bottom: 25px; }
  .brand-intro h1 { font-size: 54px; }
  .intro-copy { margin: 20px 0; }
  .login-card { padding: 26px 20px; }
  .topbar { height: auto; min-height: 68px; padding: 12px 15px; }
  .live-pill, .operator-name { display: none; }
  .workspace { display: block; }
  .sidebar {
    position: sticky;
    z-index: 3;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  .sidebar-label, .sidebar-spacer, .sidebar-status { display: none; }
  .nav-item { flex: 0 0 auto; min-height: 40px; padding: 7px 10px; }
  .content { padding: 25px 15px 40px; }
  .page-heading { align-items: start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 128px; padding: 16px; }
  .metric-card strong { font-size: 29px; }
  .operational-alert {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .operational-alert > .status-pill {
    grid-column: 2;
  }
  .filter-row { grid-template-columns: 1fr; }
  .customer-grid, .compact-metrics { grid-template-columns: 1fr; }
  .system-summary-grid, .database-health-grid { grid-template-columns: 1fr; }
  .system-detail-list { grid-template-columns: 1fr; }
  .system-section-title { align-items: start; flex-direction: column; }
  .system-section-title small { text-align: left; }
  .table-card { overflow-x: auto; }
  .release-board { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 22px 17px; }
}

@media (max-width: 440px) {
  .metric-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .topbar-context { gap: 8px; }
  .compact-brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
:root .ai-monthly { margin-top: 32px; border-top: 1px solid #39474b; padding-top: 20px; min-width: 0; }
.ai-monthly-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 12px 0; }
.ai-monthly-controls label { flex: 1 1 180px; }
.ai-monthly label { display: grid; gap: 6px; }
.ai-monthly input { min-width: 0; max-width: 100%; }
.ai-monthly button { min-height: 44px; white-space: normal; }
.ai-monthly-table { overflow: auto; max-width: 100%; margin: 16px 0; }
.ai-monthly table { width: 100%; border-collapse: collapse; }
.ai-monthly th, .ai-monthly td { padding: 12px; text-align: left; border-bottom: 1px solid #39474b; min-width: 160px; }
.ai-monthly td { overflow-wrap: anywhere; }
.ai-monthly td button { min-width: 140px; }
.ai-monthly pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 400px; overflow: auto; }
.ai-monthly details { margin: 24px 0; }
.ai-monthly summary { cursor: pointer; padding: 12px 0; }
.system-scan { display: grid; gap: 10px; }
.system-scan progress { display: block; width: 100%; height: 14px; accent-color: #e98a46; }
.system-scan small { line-height: 1.5; }
