:root {
  --ink: #0a2d4d; --accent: #0f6abf; --muted: #63788d; --line: #e2e9f1; --bg: #f3f6fa;
  --ok: #1d8a4e; --err: #c0392b; --warn: #a86b00; --gold: #c99a2e;
}
* { font-variant-numeric: lining-nums tabular-nums; }
* { box-sizing: border-box; }
/* One font for everything, form controls included (they don't inherit by default). */
button, input, select, textarea, optgroup { font-family: inherit; font-size: inherit; font-variant-numeric: inherit; }
body.admin { margin: 0; font-family: 'Bona Nova', 'David Libre', 'Times New Roman', serif;
  font-variant-numeric: lining-nums tabular-nums; color: var(--ink); background: var(--bg); font-size: 15px; }
a { color: var(--accent); }
h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 19px; margin: 0 0 6px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.holiday { color: var(--gold); }
.warn-txt { color: var(--warn); }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 9px 18px; font: inherit; font-weight: 700; background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: #12477a; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: var(--err); }
.btn:disabled { opacity: .5; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
button.link.danger { color: var(--err); }

/* top bar + layout */
.abar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
.abrand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.abrand img { width: 30px; filter: invert(1); }
.abar-actions { display: flex; gap: 16px; align-items: center; }
.abar-actions a, .abar-actions button.link { color: #cfe2f5; text-decoration: none; }
.abar-actions form { margin: 0; }
.alayout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 52px); }
.aside { background: #fff; border-left: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.aside a { display: flex; gap: 10px; border-right: 3px solid transparent; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.aside a:hover { background: #eef4fb; }
.aside a.on { background: var(--ink); color: #fff; }
.amain { padding: 24px 28px 60px; max-width: 1200px; min-width: 0; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: #e3f5ea; color: var(--ok); }
.flash.err { background: #fbe6e3; color: var(--err); }
.flash.warn { background: #fff4dc; color: var(--warn); }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 14px; padding: 16px; text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px rgba(10, 45, 77, .06); display: flex; flex-direction: column; }
.stat b { font-size: 32px; }
.stat span { color: var(--muted); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 18px; }
.panel { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 2px 8px rgba(10, 45, 77, .06); margin-bottom: 18px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th, .tbl td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl thead th { background: #f7fafd; font-size: 13px; color: var(--muted); font-weight: 700; }
.tbl.list { border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(10, 45, 77, .06); }
.tbl tr.off td { opacity: .5; }
.tbl tr.hl td, .tbl tr.hl th { background: #fff8e6; }
.tbl tr.sep th { background: #f7fafd; font-size: 13px; color: var(--muted); }
.tbl td.actions { text-align: left; white-space: nowrap; }
.tbl td.actions form { display: inline; }
.tbl.week th, .tbl.week td { text-align: center; font-size: 14px; }
.tbl.week tbody th { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.week-nav form { margin: 0; }

/* toggle */
.toggle { width: 42px; height: 24px; border-radius: 999px; border: 0; background: #c9d4df; position: relative; cursor: pointer; padding: 0; }
.toggle span { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .15s; }
.toggle.on { background: var(--ok); }
.toggle.on span { right: 21px; }
td form { margin: 0; }

/* forms */
.form { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 2px 8px rgba(10, 45, 77, .06); margin-bottom: 18px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #c9d6e3; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15, 106, 191, .35); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 6px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.fgrid[hidden] { display: none; }
.span2 { grid-column: span 2; }
.days, .modes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.chip { flex-direction: row !important; margin: 0 !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 7px 14px; border-radius: 999px; border: 1px solid #c9d6e3; background: #fff; font-weight: 600; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.quick { display: flex; gap: 12px; margin-right: 10px; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }
.form-actions { display: flex; gap: 16px; align-items: center; }
.danger-zone { margin-top: -6px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form label { margin: 0; }
.inline-form .grow, .row-form .grow { flex: 1; min-width: 220px; }
.row-form { display: flex; gap: 8px; align-items: center; margin: 0; }

/* dd / mm / yyyy date field */
.dmy { display: inline-flex; align-items: center; gap: 4px; direction: ltr; }
.dmy input, .dmy select { padding: 7px 6px; }
.dmy .dmy-d { width: 4.2em; text-align: center; }
.dmy .dmy-y { width: 5.6em; text-align: center; }
.dmy-sep { color: var(--muted); }
.dmy-x { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.dmy-x:hover { color: var(--err); }

/* events */
.ev-list { display: flex; flex-direction: column; gap: 10px; }
.ev { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: center; background: #fff; border-radius: 14px; padding: 10px; box-shadow: 0 2px 8px rgba(10, 45, 77, .06); }
.ev.off { opacity: .55; }
.ev-img { display: block; width: 140px; height: 90px; border-radius: 10px; overflow: hidden; background: #eef2f6; }
.ev-img img { width: 100%; height: 100%; object-fit: cover; }
.ev-img span, .preview span { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef4fb; color: var(--ink); }
.tag.st-מוצג { background: #e3f5ea; color: var(--ok); }
.tag.st-עתידי { background: #fff4dc; color: var(--warn); }
.tag.st-הסתיים, .tag.st-כבוי { background: #eceff2; color: var(--muted); }
.img-pick { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.preview { width: 260px; height: 160px; border-radius: 12px; overflow: hidden; background: #eef2f6; }
.preview img { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* login */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: linear-gradient(135deg, #0a2d4d, #12558f); }
.login { width: min(380px, 92vw); background: #fff; border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.login img { width: 70px; align-self: center; }
.login h1 { text-align: center; font-size: 22px; margin: 0 0 6px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }

@media (max-width: 800px) {
  .alayout { grid-template-columns: 1fr; }
  .aside { flex-direction: row; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .aside a { white-space: nowrap; }
  .amain { padding: 18px 14px 50px; }
  .span2 { grid-column: auto; }
  .img-pick { grid-template-columns: 1fr; }
  .ev { grid-template-columns: 90px 1fr auto; }
  .ev-img { width: 90px; height: 64px; }
  .row-form { flex-wrap: wrap; }
  .abar-actions a { display: none; }
}

/* rotating speakers */
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 12px; line-height: 20px; text-align: center; margin-right: 6px; }
.rot-week { margin-bottom: 18px; }
.rot-week h2 { display: flex; gap: 10px; align-items: baseline; }
.rot-week h2 small { font-weight: 400; color: var(--muted); font-size: 14px; }
.rot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.slot { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.slot.taken { border-color: #b9e1c8; background: #f3fbf6; }
.slot.waiting { border-color: #f0d9a8; background: #fffaf0; }
.slot h3 { margin: 0 0 4px; font-size: 16px; }
.slot .who { font-size: 18px; font-weight: 700; }
.req { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.req form { display: inline; margin: 0; }
.slot details summary { cursor: pointer; color: var(--accent); margin-top: 6px; }
.slot .mini { display: grid; gap: 6px; margin-top: 8px; }
.slot .mini input { width: 100%; }
