@font-face {
  font-family: "CorpConnect Montserrat";
  src: url("Montserrat-Thin.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #1f1d19;
  --bg-deep: #171611;
  --panel: #545149;
  --panel-soft: #615d53;
  --panel-deep: #302e28;
  --field: #868174;
  --text: #f5f2ea;
  --muted: #c8c2b6;
  --muted-soft: #a9a397;
  --cyan: #29f4dd;
  --cyan-soft: #aafbef;
  --lime: #d8ff53;
  --green: #72fb58;
  --danger: #ff7970;
  --warning: #ffd66b;
  --line: rgba(245, 242, 234, 0.12);
  --line-strong: rgba(216, 255, 83, 0.24);
  --focus: rgba(41, 244, 221, 0.34);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.36 "CorpConnect Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--cyan-soft);
  text-decoration: none;
}

a:hover {
  color: var(--lime);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 15px;
}

.topbar .brand-logo {
  width: 58px;
  height: 58px;
}

.center-panel .brand-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
}

.brand-text,
.title-stack {
  min-width: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 650;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 16px;
}

p {
  margin: 8px 0 0;
}

strong {
  font-weight: 700;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: rgba(245, 242, 234, 0.13);
  color: var(--text);
  border-radius: 10px;
  padding: 5px 8px;
}

.panel,
.notice {
  background: var(--panel);
  border: 0;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.panel {
  overflow: hidden;
}

.center-panel {
  width: min(640px, 100%);
  text-align: center;
}

.auth-panel {
  max-width: 480px;
}

.auth-panel .brand-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
}

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

.muted {
  color: var(--muted);
}

.button,
button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.button:hover,
button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.primary {
  background: var(--lime);
  color: #1f1d19;
}

.primary:hover {
  background: #e8ff86;
  color: #1f1d19;
}

.secondary {
  background: var(--cyan);
  color: #092521;
}

.secondary:hover {
  background: var(--cyan-soft);
  color: #092521;
}

.ghost,
.table-button {
  background: rgba(245, 242, 234, 0.12);
  color: var(--text);
}

.ghost:hover,
.table-button:hover {
  background: rgba(245, 242, 234, 0.2);
  color: var(--text);
}

.danger {
  background: rgba(255, 121, 112, 0.16);
  color: #ffaea8;
}

.danger:hover {
  background: rgba(255, 121, 112, 0.24);
}

.compact {
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.icon-button {
  min-height: 34px;
  background: rgba(41, 244, 221, 0.16);
  color: var(--cyan-soft);
}

.icon-button:hover {
  background: rgba(41, 244, 221, 0.24);
}

.form-grid,
.form-row {
  display: grid;
  gap: 10px;
}

.form-row {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 13px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-weight: 650;
}

input::placeholder {
  color: rgba(245, 242, 234, 0.56);
}

input:focus {
  outline: 3px solid var(--focus);
}

.notice {
  color: var(--text);
}

.notice.success,
.notice.created {
  background: rgba(114, 251, 88, 0.16);
  color: #d9ffd2;
}

.notice.warning {
  background: rgba(255, 214, 107, 0.16);
  color: #fff0c3;
}

.access-rules h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.access-rules ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.45;
}

.access-rules li + li {
  margin-top: 4px;
}

.notice.error {
  background: rgba(255, 121, 112, 0.18);
  color: #ffd1cd;
}

.created-grid,
.credential-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.created-grid {
  grid-template-columns: max-content minmax(0, 1fr);
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.device-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--panel);
}

.device-panel:first-child {
  background: var(--panel);
}

.device-panel.wide-panel {
  background: var(--panel);
}

.device-panel p {
  margin-bottom: 18px;
}

.download-meta {
  margin-top: -4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.download-meta strong {
  color: var(--lime);
}

.device-switch {
  display: grid;
  gap: 12px;
}

.device-switch-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.device-switch-header p {
  margin: 0;
}

.device-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.device-tab {
  width: 100%;
  height: 46px;
  min-height: 46px;
  border-radius: 12px;
  background: rgba(23, 22, 17, 0.34);
  color: var(--text);
  white-space: normal;
}

.device-tab:hover {
  background: rgba(245, 242, 234, 0.16);
}

.device-tab.is-active {
  background: var(--lime);
  color: #1f1d19;
}

.device-instruction {
  display: grid;
  gap: 12px;
}

.js .device-instruction:not(.is-active) {
  display: none;
}

.device-intro {
  max-width: 920px;
}

.settings-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 12px;
  width: 100%;
  max-width: 900px;
  margin: 12px 0 14px;
}

