:root {
  --ink: #14221d;
  --muted: #68746e;
  --paper: #f5f4ee;
  --surface: #fffefa;
  --line: #dde2da;
  --forest: #193d32;
  --forest-2: #245543;
  --lime: #c8f275;
  --orange: #f2a75b;
  --red: #d95d45;
  --shadow: 0 18px 45px rgba(20, 34, 29, .08);
  --radius: 20px;
  --display: Georgia, "Times New Roman", serif;
  --body: "Trebuchet MS", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --ink: #e9efe8;
  --muted: #aab8b1;
  --paper: #101714;
  --surface: #17211d;
  --line: #304039;
  --forest: #173f32;
  --forest-2: #76a78e;
  --lime: #c8f275;
  --shadow: 0 18px 45px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(circle at 90% 0%, #e4eed8 0, transparent 28rem), var(--paper);
  font-family: var(--body);
}
[data-theme="dark"] body { background: radial-gradient(circle at 90% 0%, #1d3329 0, transparent 28rem), var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: var(--forest); color: #eff6ec; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 30px; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px 12px 12px 2px; background: var(--lime); color: var(--forest); display: grid; place-items: center; font: bold 21px var(--display); }
.brand b { font: 700 21px var(--display); letter-spacing: -.04em; }
.brand small { display: block; margin-top: 2px; color: #a9c0b3; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.nav-label { margin: 0 10px 8px; color: #8faaa0; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav a { padding: 11px 12px; border-radius: 11px; color: #c8d8d0; font-size: 14px; transition: background .2s, color .2s; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.13); color: white; }
.nav a.active { box-shadow: inset 3px 0 0 var(--lime); }
.nav-icon { display: inline-block; width: 24px; color: var(--lime); font-size: 13px; }
.sidebar-bottom { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.user-name { overflow: hidden; color: white; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: #9eb9ab; font-size: 12px; margin-top: 3px; }
.logout { margin-top: 12px; padding: 0; border: 0; color: #c8d8d0; background: transparent; font-size: 12px; }
.logout:hover { color: var(--lime); }

.new-login-body { min-height: 100vh; background: var(--paper); }
.new-login-page { display: grid; grid-template-columns: minmax(360px, 1.05fr) minmax(380px, .95fr); min-height: 100vh; }
.new-login-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 100%; padding: clamp(26px, 5vw, 72px); color: #eff8ea; background: linear-gradient(145deg, #102f26 0%, #1d5844 72%, #377255 100%); }
.new-login-intro .brand { padding: 0; color: #eff8ea; }
.new-login-intro .brand small { color: #b5ccbd; }
.new-login-copy { position: relative; z-index: 1; max-width: 590px; margin: auto 0; padding: 70px 0; }
.new-login-copy .eyebrow { color: var(--lime); }
.new-login-copy h1 { font-size: clamp(42px, 5vw, 72px); }
.new-login-copy > p:last-child { max-width: 440px; margin: 22px 0 0; color: #c8d8d0; font-size: 16px; line-height: 1.65; }
.new-login-orbit { position: absolute; border: 1px solid rgba(200, 242, 117, .32); border-radius: 50%; pointer-events: none; }
.orbit-one { width: min(52vw, 720px); height: min(52vw, 720px); right: -310px; bottom: -255px; border-width: 56px; }
.orbit-two { width: 370px; height: 370px; top: -164px; right: 11%; border-color: rgba(255,255,255,.11); }
.new-login-panel { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 90% 2%, #e4eed8 0, transparent 27rem), var(--paper); }
.new-login-card { width: min(420px, 100%); padding: clamp(26px, 4vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.new-login-card h2 { margin: 7px 0 0; font: 700 clamp(31px, 4vw, 42px)/1 var(--display); letter-spacing: -.05em; }
.new-login-note { margin: 14px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.new-login-brand-mobile { display: none; margin-bottom: 50px; padding: 0; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: bold; }
.login-form input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: var(--paper); }
.login-form input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36, 85, 67, .12); }
.new-login-submit { width: 100%; margin-top: 5px; min-height: 47px; }
.login-error { min-height: 20px; margin-top: 14px; color: var(--red); font-size: 13px; }
@media (max-width: 760px) { .new-login-page { display: block; } .new-login-intro { display: none; } .new-login-panel { min-height: 100vh; padding: 20px; } .new-login-brand-mobile { display: flex; } }

.main { width: min(100%, 1640px); margin: 0 auto; padding: 34px clamp(20px, 4vw, 66px) 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 5px; color: var(--forest-2); font-size: 11px; font-weight: bold; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font: 700 clamp(31px, 4vw, 47px)/1 var(--display); letter-spacing: -.055em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.refresh-note { color: var(--muted); font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font-size: 13px; font-weight: bold; }
.btn:hover { border-color: var(--forest); }
.btn-primary { border-color: var(--forest); color: white; background: var(--forest); }
.btn-primary:hover { background: var(--forest-2); }
.mobile-toggle { display: none; }

.notice { margin-bottom: 20px; padding: 13px 15px; border: 1px solid #efd5ae; border-radius: 12px; color: #73491e; background: #fff6e6; font-size: 13px; }
.hidden { display: none !important; }
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; margin-bottom: 18px; }
.hero-copy { min-height: 236px; padding: clamp(26px, 4vw, 46px); overflow: hidden; border-radius: var(--radius); color: #eff8ea; background: linear-gradient(130deg, var(--forest) 0%, #225e49 100%); position: relative; box-shadow: var(--shadow); }
.hero-copy:after { content: ""; position: absolute; width: 270px; height: 270px; right: -62px; top: -92px; border: 34px solid rgba(200,242,117,.20); border-radius: 50%; }
.hero-copy h2 { max-width: 600px; position: relative; z-index: 1; margin: 0; font: 700 clamp(28px, 3.3vw, 43px)/1.04 var(--display); letter-spacing: -.05em; }
.hero-copy p { position: relative; z-index: 1; max-width: 520px; margin: 15px 0 0; color: #c8d8d0; font-size: 14px; line-height: 1.55; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(200,242,117,.14); }
.health-card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-label { color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: .1em; text-transform: uppercase; }
.health-number { margin: 13px 0 8px; font: 700 48px/1 var(--display); letter-spacing: -.06em; }
.health-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.latest-upload { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.latest-upload-title { display: block; margin-top: 8px; font: 700 clamp(25px, 3vw, 35px)/1.08 var(--display); letter-spacing: -.05em; }
.latest-upload-title:hover { color: var(--forest-2); }
.latest-upload p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 25px; }
.stat { min-height: 128px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,250,.78); }
.stat .value { display: block; margin-top: 17px; font: 700 31px/1 var(--display); letter-spacing: -.05em; }
.stat .detail { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: 20px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 30px rgba(20,34,29,.045); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 0; font: 700 22px var(--display); letter-spacing: -.04em; }
.panel-link { color: var(--forest-2); font-size: 12px; font-weight: bold; }
.clip-list, .device-list { padding: 4px 22px 12px; }
.clip-row, .device-row { display: grid; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #edf0ea; }
.clip-row:last-child, .device-row:last-child { border-bottom: 0; }
.clip-row { grid-template-columns: 72px minmax(0, 1fr) auto; }
.thumbnail { width: 72px; height: 45px; overflow: hidden; border-radius: 8px; background: #e6ece5; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.clip-title, .device-title { overflow: hidden; font-size: 13px; font-weight: bold; text-overflow: ellipsis; white-space: nowrap; }
.clip-meta, .device-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.clip-duration { color: var(--forest); font-size: 12px; font-weight: bold; }
.side-stack { display: grid; gap: 20px; }
.empty { padding: 36px 22px; color: var(--muted); font-size: 13px; text-align: center; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font: 700 20px var(--display); }
.action-list { display: grid; padding: 6px 22px 15px; }
.action-list a { padding: 14px 0; border-bottom: 1px solid #edf0ea; color: var(--forest-2); font-size: 13px; font-weight: bold; }
.action-list a:last-child { border: 0; }

.page-intro { max-width: 730px; margin: -18px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.toolbar { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(145px, .7fr) minmax(160px, .8fr) minmax(145px, .65fr) auto auto auto; gap: 10px; padding: 15px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.toolbar-toggle { min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: bold; white-space: nowrap; }
.toolbar-toggle input { accent-color: var(--forest); }
.field { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; }
.theme-toggle { min-width: 68px; }
[data-theme="dark"] .field { background: #111a16; }
[data-theme="dark"] .stat { background: rgba(23, 33, 29, .88); }
[data-theme="dark"] .thumbnail { background: #26352e; }
[data-theme="dark"] .clip-row, [data-theme="dark"] .device-row, [data-theme="dark"] .action-list a { border-color: #26342e; }
[data-theme="dark"] .config-state { background: #23362c; color: #e7f1e4; }
[data-theme="dark"] .config-state.pending { background: #45341f; color: #ffe7bd; }
[data-theme="dark"] .config-state.error { background: #472a28; color: #ffe0da; }
.field:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,85,67,.12); }
.recording-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.recording-card { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: 16px; min-height: 133px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.recording-card .thumbnail { width: 152px; height: 104px; border-radius: 11px; }
.recording-card h2 { margin: 4px 0 8px; font: 700 19px var(--display); letter-spacing: -.04em; }
.recording-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.recording-results { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 30px rgba(20,34,29,.045); }
.recording-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.recording-results-head strong { display: block; margin-top: 3px; font: 700 21px var(--display); letter-spacing: -.035em; }
.recording-results > .recording-grid, .recording-results > .recording-list-wrap { padding: 16px; }
.recording-bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 76%, var(--lime)); }
.bulk-selection, .bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.bulk-selection { color: var(--muted); font-size: 11px; }
.bulk-selection label { display: inline-flex; align-items: center; gap: 6px; font-weight: bold; }
.bulk-selection input, .recording-select input { accent-color: var(--forest); }
.bulk-selection strong { color: var(--ink); }
.bulk-link { padding: 0; border: 0; color: var(--forest-2); background: transparent; font-size: 11px; font-weight: bold; }
.bulk-actions .btn { min-height: 32px; padding: 0 10px; font-size: 10px; }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.view-switch-btn { min-height: 32px; padding: 0 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: bold; }
.view-switch-btn.active { color: white; background: var(--forest); }
.recording-card-content { min-width: 0; }
.recording-card-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.recording-select { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: bold; }
.recording-card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recording-card-footer .btn { min-height: 34px; padding: 0 11px; font-size: 11px; }
.recording-details { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -4px 0 12px; color: var(--muted); font-size: 10px; }
.recording-details > span:first-child { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recording-details .chip { min-height: 20px; font-size: 9px; }
.recording-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.recording-action { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: bold; }
.recording-action:hover { border-color: var(--forest); color: var(--forest); }
.recording-action.active { border-color: #9db864; color: var(--forest); background: #edf6db; }
.recording-action.danger { color: #9b3d31; border-color: #efc9c1; background: #fff8f6; }
.recording-list { min-width: 1110px; }
.recording-list-wrap { overflow-x: auto; }
.recording-list-head, .recording-list-row { display: grid; grid-template-columns: 58px 58px minmax(160px, 1.15fr) minmax(130px, .8fr) minmax(130px, .85fr) 68px 72px 92px minmax(330px, 1.3fr); align-items: center; gap: 13px; }
.recording-list-head { padding: 0 0 10px; color: var(--muted); font-size: 10px; font-weight: bold; letter-spacing: .08em; text-transform: uppercase; }
.recording-list-row { min-height: 66px; padding: 10px 0; border-top: 1px solid var(--line); }
.recording-list-row .thumbnail { width: 58px; height: 42px; }
.recording-list-select { display: grid; place-items: center; }
.recording-list-select .recording-select span { display: none; }
.recording-list-title { min-width: 0; }
.recording-list-title strong, .recording-list-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recording-list-title strong { font-size: 13px; }
.recording-list-title span, .recording-list-row time, .recording-list-duration { margin-top: 4px; color: var(--muted); font-size: 11px; }
.recording-list-row time { margin: 0; }
.recording-list-duration { margin: 0; color: var(--forest); font-weight: bold; }
.recording-list-device, .recording-list-size { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.recording-list-row > .chip { justify-self: start; }
.recording-list-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.recording-list-controls > .btn { min-height: 32px; padding: 0 10px; font-size: 10px; }
.recording-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.page-size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: bold; }
.page-size .field { width: 82px; min-height: 36px; }
.page-status { flex: 1; color: var(--muted); font-size: 12px; text-align: center; }
.page-status strong { display: block; color: var(--ink); font-size: 12px; }
.page-actions { display: flex; gap: 8px; }
.page-actions .btn { min-height: 36px; }
.page-numbers { display: flex; align-items: center; justify-content: center; gap: 5px; flex: 1 1 250px; }
.page-number, .page-gap { min-width: 34px; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 12px; font-weight: bold; }
.page-number:hover { border-color: var(--forest); }
.page-number.active { border-color: var(--forest); color: white; background: var(--forest); }
.page-gap { display: grid; place-items: center; border-color: transparent; color: var(--muted); background: transparent; }
.page-jump { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: bold; }
.page-jump .field { width: 62px; min-height: 36px; padding: 0 7px; text-align: center; }
.page-jump .btn { min-height: 36px; padding: 0 11px; }
.chip { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 999px; color: var(--forest); background: #e4f0d1; font-size: 11px; font-weight: bold; }
.chip.warn { color: #804713; background: #fff0d7; }
.chip.offline { color: #8a382e; background: #fce2dd; }
.discovery-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 18px; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(120deg, var(--surface), var(--paper)); }
.discovery-panel h2 { margin: 6px 0 5px; font: 700 24px var(--display); letter-spacing: -.04em; }
.discovery-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.discovery-counts { display: flex; flex: 0 0 auto; gap: 9px; }
.discovery-counts span { min-width: 92px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: bold; letter-spacing: .03em; text-transform: uppercase; }
.discovery-counts b { display: block; margin-bottom: 5px; color: var(--forest); font: 700 22px var(--display); letter-spacing: -.04em; }
.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.device-card { padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.device-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.device-card h2 { margin: 6px 0 4px; font: 700 23px var(--display); letter-spacing: -.04em; }
.device-card p { min-height: 37px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.device-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.device-details span { display: block; color: var(--muted); font-size: 11px; }
.device-details b { display: block; margin-top: 3px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.device-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.removed-device { display: inline-grid; place-items: center; min-width: 27px; height: 18px; margin-left: 7px; padding: 0 5px; vertical-align: middle; border: 1px solid #e4aaa2; border-radius: 999px; color: #9c4036; background: #fff2ef; font: 700 9px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.settings-card h2 { margin: 8px 0 9px; font: 700 24px var(--display); letter-spacing: -.04em; }
.settings-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.52; }
.users-layout { display: grid; grid-template-columns: minmax(270px, .52fr) minmax(0, 1.48fr); gap: 18px; align-items: start; }
.user-form { display: grid; gap: 14px; margin-top: 18px; }
.user-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: .03em; }
.user-form > .btn { justify-self: start; margin-top: 3px; }
.users-panel { min-width: 0; }
.count-pill { min-width: 27px; height: 27px; padding: 0 9px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--forest); background: var(--lime); font-size: 12px; font-weight: bold; }
.users-list { padding: 2px 22px 13px; }
.user-row { display: grid; grid-template-columns: minmax(180px, 1fr) 102px 142px auto; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row strong, .user-row span { display: block; }
.user-row strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-row > div:first-child > span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.user-row time { color: var(--muted); font-size: 11px; }
.user-actions { display: flex; justify-content: flex-end; gap: 7px; }
.user-actions .btn { min-height: 34px; padding: 0 10px; font-size: 11px; }
.btn.danger { color: #9b3d31; border-color: #efc9c1; background: #fff8f6; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 18, 14, .54); }
.modal-card { position: relative; width: min(100%, 470px); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 6px 0 0; font: 700 25px var(--display); letter-spacing: -.04em; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.delete-confirmation { display: grid; gap: 7px; margin: 21px 0 12px; color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: .03em; }
.delete-confirmation strong { overflow-wrap: anywhere; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: 0; }
.device-edit-form { display: grid; gap: 14px; }
.device-edit-form > label:not(.toggle) { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: .03em; }
.device-edit-form .modal-head { margin-bottom: 4px; }
.device-edit-form .form-error { margin-bottom: 0; }
.form-error { min-height: 18px; margin: 0 0 15px; color: #a74337; font-size: 12px; }
.video-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.video-modal-backdrop { position: absolute; inset: 0; background: rgba(8, 18, 14, .72); }
.video-modal-card { position: relative; width: min(100%, 1080px); max-height: calc(100dvh - 40px); padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.video-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 3px 3px 12px; }
.video-modal-head > div { display: flex; align-items: center; gap: 8px; }
.video-modal-head .btn { min-height: 34px; padding: 0 10px; font-size: 11px; }
.video-modal-card video { display: block; width: 100%; max-height: calc(100dvh - 132px); border-radius: 11px; background: #050806; }
[data-theme="dark"] .user-row { border-color: #26342e; }
[data-theme="dark"] .btn.danger { color: #ffb9ad; border-color: #613a34; background: #2f201e; }
[data-theme="dark"] .recording-action.active { border-color: #5b7b39; color: #d8efae; background: #23331c; }
[data-theme="dark"] .recording-action.danger { color: #ffb9ad; border-color: #613a34; background: #2f201e; }
[data-theme="dark"] .removed-device { border-color: #6d3d37; color: #ffc0b5; background: #34201e; }
[data-theme="dark"] .form-error { color: #ffb3a8; }
.config-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.config-form { display: grid; gap: 16px; }
.config-section { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.config-section-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.config-number { flex: 0 0 auto; width: 31px; height: 31px; border-radius: 10px; color: var(--forest); background: var(--lime); display: grid; place-items: center; font-size: 11px; font-weight: bold; }
.config-section h2 { margin: 0; font: 700 23px var(--display); letter-spacing: -.04em; }
.config-section p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: .03em; }
.form-grid .wide { grid-column: span 2; }
.toggle { min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; display: flex !important; align-items: center; gap: 9px; color: var(--ink) !important; font-size: 12px !important; letter-spacing: 0 !important; }
.toggle input { accent-color: var(--forest); }
.config-aside { position: sticky; top: 24px; display: grid; gap: 14px; }
.config-aside .panel { padding: 20px; }
.config-aside h2 { margin: 7px 0 10px; font: 700 21px var(--display); letter-spacing: -.04em; }
.config-aside p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.config-state { margin: 14px 0; padding: 12px; border-radius: 10px; color: var(--forest); background: #edf4e5; font-size: 12px; line-height: 1.45; }
.config-state.pending { color: #75451b; background: #fff1da; }
.config-state.error { color: #8d3126; background: #fde7e2; }
.savebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.savebar strong { display: block; font: 700 19px var(--display); letter-spacing: -.03em; }
.savebar span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.telemetry-panel { margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.telemetry-head, .telemetry-subhead { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.telemetry-head h2, .telemetry-subhead h3 { margin: 5px 0 0; font: 700 23px var(--display); letter-spacing: -.04em; }
.telemetry-head > strong { color: var(--forest-2); font: 700 18px var(--body); }
.storage-meter { height: 12px; margin: 19px 0; overflow: hidden; border-radius: 999px; background: var(--paper); }
.storage-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), var(--forest-2)); transition: width .25s ease; }
.telemetry-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.telemetry-stats > div { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.telemetry-stats span, .telemetry-stats strong { display: block; }
.telemetry-stats span { color: var(--muted); font-size: 10px; font-weight: bold; letter-spacing: .04em; text-transform: uppercase; }
.telemetry-stats strong { margin-top: 6px; font: 700 19px var(--display); letter-spacing: -.03em; }
.telemetry-subhead { margin: 24px 0 12px; }
.telemetry-subhead h3 { font-size: 19px; }
.telemetry-subhead span, .telemetry-note { color: var(--muted); font-size: 12px; }
.queue-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.telemetry-note { min-height: 18px; margin: 14px 0 0; line-height: 1.45; }
.history-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: bold; }
.history-select .field { width: 112px; min-height: 35px; }
.telemetry-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.telemetry-charts article { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.telemetry-charts h3 { margin: 0; font: 700 17px var(--display); }
.telemetry-charts canvas { display: block; width: 100%; height: 190px; margin-top: 12px; }
.telemetry-charts p { min-height: 16px; margin: 8px 0 0; color: var(--muted); font-size: 10px; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); height: 100dvh; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 45px rgba(0,0,0,.2); }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; }
  .hero, .content-grid { grid-template-columns: 1fr; }
  .latest-upload { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-panel { align-items: flex-start; flex-direction: column; }
  .users-layout { grid-template-columns: 1fr; }
  .config-layout { grid-template-columns: 1fr; }
  .config-aside { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .main { padding: 20px 16px 34px; }
  .topbar { align-items: flex-start; margin-bottom: 28px; }
  h1 { font-size: 34px; }
  .refresh-note { display: none; }
  .discovery-counts { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .discovery-counts span { min-width: 0; padding: 10px 8px; }
  .hero-copy { min-height: 205px; padding: 25px; }
  .stats, .recording-grid, .device-grid, .settings-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .form-grid, .config-aside { grid-template-columns: 1fr; }
  .telemetry-head, .telemetry-subhead { align-items: flex-start; flex-direction: column; }
  .telemetry-stats, .queue-stats, .telemetry-charts { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .user-row time { display: none; }
  .user-row .user-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .form-grid .wide { grid-column: auto; }
  .config-section { padding: 20px; }
  .savebar { align-items: flex-start; flex-direction: column; }
  .recording-card { grid-template-columns: 104px minmax(0, 1fr); }
  .recording-pagination { align-items: stretch; flex-direction: column; }
  .page-size, .page-actions, .page-jump { justify-content: center; }
  .page-numbers { order: 3; flex-basis: 100%; }
  .recording-card .thumbnail { width: 104px; height: 88px; }
  .clip-row { grid-template-columns: 54px minmax(0, 1fr); }
  .clip-row .clip-duration { display: none; }
  .thumbnail { width: 54px; height: 40px; }
}

.settings-overview { margin-bottom: 20px; }
.settings-section { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-title h2 { margin: 0; font: 700 24px var(--display); letter-spacing: -.04em; }
.section-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--forest); background: var(--lime); font-size: 11px; font-weight: bold; }
.admin-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: bold; letter-spacing: .03em; }
.form-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; align-self: end; min-height: 42px; }
.form-result { min-height: 17px; color: var(--forest); font-size: 12px; }
.form-result.error { color: #a74337; }
.admin-split { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(340px, 1.3fr); gap: 26px; align-items: start; }
.compact-form { grid-template-columns: 1fr; }
.admin-list-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.admin-list-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.admin-list { padding: 0 14px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-row strong, .admin-row span { display: block; }
.admin-row strong { font-size: 13px; }
.admin-row span { margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.admin-row .btn { flex: 0 0 auto; min-height: 34px; padding: 0 10px; font-size: 11px; }
[data-theme="dark"] .admin-list-wrap, [data-theme="dark"] .admin-list-head, [data-theme="dark"] .admin-row { border-color: #26342e; }
[data-theme="dark"] .form-result.error { color: #ffb3a8; }
@media (max-width: 760px) { .settings-section { padding: 18px; } .admin-form, .admin-split { grid-template-columns: 1fr; } .admin-row { align-items: flex-start; } }
