:root {
  color-scheme: dark;
  --ink: #f4f2fb;
  --ink-soft: #c9c6d8;
  --muted: #a09db2;
  --deep: #191824;
  --deep-2: #211f2c;
  --panel: #262430;
  --panel-raised: #302e3c;
  --line: rgba(231, 228, 249, 0.13);
  --accent: #ad9dff;
  --accent-rgb: 173, 157, 255;
  --accent-strong: #806cf0;
  --accent-soft: rgba(173, 157, 255, 0.12);
  --button-text: #211b36;
  --card-background: linear-gradient(145deg, rgba(42, 40, 54, 0.96), rgba(31, 30, 42, 0.98));
  --card-hover-background: linear-gradient(145deg, rgba(49, 46, 65, 0.98), rgba(35, 32, 47, 0.98));
  --input-background: rgba(13, 12, 19, 0.42);
  --header-background: rgba(25, 24, 36, 0.94);
  --login-background: linear-gradient(145deg, rgba(42, 40, 54, 0.96), rgba(31, 30, 42, 0.98));
  --welcome-background: linear-gradient(110deg, #332d76 0%, #423796 57%, #574bc1 100%);
  --metric-highlight-background: linear-gradient(120deg, #3c3285, #5749b8);
  --amber: #f3a94b;
  --blue: #70baff;
  --orbit-blue: #70baff;
  --orbit-mint: #75c9a8;
  --orbit-amber: #e8a34b;
  --orbit-coral: #e66b53;
  --orbit-track: rgba(195, 186, 239, 0.21);
  --danger: #ff9a8b;
  --radius-lg: 26px;
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.26);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #252337;
  --ink-soft: #514f65;
  --muted: #737185;
  --deep: #f2f1f8;
  --deep-2: #eae9f2;
  --panel: #ffffff;
  --panel-raised: #fbfaff;
  --line: rgba(48, 43, 82, 0.12);
  --accent: #604bd4;
  --accent-rgb: 96, 75, 212;
  --accent-strong: #4d3bc5;
  --accent-soft: rgba(96, 75, 212, 0.1);
  --button-text: #ffffff;
  --card-background: linear-gradient(145deg, #ffffff, #f9f8fd);
  --card-hover-background: linear-gradient(145deg, #ffffff, #f1effa);
  --input-background: #ffffff;
  --header-background: rgba(249, 248, 255, 0.96);
  --login-background: linear-gradient(145deg, #ffffff, #f8f7fd);
  --welcome-background: linear-gradient(110deg, #ebe7fb 0%, #f1effc 60%, #e6e1f8 100%);
  --metric-highlight-background: linear-gradient(120deg, #443896, #6153d0);
  --amber: #a9680d;
  --blue: #316fa8;
  --orbit-blue: #347fb3;
  --orbit-mint: #3e8b6c;
  --orbit-amber: #a9680d;
  --orbit-coral: #bd4d3c;
  --orbit-track: rgba(67, 57, 123, 0.2);
  --danger: #a43d46;
  --shadow-card: 0 24px 70px rgba(42, 35, 82, 0.12);
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--deep);
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }

::selection { color: var(--button-text); background: rgba(var(--accent-rgb), 0.48); }

.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(var(--accent-rgb), 0.16), transparent 34%),
    radial-gradient(ellipse at 81% 85%, rgba(108, 91, 174, 0.16), transparent 31%),
    linear-gradient(130deg, #191824 0%, #211f2c 52%, #252237 100%);
}

.auth-page::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(211, 199, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(211, 199, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px;
  content: "";
  mask-image: radial-gradient(ellipse at 50% 40%, #000 12%, transparent 76%);
}

.login-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: center;
  gap: clamp(52px, 9vw, 150px);
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 64px clamp(28px, 7.5vw, 112px);
}

.login-intro { position: relative; min-width: 0; }
.login-intro-copy { position: relative; z-index: 1; margin-top: clamp(64px, 11vh, 118px); }

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark { display: block; width: 43px; height: 43px; flex: 0 0 auto; }
.brand-name { color: var(--ink); font-size: 17px; font-weight: 760; letter-spacing: 0.045em; }
.brand-accent { color: var(--accent); }

.eyebrow, .card-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1.5;
}

.login-intro .eyebrow { display: flex; align-items: center; gap: 10px; }
.status-dot, .secure-status i, .date-chip-dot, .activity-indicator i, .account-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 13px rgba(var(--accent-rgb), 0.6);
}

.login-intro h1 {
  max-width: 720px;
  margin: 22px 0 18px;
  color: var(--ink);
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 680;
  letter-spacing: -0.065em;
  line-height: 1.035;
}

.login-intro h1 span {
  color: transparent;
  background: linear-gradient(95deg, var(--ink) 6%, var(--accent) 76%);
  -webkit-background-clip: text;
  background-clip: text;
}

.intro-description {
  max-width: 530px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.trust-points { display: flex; flex-wrap: wrap; gap: 28px 42px; margin-top: 40px; }
.trust-point { display: flex; align-items: center; gap: 12px; }
.trust-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.27);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
  font-size: 11px;
  font-weight: 800;
}

.trust-point strong, .trust-point small { display: block; }
.trust-point strong { color: var(--ink); font-size: 12px; font-weight: 680; }
.trust-point small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.intro-footnote { position: relative; z-index: 1; margin: 72px 0 0; color: var(--muted); font-size: 11px; letter-spacing: 0.035em; }

.login-orbit-art {
  position: absolute;
  z-index: 0;
  top: 20%;
  right: -2%;
  width: min(31vw, 360px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.76;
}

.login-orbit-rings { display: block; width: 100%; height: 100%; overflow: visible; }
.orbit-track { fill: none; stroke: var(--orbit-track); stroke-width: 1; }
.orbit-track-inner { stroke-dasharray: 1 5; stroke-width: 0.8; }
.orbit-segment { fill: none; stroke-width: 5; stroke-linecap: butt; }
.orbit-blue { stroke: var(--orbit-blue); }
.orbit-mint { stroke: var(--orbit-mint); stroke-width: 3; }
.orbit-amber { stroke: var(--orbit-amber); }
.orbit-coral { stroke: var(--orbit-coral); stroke-width: 2.5; }
.orbit-rotation { transform-box: view-box; transform-origin: center; animation: orbit-turn 72s linear infinite; }
.orbit-rotation-reverse { animation-duration: 54s; animation-direction: reverse; }
.orbit-ticks { fill: var(--orbit-mint); stroke: var(--orbit-blue); stroke-width: 1.5; }
.orbit-center-glow { fill: rgba(var(--accent-rgb), 0.08); filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.22)); stroke: rgba(var(--accent-rgb), 0.26); stroke-width: 1; }
.login-orbit-mark { position: absolute; top: 50%; left: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.28)); opacity: 0.92; }

