:root {
  color-scheme: dark;
  --bg: #0a1015;
  --sidebar: #0d141a;
  --surface: #111a21;
  --surface-raised: #16232c;
  --surface-strong: #1c2a34;
  --border: #263640;
  --border-strong: #344752;
  --text: #e8f0f2;
  --muted: #8da0a9;
  --subtle: #637780;
  --accent: #b3ef72;
  --accent-ink: #10200a;
  --accent-soft: rgba(179, 239, 114, .13);
  --blue: #80c9e3;
  --blue-soft: rgba(128, 201, 227, .13);
  --warning: #f2bb73;
  --warning-soft: rgba(242, 187, 115, .13);
  --danger: #ff837c;
  --danger-soft: rgba(255, 131, 124, .12);
  --success: #7fdaa0;
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
  --radius: 14px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f0;
  --sidebar: #f7f9f8;
  --surface: #ffffff;
  --surface-raised: #f7faf8;
  --surface-strong: #edf3ee;
  --border: #dce5e0;
  --border-strong: #cbd8d1;
  --text: #18241f;
  --muted: #66766e;
  --subtle: #83928b;
  --accent: #3f7622;
  --accent-ink: #ffffff;
  --accent-soft: rgba(63, 118, 34, .1);
  --blue: #26778f;
  --blue-soft: rgba(38, 119, 143, .1);
  --warning: #98610f;
  --warning-soft: rgba(152, 97, 15, .1);
  --danger: #b23b36;
  --danger-soft: rgba(178, 59, 54, .1);
  --success: #287744;
  --shadow: 0 20px 60px rgba(34, 58, 45, .12);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
a { color: inherit; }
.app-root { min-height: 100vh; }
.boot-state { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 100vh; color: var(--muted); font-size: 13px; }
.boot-mark, .brand-mark { display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent-ink); background: var(--accent); border-radius: 12px; font-size: 21px; font-weight: 900; letter-spacing: -.08em; }
.boot-mark { width: 46px; height: 46px; border-radius: 15px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr); background: var(--bg); }
.login-visual { position: relative; min-height: 720px; overflow: hidden; background: #101c21; color: #e6f0ed; padding: clamp(28px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; }
.login-visual::before { content: ""; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(179,239,114,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(179,239,114,.12) 1px, transparent 1px); background-size: 52px 52px; transform: perspective(600px) rotateX(55deg) scale(1.5) translateY(90px); transform-origin: center bottom; mask-image: linear-gradient(to bottom, transparent 3%, black 45%, transparent 100%); }
.login-visual::after { content: ""; position: absolute; width: 56vw; height: 56vw; min-width: 600px; min-height: 600px; left: 4%; top: 17%; border: 1px solid rgba(179,239,114,.16); border-radius: 50%; box-shadow: 0 0 0 80px rgba(179,239,114,.025), 0 0 0 160px rgba(179,239,114,.02); }
.login-brand, .login-copy, .login-foot { position: relative; z-index: 1; }
.login-brand { display: flex; align-self: flex-start; align-items: center; gap: 13px; font-size: 13px; font-weight: 750; letter-spacing: .15em; }
.login-brand .brand-mark { width: 44px; height: 44px; }
.login-copy { max-width: 640px; margin: auto 0; padding: 72px 0; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .15em; font-size: 10px; font-weight: 800; }
.login-copy h1 { max-width: 600px; margin: 16px 0 20px; font-size: clamp(44px, 6.1vw, 82px); line-height: .98; letter-spacing: -.065em; font-weight: 650; }
.login-copy h1 span { color: var(--accent); }
.login-copy p { max-width: 490px; color: #a1b1b4; font-size: 15px; line-height: 1.7; }
.visual-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.visual-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(215,235,223,.16); color: #ccdbd6; background: rgba(255,255,255,.035); border-radius: 999px; padding: 8px 12px; font-size: 11px; }
.visual-chip .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 12px var(--accent); }
.login-foot { display: flex; justify-content: space-between; color: #87999d; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.login-panel { display: grid; place-items: center; padding: 40px; background: var(--surface); border-left: 1px solid var(--border); }
.login-card { width: min(100%, 390px); }
.login-card h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.login-card > p { margin: 9px 0 30px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-method { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 11px; margin: 10px 0; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-raised); color: var(--text); font-size: 13px; font-weight: 680; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.login-method:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.login-method .provider-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: var(--surface-strong); color: var(--accent); }
.login-privacy { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.65; }
.demo-entry { display: flex; flex-direction: column; gap: 5px; margin-top: 16px; padding: 13px 14px; border: 1px dashed var(--border-strong); border-radius: 9px; color: var(--text); text-decoration: none; font-size: 11px; font-weight: 680; transition: border-color .16s, background .16s; }
.demo-entry:hover { border-color: var(--accent); background: var(--accent-soft); }
.demo-entry span { color: var(--muted); font-size: 9px; font-weight: 450; }
.login-state { min-height: 22px; margin: 12px 0; color: var(--warning); font-size: 12px; }
.login-theme { position: absolute; top: 18px; right: 18px; }

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 13px 15px; border-right: 1px solid var(--border); background: var(--sidebar); z-index: 20; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 1px 9px 23px; }
.brand-lockup .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 19px; }
.brand-name { font-size: 13px; font-weight: 800; letter-spacing: .11em; }
.brand-caption { margin-top: 3px; color: var(--muted); font-size: 10px; }
.server-pill { display: flex; align-items: center; gap: 9px; margin: 0 4px 22px; padding: 10px 11px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; }
.server-light { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px rgba(127,218,160,.6); }
.server-light.offline { background: var(--danger); box-shadow: 0 0 10px rgba(255,131,124,.4); }
.server-copy { min-width: 0; flex: 1; }
.server-copy b { display: block; font-size: 11px; font-weight: 680; }
.server-copy small { color: var(--muted); font-size: 9px; }
.server-count { color: var(--accent); font-family: var(--mono); font-size: 11px; }
.nav-label { padding: 0 11px 8px; color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.nav-list { display: grid; gap: 3px; }
.nav-button { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 570; text-align: left; cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.nav-button svg { flex: 0 0 auto; opacity: .75; }
.nav-button:hover { color: var(--text); background: var(--surface); }
.nav-button.active { color: var(--text); background: var(--surface-raised); border-color: var(--border); }
.nav-button.active svg { color: var(--accent); opacity: 1; }
.nav-count { margin-left: auto; color: var(--accent); font-family: var(--mono); font-size: 10px; }
.sidebar-spacer { flex: 1; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 6px; }
.profile-mini { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 780; }
.profile-mini b { display: block; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.profile-mini small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.sidebar-tools { display: flex; gap: 6px; }
.sidebar-tools .icon-button { flex: 1; }
.content-column { min-width: 0; }
.demo-banner { position: relative; z-index: 11; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 6px clamp(20px, 3vw, 42px); border-bottom: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); background: var(--warning-soft); color: var(--text); font-size: 10px; }
.demo-banner b { color: var(--warning); font: 750 9px var(--mono); letter-spacing: .08em; }
.demo-banner span { flex: 1; color: var(--muted); }
.demo-chip { white-space: nowrap; }
.topbar { position: sticky; top: 0; height: 66px; display: flex; align-items: center; gap: 16px; padding: 0 clamp(20px, 3vw, 42px); background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(18px); z-index: 10; }
.mobile-menu { display: none !important; }
.breadcrumb { color: var(--muted); font-size: 11px; }
.breadcrumb b { color: var(--text); font-weight: 690; }
.top-spacer { flex: 1; }
.global-search { position: relative; width: min(300px, 30vw); }
.global-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.global-search input { width: 100%; height: 35px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 36px; font-size: 11px; }
.global-search kbd { position: absolute; right: 8px; top: 8px; padding: 2px 5px; color: var(--subtle); border: 1px solid var(--border); border-radius: 4px; font: 9px var(--mono); }
.content { width: min(100%, 1760px); margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 52px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-heading h1 { margin: 0; font-size: clamp(23px, 2.1vw, 31px); line-height: 1.05; letter-spacing: -.055em; font-weight: 700; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button, .icon-button, .segmented button, .table-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 650; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.button:hover, .icon-button:hover, .table-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.button:active, .icon-button:active { transform: translateY(1px); }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.primary:hover { filter: brightness(1.04); background: var(--accent); }
.button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); }
.button.danger:hover { border-color: var(--danger); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.small { min-height: 29px; padding: 0 9px; font-size: 10px; }
.button:disabled, .icon-button:disabled, .table-action:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(.2); }
.icon-button { width: 34px; min-width: 34px; min-height: 34px; padding: 0; color: var(--muted); }
.icon-button svg { width: 15px; height: 15px; }
.icon-button.small { width: 29px; min-width: 29px; min-height: 29px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow-small { color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 750; letter-spacing: .12em; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 11px; margin-bottom: 17px; }
.metric { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.metric-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); }
.metric-value { display: flex; align-items: baseline; gap: 9px; font-family: var(--mono); font-size: 28px; line-height: 1; letter-spacing: -.08em; }
.metric-value small { color: var(--muted); font-family: inherit; font-size: 10px; letter-spacing: 0; }
.metric-note { color: var(--muted); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 14px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 57px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 12px; font-weight: 730; }
.panel-subtitle { color: var(--muted); font-size: 10px; margin-top: 4px; }
.panel-body { padding: 15px; }
.map-toolbar { display: flex; align-items: center; gap: 7px; }
.map-mode { display: inline-flex; border: 1px solid var(--border); background: var(--surface-raised); border-radius: 7px; padding: 3px; }
.map-mode button { border: 0; border-radius: 5px; background: transparent; color: var(--muted); height: 25px; padding: 0 8px; font-size: 9px; cursor: pointer; }
.map-mode button.active { background: var(--surface-strong); color: var(--text); }
.map-frame { position: relative; height: clamp(310px, 34vw, 470px); overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #13222a; perspective: 1100px; touch-action: none; cursor: grab; }
.map-frame.dragging { cursor: grabbing; }
.map-watermark { position: absolute; left: 15px; top: 14px; z-index: 2; display: flex; align-items: center; gap: 8px; color: #dbeadf; text-shadow: 0 1px 10px rgba(0,0,0,.6); font-size: 10px; font-weight: 750; letter-spacing: .08em; pointer-events: none; }
.map-watermark .live-dot { width: 6px; height: 6px; background: #b3ef72; border-radius: 50%; box-shadow: 0 0 12px #b3ef72; }
.map-world { position: absolute; inset: 0; overflow: hidden; transform-origin: center center; transform-style: preserve-3d; transition: transform .12s ease-out; will-change: transform; }
.map-frame.dragging .map-world { transition: none; }
.map-plane { position: absolute; inset: 0; background-image: linear-gradient(rgba(9,15,18,.12),rgba(9,15,18,.12)), var(--map-image); background-size: 100% 100%; background-position: center; background-repeat: no-repeat; }
.map-grid-overlay { position: absolute; inset: 0; opacity: .11; background-image: linear-gradient(rgba(204,231,214,.32) 1px, transparent 1px), linear-gradient(90deg, rgba(204,231,214,.32) 1px, transparent 1px); background-size: 10% 10%; pointer-events: none; }
.map-player { position: absolute; width: 18px; height: 18px; padding: 0; transform: translate(-50%,-50%) translateZ(var(--elevation, 0px)); border: 2px solid #f1f6f0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(179,239,114,.21), 0 0 18px rgba(179,239,114,.8); cursor: pointer; z-index: 1; }
.map-player.admin { background: #f2bb73; box-shadow: 0 0 0 4px rgba(242,187,115,.21), 0 0 18px rgba(242,187,115,.8); }
.map-player::after { content: ""; position: absolute; width: 2px; height: var(--height, 10px); left: 50%; bottom: 100%; transform: translateX(-50%); background: rgba(242,248,239,.85); transform-origin: bottom; }
.map-player:hover { z-index: 4; transform: translate(-50%,-50%) translateZ(var(--elevation, 0px)) scale(1.25); }
.map-player-label { position: absolute; left: 50%; top: 19px; transform: translateX(-50%); max-width: 120px; padding: 4px 6px; border: 1px solid rgba(230,240,230,.18); border-radius: 5px; background: rgba(10,16,20,.86); color: #e7f0ea; font-size: 8px; white-space: nowrap; pointer-events: none; }
.map-empty { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: #e7f0ea; font-size: 11px; text-shadow: 0 1px 8px rgba(0,0,0,.8); pointer-events: none; }
.map-legend { display: flex; align-items: center; gap: 14px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.legend-dot.admin { background: var(--warning); }
.map-footnote { margin-left: auto; }
.online-panel { max-height: 562px; }
.online-list { display: grid; }
.online-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.online-row:last-child { border-bottom: 0; }
.online-row:hover { background: var(--surface-raised); }
.online-row .avatar { width: 28px; height: 28px; }
.online-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.online-meta { margin-top: 4px; color: var(--muted); font-size: 9px; }
.online-position { color: var(--muted); font: 9px var(--mono); text-align: right; }
.online-position b { display: block; color: var(--text); font-size: 10px; font-weight: 550; margin-bottom: 4px; }
.online-empty { display: grid; place-items: center; min-height: 140px; padding: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 21px 0 10px; }
.section-row h2 { margin: 0; font-size: 13px; letter-spacing: -.02em; }
.activity-row { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--blue); background: var(--blue-soft); }
.activity-copy { min-width: 0; font-size: 10px; line-height: 1.55; }
.activity-copy b { font-weight: 700; }
.activity-copy small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.activity-time { color: var(--muted); font: 9px var(--mono); white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 12px; }
.search-field { position: relative; flex: 1 1 240px; max-width: 440px; }
.search-field svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { width: 100%; height: 36px; padding: 0 10px 0 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 11px; }
.filter-select { height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); padding: 0 10px; font-size: 10px; }
.segmented { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--border); border-radius: 8px; padding: 3px; background: var(--surface); }
.segmented button { min-height: 27px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; }
.segmented button.active { color: var(--text); background: var(--surface-strong); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.data-table th { height: 39px; padding: 0 14px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-raised); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 740; }
.data-table td { height: 52px; padding: 7px 14px; border-bottom: 1px solid var(--border); font-size: 10px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-clickable="true"] { cursor: pointer; }
.data-table tbody tr[data-clickable="true"]:hover { background: var(--surface-raised); }
.row-title { font-size: 11px; font-weight: 700; }
.row-sub { margin-top: 4px; color: var(--muted); font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-raised); font-size: 9px; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--subtle); }
.status.good { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, var(--border)); background: var(--accent-soft); }
.status.good::before { background: var(--success); }
.status.warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, var(--border)); background: var(--warning-soft); }
.status.warn::before { background: var(--warning); }
.status.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: var(--danger-soft); }
.status.bad::before { background: var(--danger); }
.table-empty, .empty-state { padding: 44px 20px; color: var(--muted); text-align: center; font-size: 11px; }
.empty-state svg { display: block; margin: 0 auto 12px; color: var(--subtle); }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; color: var(--muted); font-size: 9px; }
.vehicle-kind { color: var(--blue); }
.faction-swatch { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border: 1px solid rgba(0,0,0,.2); border-radius: 3px; vertical-align: -1px; }
.log-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.log-list { display: grid; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface); }
.log-row { display: grid; grid-template-columns: 112px 92px minmax(130px,.65fr) minmax(180px,1fr) minmax(140px,.7fr); gap: 14px; align-items: center; min-height: 57px; padding: 8px 13px; border-bottom: 1px solid var(--border); font-size: 10px; }
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: var(--surface-raised); }
.log-time { color: var(--muted); font: 9px var(--mono); }
.log-category { color: var(--blue); font-size: 9px; }
.log-action { font-weight: 650; }
.log-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-target { color: var(--muted); font-family: var(--mono); }
.log-expansion { grid-column: 1 / -1; min-width: 0; font-size: 10px; }
.log-expansion summary { width: fit-content; color: var(--accent); cursor: pointer; }
.log-expansion pre { max-height: 300px; overflow: auto; margin: 8px 0 4px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-raised); color: var(--muted); font: 10px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.two-column { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.7fr); gap: 14px; align-items: start; }
.form-stack { display: grid; gap: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1/-1; }
.field label { color: var(--muted); font-size: 10px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-raised); color: var(--text); padding: 8px 10px; font-size: 11px; }
.field textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.field-hint { color: var(--subtle); font-size: 9px; line-height: 1.5; }
.callout { border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); border-radius: 9px; background: var(--warning-soft); color: var(--text); padding: 11px 12px; font-size: 10px; line-height: 1.55; }
.callout b { color: var(--warning); }
.admin-role { color: var(--accent); font-family: var(--mono); font-size: 10px; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.38); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; width: min(660px, 100vw); height: 100vh; z-index: 41; transform: translateX(102%); transition: transform .22s cubic-bezier(.2,.8,.2,1); border-left: 1px solid var(--border); background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px; border-bottom: 1px solid var(--border); }
.drawer-head-copy { flex: 1; min-width: 0; }
.drawer-head h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.drawer-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px 36px; }
.drawer-section { margin-bottom: 22px; }
.drawer-section h3 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 11px; font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.detail-cell { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.detail-cell:nth-child(2n) { border-right: 0; }
.detail-cell:nth-last-child(-n+2) { border-bottom: 0; }
.detail-cell small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .09em; }
.detail-cell strong { display: block; overflow-wrap: anywhere; font-size: 10px; font-weight: 580; }
.drawer-tabs { display: flex; gap: 4px; margin: -4px 0 16px; border-bottom: 1px solid var(--border); }
.drawer-tabs button { min-height: 34px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.drawer-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 7px; }
.inventory-item { min-height: 63px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 9px; }
.inventory-item b { display: block; font-size: 10px; }
.inventory-item small { display: block; margin-top: 5px; color: var(--muted); font: 9px var(--mono); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.viewer { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #03070a; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.viewer img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.viewer-empty { display: grid; place-items: center; min-height: 220px; color: var(--muted); font-size: 10px; }
.confirm-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.52); }
.confirm-card { width: min(100%,430px); border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); padding: 18px; box-shadow: var(--shadow); }
.confirm-card h3 { margin: 0; font-size: 16px; }
.confirm-card p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#notice-root { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.notice { border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: 9px; background: var(--surface); padding: 12px 14px; box-shadow: var(--shadow); font-size: 11px; line-height: 1.5; animation: notice-in .18s ease-out; }
.notice.error { border-left-color: var(--danger); }
.notice.warning { border-left-color: var(--warning); }
@keyframes notice-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.loading-line { height: 3px; margin: 0 0 14px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.loading-line::after { content: ""; display: block; width: 32%; height: 100%; background: var(--accent); animation: loading 1.2s infinite ease-in-out; }
@keyframes loading { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
.error-state { display: flex; align-items: center; gap: 10px; margin: 13px 0; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); border-radius: 9px; background: var(--danger-soft); color: var(--danger); padding: 11px; font-size: 10px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 205px minmax(0,1fr); }
  .dashboard-grid { grid-template-columns: minmax(0,1.4fr) minmax(240px,.8fr); }
  .log-row { grid-template-columns: 95px 80px minmax(110px,.6fr) minmax(160px,1fr); }
  .log-target { display: none; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; width: 246px; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu { display: inline-flex !important; }
  .topbar { height: 58px; padding: 0 16px; }
  .content { padding: 23px 16px 40px; }
  .dashboard-grid, .two-column { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .map-frame { height: 390px; }
  .global-search { width: min(250px, 42vw); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 320px; padding: 25px; }
  .login-copy { padding: 50px 0 28px; }
  .login-copy h1 { max-width: 540px; font-size: clamp(42px, 10vw, 65px); }
  .login-visual::after { left: 30%; top: 5%; }
  .login-foot { display: none; }
  .login-panel { min-height: 410px; border-left: 0; border-top: 1px solid var(--border); padding: 40px 24px; }
}
@media (max-width: 580px) {
  .demo-banner { align-items: flex-start; flex-wrap: wrap; gap: 7px 10px; padding: 9px 15px; }
  .demo-banner span { flex-basis: calc(100% - 122px); }
  .demo-banner .button { margin-left: auto; }
  .topbar { gap: 9px; }
  .breadcrumb { display: none; }
  .global-search { width: 100%; flex: 1; }
  .content { padding: 20px 12px 34px; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 13px; }
  .metric { min-height: 104px; padding: 12px; }
  .metric-value { font-size: 24px; }
  .map-frame { height: 320px; }
  .map-footnote { display: none; }
  .toolbar { align-items: stretch; }
  .search-field { max-width: none; flex-basis: 100%; }
  .log-row { grid-template-columns: 74px 1fr minmax(100px,1fr); gap: 8px; }
  .log-category { display: none; }
  .log-detail { display: none; }
  .log-target { display: block; text-align: right; }
  .drawer-head { padding: 17px; }
  .drawer-body { padding: 16px 17px 30px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .login-copy p { font-size: 13px; }
  .login-visual { min-height: 300px; }
  .login-panel { min-height: 390px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
