:root {
  --admin-bg: #151021;
  --admin-panel: #21182f;
  --admin-soft: #2b203b;
  --admin-line: #4c3a5d;
  --admin-text: #fff9ff;
  --admin-muted: #c9bdd4;
  --admin-orange: #ff983e;
  --admin-green: #8de7bd;
}
.lsc-admin {
  min-width: 0;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: Inter, system-ui, sans-serif;
}
.lsc-admin .admin-sidebar {
  width: 242px;
  background: #1f162d;
  border-inline-end: 1px solid #3d304c;
}
.lsc-admin .admin-sidebar img { width: 135px; mix-blend-mode: normal; }
.lsc-admin .admin-sidebar h2 { font-size: 1rem; margin: 10px 0; }
.lsc-admin .admin-sidebar nav { margin-top: 18px; gap: 4px; }
.lsc-admin .admin-sidebar nav button, .lsc-admin .admin-sidebar nav a {
  display: block;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 8px;
  text-align: left;
  font: 700 14px Inter, system-ui, sans-serif;
  background: transparent;
  color: var(--admin-muted);
  text-decoration: none;
  border: 0;
}
.lsc-admin .admin-sidebar nav :is(a,button):hover, .lsc-admin .admin-sidebar nav [aria-current] {
  background: #412b41;
  color: var(--admin-orange);
}
.lsc-admin main { max-width: 1240px; margin: 0 auto; }
.lsc-admin .top { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 13px; }
.lsc-admin h1 { margin: 0; font-size: clamp(1.65rem, 5vw, 3rem); line-height: 1.05; }
.lsc-admin h2 { font-size: clamp(1.18rem, 3vw, 1.5rem); }
.lsc-admin p, .lsc-admin small { color: var(--admin-muted); }
.lsc-admin .card, .lsc-admin .stat { background: var(--admin-panel); border: 1px solid var(--admin-line); box-shadow: none; }
.lsc-admin :where(input, select, textarea, button):not(:where([type=checkbox], [type=radio])) {
  border: 1px solid var(--admin-line);
  background: var(--admin-soft);
  color: var(--admin-text);
  border-radius: 9px;
  font: inherit;
}
.lsc-admin :is(button, select) { cursor: pointer; }
.lsc-admin button { min-height: 38px; padding: 8px 12px; }
.lsc-admin :is(button, a, input, select):focus-visible { outline: 2px solid var(--admin-orange); outline-offset: 3px; }
.lsc-admin button.save, .lsc-admin .mode-switch button[aria-pressed=true] { font-weight: 800; background: var(--admin-orange); color: #241221; border-color: transparent; }
.lsc-admin button.danger { background: #a62e48; }
.lsc-admin button:disabled { cursor: default; opacity: .5; }
.lsc-admin :is(td, th, .category-form, .cash-order) { border-color: var(--admin-line); }
.lsc-admin th { background: #382948; color: var(--admin-muted); }
.lsc-admin a { color: var(--admin-orange); }
.lsc-admin .staff-badge { background: #244238; color: var(--admin-green); font-size: .74rem; padding: 6px 9px; border-radius: 8px; font-weight: 800; text-transform: uppercase; }
.lsc-admin .card-heading { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lsc-admin .card-heading h2 { margin: 0; }
.timing-settings label { margin-top: 0; }
.timing-settings select { display: block; width: min(100%, 440px); margin-top: 6px; padding: 10px; }
.timing-settings .button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-switch { display: flex; gap: 9px; }
.mode-switch button { min-width: 88px; }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.start-grid article { padding: 13px; border: 1px solid var(--admin-line); border-radius: 10px; background: var(--admin-soft); }
.start-grid h3 { margin: 0; color: var(--admin-orange); }
.start-grid article:first-child h3 { color: #adc8ff; }
.start-grid article:last-child h3 { color: var(--admin-green); }
.timing-tools { display: grid; grid-template-columns: minmax(0, 1fr); }
.timing-log-card table td:nth-child(4) { color: var(--admin-orange); font-weight: 800; }
.timing-log-card table td:not(:nth-child(2)) { white-space: nowrap; }
.scan-frame { position: relative; max-width: 480px; margin-top: 11px; overflow: hidden; border-radius: 13px; background: #332a40; aspect-ratio: 16/10; }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame span { position: absolute; inset: 15% auto; left: 50%; aspect-ratio: 1; transform: translateX(-50%); border: 2px solid #65e3ed; border-radius: 12px; pointer-events: none; }
.scan-manual { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 14px 0; }
.scan-manual label { margin: 0 !important; flex: 1 1 140px; }
.scan-manual :is(input,select) { display: block; width: 100%; padding: 10px; margin-top: 4px; }
.kit-match, .scan-result { padding: 14px; border: 1px solid var(--admin-line); background: var(--admin-soft); border-radius: 11px; margin-top: 12px; }
.kit-match h2 { margin: 10px 0 0; }
.kit-state { display: flex; justify-content: space-between; gap: 6px; padding-top: 12px; border-top: 1px solid var(--admin-line); }
.kit-state strong { color: var(--admin-orange); }
.scan-result p { margin: 4px 0 0; }
.scan-result.success { background: #213631; border-color: #365d51; color: var(--admin-green); }
.scan-result.warning { background: #3c2937; color: #ffcf9a; }
.staff-tabs { display: none; }
@media(max-width: 760px) {
  .lsc-admin .admin-sidebar nav { flex-wrap: wrap; }
  .staff-view .admin-sidebar nav { display: none; }
  .staff-view .admin-sidebar { display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--admin-line); }
  .staff-view main { padding-bottom: 83px !important; }
  .staff-view .staff-tabs {
    display: flex;
    position: fixed;
    inset: auto 0 0;
    z-index: 1000;
    background: #2b203b;
    padding: 8px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--admin-line);
  }
  .staff-view .staff-tabs a { text-align: center; text-decoration: none; flex: 1; min-height: 42px; padding: 9px 4px; color: var(--admin-muted); font-weight: 700; }
  .staff-view .staff-tabs [aria-current] { color: var(--admin-orange); }
  .staff-view .scan-card [data-camera-open], .staff-view .kit-match .save { width: 100%; min-height: 45px; }
}
@media(max-width: 520px) {
  .start-grid { grid-template-columns: 1fr; }
  .mode-switch button { flex: 1; }
}

@media(min-width: 761px) {
  .timing-page:not(.staff-view) .timing-settings { order: 0; }
  .timing-page:not(.staff-view) #timing-starts { order: 1; }
  .timing-page:not(.staff-view) .timing-log-card { order: 2; }
  .timing-page:not(.staff-view) .scan-card { order: 3; }
}