@keyframes orbit-turn { to { transform: rotate(360deg); } }

.login-card {
  position: relative;
  width: 100%;
  padding: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--login-background);
  box-shadow: var(--shadow-card), inset 0 1px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px);
  animation: card-enter 650ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.login-card::before {
  position: absolute;
  top: 0;
  left: 36px;
  width: 70px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  content: "";
}

.login-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.card-kicker { color: var(--muted); font-size: 9px; }
.secure-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(var(--accent-rgb), 0.19); border-radius: 13px; background: rgba(var(--accent-rgb), 0.08); }
.secure-mark svg { width: 19px; fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.login-card h2 { margin: 0; color: var(--ink); font-size: 25px; font-weight: 680; letter-spacing: -0.04em; }
.login-subtitle { margin: 9px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.field { margin: 0 0 18px; }
.field label { display: block; margin: 0 0 8px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.input-wrap { position: relative; }

.field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: #718b97;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  pointer-events: none;
}

.field input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px 0 43px;
  border: 1px solid rgba(197, 221, 227, 0.14);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--input-background);
  font-size: 13px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input::placeholder { color: var(--muted); }
.field input:hover { border-color: rgba(197, 221, 227, 0.25); }
.field input:focus { border-color: var(--accent); background: var(--input-background); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14); }
.input-wrap:focus-within .field-icon { stroke: var(--accent); }

.submit, .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid rgba(122, 255, 219, 0.34);
  border-radius: 12px;
  color: var(--button-text);
  background: linear-gradient(110deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
  font-size: 13px;
  font-weight: 760;
  transition: transform 170ms ease, filter 170ms ease, box-shadow 170ms ease;
}

.submit { width: 100%; margin-top: 5px; cursor: pointer; }
.submit svg, .button-primary svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.submit:hover, .button-primary:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 14px 28px rgba(var(--accent-rgb), 0.28); }
.submit:focus-visible, .button-primary:focus-visible, .nav-link:focus-visible, .user-menu-trigger:focus-visible, .theme-option:focus-visible, .sidebar-link:focus-visible, .user-menu-logout:focus-visible, .theme-cycle-button:focus-visible, .mobile-tab:focus-visible, .mobile-more-panel a:focus-visible, .mobile-more-panel button:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.65); outline-offset: 3px; }
.submit:disabled { cursor: wait; opacity: 0.75; }
.submit.is-loading svg { animation: arrow-pulse 700ms ease-in-out infinite alternate; }

