:root {
  --ink: #172033;
  --muted: #718096;
  --line: #e7ebf2;
  --surface: #ffffff;
  --canvas: #f4f6fa;
  --navy: #111827;
  --blue: #315efb;
  --blue-soft: #edf2ff;
  --green: #1eaa75;
  --red: #e44d4d;
  --amber: #e9a23b;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; color: var(--ink); background: var(--canvas); }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 24px 16px; background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand strong, .brand span { display: block; }
.brand span { margin-top: 3px; color: #98a2b3; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); font-size: 12px; font-weight: 800; }
.brand-mark.large { width: 54px; height: 54px; margin-bottom: 14px; font-size: 16px; }
.nav { display: grid; gap: 6px; margin-top: 18px; }
.nav-item { border: 0; border-radius: 8px; padding: 11px 12px; background: transparent; color: #bdc5d1; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: #fff; }
.logout { margin-top: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; padding: 10px; background: transparent; color: #cbd3df; cursor: pointer; }
.main { grid-column: 2; min-height: 100vh; }
.topbar { height: 86px; padding: 0 36px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { margin: 2px 0 0; font-size: 24px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.role-badge { padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; }
.auth-view { min-height: calc(100vh - 86px); display: grid; place-items: center; }
.auth-card { width: min(410px, calc(100% - 32px)); padding: 36px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 50px rgba(23,32,51,.08); }
.auth-intro h2 { margin: 0 0 6px; }
.auth-intro p { margin: 0 0 24px; color: var(--muted); }
.auth-form { display: grid; gap: 14px; }
.credential-group { display: grid; gap: 7px; color: #4d596b; font-size: 12px; font-weight: 700; }
.credential-group label { cursor: pointer; }
.credential-field { position: relative; }
.auth-form input { width: 100%; height: 43px; border: 1px solid var(--line); border-radius: 8px; padding: 0 42px 0 12px; font: inherit; }
.auth-form input:focus { outline: 2px solid #dfe6ff; border-color: var(--blue); }
.visibility-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 30px; height: 30px; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.visibility-toggle:hover { background: var(--blue-soft); color: var(--blue); }
.visibility-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.visibility-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visibility-slash { display: none; }
.visibility-toggle.is-hidden .visibility-slash { display: block; }
.primary { height: 43px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; cursor: pointer; }
.text-button { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--blue); cursor: pointer; }
.message { min-height: 18px; margin: 10px 0 0; color: var(--red); text-align: center; font-size: 13px; }
.dashboard { padding: 28px 36px 40px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card { min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 12px; font-size: 28px; }
.panel-grid { display: grid; grid-template-columns: 1.7fr .8fr; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.panel.full { min-height: 300px; }
.panel-heading { min-height: 58px; padding: 0 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-heading h3 { margin: 0; font-size: 14px; }
.panel-heading span { color: var(--muted); font-size: 11px; }
.timeline { min-height: 230px; padding: 18px; display: flex; align-items: flex-end; gap: 7px; }
.bar-group { flex: 1; min-width: 10px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 190px; }
.bar { width: 8px; min-height: 2px; border-radius: 4px 4px 0 0; }
.bar.success { background: var(--green); }
.bar.failed { background: var(--red); }
.bar.blocked { background: var(--amber); }
.ip-list { padding: 10px 18px 18px; }
.ip-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ip-row:last-child { border: 0; }
.ip-row strong { color: var(--red); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: #fafbfc; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.status { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #eef1f5; font-size: 11px; font-weight: 700; }
.status.success, .status.resolved { background: #dff4ec; color: #167956; }
.status.failed, .status.open, .status.critical { background: #fde7e7; color: #b93434; }
.status.high { background: #fff0d9; color: #9a6320; }
.action-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff; color: var(--blue); cursor: pointer; }
.action-button:disabled { color: #99a1ae; cursor: default; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; }
  .main { grid-column: 1; }
  .nav { grid-template-columns: repeat(4, 1fr); }
  .logout { margin-top: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
