/* ============================================================
 * DynaSuite Admin Backbone — shared styles
 * v0.4 — adds sidebar section dividers
 *
 * Dark cinematic theme. Marketing pages on dynascore.me root use
 * the LIGHT paper theme (site.css).
 * ============================================================ */

:root {
  --orange: #FF6B00;
  --orange-dark: #E15D00;
  --orange-soft: rgba(255, 107, 0, 0.15);

  --ink:      #E5E7EB;
  --ink-soft: #B8BEC9;
  --ink-mute: #7C8694;
  --ink-fade: #4B5563;

  --bg:              #0D0F12;
  --bg-soft:         #14171C;
  --bg-card:         #1A1F26;
  --bg-sidebar:      #0A0C10;
  --bg-sidebar-soft: #1A1F26;

  --line:        #2A2F38;
  --line-strong: #3A414D;
  --line-fade:   #1F242C;

  --success:      #10B981;
  --emerald:      #10B981;
  --emerald-soft: rgba(16, 185, 129, 0.15);
  --warn:         #F59E0B;
  --danger:       #EF4444;

  --f-display: 'Barlow Condensed', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', 'Courier New', monospace;
  --f-ui:      Inter, system-ui, -apple-system, sans-serif;

  --sidebar-w: 280px;
  --topbar-h:  56px;
  --banner-h:  56px;
  --radius:      6px;
  --radius-soft: 4px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow:    0 4px 16px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; }

code, pre, .mono { font-family: var(--f-mono); }

/* ============================================================
 * App layout
 * ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  height: 100vh;
}

.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  color: white;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 0 20px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--bg-sidebar-soft);
}
.sidebar-brand .brand-name {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-nav { flex: 1; padding: 8px 8px 12px; overflow-y: auto; }

/* Section labels (Site Admin / Match Admin / Shooter / RO / Account) */
.sidebar-section-label {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 16px 14px 6px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-section-label:first-child {
  border-top: none;
  margin-top: 4px;
  padding-top: 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-soft);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.sidebar-nav-item:hover {
  background: var(--bg-sidebar-soft);
  color: white;
}
.sidebar-nav-item.active {
  background: var(--orange);
  color: white;
}
.sidebar-nav-item .icon { width: 16px; height: 16px; opacity: 0.9; flex-shrink: 0; }
.sidebar-nav-item .label { font-size: 14px; }
.sidebar-nav-item .badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  font-family: var(--f-mono);
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--bg-sidebar-soft);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}

.topbar {
  grid-area: topbar;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-mute);
}
.topbar-user .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.main iframe {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 0;
  background: var(--bg-soft);
}

/* ============================================================
 * Role banner
 * ============================================================ */

.role-banner {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.role-banner-role {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--orange);
  line-height: 1;
}
.role-banner-sep {
  color: var(--ink-fade);
  font-size: 22px;
  line-height: 1;
}
.role-banner-surface {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  line-height: 1;
}
.role-banner-multi {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-fade);
  text-transform: uppercase;
  align-self: center;
  margin-left: auto;
}

/* ============================================================
 * Forms & buttons (used by login/forgot/reset)
 * ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-soft);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: var(--orange-dark); color: white; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-quiet {
  background: transparent;
  color: var(--ink-mute);
  padding: 6px 10px;
  font-size: 12px;
}
.btn-quiet:hover { color: var(--ink); }

.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.form-field input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--f-ui);
  font-size: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-soft);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.1s, box-shadow 0.1s;
}
.form-field input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-soft);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}
.alert-info {
  background: rgba(255, 107, 0, 0.10);
  border: 1px solid rgba(255, 107, 0, 0.30);
  color: var(--orange);
}
.alert-success {
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.30);
  color: #6EE7B7;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .name {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.login-brand .tag {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 4px;
}
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .hint { font-size: 12px; color: var(--ink-mute); margin-bottom: 20px; }

.signed-out-notice {
  background: var(--emerald-soft);
  border: 1px solid var(--emerald);
  color: #6EE7B7;
  padding: 10px 14px;
  border-radius: var(--radius-soft);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

/* ============================================================
 * Surface (iframe content) base styles
 * ============================================================ */