.settings-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-grid code {
  display: block;
  width: 100%;
  min-width: 0;
}

.instruction-list {
  max-width: 900px;
  margin: 12px 0 16px;
  padding-left: 22px;
}

.instruction-list li {
  margin: 6px 0;
  padding-left: 4px;
}

.device-panel .button {
  margin-top: auto;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.inline-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(23, 22, 17, 0.26);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-metrics strong {
  color: var(--lime);
  font-size: 16px;
  line-height: 1;
}

.inline-metrics .is-danger strong {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  table-layout: fixed;
}

th,
td {
  height: 56px;
  padding: 8px 7px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  background: rgba(23, 22, 17, 0.34);
}

td:first-child {
  border-radius: 14px 0 0 14px;
}

td:last-child {
  border-radius: 0 14px 14px 0;
}

small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.user-name,
.user-login-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.user-login-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.users-panel table,
.users-panel small,
.users-panel code,
.users-panel .button,
.users-panel button {
  font-size: 13px;
}

.usage-cell strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.connection-dates-cell {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.connection-dates-cell span {
  display: block;
}

.connection-dates-cell span + span {
  margin-top: 4px;
}

.traffic-cell span {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}

.actions,
.table-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.table-button {
  min-width: 58px;
}

.link-actions {
  flex-direction: row;
  align-items: center;
  gap: 7px;
}

.link-actions .table-button {
  width: auto;
}

.issue-state {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  white-space: nowrap;
}

.usage-cell .pill {
  margin-top: 4px;
  white-space: nowrap;
}

.actions form {
  display: flex;
  align-items: center;
  margin: 0;
}

.table-button:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.copy-button,
.table-button[data-copy] {
  background: rgba(41, 244, 221, 0.14);
  color: var(--cyan-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(245, 242, 234, 0.13);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.active,
.pill.synced {
  background: rgba(114, 251, 88, 0.18);
  color: #d7ffd0;
}

.pill.disabled,
.pill.failed {
  background: rgba(255, 121, 112, 0.18);
  color: #ffb8b2;
}

.pill.pending_agent,
.pill.created {
  background: rgba(255, 214, 107, 0.18);
  color: #ffeab3;
}

.checklist {
  margin: 14px 0 0;
  padding-left: 20px;
}

.code-block {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #11100c;
  color: #f6f3eb;
  padding: 16px;
}

.modal {
  width: min(540px, calc(100% - 32px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: var(--text);
  background: transparent;
}

.modal::backdrop {
  background: rgba(10, 10, 8, 0.62);
}

.modal-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 18px 0;
  }

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

  h1 {
    font-size: 34px;
  }

  .form-row,
  .device-grid,
  .credential-grid,
  .created-grid {
    grid-template-columns: 1fr;
  }

  .inline-metrics {
    justify-content: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .credential-grid .icon-button {
    justify-self: start;
  }

  .device-switch-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .device-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .device-tabs {
    grid-template-columns: 1fr;
  }
}

.logout-form {
  display: flex;
  margin: 0;
}

/* Admin users table: one grid, fixed columns, actions behind a menu. */
.users-panel,
.users-panel .table-wrap {
  overflow: visible;
}

.users-table {
  min-width: 1450px;
}

.users-table .col-user { width: 160px; }
.users-table .col-access { width: 250px; }
.users-table .col-devices { width: 125px; }
.users-table .col-blocked { width: 135px; }
.users-table .col-dates { width: 205px; }
.users-table .col-traffic { width: 100px; }
.users-table .col-egress { width: 245px; }
.users-table .col-status { width: 110px; }
.users-table .col-actions { width: 120px; }

.users-panel .table-wrap {
  overflow-x: auto;
  padding-bottom: 180px;
  margin-bottom: -180px;
}

.egress-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.egress-form select {
  min-width: 0;
  width: 123px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 6px;
  background: var(--panel-deep);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.egress-form select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.egress-form select:disabled,
.egress-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.blocked-count {
  color: var(--accent, var(--lime));
}

.users-table th,
.users-table td {
  height: auto;
  padding: 12px 10px;
  vertical-align: middle;
}

.users-table th {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.users-table td:first-child,
.users-table th:first-child {
  padding-left: 16px;
}

.users-table td:last-child,
.users-table th:last-child {
  padding-right: 16px;
}

.users-table .cell-end {
  text-align: right;
}

.users-table tr.has-conflict td {
  background: rgba(255, 121, 112, 0.1);
}

.users-table .user-name {
  font-size: 14px;
}

.cell-main {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
}

.cell-sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.users-table .muted {
  color: var(--muted-soft);
}

.button-row {
  display: flex;
  gap: 6px;
}

.users-table .button.compact {
  height: 32px;
  min-height: 32px;
  min-width: 0;
  padding: 0 11px;
  font-size: 12px;
}

.users-table .button-row .button {
  flex: 1 1 0;
  justify-content: center;
}

.issue-state {
  margin-top: 8px;
}

.issue-state.is-open {
  color: var(--lime);
}

.dates-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 8px;
  row-gap: 3px;
  font-size: 12px;
  white-space: nowrap;
}

.users-table .traffic-cell span {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.danger-tag {
  background: rgba(255, 121, 112, 0.2);
  color: #ffb8b2;
}

.online-tag {
  background: rgba(114, 251, 88, 0.16);
  color: #d7ffd0;
}

.tag-button {
  cursor: pointer;
}

.users-table .pill {
  height: 28px;
  min-height: 28px;
  padding: 0 12px;
  font-size: 11px;
}

.users-table td .tag {
  display: flex;
  width: max-content;
}

.row-menu {
  position: relative;
  display: inline-block;
}

.row-menu summary {
  list-style: none;
  cursor: pointer;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu summary::after {
  content: "▾";
  margin-left: 6px;
  font-size: 10px;
}

.row-menu[open] summary {
  background: rgba(245, 242, 234, 0.22);
}

.row-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  min-width: 210px;
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--panel-deep);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.row-menu-list form {
  margin: 0;
}

.row-menu-list button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.row-menu-list button:hover {
  background: rgba(245, 242, 234, 0.1);
}

.row-menu-list button.is-danger {
  color: #ffaea8;
}

.conflict-notice p {
  margin: 6px 0 8px;
}

.conflict-notice ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 1120px) {
  .users-panel .table-wrap {
    overflow-x: auto;
    padding-bottom: 180px;
    margin-bottom: -180px;
  }
}


/* ------------------------------------------------------------------
   Admin theme: frosted glass over warm golden light.
   Scoped to body.glass-theme so the user pages keep their own look.
   ------------------------------------------------------------------ */
.glass-theme {
  --glass: rgba(255, 246, 214, 0.075);
  --glass-strong: rgba(255, 246, 214, 0.12);
  --glass-row: rgba(255, 246, 214, 0.055);
  --glass-line: rgba(255, 250, 230, 0.14);
  --glass-line-soft: rgba(255, 250, 230, 0.08);
  --accent: #e8f25c;
  --accent-soft: rgba(232, 242, 92, 0.16);
  --ink: #f6f3e8;
  --ink-soft: rgba(246, 243, 232, 0.66);
  --ink-faint: rgba(246, 243, 232, 0.42);
  --alert: #ff9b8a;
  min-height: 100vh;
  background:
    radial-gradient(62vw 44vw at 90% -8%, rgba(246, 206, 96, 0.55), transparent 62%),
    radial-gradient(50vw 38vw at -10% 30%, rgba(214, 172, 74, 0.38), transparent 64%),
    radial-gradient(72vw 42vw at 58% 114%, rgba(238, 214, 126, 0.3), transparent 60%),
    linear-gradient(160deg, #2a261b 0%, #1b1912 52%, #14130e 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-weight: 300;
}

.glass-theme h1,
.glass-theme h2 {
  font-weight: 300;
  letter-spacing: -0.01em;
}

.glass-theme h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.glass-theme .eyebrow {
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: 0.14em;
}

.glass-theme .topbar {
  margin: 8px 0 22px;
}

.glass-theme .topbar .brand-logo {
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--glass-line);
}

.glass-theme .panel,
.glass-theme .notice,
.glass-theme .kpi-card {
  border: 1px solid var(--glass-line);
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(255, 248, 222, 0.13), rgba(255, 246, 214, 0.04) 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.glass-theme .notice.warning {
  background: linear-gradient(155deg, rgba(232, 242, 92, 0.16), rgba(255, 246, 214, 0.04) 70%);
  color: var(--ink);
}

.glass-theme .notice.success,
.glass-theme .notice.created {
  background: linear-gradient(155deg, rgba(232, 242, 92, 0.2), rgba(255, 246, 214, 0.05) 70%);
  color: var(--ink);
}

.glass-theme .notice.error {
  background: linear-gradient(155deg, rgba(255, 155, 138, 0.2), rgba(255, 246, 214, 0.04) 70%);
  color: var(--ink);
}

/* Buttons and fields */
.glass-theme .button,
.glass-theme button {
  font-weight: 500;
}

.glass-theme .primary {
  background: var(--accent);
  color: #1b1a12;
  box-shadow: 0 0 24px rgba(232, 242, 92, 0.28);
}

.glass-theme .ghost,
.glass-theme .table-button,
.glass-theme .copy-button,
.glass-theme .table-button[data-copy] {
  border: 1px solid var(--glass-line);
  background: rgba(255, 250, 230, 0.06);
  color: var(--ink);
}

.glass-theme .ghost:hover,
.glass-theme .table-button:hover {
  background: rgba(255, 250, 230, 0.14);
  color: var(--ink);
}

.glass-theme .logout-form button {
  border: 1px solid var(--glass-line);
  background: rgba(255, 250, 230, 0.06);
  color: var(--ink);
}

.glass-theme label span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.glass-theme input {
  min-height: 44px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(20, 18, 12, 0.32);
  color: var(--ink);
  font-weight: 400;
}

.glass-theme input::placeholder {
  color: var(--ink-faint);
}

.glass-theme input:focus {
  outline: none;
  border-color: rgba(232, 242, 92, 0.6);
  box-shadow: 0 0 0 3px rgba(232, 242, 92, 0.14);
}

.glass-theme .form-row .button {
  height: 44px;
  min-height: 44px;
  padding: 0 26px;
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.glass-theme .kpi-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  margin: 0;
  padding: 22px 24px 20px;
}

.kpi-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kpi-arrow {
  color: var(--ink-soft);
  font-size: 18px;
  letter-spacing: 0;
}

.kpi-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.kpi-live i,
.glass-theme .pill::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 242, 92, 0.16), 0 0 12px rgba(232, 242, 92, 0.6);
}

.kpi-live i {
  display: inline-block;
}

.kpi-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  margin-top: 22px;
}

.kpi-scale i {
  display: block;
  width: 1px;
  height: 22px;
  background: var(--glass-line);
}

.kpi-scale i:nth-child(5n + 1) {
  height: 30px;
  background: rgba(255, 250, 230, 0.32);
}

.kpi-scale i.is-marker {
  width: 2px;
  height: 30px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(232, 242, 92, 0.8);
}

.kpi-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: auto 0 0;
  padding-top: 18px;
  color: var(--ink);
  font-size: clamp(38px, 3.8vw, 52px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kpi-value small {
  display: inline;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}

.kpi-value small::before {
  content: "·";
  margin-right: 8px;
  color: var(--ink-faint);
}

.glass-theme .kpi-card.is-alert .kpi-value {
  color: var(--accent);
  text-shadow: 0 0 22px rgba(232, 242, 92, 0.4);
}

/* Users table */
.glass-theme .panel > h2 {
  margin-bottom: 16px;
}

.glass-theme .conflict-notice > strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.glass-theme .section-title {
  align-items: center;
  margin-bottom: 14px;
}

.glass-theme .inline-metrics span {
  border: 1px solid var(--glass-line-soft);
  background: rgba(255, 250, 230, 0.04);
  color: var(--ink-soft);
  font-weight: 400;
}

.glass-theme .inline-metrics strong {
  color: var(--ink);
  font-weight: 400;
}

.glass-theme .inline-metrics .is-danger strong {
  color: var(--accent);
}

.glass-theme .users-table th {
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.glass-theme .users-table td {
  border-top: 1px solid var(--glass-line-soft);
  border-bottom: 1px solid var(--glass-line-soft);
  background: var(--glass-row);
}

.glass-theme .users-table td:first-child {
  border-left: 1px solid var(--glass-line-soft);
  border-radius: 20px 0 0 20px;
}

.glass-theme .users-table td:last-child {
  border-right: 1px solid var(--glass-line-soft);
  border-radius: 0 20px 20px 0;
}

.glass-theme .users-table tbody tr:hover td {
  background: rgba(255, 246, 214, 0.1);
}

.glass-theme .users-table tr.has-conflict td {
  background: rgba(232, 242, 92, 0.08);
  border-color: rgba(232, 242, 92, 0.3);
}

.glass-theme .user-name {
  font-weight: 400;
}

.glass-theme .users-table .muted,
.glass-theme .cell-sub {
  color: var(--ink-faint);
}

.glass-theme .issue-state.is-open {
  color: var(--accent);
}

.glass-theme .users-table .traffic-cell span {
  color: var(--ink-soft);
}

/* Status: a glowing dot and a word instead of a filled pill. */
.glass-theme .pill {
  gap: 8px;
  height: auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 400;
}

.glass-theme .pill::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
}

.glass-theme .pill.active,
.glass-theme .pill.synced {
  background: transparent;
  color: var(--ink);
}

.glass-theme .pill.disabled,
.glass-theme .pill.failed {
  background: transparent;
  color: var(--ink-faint);
}

.glass-theme .pill.disabled::before,
.glass-theme .pill.failed::before {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ink-faint);
}

.glass-theme .danger-tag {
  border: 1px solid rgba(232, 242, 92, 0.4);
  background: rgba(232, 242, 92, 0.12);
  color: var(--accent);
  font-weight: 500;
}

.glass-theme .online-tag {
  border: 1px solid var(--glass-line);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 400;
}

.glass-theme .row-menu[open] summary {
  background: rgba(255, 250, 230, 0.16);
}

.glass-theme .row-menu-list {
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: rgba(46, 41, 27, 0.98);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

.glass-theme .row-menu-list button {
  border-radius: 12px;
  font-weight: 400;
}

.glass-theme .row-menu-list button.is-danger {
  color: var(--alert);
}

.glass-theme .auth-panel {
  width: min(440px, 100%);
}

.glass-theme .modal-card {
  border: 1px solid var(--glass-line);
  background: rgba(40, 36, 24, 0.9);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .glass-theme .kpi-card {
    min-height: 150px;
  }
}

/* Personal pages in the same glass theme. */
.glass-theme .center-panel {
  text-align: center;
}

.glass-theme .center-panel h1 {
  font-size: clamp(26px, 4vw, 38px);
}

.glass-theme .center-panel .brand-logo {
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--glass-line);
}

.glass-theme .pill.active {
  font-size: 13px;
}

.glass-theme code {
  border: 1px solid var(--glass-line-soft);
  border-radius: 12px;
  background: rgba(20, 18, 12, 0.3);
  color: var(--ink);
  padding: 7px 11px;
}

.glass-theme .credential-grid > span,
.glass-theme .settings-grid span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.glass-theme .credential-grid code {
  font-size: 15px;
}

.glass-theme .icon-button,
.glass-theme .secondary {
  border: 1px solid var(--glass-line);
  background: rgba(255, 250, 230, 0.06);
  color: var(--ink);
}

.glass-theme .icon-button:hover,
.glass-theme .secondary:hover {
  background: rgba(255, 250, 230, 0.14);
  color: var(--ink);
}

.glass-theme .device-panel .button {
  height: 46px;
  min-height: 46px;
  padding: 0 28px;
  border: 0;
  background: var(--accent);
  color: #1b1a12;
  box-shadow: 0 0 24px rgba(232, 242, 92, 0.28);
}

.glass-theme .device-panel,
.glass-theme .device-panel:first-child,
.glass-theme .device-panel.wide-panel {
  background: linear-gradient(155deg, rgba(255, 248, 222, 0.13), rgba(255, 246, 214, 0.04) 60%);
}

.glass-theme .device-panel h2 {
  margin-bottom: 12px;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.01em;
  text-transform: none;
}

.glass-theme .device-switch-header h2 {
  margin-bottom: 4px;
}

.glass-theme .device-tab {
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: rgba(255, 250, 230, 0.05);
  color: var(--ink);
  font-weight: 400;
}

.glass-theme .device-tab:hover {
  background: rgba(255, 250, 230, 0.12);
}

.glass-theme .device-tab.is-active {
  border-color: transparent;
  background: var(--accent);
  color: #1b1a12;
  font-weight: 500;
  box-shadow: 0 0 24px rgba(232, 242, 92, 0.3);
}

.glass-theme .instruction-list {
  color: var(--ink-soft);
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.glass-theme .instruction-list li {
  position: relative;
  margin: 10px 0;
  padding-left: 40px;
  counter-increment: step;
}

.glass-theme .instruction-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 12px;
}

.glass-theme .instruction-list strong,
.glass-theme .device-intro strong,
.glass-theme .panel p strong {
  color: var(--ink);
  font-weight: 500;
}

.glass-theme .muted {
  color: var(--ink-faint);
}

.glass-theme .access-rules ul {
  color: var(--ink-soft);
}

.glass-theme .access-rules li::marker {
  color: var(--accent);
}

.glass-theme .settings-grid,
.glass-theme .credential-grid {
  align-items: center;
}