.error { margin: 0 0 14px; padding: 11px 13px; border: 1px solid rgba(255, 154, 139, 0.22); border-radius: 10px; color: #ffc2b8; background: rgba(130, 45, 50, 0.18); font-size: 12px; line-height: 1.5; }
.demo-access { margin-top: 25px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.demo-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.demo-tag { padding: 4px 7px; border-radius: 6px; color: #f7c37e; background: rgba(243, 169, 75, 0.12); font-size: 8px; font-weight: 850; letter-spacing: 0.12em; }
.demo-access p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.demo-access p strong { color: var(--ink-soft); font-weight: 650; }
.demo-access p span { font-variant-numeric: tabular-nums; }
.demo-access i { padding: 0 3px; color: #5e7783; font-style: normal; }
.login-legal { margin: 17px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }

.setup-page {
  min-height: 100vh;
  padding: 0 28px;
  background:
    radial-gradient(ellipse at 10% 12%, rgba(var(--accent-rgb), 0.14), transparent 34%),
    radial-gradient(ellipse at 90% 86%, rgba(108, 91, 174, 0.12), transparent 32%),
    var(--deep);
}
.entry-page { display: grid; place-items: center; padding: 24px; }
.setup-header { display: flex; width: min(100%, 1120px); min-height: 78px; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; }
.setup-header .brand-mark { width: 36px; height: 36px; }
.setup-header .brand-name { font-size: 14px; }
.setup-header .theme-options { width: min(100%, 330px); }
.setup-main { display: grid; justify-items: center; gap: 18px; padding: 25px 0 30px; }
.setup-card { position: relative; width: min(100%, 760px); padding: clamp(24px, 5vw, 46px); border: 1px solid var(--line); border-radius: 24px; background: var(--login-background); box-shadow: var(--shadow-card), inset 0 1px rgba(255, 255, 255, 0.04); }
.setup-card::before { position: absolute; top: 0; left: 44px; width: 74px; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); content: ""; }
.setup-card-heading { margin-bottom: 27px; text-align: center; }
.setup-card-heading .eyebrow { color: var(--accent); font-size: 9px; font-weight: 780; letter-spacing: 0.15em; }
.setup-card-heading h1 { margin: 10px 0 8px; color: var(--ink); font-size: clamp(25px, 4vw, 34px); font-weight: 690; letter-spacing: -0.045em; }
.setup-card-heading > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.setup-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; }
.setup-progress li { position: relative; display: flex; min-width: 0; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(var(--accent-rgb), 0.035); }
.setup-progress li > span { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; font-size: 9px; font-weight: 760; }
.setup-progress small { overflow: hidden; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.setup-progress li.is-current { border-color: rgba(var(--accent-rgb), 0.34); color: var(--ink); background: rgba(var(--accent-rgb), 0.1); }
.setup-progress li.is-current > span, .setup-progress li.is-complete > span { border-color: rgba(var(--accent-rgb), 0.35); color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.setup-progress li.is-complete { color: var(--ink-soft); }
.setup-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.setup-step-heading { margin-bottom: 22px; }
.setup-step-heading > span { color: var(--accent); font-size: 8px; font-weight: 780; letter-spacing: 0.13em; }
.setup-step-heading h2 { margin: 6px 0; color: var(--ink); font-size: 18px; font-weight: 680; letter-spacing: -0.025em; }
.setup-step-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.setup-step .field { margin-bottom: 15px; }
.setup-step .field label { font-size: 11px; }
.setup-step .field input { height: 45px; padding: 0 13px; font-size: 12px; }
.setup-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setup-field-grid .field { min-width: 0; }
.database-options { display: grid; gap: 10px; }
.database-option { display: flex; min-height: 69px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(var(--accent-rgb), 0.035); }
.database-option.is-selected { border-color: rgba(var(--accent-rgb), 0.38); background: rgba(var(--accent-rgb), 0.09); }
.database-option > input { width: 16px; height: 16px; accent-color: var(--accent); }
.database-option-mark { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 8px; font-weight: 800; }
.database-option-copy { display: grid; min-width: 0; gap: 4px; }
.database-option-copy strong { color: var(--ink); font-size: 11px; font-weight: 680; }
.database-option-copy small { color: var(--muted); font-size: 9px; }
.database-option-state { margin-left: auto; color: var(--accent); font-size: 8px; font-weight: 700; white-space: nowrap; }
.database-option.is-unavailable { opacity: 0.55; }
.database-option.is-unavailable .database-option-state { color: var(--muted); }
.setup-note { margin: 15px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.setup-port-note output { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.setup-port-note code { color: var(--ink-soft); font-size: inherit; }
.management-placeholder { display: flex; min-height: 68px; align-items: center; gap: 11px; margin-top: 21px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(var(--accent-rgb), 0.035); }
.management-placeholder-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 18px; }
.management-placeholder > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.management-placeholder strong { color: var(--ink-soft); font-size: 10px; }
.management-placeholder small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.coming-soon { margin-left: auto; color: var(--muted); font-size: 8px; white-space: nowrap; }
.setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.setup-back { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 11px; font-weight: 650; }
.setup-back:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.07); }
.setup-retry { display: block; margin: 0 auto; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 10px; }
.setup-retry:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.07); }
.setup-next, .setup-submit { min-height: 44px; margin: 0 0 0 auto; padding: 0 16px; border-radius: 11px; cursor: pointer; font-size: 11px; }
.setup-next:disabled, .setup-submit:disabled, .setup-back:disabled { cursor: wait; opacity: 0.65; }
.setup-success { margin: 0 0 14px; padding: 11px 13px; border: 1px solid rgba(74, 205, 158, 0.25); border-radius: 10px; color: #8be0bf; background: rgba(25, 128, 93, 0.12); font-size: 11px; line-height: 1.5; }
.setup-loading { display: flex; min-height: 120px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 11px; }
.setup-loader { width: 19px; height: 19px; flex: 0 0 auto; border: 2px solid rgba(var(--accent-rgb), 0.22); border-top-color: var(--accent); border-radius: 50%; animation: setup-spin 800ms linear infinite; }
.setup-footer { margin: 0; color: var(--muted); font-size: 9px; text-align: center; }
.setup-footer span { padding: 0 5px; color: var(--accent); }
.entry-card { display: grid; width: min(100%, 380px); justify-items: center; gap: 12px; padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: var(--login-background); box-shadow: var(--shadow-card); text-align: center; }
.entry-card .brand-mark { width: 46px; height: 46px; }
.entry-card .eyebrow { margin: 4px 0 0; color: var(--accent); font-size: 9px; font-weight: 760; letter-spacing: 0.14em; }
.entry-card h1 { margin: 0; color: var(--ink); font-size: 21px; }
.entry-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.entry-card .button-primary { min-height: 40px; margin: 8px 0 0; padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: 10px; }
.installation-error-banner { position: fixed; z-index: 50; top: 12px; right: 12px; left: 12px; max-width: 700px; margin: 0 auto; padding: 13px 16px; border: 1px solid rgba(255, 154, 139, 0.35); border-radius: 12px; color: var(--danger); background: var(--panel-raised); box-shadow: var(--shadow-card); font-size: 11px; line-height: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.app-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 7% 0%, rgba(var(--accent-rgb), 0.11), transparent 28%),
    radial-gradient(ellipse at 100% 34%, rgba(103, 85, 160, 0.1), transparent 32%),
    var(--deep);
}

.app-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header-background);
  backdrop-filter: blur(18px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(100% - 48px, 1600px);
  min-height: 64px;
  margin: 0 auto;
}

