:root {
  --bg: #07100f;
  --panel: #0c1715;
  --panel-2: #101e1b;
  --line: rgba(180, 221, 209, 0.14);
  --text: #effbf7;
  --muted: #89a59d;
  --green: #38e6a2;
  --green-dark: #123f32;
  --amber: #f5c563;
  --danger: #ff8377;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select { font: inherit; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-intro { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 8rem); display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 30% 40%, #173d32 0, #0a1714 35%, #07100f 72%); }
.login-intro::after { content: ""; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to right, #000, transparent); }
.login-intro > * { position: relative; z-index: 1; }
.brand-mark { display: flex; gap: 5px; width: max-content; margin-bottom: 3rem; transform: skewX(-14deg); }
.brand-mark span { display: block; width: 10px; height: 30px; border-radius: 2px; background: var(--green); }
.brand-mark span:nth-child(2) { opacity: .62; }
.brand-mark span:nth-child(3) { opacity: .28; }
.eyebrow { margin: 0 0 .75rem; color: var(--green); font-size: .72rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.login-intro h1 { max-width: 680px; margin: 0; font-size: clamp(3rem, 7vw, 6.8rem); line-height: .92; letter-spacing: -.055em; }
.intro-copy { max-width: 470px; margin: 2rem 0 0; color: #b6cbc5; font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.6; }
.signal-card { width: min(430px, 100%); margin-top: 4rem; padding: 1.1rem 1.25rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(6, 18, 15, .7); backdrop-filter: blur(12px); }
.signal-label, .signal-state { font-size: .77rem; color: var(--muted); }
.signal-state b, .status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.signal-line { height: 1px; background: var(--line); display: flex; justify-content: space-around; }
.signal-line i { width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: var(--green); }
.login-panel { padding: 2rem; display: grid; place-items: center; background: #08110f; }
.login-card { width: min(440px, 100%); }
.login-card h2 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
.muted { margin: .8rem 0 2rem; color: var(--muted); }
.alert { margin: 0 0 1.3rem; padding: .85rem 1rem; color: #ffd9d5; border: 1px solid rgba(255, 131, 119, .3); border-radius: 10px; background: rgba(255, 131, 119, .09); font-size: .9rem; }
.login-form { display: grid; gap: .7rem; }
.login-form label { margin-top: .55rem; color: #c9d9d4; font-size: .82rem; font-weight: 650; }
.login-form input { width: 100%; padding: .95rem 1rem; color: var(--text); border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--panel); transition: border .2s, box-shadow .2s; }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(56, 230, 162, .1); }
.login-form button { margin-top: 1rem; padding: 1rem 1.2rem; display: flex; justify-content: space-between; color: #04100c; border: 0; border-radius: 10px; background: var(--green); font-weight: 800; cursor: pointer; }
.security-note { margin-top: 1.5rem; color: #67827a; font-size: .75rem; text-align: center; }
.security-note span { color: var(--green); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { min-height: 100vh; padding: 1.5rem 1rem; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); background: #081210; }
.brand { display: flex; align-items: center; gap: .8rem; padding: .4rem .6rem 1.8rem; }
.brand .brand-mark { margin: 0; }
.brand .brand-mark span { width: 6px; height: 21px; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .12em; }
.brand small { margin-top: .18rem; color: var(--muted); font-size: .67rem; }
nav { display: grid; gap: .35rem; }
nav a, .nav-disabled { padding: .78rem .85rem; display: flex; align-items: center; gap: .8rem; color: var(--muted); border-radius: 8px; font-size: .84rem; text-decoration: none; }
nav a.active { color: var(--text); background: var(--green-dark); }
.nav-disabled { opacity: .42; }
.sidebar-footer { padding: 1rem .5rem 0; display: flex; align-items: center; gap: .7rem; border-top: 1px solid var(--line); }
.tenant-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-size: .72rem; font-weight: 800; }
.tenant-copy { min-width: 0; }
.tenant-copy strong, .tenant-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-copy strong { font-size: .75rem; }
.tenant-copy small { max-width: 155px; margin-top: .2rem; color: var(--muted); font-size: .65rem; }
.dashboard { padding: clamp(1.5rem, 4vw, 3.5rem); overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.topbar h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.045em; }
.ghost-button { padding: .7rem 1rem; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; }
.summary-grid { margin-top: 2.5rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.summary-grid article { padding: 1.35rem; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); }
.summary-grid span, .summary-grid small { display: block; color: var(--muted); font-size: .73rem; }
.summary-grid strong { display: block; margin: .75rem 0 .45rem; font-size: 1.8rem; }
.summary-grid strong.good { color: var(--green); font-size: 1.35rem; }
.domains-section { margin-top: 3rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: 1.45rem; }
.read-only-pill { padding: .35rem .6rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: .67rem; }
.domain-list { display: grid; gap: .8rem; }
.domain-card { padding: 1.2rem 1.35rem; display: grid; grid-template-columns: minmax(220px, 1fr) 1.2fr; align-items: center; gap: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.domain-main { display: flex; align-items: center; gap: .9rem; }
.domain-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--green); border-radius: 9px; background: var(--green-dark); }
.domain-card h3 { margin: 0; font-size: .95rem; }
.domain-card p { margin: .3rem 0 0; color: var(--muted); font-size: .7rem; }
.domain-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.domain-card dl div { padding-left: 1rem; border-left: 1px solid var(--line); }
.domain-card dt { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.domain-card dd { margin: .35rem 0 0; font-size: .75rem; font-weight: 750; }
.status-online { color: var(--green); }
.status-down { color: var(--danger); }
.status-unknown { color: var(--amber); }
.empty-state { padding: 4rem 2rem; text-align: center; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); }
.empty-state span { color: var(--green); font-size: 2rem; }
.empty-state h3 { margin: 1rem 0 .3rem; color: var(--text); }
.empty-state p { margin: 0; font-size: .85rem; }
.inline-link, .back-link { color: var(--green); text-decoration: none; }
.center-shell { min-height: 100vh; padding: 2rem; display: grid; place-items: center; background: radial-gradient(circle at 50% 20%, #15362e 0, var(--bg) 45%); }
.security-card { width: min(440px, 100%); padding: 2rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(12, 23, 21, .96); }
.security-card.wide { width: min(620px, 100%); }
.security-card h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
.back-link { display: inline-block; margin-bottom: 2rem; font-size: .82rem; }
.primary-button { padding: 1rem 1.2rem; color: #04100c; border: 0; border-radius: 10px; background: var(--green); font-weight: 800; cursor: pointer; }
.link-button { display: block; text-align: center; text-decoration: none; }
.success-box { margin-top: 2rem; padding: 1.25rem; display: grid; gap: .4rem; color: var(--green); border: 1px solid rgba(56, 230, 162, .3); border-radius: 12px; background: rgba(56, 230, 162, .08); }
.success-box span { color: var(--muted); font-size: .85rem; }
.qr-panel { margin: 1.5rem 0; display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 1.5rem; }
.qr-panel img { width: 190px; padding: .5rem; border-radius: 10px; background: white; }
.qr-panel small, .qr-panel code { display: block; }
.qr-panel small { margin-bottom: .5rem; color: var(--muted); }
.qr-panel code { overflow-wrap: anywhere; color: var(--green); letter-spacing: .08em; }
.alert.warning { color: #ffe5ad; border-color: rgba(245, 197, 99, .3); background: rgba(245, 197, 99, .09); }
.recovery-codes { margin: 1.5rem 0; padding: 1.2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: #07100f; }
.recovery-codes code { color: var(--text); letter-spacing: .08em; }
.wizard-shell { min-height: 100vh; padding: clamp(1.5rem, 5vw, 4rem); background: radial-gradient(circle at 20% 0, #15362e 0, var(--bg) 38%); }
.wizard-card { width: min(980px, 100%); margin: 0 auto; }
.wizard-card h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: -.05em; }
.wizard-form { display: grid; gap: 1rem; }
.wizard-form fieldset { margin: 0; padding: 1.4rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.wizard-form legend { padding: 0 .5rem; font-weight: 750; }
.wizard-form legend span { width: 25px; height: 25px; margin-right: .45rem; display: inline-grid; place-items: center; color: #04100c; border-radius: 50%; background: var(--green); font-size: .72rem; }
.wizard-form label { display: block; margin-bottom: .45rem; color: #c9d9d4; font-size: .78rem; font-weight: 650; }
.wizard-form input, .wizard-form select { width: 100%; padding: .85rem .9rem; color: var(--text); border: 1px solid var(--line); border-radius: 9px; outline: none; background: #081210; }
.wizard-form input:focus, .wizard-form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(56, 230, 162, .1); }
.form-grid { display: grid; gap: 1rem; }
.form-grid.three { grid-template-columns: 2fr .7fr .6fr; }
.health-grid { grid-template-columns: repeat(3, 1fr); }
.wizard-submit { margin-top: .5rem; }

@media (max-width: 850px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 38vh; padding: 3rem 2rem; }
  .login-intro h1 { font-size: 3rem; }
  .login-intro .brand-mark, .signal-card { display: none; }
  .intro-copy { margin-top: 1rem; }
  .login-panel { padding: 3rem 1.4rem; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav, .sidebar-footer { display: none; }
  .brand { padding: 0; }
  .summary-grid { grid-template-columns: 1fr; }
  .domain-card { grid-template-columns: 1fr; }
  .qr-panel { grid-template-columns: 1fr; }
  .recovery-codes { grid-template-columns: 1fr; }
  .form-grid.three, .health-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
