/* RefereeHub admin — "Salon gecesi" tokens from design/html/Yonetim.html (dark default, light via data-theme). */
:root {
  --bg: #0F1B2D; --surface: #16263D; --raised: #1D3150; --sunken: #0B1524; --border: #26395A; --border-strong: #6F82A3;
  --text: #F4F6FA; --text2: #A9B6CC; --text-dis: #5D6D88; --ph: #8C9AB3;
  --primary: #FF7A1A; --primary-h: #FF8F3D; --on-primary: #1A0D00; --primary-sub: #3A2412; --on-primary-sub: #FFB27A;
  --accent: #FFD23F; --on-accent: #1A1400;
  --ctrl: #1D3150; --ctrl-h: #24395C; --ctrl-dis: #16263D; --subtle-h: #FFFFFF12; --input: #0F1B2D;
  --focus: #F4F6FA; --focus-in: #0F1B2D;
  --success: #4ADE80; --success-sub: #12321F; --warning: #FBBF24; --warning-sub: #3A2C0C;
  --error: #FF6B6B; --error-sub: #3E1A1F; --info: #60A5FA; --info-sub: #13284A;
  --inverse: #F4F6FA; --on-inverse: #0F1B2D;
  --sh1: 0 1px 2px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.2); --sh3: 0 8px 16px rgba(0,0,0,.55);
  --ft: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --fd: "Bahnschrift", "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF1F6; --surface: #FFFFFF; --raised: #FFFFFF; --sunken: #E3E8F0; --border: #D3DAE5; --border-strong: #7C8AA3;
  --text: #0F1B2D; --text2: #4A5870; --text-dis: #A0AABB; --ph: #66748C;
  --primary: #C2410C; --primary-h: #A8380A; --on-primary: #FFFFFF; --primary-sub: #FFE7D6; --on-primary-sub: #7A2806;
  --accent: #A16207; --on-accent: #FFFFFF;
  --ctrl: #FFFFFF; --ctrl-h: #F1F4F8; --ctrl-dis: #E9EDF3; --subtle-h: #0F1B2D0F; --input: #FFFFFF;
  --focus: #0F1B2D; --focus-in: #FFFFFF;
  --success: #15803D; --success-sub: #DCFCE7; --warning: #A16207; --warning-sub: #FEF3C7;
  --error: #C81E1E; --error-sub: #FDE2E2; --info: #1D4ED8; --info-sub: #DBEAFE;
  --inverse: #0F1B2D; --on-inverse: #F4F6FA;
  --sh1: 0 1px 2px rgba(15,27,45,.08), 0 0 0 1px rgba(15,27,45,.04); --sh3: 0 8px 16px rgba(15,27,45,.16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
/* Reserve the scroll bar's space so content never changes width when a list grows past the viewport. */
html { scrollbar-gutter: stable; }
body { background: var(--bg); color: var(--text); font: 14px/20px var(--ft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; box-shadow: 0 0 0 1px var(--focus-in); }
/* FocusOnNavigate moves focus to the page title for screen readers; it is not an interactive control, so no ring. */
h1:focus, h1:focus-visible { outline: none; box-shadow: none; }
a { color: var(--primary); }
a:hover { color: var(--primary-h); }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side {
  --surface: #0A1422; --text: #F4F6FA; --text2: #A9B6CC; --border: #1E2E48; --subtle-h: #FFFFFF12;
  --primary: #FF7A1A; --primary-sub: #FF7A1A24; --on-primary-sub: #FFB27A; --sunken: #132238;
  flex: 0 0 248px; background: var(--surface); color: var(--text); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 8px; }
.brand-name { font-family: var(--fd); font-size: 16px; line-height: 20px; font-weight: 600; }
.logo { width: 32px; height: 32px; flex: none; }
.admin-tag { align-self: flex-start; margin: 0 6px 16px; height: 22px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--primary);
  color: var(--on-primary-sub); font-family: var(--fd); font-size: 12px; font-weight: 700; letter-spacing: .08em; display: inline-flex; align-items: center; }
.nav-group { padding: 12px 12px 4px; font-family: var(--fd); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--text2); }
.nav { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 4px; color: var(--text); text-decoration: none; position: relative; }
.nav:hover { background: var(--subtle-h); color: var(--text); }
.nav.active { background: var(--primary-sub); color: var(--on-primary-sub); font-weight: 600; }
.nav.active::before { content: ""; position: absolute; left: 0; top: 12px; width: 3px; height: 16px; border-radius: 2px; background: var(--primary); }
.cnt { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #FFD23F; color: #1A1400;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px 6px 0; border-top: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--primary-sub); color: var(--on-primary-sub); display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header { min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 12px 32px; background: var(--surface);
  border-bottom: 1px solid var(--border); }
.header h1 { font-family: var(--fd); font-size: 28px; line-height: 36px; font-weight: 600; }
.header .grow { flex: 1; }
.content { width: 100%; max-width: 1360px; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 16px; }

/* Text */
.cap { font-size: 12px; line-height: 16px; color: var(--text2); }
.muted { color: var(--text2); }
.h3 { font-family: var(--fd); font-size: 16px; line-height: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }

/* Icons */
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons */
.btn { height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--ctrl); color: var(--text);
  font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--ctrl-h); color: var(--text); }