.app-header .brand { gap: 10px; flex: 0 0 auto; }
.app-header .brand-mark { width: 36px; height: 36px; }
.app-header .brand-name { font-size: 15px; }
.primary-nav { display: flex; align-self: stretch; align-items: center; gap: 7px; margin-left: 8px; }
.nav-link { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 620; transition: color 160ms ease, background 160ms ease; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); background: rgba(var(--accent-rgb), 0.09); }
.nav-link.is-active::after { position: absolute; right: 13px; bottom: -12px; left: 13px; height: 2px; border-radius: 2px; background: var(--accent); content: ""; }
.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.theme-cycle-button { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-soft); background: rgba(var(--accent-rgb), 0.06); cursor: pointer; transition: color 160ms ease, border-color 160ms ease, background 160ms ease; }
.theme-cycle-button:hover { border-color: rgba(var(--accent-rgb), 0.35); color: var(--ink); background: rgba(var(--accent-rgb), 0.12); }
.theme-cycle-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.user-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(var(--accent-rgb), 0.3); border-radius: 12px; color: var(--ink); background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.12)); font-size: 14px; font-weight: 750; }
.user-meta small, .user-meta strong { display: block; }
.user-meta small { margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.user-meta strong { color: var(--ink); font-size: 12px; font-weight: 670; }

.app-main { width: min(100% - 64px, 1160px); margin: 0 auto; padding: 38px 0 30px; }
.page-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.page-context .eyebrow { color: #91aab3; font-size: 9px; }
.context-divider { padding: 0 6px; color: #526e79; }
.secure-status { display: inline-flex; align-items: center; gap: 8px; color: #91a8af; font-size: 10px; white-space: nowrap; }
.secure-status i { width: 6px; height: 6px; }

.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 300px;
  padding: 42px 54px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 25px;
  background: var(--welcome-background);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.17), inset 0 1px rgba(255, 255, 255, 0.04);
}

.welcome-panel::after { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 43%, rgba(255, 255, 255, 0.025) 100%); content: ""; }
.welcome-copy { position: relative; z-index: 1; max-width: 630px; }
.welcome-overline { margin: 0 0 14px; color: #8bcdbd; font-size: 9px; font-weight: 800; letter-spacing: 0.17em; }
.welcome-overline span { padding: 0 6px; color: var(--amber); }
.welcome-copy h1 { margin: 0; color: var(--ink); font-size: clamp(34px, 4vw, 50px); font-weight: 680; letter-spacing: -0.055em; line-height: 1.1; }
.welcome-copy h1 span { color: var(--accent); }
.welcome-copy > p:not(.welcome-overline) { max-width: 530px; margin: 15px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.button-primary { min-height: 42px; margin-top: 23px; padding: 0 15px; border-radius: 10px; font-size: 11px; }

.welcome-art { position: relative; z-index: 1; display: grid; width: 245px; height: 220px; flex: 0 0 auto; place-items: center; margin: 0 16px 0 35px; }
.welcome-art > img { z-index: 1; width: 75px; height: 75px; filter: drop-shadow(0 10px 28px rgba(53, 214, 176, 0.18)); animation: logo-breathe 4s ease-in-out infinite; }
.orbit { position: absolute; border: 1px solid rgba(135, 231, 207, 0.23); border-radius: 50%; }
.orbit-outer { width: 195px; height: 195px; transform: rotate(-24deg) scaleY(0.7); }
.orbit-inner { width: 142px; height: 142px; border-color: rgba(243, 169, 75, 0.25); transform: rotate(38deg) scaleY(0.66); }
.orbit-point { position: absolute; z-index: 2; width: 8px; height: 8px; border: 2px solid var(--panel); border-radius: 50%; background: var(--accent); box-shadow: 0 0 13px rgba(var(--accent-rgb), 0.7); }
.orbit-point-one { top: 38px; right: 39px; }
.orbit-point-two { bottom: 42px; left: 40px; background: var(--amber); box-shadow: 0 0 12px rgba(243, 169, 75, 0.55); }
.orbit-caption { position: absolute; right: -9px; bottom: 3px; color: rgba(177, 219, 213, 0.56); font-size: 8px; font-weight: 800; letter-spacing: 0.15em; line-height: 1.55; text-align: right; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 38px 0 16px; }
.section-heading .eyebrow { color: var(--accent); font-size: 9px; }
.section-heading h2, .activity-heading h2 { margin: 5px 0 0; color: var(--ink); font-size: 19px; font-weight: 660; letter-spacing: -0.035em; }
.section-note { padding-bottom: 3px; color: #7f98a2; font-size: 10px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.module-card { position: relative; min-height: 190px; padding: 20px 21px 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--card-background); transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
.module-card:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), 0.3); background: var(--card-hover-background); }
.module-card-accent { border-color: rgba(243, 169, 75, 0.17); }
.module-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-number { color: #74909b; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }
.module-status { display: inline-flex; align-items: center; gap: 6px; color: #8fa8b0; font-size: 9px; font-weight: 600; }
.module-status::before { width: 5px; height: 5px; border-radius: 50%; background: #e7aa56; content: ""; }
.module-card h3 { margin: 22px 0 7px; color: var(--ink); font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.module-card p { max-width: 300px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.module-line { position: absolute; right: 21px; bottom: 0; left: 21px; height: 2px; background: rgba(207, 230, 234, 0.07); }
.module-line span { display: block; width: 24%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), transparent); }
.module-card-accent .module-line span { background: linear-gradient(90deg, var(--amber), transparent); }

.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 16px; }
.info-panel { display: flex; align-items: flex-start; gap: 15px; min-height: 130px; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--card-background); }
.info-panel-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(var(--accent-rgb), 0.25); border-radius: 12px; color: var(--accent); background: rgba(var(--accent-rgb), 0.09); font-size: 10px; font-weight: 800; }
.account-icon { border-color: rgba(112, 186, 255, 0.22); color: var(--blue); background: rgba(112, 186, 255, 0.07); }
.info-panel .eyebrow { color: #7e9ba4; font-size: 8px; }
.info-panel h2 { margin: 5px 0 7px; color: var(--ink); font-size: 13px; font-weight: 680; }
.panel-detail { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.account-status-dot { width: 6px; height: 6px; margin-right: 5px; vertical-align: 1px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 27px; padding: 17px 2px 0; border-top: 1px solid rgba(195, 220, 227, 0.08); color: #6f8791; font-size: 9px; }
.app-footer span:first-child { color: #8aa3ad; font-weight: 720; letter-spacing: 0.08em; }

.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 24px 0 22px; }
.dashboard-heading .eyebrow { color: #8da7af; }
.dashboard-heading h1 { margin: 9px 0 8px; color: var(--ink); font-size: clamp(28px, 4vw, 38px); font-weight: 680; letter-spacing: -0.05em; }
.dashboard-heading > div:first-child > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--card-background); font-size: 10px; }
.date-chip-dot { width: 6px; height: 6px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.metric-card { min-height: 153px; padding: 19px 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--card-background); }
.metric-card-highlight { border-color: rgba(var(--accent-rgb), 0.3); background: var(--metric-highlight-background); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #88a1aa; font-size: 8px; font-weight: 800; letter-spacing: 0.13em; }
.metric-symbol { color: #62828d; font-size: 9px; }
.metric-card > strong { display: block; margin-top: 16px; color: var(--ink); font-size: 29px; font-weight: 690; letter-spacing: -0.05em; }
.metric-card > strong.metric-pending { margin-top: 18px; color: var(--ink-soft); font-size: 17px; letter-spacing: -0.025em; }
.metric-card > p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; font-weight: 640; }
.metric-card > small { display: block; margin-top: 8px; color: #7f99a2; font-size: 9px; }
.dashboard-section-heading { margin-top: 34px; }
.admin-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-module-card { position: relative; display: flex; align-items: flex-start; gap: 13px; min-height: 172px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-background); transition: transform 180ms ease, border-color 180ms ease; scroll-margin-top: 100px; }
.admin-module-card:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), 0.3); }
.admin-module-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(var(--accent-rgb), 0.25); border-radius: 12px; color: var(--accent); background: rgba(var(--accent-rgb), 0.09); font-size: 10px; font-weight: 850; }
.admin-module-icon.icon-amber { border-color: rgba(243, 169, 75, 0.2); color: var(--amber); background: rgba(243, 169, 75, 0.08); }
.admin-module-icon.icon-blue { border-color: rgba(112, 186, 255, 0.2); color: var(--blue); background: rgba(112, 186, 255, 0.08); }
.admin-module-copy { min-width: 0; }
.admin-module-copy .module-status { font-size: 8px; }
.admin-module-copy h3 { margin: 11px 0 6px; color: var(--ink); font-size: 12px; font-weight: 670; line-height: 1.4; }
.admin-module-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.module-arrow { position: absolute; right: 14px; bottom: 12px; color: #55737f; font-size: 13px; }
.activity-panel { margin-top: 16px; padding: 19px 21px 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--card-background); scroll-margin-top: 100px; }
.activity-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.activity-heading .eyebrow { color: #7e9ba4; font-size: 8px; }
.activity-heading h2 { margin-top: 4px; font-size: 14px; }
.activity-indicator { display: inline-flex; align-items: center; gap: 7px; color: #8da6ae; font-size: 9px; }
.activity-indicator i { width: 6px; height: 6px; }
.empty-activity { display: flex; align-items: center; gap: 14px; margin-top: 17px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(var(--accent-rgb), 0.04); }
.empty-activity-mark { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: var(--accent); background: rgba(var(--accent-rgb), 0.1); font-size: 9px; font-weight: 850; letter-spacing: -0.04em; }
.empty-activity strong { display: block; color: var(--ink); font-size: 10px; font-weight: 660; }
.empty-activity p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.auth-theme-switcher {
  position: fixed;
  z-index: 8;
  top: 18px;
  right: 22px;
  box-shadow: var(--shadow-card);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.07);
}

.theme-option {
  display: inline-flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.theme-option svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.theme-option:hover { color: var(--ink); }
.theme-option[aria-pressed="true"] { border-color: var(--line); color: var(--ink); background: var(--panel-raised); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }

.user-menu { position: relative; }
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  list-style: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.user-menu-trigger::-webkit-details-marker { display: none; }
.user-menu-trigger:hover, .user-menu[open] .user-menu-trigger { border-color: var(--line); background: rgba(var(--accent-rgb), 0.07); }
.user-menu-chevron { width: 15px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: transform 160ms ease; }
.user-menu[open] .user-menu-chevron { transform: rotate(180deg); }
.user-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  width: min(310px, calc(100vw - 28px));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-raised);
  box-shadow: var(--shadow-card);
}

