:root {
  color-scheme: dark;
  --ink: #111312;
  --surface: #191c1a;
  --surface-high: #202421;
  --paper: #f4efe2;
  --muted: #989b94;
  --blue: #7a88b7;
  --blue-soft: #aeb8d5;
  --green: #43bd6a;
  --amber: #dfb35c;
  --red: #dc625d;
  --line: rgba(244, 239, 226, 0.1);
  font-family: 'Lato', sans-serif;
  color: var(--paper);
  background: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--ink); }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-page { display: flex; min-height: 100vh; flex-direction: column; padding: 0 clamp(22px, 6vw, 90px); background: radial-gradient(ellipse at 12% 45%, rgba(94, 108, 182, 0.14), transparent 34%), radial-gradient(ellipse at 87% 82%, rgba(220, 98, 93, 0.055), transparent 26%), repeating-linear-gradient(135deg, transparent 0 75px, rgba(255, 255, 255, 0.012) 76px 77px), var(--ink); }
.login-topbar { display: flex; min-height: 82px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(174, 184, 213, 0.43); background: rgba(94, 108, 182, 0.17); color: var(--paper); font: 800 12px 'Montserrat', sans-serif; }
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-text strong { font: 800 12px 'Montserrat', sans-serif; letter-spacing: 1px; }
.brand-text small { color: var(--muted); font: 700 8px 'Lato', sans-serif; letter-spacing: 2px; }
.system-state, .login-footer, .eyebrow, .panel-bar, .security-caption { font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.system-state { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.system-state i, .live-badge i, .online-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(67, 189, 106, 0.45); }
.login-layout { display: grid; width: min(1060px, 100%); flex: 1; grid-template-columns: minmax(0, 1.15fr) minmax(345px, 0.85fr); align-items: center; gap: clamp(55px, 9vw, 128px); margin: 0 auto; padding: 65px 0; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 17px; color: var(--blue-soft); }
.eyebrow > span { width: 22px; height: 1px; background: var(--red); }
.intro-copy h1, .page-heading h1 { margin: 0; font: 700 clamp(43px, 5.4vw, 67px)/1.02 'Montserrat', sans-serif; letter-spacing: 0; }
.intro-copy h1 em, .page-heading h1 em { color: var(--blue-soft); font-style: normal; }
.intro-lead { max-width: 430px; margin: 20px 0 0; color: #b5b7b0; font-size: 15px; line-height: 1.7; }
.access-note { display: flex; max-width: 430px; gap: 17px; margin-top: 48px; padding-top: 19px; border-top: 1px solid var(--line); }
.note-number { color: var(--red); font: 700 10px 'Montserrat', sans-serif; }
.access-note strong { font-size: 12px; }
.access-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-panel { overflow: hidden; border: 1px solid rgba(244, 239, 226, 0.1); background: linear-gradient(180deg, rgba(27, 30, 28, 0.98), rgba(20, 22, 21, 0.98)); box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3); }
.panel-bar { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 19px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.panel-body { padding: 29px 26px 20px; }
.signal-mark { display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; gap: 3px; margin-bottom: 27px; border: 1px solid rgba(174, 184, 213, 0.28); }
.signal-mark i { width: 3px; background: var(--blue-soft); }
.signal-mark i:nth-child(1) { height: 10px; opacity: 0.45; }
.signal-mark i:nth-child(2) { height: 19px; opacity: 0.8; }
.signal-mark i:nth-child(3) { height: 13px; }
.signal-mark i:nth-child(4) { height: 22px; opacity: 0.62; }
.panel-body .eyebrow { margin-bottom: 10px; font-size: 8px; }
.panel-body h2 { margin: 0; font: 700 21px 'Montserrat', sans-serif; }
.auth-copy { min-height: 42px; margin: 11px 0 23px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.discord-button { display: flex; min-height: 51px; align-items: center; gap: 11px; padding: 0 13px; border: 1px solid rgba(174, 184, 213, 0.4); background: linear-gradient(180deg, rgba(94, 108, 182, 0.36), rgba(55, 63, 101, 0.34)); color: var(--paper); font-size: 12px; font-weight: 700; transition: background 160ms ease, border-color 160ms ease; }
.discord-button:hover { border-color: var(--blue-soft); background: rgba(94, 108, 182, 0.52); }
.discord-icon { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgba(244, 239, 226, 0.65); border-radius: 7px; font: 800 12px 'Montserrat', sans-serif; }
.button-arrow { margin-left: auto; color: var(--blue-soft); font-size: 16px; }
.discord-button.is-disabled { cursor: not-allowed; opacity: 0.45; pointer-events: none; }
.auth-message { min-height: 18px; margin: 12px 0 0; color: var(--blue-soft); font-size: 10px; line-height: 1.5; }
.security-caption { display: flex; align-items: center; gap: 8px; margin-top: 23px; padding-top: 16px; border-top: 1px solid var(--line); color: #858981; font-size: 8px; letter-spacing: 0.3px; }
.lock-icon { position: relative; width: 9px; height: 8px; border: 1px solid currentColor; border-radius: 1px; }
.lock-icon::before { position: absolute; right: 1px; bottom: 6px; left: 1px; height: 5px; border: 1px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; content: ''; }
.login-footer { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }

.dashboard-body { background: #111312; }
.dashboard-shell { display: grid; min-height: 100vh; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 0 15px; border-right: 1px solid var(--line); background: #151816; }
.sidebar-brand { min-height: 72px; padding-left: 7px; border-bottom: 1px solid var(--line); }
.sidebar-brand .brand-mark { width: 32px; height: 32px; }
.sidebar-brand .brand-text strong { font-size: 10px; }
.server-label { display: flex; align-items: center; gap: 10px; margin: 18px 0 25px; padding: 11px 8px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.14); }
.server-avatar { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; background: rgba(94, 108, 182, 0.34); color: var(--paper); font: 700 13px 'Montserrat', sans-serif; }
.server-label > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.server-label small { color: var(--muted); font-size: 8px; letter-spacing: 1px; }
.server-label strong { font-size: 11px; }
.chevron { color: var(--muted); }
.nav-section-title { display: block; margin: 0 0 9px 9px; color: #757971; font-size: 8px; font-weight: 700; letter-spacing: 1.4px; }
.side-link { display: flex; min-height: 39px; align-items: center; gap: 11px; padding: 0 10px; border-left: 2px solid transparent; color: var(--muted); font-size: 11px; }
.side-link.active { border-left-color: var(--blue); background: rgba(94, 108, 182, 0.14); color: var(--paper); }
.nav-icon { position: relative; display: inline-block; width: 13px; height: 13px; border: 1px solid currentColor; opacity: 0.8; }
.log-icon::before, .log-icon::after { position: absolute; left: 3px; width: 5px; height: 1px; background: currentColor; content: ''; }
.log-icon::before { top: 3px; }.log-icon::after { top: 7px; }
.sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 16px 4px; border-top: 1px solid var(--line); color: #858981; font-size: 7px; font-weight: 700; letter-spacing: 0.75px; }
.sidebar-bottom .online-dot { width: 6px; height: 6px; }
.workspace { min-width: 0; }
.dashboard-topbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(20px, 3vw, 42px); border-bottom: 1px solid var(--line); background: rgba(22, 25, 23, 0.78); }
.breadcrumbs, .topbar-actions, .user-chip { display: flex; align-items: center; }
.breadcrumbs { gap: 10px; color: var(--muted); font-size: 10px; }
.breadcrumbs strong { color: var(--paper); font-weight: 600; }
.topbar-actions { gap: 17px; }
.live-badge { display: flex; align-items: center; gap: 7px; color: #a4d7ae; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.live-badge i { width: 6px; height: 6px; }
.user-chip { gap: 8px; padding-left: 15px; border-left: 1px solid var(--line); font-size: 10px; }
.user-chip img, .avatar-fallback { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: #596898; color: var(--paper); font-weight: 700; }
.logout-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.dashboard-main { width: min(1240px, 100%); margin: 0 auto; padding: 38px clamp(20px, 3vw, 42px) 50px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading .eyebrow { margin-bottom: 10px; font-size: 8px; }
.page-heading h1 { font-size: clamp(25px, 3vw, 34px); }
.page-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.refresh-button { display: flex; min-height: 35px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); background: #191c1a; color: var(--paper); cursor: pointer; font-size: 10px; }
.refresh-button:hover { border-color: rgba(174, 184, 213, 0.45); }
.refresh-button:disabled { opacity: 0.5; cursor: wait; }
.refresh-button span { color: var(--blue-soft); font-size: 16px; }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 19px; }
.metric-panel { display: flex; min-height: 112px; flex-direction: column; padding: 15px 17px 13px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(31, 35, 32, 0.85), rgba(22, 25, 23, 0.94)); }
.metric-label { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.metric-value { margin-top: 12px; font: 700 25px 'Montserrat', sans-serif; font-variant-numeric: tabular-nums; }
.metric-online { color: #91c99b; font-size: 15px; }
.metric-foot { margin-top: auto; color: #7e827b; font-size: 9px; }
.log-panel { overflow: hidden; border: 1px solid var(--line); background: rgba(24, 27, 25, 0.93); }
.log-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 18px 15px; }
.log-panel-heading h2 { margin: 0; font: 700 14px 'Montserrat', sans-serif; }
.log-panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.record-count { color: var(--blue-soft); font: 9px 'Montserrat', sans-serif; letter-spacing: 0.8px; }
.log-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, 0.1); }
.search-field { display: flex; width: min(300px, 100%); min-height: 34px; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); background: #141715; color: var(--muted); }
.search-field > span { font-size: 17px; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--paper); font-size: 10px; }
.search-field input::placeholder { color: #757971; }
.select-wrap select { min-height: 34px; max-width: 210px; padding: 0 27px 0 10px; border: 1px solid var(--line); background: #141715; color: #c7c8c2; font-size: 9px; }
.table-wrap { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; text-align: left; }
.log-table th { height: 37px; padding: 0 12px; border-bottom: 1px solid var(--line); color: #858981; font-size: 8px; font-weight: 700; letter-spacing: 0.8px; white-space: nowrap; }
.log-table th:first-child, .log-table td:first-child { padding-left: 18px; }
.log-table td { max-width: 275px; height: 53px; padding: 9px 12px; border-bottom: 1px solid rgba(244, 239, 226, 0.06); color: #c4c5be; font-size: 10px; vertical-align: middle; }
.log-table tr:last-child td { border-bottom: 0; }
.log-table td:first-child > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.log-table td strong { color: var(--paper); font-size: 10px; }
.event-badge { padding: 3px 5px; border: 1px solid rgba(174, 184, 213, 0.2); background: rgba(94, 108, 182, 0.12); color: var(--blue-soft); font-size: 7px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.event-badge.severity-warning { border-color: rgba(223, 179, 92, 0.24); background: rgba(223, 179, 92, 0.1); color: #e4c77f; }
.event-badge.severity-critical { border-color: rgba(220, 98, 93, 0.26); background: rgba(220, 98, 93, 0.1); color: #e88b84; }
.actor-cell, .source-cell, .time-cell { white-space: nowrap; }
.details-cell { overflow-wrap: anywhere; color: var(--muted) !important; }
.time-cell { color: #9b9e96 !important; font-variant-numeric: tabular-nums; }
.empty-logs { display: flex; min-height: 220px; align-items: center; justify-content: center; flex-direction: column; padding: 30px 20px; text-align: center; }
.empty-logs[hidden] { display: none; }
.empty-mark { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 12px; border: 1px solid rgba(174, 184, 213, 0.22); color: var(--blue-soft); font-size: 20px; }
.empty-logs strong { font: 600 12px 'Montserrat', sans-serif; }
.empty-logs p { max-width: 360px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.empty-logs.filtered-empty { min-height: 140px; }
.load-error { margin: 0; padding: 10px 18px; border-top: 1px solid rgba(220, 98, 93, 0.3); color: #e88b84; font-size: 10px; }
.log-panel-footer { display: flex; min-height: 35px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px; border-top: 1px solid var(--line); color: #777b74; font-size: 8px; }

@media (max-width: 760px) {
  .login-page { padding: 0 22px; }
  .login-layout { grid-template-columns: 1fr; gap: 35px; padding: 45px 0; }
  .intro-copy h1 { font-size: 47px; }
  .intro-lead { font-size: 13px; }
  .access-note { margin-top: 23px; }
  .panel-body { padding: 24px 21px 18px; }
  .signal-mark { margin-bottom: 20px; }
  .login-footer { font-size: 7px; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 0 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { min-height: 61px; border: 0; }
  .server-label, .side-nav, .sidebar-bottom { display: none; }
  .dashboard-topbar { min-height: 54px; padding: 0 17px; }
  .topbar-actions { gap: 10px; }
  .live-badge { font-size: 7px; }
  .breadcrumbs { font-size: 9px; }
  .user-chip { padding-left: 9px; font-size: 9px; }
  .dashboard-main { padding: 27px 17px 38px; }
  .metric-row { gap: 7px; }
  .metric-panel { min-height: 101px; padding: 12px 10px; }
  .metric-label { font-size: 7px; letter-spacing: 0.4px; }
  .metric-value { font-size: 21px; }
  .metric-online { font-size: 12px; }
  .metric-foot { font-size: 8px; }
  .log-table { min-width: 760px; }
}

@media (max-width: 440px) {
  .system-state { font-size: 7px; letter-spacing: 0.8px; }
  .panel-bar { padding: 0 12px; font-size: 7px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 27px; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-panel:last-child { grid-column: 1 / -1; min-height: 78px; }
  .metric-panel:last-child .metric-value { margin-top: 7px; }
  .log-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .select-wrap select { width: 100%; max-width: none; }
  .log-panel-heading { align-items: flex-start; }
  .log-panel-footer { font-size: 7px; }
  .login-footer span:last-child { max-width: 165px; text-align: right; }
}

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