.surface { padding: 24px 32px; max-width: 1200px; }
.surface h1 { margin-bottom: 6px; }
.surface .surface-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 24px;
}

.placeholder-banner {
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  color: var(--ink-mute);
}
.placeholder-banner h2 { color: var(--ink); margin-bottom: 8px; }
.placeholder-banner .pill {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background: var(--orange-soft);
  color: var(--orange);
  padding: 4px 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ============================================================
 * Responsive
 * ============================================================ */

/* mobile-menu-order-fix */
.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-soft);
  background: var(--bg-card);
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 800px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar-menu-btn { display: inline-flex; }
  .role-banner { padding: 10px 20px; gap: 10px; }
  .role-banner-role { font-size: 20px; }
  .role-banner-surface { font-size: 16px; }
  .role-banner-multi { display: none; }
}

/* ─── Themed scrollbars (admin-css-scrollbars-v2) ──────────────────────
   html selector (Chrome needs that for the page scrollbar) + matches the
   v0.7.8 match-detail.html scheme: --line thumb, --bg-soft track, orange hover. */

html {
  scrollbar-color: var(--line) var(--bg-soft);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-soft);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 6px;
  border: 2px solid var(--bg-soft);
  transition: background 0.12s;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}
::-webkit-scrollbar-corner {
  background: var(--bg-soft);
}
/* registration board (D-013) */
.rb-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;flex-wrap:wrap;gap:10px;}
.rb-stat{opacity:.8;font-size:14px;}
.rb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px;}
.rb-card{border:1px solid var(--border,#2a2a32);border-radius:10px;background:var(--panel,#16161c);overflow:hidden;}
.rb-card.rb-unassigned{border-color:rgba(255,107,0,.4);}
.rb-card-head{padding:10px 12px;font-weight:600;font-size:13px;border-bottom:1px solid var(--border,#2a2a32);display:flex;justify-content:space-between;gap:8px;}
.rb-cap{opacity:.6;font-weight:400;}
.rb-people{padding:8px;display:flex;flex-direction:column;gap:6px;min-height:30px;}
.rb-person{display:flex;flex-direction:column;gap:2px;padding:7px 9px;border-radius:7px;background:rgba(255,255,255,.03);}
.rb-name{font-size:13px;font-weight:500;}
.rb-meta{font-size:11px;opacity:.6;}
.rb-move{margin-top:4px;font-size:11px;padding:3px 5px;background:var(--input,#0e0e12);color:inherit;border:1px solid var(--border,#333);border-radius:5px;}
.rb-empty{opacity:.35;font-size:12px;text-align:center;padding:8px;}
.rb-modal-bd{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:1000;}
.rb-modal{background:var(--panel,#16161c);border:1px solid var(--border,#2a2a32);border-radius:12px;width:380px;max-width:92vw;}
.rb-modal-h{padding:14px 16px;border-bottom:1px solid var(--border,#2a2a32);font-weight:600;display:flex;justify-content:space-between;}
.rb-x{background:none;border:none;color:inherit;font-size:20px;cursor:pointer;opacity:.6;}
.rb-modal-b{padding:16px;}
.rb-f{margin-bottom:12px;}
.rb-f label{display:block;font-size:12px;opacity:.7;margin-bottom:4px;}
.rb-f input,.rb-f select{width:100%;padding:8px 10px;background:var(--input,#0e0e12);color:inherit;border:1px solid var(--border,#333);border-radius:7px;font-size:14px;}
.rb-modal-f{padding:12px 16px;border-top:1px solid var(--border,#2a2a32);display:flex;gap:10px;justify-content:flex-end;}
.rb-err{color:#ff6b6b;font-size:13px;min-height:16px;}
/* schedule-controls.js styles (Lane A) — append to admin.css */
.sc-wrap { max-width: 640px; padding: 4px 2px 24px; }
.sc-h { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.sc-sub { margin: 0 0 16px; opacity: 0.7; font-size: 13px; }
.sc-form { display: flex; flex-direction: column; gap: 16px; }
.sc-fs { border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 12px 14px; margin: 0; }
.sc-fs legend { padding: 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; }
.sc-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.sc-lbl { flex: 0 0 150px; font-size: 14px; }
.sc-row input, .sc-row select {
  flex: 1; padding: 7px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(0,0,0,0.25);
  color: inherit; font-size: 14px;
}
.sc-hint { display: block; margin: 2px 0 4px; font-size: 12px; opacity: 0.6; line-height: 1.4; }
.sc-actions { margin-top: 20px; }
.sc-btn { padding: 9px 18px; border-radius: 6px; border: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.sc-btn-primary { background: #ff6b00; color: #fff; }
.sc-btn-primary:hover { filter: brightness(1.08); }
.sc-btn:disabled { opacity: 0.55; cursor: default; }
.sc-result { margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 13px; min-height: 0; }
.sc-result:empty { display: none; }
.sc-ok   { background: rgba(15,127,90,0.18);  border: 1px solid rgba(15,127,90,0.5); }
.sc-err  { background: rgba(200,40,40,0.16);   border: 1px solid rgba(200,40,40,0.5); }
.sc-warn { background: rgba(255,160,0,0.14);   border: 1px solid rgba(255,160,0,0.45); }
.sc-info { background: rgba(255,255,255,0.06);  border: 1px solid rgba(255,255,255,0.15); }
/* ro-board.js styles (Lane A) — append to admin.css */
.rob-wrap { padding: 4px 2px 24px; }
.rob-h { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.rob-sub { margin: 0 0 14px; font-size: 13px; opacity: 0.75; }
.rob-empty, .rob-err { padding: 16px; font-size: 14px; opacity: 0.8; }
.rob-err { color: #ff8a8a; }
.rob-scroll { overflow-x: auto; border: 1px solid rgba(255,255,255,0.10); border-radius: 8px; }
.rob-grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.rob-grid th, .rob-grid td { border: 1px solid rgba(255,255,255,0.08); padding: 6px 8px; text-align: center; vertical-align: top; }
.rob-grid thead th { position: sticky; top: 0; background: rgba(20,20,28,0.96); font-weight: 600; white-space: nowrap; }
.rob-th-range, .rob-range { position: sticky; left: 0; background: rgba(20,20,28,0.96); text-align: left; font-weight: 700; min-width: 56px; z-index: 1; }
.rob-th-shift { font-family: var(--f-mono, monospace); font-size: 11px; }
.rob-len-sel { padding: 3px 6px; border-radius: 5px; border: 1px solid rgba(255,255,255,0.18); background: rgba(0,0,0,0.25); color: inherit; font-size: 12px; }
.rob-len-actual { font-size: 12px; opacity: 0.85; }
.rob-mismatch { color: #ffb84d; font-size: 11px; }
.rob-req { font-weight: 700; opacity: 0.8; }
.rob-cell { min-width: 92px; }
.rob-cell.rob-full { background: rgba(15,127,90,0.14); }
.rob-cell.rob-partial { background: rgba(255,160,0,0.10); }
.rob-cell.rob-empty-cell { background: transparent; }
.rob-chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px; padding: 2px 6px; border-radius: 10px; background: rgba(255,107,0,0.16); border: 1px solid rgba(255,107,0,0.4); font-size: 11px; white-space: nowrap; }
.rob-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; opacity: 0.7; padding: 0 1px; }
.rob-x:hover { opacity: 1; color: #ff8a8a; }
.rob-add { display: block; margin: 3px auto 0; padding: 2px 8px; border-radius: 5px; border: 1px dashed rgba(255,255,255,0.3); background: transparent; color: inherit; font-size: 11px; cursor: pointer; opacity: 0.75; }
.rob-add:hover { opacity: 1; border-style: solid; }
.rob-msg { margin-top: 12px; font-size: 13px; min-height: 0; }
.rob-msg:empty { display: none; }
.rob-ok { color: #7ee0b0; }
.rob-err { color: #ff8a8a; }