.user-menu[open] .user-menu-panel { display: grid; }
.user-menu-section { display: grid; gap: 8px; }
.user-menu-label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.user-menu-identity { display: flex; align-items: center; gap: 10px; padding: 2px 2px 11px; border-bottom: 1px solid var(--line); }
.user-menu-identity > span:last-child { display: grid; min-width: 0; gap: 3px; }
.user-menu-identity strong { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-identity small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-action { display: flex; min-height: 36px; align-items: center; gap: 9px; padding: 0 9px; border-radius: 8px; color: var(--ink-soft); font-size: 10px; transition: background 160ms ease, color 160ms ease; }
.user-menu-action:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.08); }
.user-menu-action svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.user-menu-external { margin-left: auto; color: var(--muted); font-size: 12px; }
.user-menu-logout { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 10px; border: 0; border-top: 1px solid var(--line); color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 11px; text-align: left; }
.user-menu-action:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.65); outline-offset: 2px; }
.user-menu-logout:hover { color: var(--danger); }
.user-menu-logout svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.admin-page {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  grid-template-rows: 64px minmax(calc(100vh - 64px), auto);
  min-height: 100vh;
}

.admin-page > .app-header {
  position: sticky;
  grid-column: 2;
  grid-row: 1;
  top: 0;
  z-index: 15;
  min-width: 0;
}

.admin-page .app-header-inner {
  width: auto;
  min-height: 64px;
  gap: 12px;
  padding: 0 clamp(20px, 3vw, 40px);
}

.admin-page .app-header-inner > .brand,
.admin-page .primary-nav { display: none; }
.admin-page .header-actions { gap: 12px; }
.admin-page .admin-layout { display: contents; }