.btn:disabled { background: var(--ctrl-dis); border-color: var(--border); color: var(--text-dis); cursor: not-allowed; }
.btn-p { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-p:hover { background: var(--primary-h); border-color: var(--primary-h); color: var(--on-primary); }
.btn-d { color: var(--error); border-color: var(--error); }
.btn-t { background: transparent; border-color: transparent; }
.btn-t:hover { background: var(--subtle-h); }
.btn-ic { width: 32px; padding: 0; }
.btn-lg { height: 44px; font-size: 15px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Cards, notes, badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--sh1); }
.card.pad { padding: 20px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--info-sub); }
.note.warn { background: var(--warning-sub); }
.note.err { background: var(--error-sub); }
.note.ok { background: var(--success-sub); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--success-sub); color: var(--success); }
.b-wa { background: var(--warning-sub); color: var(--warning); }
.b-er { background: var(--error-sub); color: var(--error); }
.b-in { background: var(--info-sub); color: var(--info); }
.b-ne { background: var(--sunken); color: var(--text2); }
.al { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--border); font-size: 12px; color: var(--text2); margin: 2px 4px 2px 0; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { height: 40px; padding: 0 12px; text-align: left; font-family: var(--fd); font-size: 13px; line-height: 16px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text2); background: var(--sunken); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--subtle-h); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .group td { height: 36px; background: var(--sunken); font-family: var(--fd); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--text2); }
.tbl tr.dim td { opacity: .6; }
.tbl-foot { padding: 12px 16px; background: var(--sunken); display: flex; gap: 24px; flex-wrap: wrap; }

/* Forms */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label, .fld > .l { font-size: 13px; line-height: 16px; font-weight: 600; }
.inp, .sel, textarea.inp { height: 32px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--input); color: var(--text); font: inherit;
  padding: 0 10px; width: 100%; }
textarea.inp { height: auto; min-height: 220px; padding: 8px 10px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; line-height: 18px; }
.inp:focus, .sel:focus { border-color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); outline: none; }
.inp.invalid, .sel.invalid { border-color: var(--error); box-shadow: inset 0 -2px 0 var(--error); }
.inp::placeholder { color: var(--ph); }
.search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--input);
  flex: 0 1 320px; min-width: 200px; }
.search input { border: 0; background: transparent; color: var(--text); font: inherit; outline: none; flex: 1; min-width: 0; }
.msg { font-size: 12px; line-height: 16px; color: var(--error); }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.check { display: inline-flex; gap: 8px; align-items: center; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.editor { border: 1px solid var(--primary); }
.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.editor-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Program: view tabs, link-like name buttons, the officials of a match */
.seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--border-strong); border-radius: 4px; overflow: hidden; }
.seg button { height: 32px; padding: 0 14px; border: 0; background: var(--ctrl); color: var(--text); font: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { background: var(--ctrl-h); }
.seg button.on { background: var(--primary-sub); color: var(--on-primary-sub); font-weight: 600; }
.lnk { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lnk:hover { color: var(--primary); text-decoration: underline; }
.duties { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.duties li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duties li.hit .lnk { color: var(--primary); font-weight: 600; }

/* Empty state */
.empty { padding: 48px 24px; text-align: center; color: var(--text2); }
.empty strong { display: block; color: var(--text); font-family: var(--fd); text-transform: uppercase; font-size: 18px; margin-bottom: 6px; }

/* Toast */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 8px;
  background: var(--inverse); color: var(--on-inverse); box-shadow: var(--sh3); max-width: 480px; }
.toast.err { background: var(--error); color: #fff; }
.toast button { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-family: var(--fd); font-size: 28px; line-height: 36px; font-weight: 600; text-transform: uppercase; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px 24px; background: var(--error); color: #fff; }
#blazor-error-ui .reload { color: #fff; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; flex: none; }
  .header, .content { padding-left: 16px; padding-right: 16px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
}

/* File chooser (Shared/FilePicker): a normal button and the chosen names; the native input is kept for keyboard and
   screen readers but not shown. */
.file-pick { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px; border: 1px dashed var(--border-strong);
             border-radius: 4px; background: var(--input); }
.file-pick .btn { flex: none; cursor: pointer; }
.file-pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-pick:focus-within .btn { outline: 2px solid var(--focus); outline-offset: 1px; }
.file-pick.dis .btn { background: var(--ctrl-dis); border-color: var(--border); color: var(--text-dis); cursor: not-allowed; }

/* Schedule › Salonlara göre: venue list on the left, the selected venue's officials on the right. */
.venue-split { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); min-height: 320px; }
.venue-list { list-style: none; margin: 0; padding: 8px; border-right: 1px solid var(--border); max-height: 640px; overflow-y: auto; }
.venue-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border: 0; border-radius: 4px;
              background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.venue-item:hover { background: var(--subtle-h); }
.venue-item.on { background: var(--primary-sub); color: var(--on-primary-sub); }
.venue-item.on .cap { color: inherit; }
.venue-name { font-weight: 600; }
.venue-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; }
@media (max-width: 767px) {
    .venue-split { grid-template-columns: minmax(0, 1fr); }
    .venue-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 240px; }
}

/* Salonlar: spellings of one venue in the program import, and the merge groups. */
.venue-spellings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.venue-spellings .al { display: inline-flex; align-items: center; gap: 6px; }
.merge-group { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.merge-option { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.merge-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