.admin-sidebar {
  --ink: #f5f3ff;
  --ink-soft: #d3cfea;
  --muted: #aaa5c9;
  --line: rgba(234, 229, 255, 0.13);
  --accent: #b7a7ff;
  --accent-rgb: 183, 167, 255;
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 0;
  z-index: 16;
  display: flex;
  width: 264px;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  padding: 18px 14px 20px;
  overflow: hidden;
  border-right: 1px solid rgba(234, 229, 255, 0.1);
  background: #24213f;
  color: var(--ink);
}

.admin-sidebar-top { display: grid; flex: 0 0 auto; }
.admin-sidebar-brand { display: flex; min-height: 48px; align-items: center; gap: 10px; margin-bottom: 20px; padding: 0 10px 15px; border-bottom: 1px solid var(--line); }
.admin-sidebar-brand .brand-mark { width: 36px; height: 36px; }
.admin-sidebar-brand .brand-name { color: var(--ink); font-size: 15px; }
.admin-sidebar-heading { display: grid; gap: 7px; padding: 0 12px 17px; }
.admin-sidebar-heading .eyebrow { color: var(--muted); font-size: 10px; }
.admin-sidebar-heading strong { color: var(--ink); font-size: 16px; font-weight: 700; }
.admin-sidebar-company-link { margin: 0 0 15px; border-color: var(--line); color: var(--ink-soft); background: rgba(var(--accent-rgb), 0.08); }
.admin-sidebar-nav { display: grid; min-height: 0; flex: 1 1 auto; align-content: start; gap: 5px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: rgba(183, 167, 255, 0.38) transparent; scrollbar-width: thin; }
.admin-sidebar-nav::-webkit-scrollbar { width: 5px; }
.admin-sidebar-nav::-webkit-scrollbar-thumb { border-radius: 5px; background: rgba(183, 167, 255, 0.38); }
.sidebar-label { margin: 19px 12px 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; }
.sidebar-link { position: relative; display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 620; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; }
.sidebar-link:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.1); }
.sidebar-link.is-active { border-color: rgba(var(--accent-rgb), 0.26); color: var(--ink); background: rgba(var(--accent-rgb), 0.2); }
.sidebar-link.is-active::before { position: absolute; top: 9px; bottom: 9px; left: -1px; width: 3px; border-radius: 3px; background: var(--accent); content: ""; }
.sidebar-link > svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.sidebar-sub-link { min-height: 39px; padding-left: 18px; font-size: 12px; }
.sidebar-module-mark { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); font-size: 9px; font-weight: 800; }
.admin-sidebar-footer { display: grid; flex: 0 0 auto; gap: 14px; margin-top: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-sidebar-footer > span { padding: 0 12px; color: var(--muted); font-size: 10px; }
.admin-main { grid-column: 2; grid-row: 2; width: auto; max-width: none; margin: 0; padding: 30px clamp(24px, 3.2vw, 52px) 34px; }
.admin-main .page-context .eyebrow { font-size: 10px; }
.admin-main .secure-status { font-size: 12px; }
.admin-main .dashboard-heading > div:first-child > p:last-child { font-size: 14px; }
.admin-main .metric-top { font-size: 10px; }
.admin-main .metric-card > p { font-size: 13px; }
.admin-main .metric-card > small { font-size: 11px; }
.admin-main .admin-module-copy .module-status { font-size: 10px; }
.admin-main .admin-module-copy h3 { font-size: 14px; }
.admin-main .admin-module-copy p { font-size: 12px; }
.admin-main .activity-indicator { font-size: 11px; }
.admin-main .empty-activity strong { font-size: 12px; }
.admin-main .empty-activity p { font-size: 11px; }
.admin-main .dashboard-heading, .admin-main #modules, .admin-main #companies, .admin-main #activity, .admin-main #system { scroll-margin-top: 100px; }
.company-panel, .system-panel { margin-top: 29px; }
.company-panel .dashboard-section-heading, .system-panel .dashboard-section-heading { margin-top: 0; }
.company-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.company-card { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-background); }
.company-card-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(var(--accent-rgb), 0.23); border-radius: 11px; color: var(--accent); background: rgba(var(--accent-rgb), 0.09); font-size: 13px; font-weight: 760; }
.company-card-details { display: grid; min-width: 0; gap: 4px; }
.company-card-details strong { overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.company-card-details small { color: var(--muted); font-size: 9px; }
.company-card-status { margin-left: auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.company-empty { grid-column: 1 / -1; margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); background: rgba(var(--accent-rgb), 0.035); font-size: 10px; line-height: 1.5; }
.company-load-error { color: var(--danger); }
.system-info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.system-info-card { display: grid; min-width: 0; min-height: 108px; align-content: center; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-background); }
.system-info-card > span { color: var(--muted); font-size: 8px; font-weight: 760; letter-spacing: 0.1em; }
.system-info-card strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.system-info-card small { color: var(--muted); font-size: 9px; }
.mobile-bottom-nav { display: none; }

:root[data-theme="light"] .auth-page {
  background:
    radial-gradient(ellipse at 12% 18%, rgba(var(--accent-rgb), 0.1), transparent 34%),
    radial-gradient(ellipse at 81% 85%, rgba(108, 91, 174, 0.08), transparent 31%),
    linear-gradient(130deg, #fbfaff 0%, #f1eff9 52%, #f5f2fc 100%);
}

:root[data-theme="light"] .auth-page::before { opacity: 0.35; }
:root[data-theme="light"] .login-intro h1 { color: var(--ink); }
:root[data-theme="light"] .intro-description,
:root[data-theme="light"] .trust-point small,
:root[data-theme="light"] .login-subtitle { color: var(--muted); }
:root[data-theme="light"] .trust-point strong,
:root[data-theme="light"] .login-card h2,
:root[data-theme="light"] .field label { color: var(--ink); }
:root[data-theme="light"] .login-card { border-color: var(--line); }
:root[data-theme="light"] .field input { border-color: var(--line); }
:root[data-theme="light"] .field input:hover { border-color: rgba(var(--accent-rgb), 0.45); }
:root[data-theme="light"] .field input:focus { background: var(--input-background); }
:root[data-theme="light"] .demo-tag { color: #82530a; }
:root[data-theme="light"] .demo-access p strong { color: var(--ink); }
:root[data-theme="light"] .page-context .eyebrow,
:root[data-theme="light"] .dashboard-heading .eyebrow,
:root[data-theme="light"] .info-panel .eyebrow,
:root[data-theme="light"] .activity-heading .eyebrow { color: var(--muted); }
:root[data-theme="light"] .context-divider { color: var(--muted); }
:root[data-theme="light"] .secure-status,
:root[data-theme="light"] .welcome-overline,
:root[data-theme="light"] .section-note,
:root[data-theme="light"] .module-number,
:root[data-theme="light"] .module-status,
:root[data-theme="light"] .info-panel h2,
:root[data-theme="light"] .panel-detail,
:root[data-theme="light"] .metric-top,
:root[data-theme="light"] .metric-symbol,
:root[data-theme="light"] .metric-card > small,
:root[data-theme="light"] .activity-indicator,
:root[data-theme="light"] .empty-activity p { color: var(--muted); }
:root[data-theme="light"] .welcome-copy h1,
:root[data-theme="light"] .section-heading h2,
:root[data-theme="light"] .activity-heading h2,
:root[data-theme="light"] .module-card h3,
:root[data-theme="light"] .metric-card > strong,
:root[data-theme="light"] .metric-card > strong.metric-pending,
:root[data-theme="light"] .metric-card > p,
:root[data-theme="light"] .admin-module-copy h3,
:root[data-theme="light"] .empty-activity strong { color: var(--ink); }
:root[data-theme="light"] .welcome-copy > p:not(.welcome-overline) { color: var(--ink-soft); }
:root[data-theme="light"] .welcome-panel { box-shadow: 0 20px 60px rgba(46, 37, 78, 0.08); }
:root[data-theme="light"] .orbit { border-color: rgba(var(--accent-rgb), 0.25); }
:root[data-theme="light"] .orbit-caption { color: rgba(81, 60, 137, 0.58); }
:root[data-theme="light"] .module-number,
:root[data-theme="light"] .metric-symbol { color: var(--muted); }
:root[data-theme="light"] .module-line { background: var(--line); }
:root[data-theme="light"] .app-footer { border-color: var(--line); color: var(--muted); }
:root[data-theme="light"] .app-footer span:first-child { color: var(--ink-soft); }
:root[data-theme="light"] .admin-sidebar { background: #24213f; }
:root[data-theme="light"] .admin-sidebar-heading strong { color: #f5f3ff; }
:root[data-theme="light"] .admin-sidebar-footer > span,
:root[data-theme="light"] .sidebar-label { color: var(--muted); }
:root[data-theme="light"] .metric-card-highlight .metric-top,
:root[data-theme="light"] .metric-card-highlight .metric-symbol,
:root[data-theme="light"] .metric-card-highlight > p,
:root[data-theme="light"] .metric-card-highlight > small { color: rgba(255, 255, 255, 0.82); }
:root[data-theme="light"] .metric-card-highlight > strong { color: #ffffff; }
:root[data-theme="light"] .setup-success { color: #176847; background: rgba(25, 128, 93, 0.08); }
:root[data-theme="light"] .error { color: #9c343d; background: rgba(255, 223, 225, 0.72); }

@keyframes card-enter {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes logo-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@keyframes arrow-pulse {
  from { transform: translateX(0); }
  to { transform: translateX(4px); }
}

@keyframes setup-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .login-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 42px; padding-right: 42px; padding-left: 42px; }
  .login-intro h1 { font-size: clamp(40px, 5.5vw, 58px); }
  .trust-points { gap: 18px; }
  .welcome-panel { padding-right: 34px; padding-left: 34px; }
  .welcome-art { width: 205px; margin-right: 0; }
  .admin-module-card { flex-direction: column; }
  .admin-module-copy h3 { min-height: 34px; }
  .system-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; justify-items: center; gap: 38px; max-width: 580px; padding: 34px 24px 40px; }
  .login-intro { width: 100%; }
  .login-intro-copy { margin-top: 50px; }
  .login-intro h1 { max-width: 600px; font-size: clamp(40px, 8vw, 57px); }
  .intro-description { max-width: 560px; font-size: 14px; }
  .trust-points { margin-top: 25px; }
  .intro-footnote { margin-top: 29px; }
  .login-orbit-art { top: 12%; right: 3%; width: 220px; opacity: 0.34; }
  .login-card { max-width: 480px; }
  .setup-page { padding: 0 20px; }
  .setup-header { min-height: 68px; }
  .setup-main { padding-top: 18px; }
  .setup-card { border-radius: 20px; }
  .app-header-inner { width: min(100% - 40px, 640px); min-height: 64px; gap: 16px; }
  .primary-nav { gap: 2px; margin-left: auto; }
  .nav-link { padding: 0 8px; font-size: 10px; }
  .nav-link.is-active::after { right: 8px; bottom: -11px; left: 8px; }
  .header-actions { gap: 10px; margin-left: 0; }
  .user-meta { display: none; }
  .app-main { width: min(100% - 40px, 640px); padding-top: 28px; }
  .admin-page { display: block; min-height: 100vh; }
  .admin-page .admin-layout { display: block; min-height: auto; }
  .admin-page .admin-sidebar { display: none; }
  .admin-page .app-header-inner > .brand { display: inline-flex; }
  .admin-page .primary-nav { display: none; }
  .admin-main { width: 100%; max-width: none; padding: 26px 20px 112px; }
  .mobile-bottom-nav { position: fixed; z-index: 15; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--header-background); backdrop-filter: blur(18px); }
  .mobile-tab { display: flex; min-width: 0; min-height: 49px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 650; list-style: none; transition: color 160ms ease, background 160ms ease; }
  .mobile-tab::-webkit-details-marker { display: none; }
  .mobile-tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
  .mobile-tab:hover, .mobile-tab.is-active, .mobile-more-menu[open] > .mobile-tab { color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
  .mobile-more-menu { position: relative; min-width: 0; }
  .mobile-more-panel { position: absolute; right: 0; bottom: calc(100% + 12px); display: grid; width: min(230px, calc(100vw - 24px)); gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-raised); box-shadow: var(--shadow-card); }
  .mobile-more-panel a, .mobile-more-panel button { display: flex; min-height: 42px; align-items: center; padding: 0 11px; border: 0; border-radius: 9px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 12px; text-align: left; }
  .mobile-more-panel a:hover, .mobile-more-panel button:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.09); }
  .mobile-more-panel button { border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; }
  .welcome-panel { min-height: 270px; padding: 30px; }
  .welcome-art { width: 150px; height: 175px; margin-left: 5px; }
  .orbit-outer { width: 150px; height: 150px; }
  .orbit-inner { width: 108px; height: 108px; }
  .welcome-art > img { width: 60px; height: 60px; }
  .orbit-caption { right: -2px; font-size: 7px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 160px; }
  .module-card h3 { margin-top: 17px; }
  .module-card p { max-width: 480px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 135px; }
  .admin-module-grid { grid-template-columns: 1fr; }
  .admin-module-card { min-height: 125px; flex-direction: row; }
  .admin-module-copy h3 { min-height: 0; }
}

@media (max-width: 520px) {
  .auth-theme-switcher { top: 10px; right: 12px; left: 12px; box-shadow: none; }
  .auth-theme-switcher .theme-option { min-height: 31px; font-size: 9px; }
  .login-layout { padding: 63px 18px 30px; }
  .setup-page { padding: 0 14px; }
  .setup-header { flex-wrap: wrap; justify-content: center; padding: 14px 0 4px; }
  .setup-header .brand { margin-right: auto; }
  .setup-header .brand-mark { width: 32px; height: 32px; }
  .setup-header .brand-name { font-size: 12px; }
  .setup-header .theme-options { width: 100%; }
  .setup-header .theme-option { min-height: 31px; font-size: 9px; }
  .setup-card { padding: 25px 18px 20px; }
  .setup-card::before { left: 18px; }
  .setup-card-heading { margin-bottom: 22px; }
  .setup-card-heading h1 { font-size: 26px; }
  .setup-progress { gap: 6px; margin-bottom: 24px; }
  .setup-progress li { flex-direction: column; gap: 5px; padding: 8px 4px; text-align: center; }
  .setup-progress li > span { width: 25px; height: 25px; }
  .setup-progress small { max-width: 100%; font-size: 7px; }
  .setup-field-grid { grid-template-columns: 1fr; gap: 0; }
  .management-placeholder { align-items: flex-start; }
  .coming-soon { max-width: 68px; padding-top: 2px; text-align: right; white-space: normal; }
  .setup-actions { margin-top: 17px; }
  .setup-next, .setup-submit, .setup-back { min-height: 42px; padding: 0 12px; font-size: 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 15px; }
  .login-intro-copy { margin-top: 43px; }
  .login-intro h1 { margin-top: 17px; font-size: clamp(37px, 10vw, 49px); }
  .login-orbit-art { top: 14%; right: 1%; width: 185px; opacity: 0.26; }
  .intro-description { font-size: 13px; }
  .trust-points { display: grid; gap: 13px; }
  .login-card { padding: 27px 22px 23px; border-radius: 21px; }
  .login-card::before { left: 22px; }
  .login-card h2 { font-size: 22px; }
  .demo-access { padding: 13px; }
  .demo-access p { display: block; line-height: 1.8; }
  .demo-access p strong { display: block; }
  .app-header-inner { width: calc(100% - 28px); flex-wrap: wrap; gap: 0 10px; padding: 10px 0; }
  .app-header .brand { margin-right: auto; }
  .app-header .brand-mark { width: 32px; height: 32px; }
  .app-header .brand-name { font-size: 12px; }
  .primary-nav { order: 3; width: 100%; min-height: 35px; margin: 4px 0 -7px; }
  .admin-page .app-header-inner { flex-wrap: nowrap; }
  .admin-page .primary-nav { display: none; }
  .nav-link { min-height: 32px; }
  .nav-link.is-active::after { bottom: -8px; }
  .header-actions { gap: 6px; }
  .theme-cycle-button { width: 33px; height: 33px; border-radius: 10px; }
  .user-avatar { width: 31px; height: 31px; }
  .app-main { width: calc(100% - 32px); padding-top: 22px; }
  .page-context { align-items: flex-start; }
  .page-context .eyebrow { max-width: 65%; font-size: 8px; }
  .secure-status { font-size: 9px; }
  .welcome-panel { min-height: unset; padding: 26px 22px 30px; }
  .welcome-copy { max-width: 100%; }
  .welcome-copy h1 { font-size: 36px; }
  .welcome-copy > p:not(.welcome-overline) { font-size: 12px; }
  .welcome-art { position: absolute; right: -55px; bottom: -55px; width: 175px; height: 175px; margin: 0; opacity: 0.3; }
  .welcome-art > img { width: 55px; height: 55px; }
  .welcome-copy .button-primary { position: relative; z-index: 2; }
  .section-heading { align-items: flex-start; margin-top: 30px; }
  .section-heading h2 { font-size: 17px; }
  .section-note { padding-top: 4px; font-size: 9px; text-align: right; }
  .overview-grid { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .dashboard-heading h1 { font-size: 30px; }
  .metric-card { min-height: 128px; }
  .metric-card > strong.metric-pending { font-size: 15px; }
  .activity-panel { padding: 16px; }
  .system-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .system-info-card { min-height: 100px; padding: 12px; }
  .system-info-card strong { font-size: 10px; }
  .mobile-bottom-nav { padding-right: 5px; padding-left: 5px; }
  .mobile-tab { min-height: 49px; font-size: 10px; }
  .app-footer { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
