/* =========================================================================
   Interface styles (same look as the school reports app)
   Palette taken from the school crest: plum ring + laurel green.
   The teacher app additions are at the end of this file.
   Designed and developed by Dipl.-Ing. A. Sanallah
   ========================================================================= */
:root {
  --plum: #4A2F6E;
  --plum-deep: #33204D;
  --plum-soft: #EFEAF5;
  --laurel: #4E7A3A;
  --laurel-soft: #E8F0E3;
  --ink: #1E2230;
  --muted: #646B7A;
  --rule: #DCDFE6;
  --ground: #F2F3F6;
  --panel: #FFFFFF;
  --hilite: #FFF0BF;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --radius: 6px;
  --panel-w: 348px;
  --top-h: 60px;
  font-family: 'Plex', 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; }
.btn svg path, .icon-btn svg path { stroke: currentColor; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--laurel); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: #fff; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #B9BECB; background: #FAFAFC; }
.btn-primary { background: var(--plum); border-color: var(--plum); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--plum-deep); border-color: var(--plum-deep); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); border-color: transparent; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; height: 42px; font-size: 14.5px; }
.btn.danger { color: var(--danger); }
.btn-onplum { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.btn-onplum:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.btn-onplum.attn { background: #fff; color: var(--plum); border-color: #fff; font-weight: 600; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------- top bar ---------- */
.topbar {
  flex: none; height: var(--top-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  background: var(--plum); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; }
.brand-school { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-app { font-size: 12px; opacity: .78; }
.filebar { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; min-width: 0; }
.filechip {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: var(--radius); background: rgba(0,0,0,.18); min-width: 0; max-width: 360px;
}
.file-dot { width: 8px; height: 8px; border-radius: 50%; background: #9BD27F; flex: none; }
.file-dot.stale { background: #F3C24E; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.file-time { opacity: .75; font-size: 12px; white-space: nowrap; }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 30px; height: 17px; border-radius: 9px; background: rgba(255,255,255,.3); position: relative; transition: background .15s; }
.switch-track::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch input:checked + .switch-track { background: #9BD27F; }
.switch input:checked + .switch-track::after { inset-inline-start: 15px; }
.switch input:focus-visible + .switch-track { outline: 2px solid #fff; outline-offset: 2px; }
.langs { display: flex; background: rgba(0,0,0,.2); border-radius: var(--radius); padding: 3px; }
.langs button { border: 0; background: transparent; color: #fff; padding: 5px 11px; border-radius: 4px; cursor: pointer; opacity: .8; }
.langs button[aria-pressed="true"] { background: #fff; color: var(--plum); opacity: 1; font-weight: 600; }

/* ---------- layout ---------- */
.layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
}
.layout.no-panel { grid-template-columns: minmax(0, 1fr); }

/* sheet tabs (like the tabs at the bottom of Excel) */
.tabbar { flex: none; background: var(--panel); border-bottom: 1px solid var(--rule); padding: 0 12px; }
.tablist { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.tab {
  flex: none; display: flex; align-items: center; gap: 7px;
  border: 0; background: none; cursor: pointer;
  padding: 11px 14px 9px; border-bottom: 3px solid transparent;
  color: var(--muted); white-space: nowrap;
}
.tab svg { width: 16px; height: 16px; color: var(--muted); }
.tab:hover { color: var(--ink); background: var(--ground); }
.tab[aria-selected="true"] { color: var(--plum-deep); border-bottom-color: var(--plum); font-weight: 600; }
.tab[aria-selected="true"] svg { color: var(--plum); }
.tab .tab-name { unicode-bidi: plaintext; }
.tab-home { padding-inline-end: 18px; margin-inline-end: 6px; border-inline-end: 1px solid var(--rule); }

/* ---------- dashboard ---------- */
.dash { flex: 1; min-height: 0; overflow: auto; }
.dash-wrap { max-width: 1320px; margin: 0 auto; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 22px; }
.dash-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { margin: 0; font-size: 24px; color: var(--plum-deep); }
.dash-head p { margin: 2px 0 0; color: var(--muted); }
.dash-src { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 7px 12px; font-size: 12.5px; }
.dash-src b { direction: ltr; unicode-bidi: isolate; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; }
.kpi { padding: 14px 18px; border-inline-start: 1px solid var(--rule); }
.kpi:first-child { border-inline-start: 0; }
.kpi b { display: block; font-size: 26px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.dash-sec h2 { margin: 0 0 4px; font-size: 16px; color: var(--plum-deep); }
.dash-sec > p { margin: 0 0 12px; color: var(--muted); }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.tcard { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.tcard:hover { border-color: #C5BBD6; }
.tcard-thumb { height: 196px; border: 0; padding: 0; background: #E9EAEF; display: grid; place-items: center; cursor: pointer; overflow: hidden; border-bottom: 1px solid var(--rule); }
.tcard-thumb:hover { background: #E2DDEA; }
.tcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tcard-body h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.tcard-body h3 span { unicode-bidi: plaintext; }
.tcard-body h3 svg { width: 16px; height: 16px; color: var(--plum); }
.tcard-desc { margin: 0; color: var(--ink); }
.tcard-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.src-own { color: #8A5A00; }
.tcard-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.tcard-actions .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
.chart { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px 16px; }
.legend { display: flex; gap: 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bars { display: grid; grid-template-columns: minmax(110px, max-content) 1fr 40px; gap: 6px 12px; align-items: center; }
.bar-label { font-size: 12.5px; white-space: nowrap; unicode-bidi: plaintext; }
.bar-track { display: flex; gap: 2px; height: 18px; cursor: default; }
.bar-seg { height: 100%; min-width: 2px; }
.bar-seg:first-child { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.bar-seg:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.seg-in { background: #5E8F45; }
.seg-out { background: #7A5BA6; }
.seg-na { background: repeating-linear-gradient(45deg, #fff 0 3px, #B9BDC7 3px 4.5px); box-shadow: inset 0 0 0 1px #B9BDC7; }
.bar-n { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; border-radius: 6px; padding: 7px 10px; font-size: 12px; line-height: 1.5; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.chart-tip b { display: block; unicode-bidi: plaintext; }
.view-sub { color: var(--muted); font-size: 13px; }

/* workspace */
.workspace { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.empty { margin: auto; max-width: 520px; text-align: center; padding: 30px; }
.empty img { width: 96px; height: 96px; }
.empty h1 { font-size: 22px; margin: 14px 0 8px; color: var(--plum-deep); }
.empty p { line-height: 1.6; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 18px 12px; gap: 10px; }
.banner { background: var(--hilite); border: 1px solid #EBD38A; border-radius: var(--radius); padding: 8px 12px; margin: 0; }
.banner.err { background: var(--danger-soft); border-color: #F2B8B2; color: var(--danger); }
.view-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: -6px; }
.view-head h1 { margin: 0; font-size: 21px; color: var(--plum-deep); unicode-bidi: plaintext; }
.view-count { color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; top: 8px; inset-inline-start: 10px; color: var(--muted); width: 17px; height: 17px; }
.search svg path { stroke: currentColor; }
.search input { width: 100%; height: 34px; border: 1px solid var(--rule); border-radius: var(--radius); padding-inline: 34px 10px; background: #fff; }
.ctl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.ctl select, .ctl input { color: var(--ink); }
select, .num-in, .fld input, .fld select, .pf input[type="text"], .pf input[type="number"], .pf select {
  height: 32px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: 0 8px;
}
.num-in { width: 64px; }
.chk { gap: 6px; cursor: pointer; }
.chk input { accent-color: var(--plum); width: 16px; height: 16px; }

/* slicers */
.slicers { display: flex; flex-direction: column; gap: 6px; }
.slicer { display: flex; align-items: flex-start; gap: 8px; }
.slicer-name { flex: none; min-width: 92px; max-width: 160px; padding-top: 5px; font-weight: 600; font-size: 12.5px; color: var(--plum-deep); unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.chip {
  border: 1px solid var(--rule); background: #fff; border-radius: 14px;
  padding: 3px 5px 3px 10px; padding-inline: 10px 5px; cursor: pointer; font-size: 12.5px;
}
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-v { unicode-bidi: isolate; }
.chip small { color: var(--muted); background: var(--ground); border-radius: 8px; padding: 0 6px; font-size: 11px; line-height: 16px; unicode-bidi: isolate; }
.chip:hover { border-color: var(--plum); }
.chip[aria-pressed="true"] { background: var(--plum); border-color: var(--plum); color: #fff; }
.chip[aria-pressed="true"] small { color: var(--plum-deep); background: #fff; }
.slicer-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 6px; font-size: 16px; line-height: 1; border-radius: 4px; }
.slicer-x:hover { background: var(--ground); color: var(--danger); }
.slicer-tools { display: flex; gap: 8px; align-items: center; }
.slicer-tools select { height: 30px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--plum); cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }

/* data table */
.table-wrap { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); }
table.data { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
table.data thead { position: sticky; top: 0; z-index: 3; }
table.data th {
  background: #F7F7FA; color: var(--ink); font-weight: 600; text-align: center;
  padding: 7px 8px; border-bottom: 1px solid var(--rule); border-inline-end: 1px solid #ECEEF2;
  cursor: pointer; white-space: nowrap; unicode-bidi: plaintext; user-select: none;
}
table.data th:hover { background: var(--plum-soft); }
table.data th .sort { color: var(--plum); margin-inline-start: 4px; font-size: 10px; }
table.data th.core { box-shadow: inset 0 -3px 0 #F4B183; }
table.data td { padding: 5px 8px; border-bottom: 1px solid #EEF0F3; border-inline-end: 1px solid #F3F4F6; text-align: center; white-space: nowrap; unicode-bidi: plaintext; }
table.data td.txt { text-align: start; }
table.data td.rn, table.data th.rn { color: var(--muted); width: 1%; }
table.data tbody tr:hover td { background: #FAF8FD; }
table.data td.core { background: #FFFBEA; }
table.data td.g-fail { color: var(--danger); font-weight: 600; background: #FFF5F4; }
table.data td.g-top { color: var(--laurel); font-weight: 600; }
table.data tr.grp td { background: var(--plum-soft); color: var(--plum-deep); font-weight: 600; text-align: start; }
table.data tr.sum td { background: #F7F7FA; font-weight: 600; }
.table-empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- print panel ---------- */
.panel { background: var(--panel); border-inline-start: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; }
.thumb-area { flex: none; padding: 14px 16px 12px; background: #E9EAEF; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.thumb { height: 230px; display: grid; place-items: center; overflow: hidden; position: relative; cursor: zoom-in; }
.thumb-paper { box-shadow: 0 1px 2px rgba(30,34,48,.25), 0 8px 18px -6px rgba(30,34,48,.35); background: #fff; position: relative; overflow: hidden; }
.thumb-paper .pp-page { position: absolute; top: 0; left: 0; transform-origin: top left; }
.thumb-info { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.thumb-info b { color: var(--ink); }
.tabs { display: flex; border-bottom: 1px solid var(--rule); padding: 0 10px; flex: none; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 4px 9px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--plum-deep); border-bottom-color: var(--plum); font-weight: 600; }
.tabpanel { flex: 1; overflow: auto; padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.pf { display: flex; flex-direction: column; gap: 5px; }
.pf > span { font-size: 12.5px; color: var(--muted); }
.pf input[type="text"], .pf select { width: 100%; }
.pf-row { display: flex; gap: 10px; }
.pf-row > * { flex: 1; }
.pf-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pf-check input { accent-color: var(--plum); width: 16px; height: 16px; flex: none; }
.pf-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-inline input[type="number"] { width: 70px; }
.seg { display: flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 6px 4px; cursor: pointer; border-inline-end: 1px solid var(--rule); font-size: 12.5px; }
.seg button:last-child { border-inline-end: 0; }
.seg button[aria-pressed="true"] { background: var(--plum); color: #fff; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--plum); }
.range-row output { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatch { border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.swatch i { display: block; height: 12px; border-radius: 2px; }
.swatch i + i { height: 6px; }
.swatch[aria-pressed="true"] { border-color: var(--plum); box-shadow: 0 0 0 2px var(--plum); }
.swatch-name { font-size: 12px; color: var(--ink); margin-top: 2px; }
.pf-sep { border: 0; border-top: 1px solid var(--rule); margin: 2px 0; }

/* column list */
.cols-hint { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.cols-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cols-tools .btn { height: 28px; padding: 0 9px; font-size: 12px; }
.collist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.collist li { display: flex; align-items: center; gap: 6px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 3px 6px; background: #fff; }
.collist li.off { background: #F8F8FA; }
.collist li.off .col-label { color: var(--muted); }
.col-grip { cursor: grab; color: #A3A8B4; padding: 0 2px; font-size: 14px; line-height: 1; user-select: none; }
.collist input[type="checkbox"] { accent-color: var(--plum); width: 16px; height: 16px; flex: none; }
.col-label { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; height: 28px; padding: 0 6px; border-radius: 4px; unicode-bidi: plaintext; }
.col-label:hover { border-color: var(--rule); }
.col-label:focus { border-color: var(--plum); background: #fff; outline: none; }
.col-kind { font-size: 10.5px; color: var(--muted); flex: none; }
.col-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.col-del:hover { color: var(--danger); }
.sortable-ghost { opacity: .4; }

/* ---------- preview ---------- */
.preview { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #5A5E6B; }
.preview-bar { flex: none; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--plum-deep); color: #fff; flex-wrap: wrap; }
.pv-title { display: flex; align-items: baseline; gap: 10px; margin-inline-end: auto; }
.pv-title b { font-size: 15px; unicode-bidi: plaintext; }
.pv-title span { opacity: .78; }
.pv-zoom { display: flex; align-items: center; gap: 6px; }
.pv-zoom select { height: 32px; color: var(--ink); background: #fff; }
.pv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview .btn:not(.btn-primary) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.preview .btn:not(.btn-primary):hover { background: rgba(255,255,255,.22); }
.preview .btn-primary { background: #fff; color: var(--plum-deep); border-color: #fff; }
.preview-scroll { flex: 1; overflow: auto; padding: 24px; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; width: max-content; min-width: 100%; }
.pv-pages .pp-page { box-shadow: 0 2px 10px rgba(0,0,0,.35); flex: none; }

/* ---------- dialog, toast, busy, drop ---------- */
.dlg { border: 0; border-radius: 10px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(30,34,48,.45); }
.dlg form { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { margin: 0 0 4px; font-size: 18px; color: var(--plum-deep); }
.dlg fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.dlg legend { color: var(--muted); font-size: 12.5px; padding: 0 4px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > span { font-size: 12.5px; color: var(--muted); }
.fld small { color: var(--muted); font-size: 11.5px; }
.fld input, .fld select { width: 100%; }
fieldset .fld { flex-direction: row; align-items: center; }
fieldset .fld > span { width: 64px; flex: none; }
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { flex: 1; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-row img { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--rule); border-radius: 50%; padding: 2px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.grow { flex: 1; }
.toast {
  position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; max-width: 80vw;
}
[dir="rtl"] .toast { transform: translateX(50%) translateY(20px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[dir="rtl"] .toast.show { transform: translateX(50%) translateY(0); }
.toast.err { background: var(--danger); }
.busy { position: fixed; inset: 0; background: rgba(30,34,48,.35); z-index: 90; display: grid; place-items: center; }
.busy-box { background: #fff; border-radius: 10px; padding: 20px 26px; display: flex; align-items: center; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--plum-soft); border-top-color: var(--plum); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drop { position: fixed; inset: 10px; z-index: 70; border: 3px dashed #fff; border-radius: 14px; background: rgba(74,47,110,.82); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; pointer-events: none; }
#measure { position: fixed; top: 0; left: -100000px; visibility: hidden; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }

/* narrow screens: panel moves under the table */
@media (max-width: 1100px) {
  body { overflow: auto; }
  .layout, .layout.no-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-inline-start: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .panel { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--rule); }
  .table-wrap { max-height: 60vh; }
  .filechip { max-width: 200px; }
  .brand-text { display: none; }
}
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
}

/* ---------- print (Ctrl+P / right-click > Print) ----------
   preview open  -> only the preview pages
   otherwise     -> the page on the screen (dashboard, Key, Reports, find a teacher, table), without bars and buttons */
@media print {
  html, body { height: auto; overflow: visible; background: #fff; display: block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.pv-open > *:not(#preview) { display: none !important; }
  body.pv-open #preview { position: static; display: block !important; background: none; }
  .preview-bar { display: none !important; }
  .preview-scroll { overflow: visible; padding: 0; }
  .pv-pages { display: block; zoom: 1 !important; width: auto; min-width: 0; }
  .pv-pages .pp-page { box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  .pv-pages .pp-page:last-child { break-after: auto; page-break-after: auto; }

  body:not(.pv-open) #preview, body:not(.pv-open) .tabbar, body:not(.pv-open) .panel, body:not(.pv-open) .login,
  body:not(.pv-open) .toast, body:not(.pv-open) .busy, body:not(.pv-open) dialog, body:not(.pv-open) #measure { display: none !important; }
  body:not(.pv-open) .topbar { background: #fff; color: var(--ink); height: auto; padding: 0 0 6px; border-bottom: 2px solid var(--plum); }
  body:not(.pv-open) .topbar > :not(.brand) { display: none !important; }
  body:not(.pv-open) .brand-text { display: block !important; }
  body:not(.pv-open) .layout { display: block; }
  body:not(.pv-open) .workspace, body:not(.pv-open) .dash, body:not(.pv-open) .page, body:not(.pv-open) .vp,
  body:not(.pv-open) .view, body:not(.pv-open) .table-wrap { overflow: visible !important; height: auto !important; max-height: none !important; flex: none !important; display: block; }
  body:not(.pv-open) .dash-wrap, body:not(.pv-open) .page-wrap, body:not(.pv-open) .vp-wrap { max-width: none; padding: 8px 0; }
  body:not(.pv-open) .btn, body:not(.pv-open) .kseg, body:not(.pv-open) .dash-tools, body:not(.pv-open) .controls,
  body:not(.pv-open) .slicer-tools, body:not(.pv-open) .slicer-x, body:not(.pv-open) .vp-search,
  body:not(.pv-open) .ractions, body:not(.pv-open) .tcard-actions, body:not(.pv-open) .mm-actions { display: none !important; }
  body:not(.pv-open) .dash-sec, body:not(.pv-open) .kcard, body:not(.pv-open) .rcard, body:not(.pv-open) .vp-card,
  body:not(.pv-open) .kpis, body:not(.pv-open) .tcard { break-inside: avoid; page-break-inside: avoid; }
  body:not(.pv-open) .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  body:not(.pv-open) .vp-results { display: block; }
  body:not(.pv-open) .vp-card { margin-bottom: 10px; }
  body:not(.pv-open) table.data thead { position: static; }
  body:not(.pv-open) table.data th.stick, body:not(.pv-open) table.data td.stick { position: static; }
  body:not(.pv-open) .mm-wrap { max-height: none; overflow: visible; }
  body:not(.pv-open) input, body:not(.pv-open) select { border: 0 !important; background: transparent !important; }
  body:not(.pv-open) .print-credit { display: flex; justify-content: center; margin-top: 12px; padding-top: 6px; border-top: 1px solid #bbb; font-size: 9pt; break-inside: avoid; }
  body:not(.pv-open) .print-credit .dev-mark { width: 26px; height: 26px; }
}

/* ---------- sign-in ---------- */
body.locked > *:not(.login):not(.toast):not(.busy) { display: none !important; }
.login {
  position: fixed; inset: 0; z-index: 40; overflow: auto;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 18% 22%, rgba(94,143,69,.16), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(74,47,110,.22), transparent 46%),
    var(--ground);
}
.login-card {
  width: min(380px, 100%); background: var(--panel); border: 1px solid var(--rule); border-radius: 12px;
  padding: 28px 28px 18px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 18px 50px -20px rgba(51,32,77,.45);
}
.login-card img { width: 84px; height: 84px; align-self: center; }
.login-card h1 { margin: 2px 0 0; text-align: center; font-size: 19px; color: var(--plum-deep); }
.login-sub { margin: 0 0 6px; text-align: center; color: var(--muted); }
.login-card .fld input { height: 38px; font-size: 14px; }
.login-err { margin: 0; color: var(--danger); background: var(--danger-soft); border-radius: var(--radius); padding: 7px 10px; font-size: 13px; }
.login-langs { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.login-langs button { border: 0; background: none; padding: 4px 10px; border-radius: 4px; color: var(--muted); cursor: pointer; }
.login-langs button[aria-pressed="true"] { color: var(--plum-deep); background: var(--plum-soft); font-weight: 600; }
.login-credit { margin: 10px 0 0; display: flex; justify-content: center; font-size: 11.5px; }
/* the developer credit (mark + two lines), the same everywhere; grayscale */
.dev-credit { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; color: #555; font-style: normal; }
.dev-mark { width: 30px; height: 30px; flex: none; display: block; }
.dev-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.dev-l1 { font-weight: 600; color: #444; }
.dev-l2 { font-size: .9em; color: #777; }
.print-credit { display: none; }

/* ---------- signed-in user ---------- */
.userchip { display: flex; align-items: center; gap: 8px; color: #fff; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.user-avatar svg { width: 18px; height: 18px; color: #fff; }
.user-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-text b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-text small { font-size: 11px; opacity: .78; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- editing cells (admin) ---------- */
table.data td.ed { cursor: cell; }
table.data td.ed:hover { box-shadow: inset 0 0 0 1px #B9A9D2; }
table.data td.editing { padding: 0; box-shadow: inset 0 0 0 2px var(--plum); background: #fff; }
table.data td.saving { opacity: .55; }
.cell-input { width: 100%; min-width: 64px; height: 28px; border: 0; padding: 0 6px; font: inherit; background: #fff; text-align: center; outline: none; }
.edit-hint { color: var(--plum); }
table.data td.ed-off { cursor: cell; user-select: none; }
table.data td.ed-off:hover { box-shadow: inset 0 0 0 1px #D9D2E4; }
.edit-off { color: var(--muted); }
.btn-edit { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; border-color: var(--plum); color: var(--plum); font-weight: 600; margin-inline-start: 4px; }
.btn-edit:hover { background: var(--plum-soft); }
.btn-edit svg { width: 15px; height: 15px; }
.dlg-msg { width: min(520px, 94vw); }
.db-fs .db-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.db-fs .db-row > span:first-child { width: 120px; flex: none; color: var(--muted); font-size: 12.5px; }
.db-fs #dbReadFrom { unicode-bidi: isolate; font-size: 13px; overflow-wrap: anywhere; }
.db-folder { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.db-status { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--ground); color: var(--muted); }
.db-status.on { background: #E5F3EA; color: #1F6B3A; }
.db-status.wait { background: #FFF4DB; color: #7A5300; }
.db-actions { display: flex; gap: 8px; }
.db-note { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.msg-body { display: flex; flex-direction: column; gap: 10px; line-height: 1.6; }
.msg-body p { margin: 0; }
.msg-tip { color: var(--muted); font-size: 13px; }
.msg-steps { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.panel-note { margin: 0; padding: 10px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--rule); }

/* opened as a file: choose the DB folder first */
.folder-steps { display: none; }
.login-card.need-folder .folder-steps { display: flex; flex-direction: column; gap: 10px; }
.login-card.need-folder .fld, .login-card.need-folder #btnLogin { display: none; }
.start-title { margin: 0; font-weight: 600; color: var(--plum-deep); text-align: center; }
.folder-text { margin: 0; color: var(--muted); line-height: 1.55; text-align: center; }
a.btn { text-decoration: none; }

/* ---------- View page: find a student (phones too) ---------- */
.vp { flex: 1; min-height: 0; overflow: auto; }
.vp-wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 12px; }
.vp-search { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.vp-head { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.vp-head h1 { margin: 0; font-size: 22px; color: var(--plum-deep); }
.vp-sub { margin: 0; color: var(--muted); }
.vp-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.vp-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.vp-fld > span { font-size: 12.5px; font-weight: 600; color: var(--plum-deep); }
.vp-fld input { width: 100%; height: 42px; border: 1px solid #C9CDD6; border-radius: var(--radius); padding: 0 12px; background: #fff; font-size: 15px; }
.vp-fld input:focus { outline: 2px solid var(--plum); outline-offset: -1px; border-color: var(--plum); }
.vp-fld input::placeholder { color: #9AA0AC; }
#vpClear { height: 42px; }
.vp-meta { margin: 4px 4px 0; color: var(--muted); }
.vp-meta:empty { display: none; }
.vp-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.vp-start { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 44px 16px; }
.vp-start svg { width: 36px; height: 36px; color: #B9A9D2; }
.vp-start p { margin: 10px auto 0; max-width: 36ch; line-height: 1.6; }
.vp-card { background: var(--panel); border: 1px solid var(--rule); border-top: 3px solid var(--plum); border-radius: 10px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vp-card-head { display: flex; align-items: flex-start; gap: 12px; }
.vp-card-head > div { flex: 1; min-width: 0; }
.vp-card-head h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.vp-card-head p { margin: 4px 0 0; color: var(--muted); display: flex; gap: 4px 14px; flex-wrap: wrap; }
.vp-card-head p small { font-size: 11.5px; }
.vp-card-head bdi { color: var(--ink); font-variant-numeric: tabular-nums; }
.vp-class { flex: none; background: var(--plum-soft); color: var(--plum-deep); font-weight: 700; font-size: 16px; border-radius: 8px; padding: 5px 11px; }
.vp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vp-stat { background: var(--ground); border: 1px solid transparent; border-radius: 8px; padding: 8px 11px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vp-stat span { font-size: 12px; color: var(--muted); }
.vp-stat b { font-size: 21px; font-variant-numeric: tabular-nums; }
.vp-grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.vp-g { border: 1px solid var(--rule); border-radius: 6px; padding: 5px 8px 6px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vp-g span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-g b { font-size: 15px; font-variant-numeric: tabular-nums; }
.vp-g.fail, .vp-stat.fail { background: var(--danger-soft); border-color: #F1C2BC; }
.vp-g.fail b, .vp-stat.fail b { color: var(--danger); }
.vp-g.top, .vp-stat.top { background: var(--laurel-soft); border-color: #C8DCBD; }
.vp-g.top b, .vp-stat.top b { color: var(--laurel); }
.vp-details { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding-top: 10px; border-top: 1px solid var(--rule); }
.vp-details dt { font-size: 11.5px; color: var(--muted); }
.vp-details dd { margin: 1px 0 0; overflow-wrap: anywhere; }

/* viewer: only the View page */
body.is-viewer .tabbar, body.is-viewer .filebar, body.is-viewer #btnSettings { display: none !important; }
body.is-viewer .userchip { margin-inline-start: auto; }

@media (max-width: 700px) {
  .vp-wrap { padding: 12px 10px 32px; gap: 10px; }
  .vp-search { padding: 14px 14px 16px; gap: 12px; }
  .vp-head h1 { font-size: 19px; }
  .vp-fields { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .vp-fld input, #vpClear { height: 46px; font-size: 16px; }
  .vp-results { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .vp-card { padding: 12px 12px 14px; }
  .vp-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar .user-avatar { display: none; }
  .topbar .langs button { padding: 5px 8px; }
}


/* =========================================================================
   Teacher app additions
   ========================================================================= */

/* sheet tables: the band row (column groups), Excel colours, vertical headers */
table.data tr.band th { background: #EDEAF3; color: var(--plum-deep); font-size: 12px; border-bottom: 1px solid var(--rule); border-inline-end: 1px solid #D6D0E2; cursor: default; }
table.data tr.band th.empty { background: #F7F7FA; }
table.data tr.band th.rn { vertical-align: bottom; }
table.data tr.hdr th { border-bottom: 1px solid #C9CDD6; }
table.data.vh tr.hdr th { height: 132px; vertical-align: bottom; padding: 6px 3px; }
table.data.vh tr.hdr th span:first-child { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; max-height: 124px; white-space: normal; text-align: start; line-height: 1.15; }
table.data.vh tr.hdr th .sort { display: block; margin: 2px 0 0; }
table.data th.stick, table.data td.stick { position: sticky; inset-inline-start: 0; z-index: 1; background: #fff; box-shadow: inset -1px 0 0 var(--rule); }
[dir="rtl"] table.data th.stick, [dir="rtl"] table.data td.stick { box-shadow: inset 1px 0 0 var(--rule); }
table.data thead th.stick { background: #F7F7FA; z-index: 4; }
table.data tbody tr:hover td.stick { background: #FAF8FD; }
table.data td.num { font-variant-numeric: tabular-nums; }
table.data td.fx { color: #23324F; }
table.data tr.sum td { background: #EEF0F5; }
table.data tr.sum.total td { background: #E4E7EF; border-top: 2px solid #B9BECB; }
/* the conditional formatting of the Excel sheet */
.cf-ok, table.data td.cf-ok { background: #00B050 !important; color: #fff; font-weight: 600; }
.cf-bad, table.data td.cf-bad { background: #FF0000 !important; color: #fff; font-weight: 600; }
.cf-blue, table.data td.cf-blue { background: #00B0F0 !important; font-weight: 700; }
.cf-yellow, table.data td.cf-yellow { background: #FFEB9C !important; color: #9C6500; }
.cf-green, table.data td.cf-green { background: #C6EFCE !important; color: #006100; }

/* dashboard */
.kpis-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis-8 .kpi:nth-child(5) { border-inline-start: 0; }
.kpis-8 .kpi:nth-child(n+5) { border-top: 1px solid var(--rule); }
.kpi-bad b { color: var(--danger); }
.kpi-ok b { color: var(--laurel); }
.mm-wrap { max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); }
table.data.mm th { cursor: default; }
.mm-actions { margin-top: 10px; }
.ok-line { color: var(--laurel) !important; font-weight: 600; }
.dash-charts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 16px; }
.dash-sec.chart h2 { margin-bottom: 12px; }
.tcard-icon { color: var(--plum); }
.tcard-icon svg { width: 64px; height: 64px; opacity: .55; }

/* Key and Reports pages */
.page { flex: 1; min-height: 0; overflow: auto; }
.page-wrap { max-width: 1320px; margin: 0 auto; padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 18px; }
.page-head h1 { margin: 0; font-size: 22px; color: var(--plum-deep); display: flex; align-items: center; gap: 9px; }
.page-head h1 svg { width: 24px; height: 24px; color: var(--plum); }
.page-head p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.key-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kcard { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kcard-wide { grid-column: 1 / -1; }
.kcard h2 { margin: 0; font-size: 16px; color: var(--plum-deep); }
.kcard h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.kcard p { margin: 0; font-size: 12.5px; }
.kt-wrap { overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
table.data.kt { width: 100%; }
table.data.kt th { cursor: default; white-space: normal; }
table.data.kt td { white-space: normal; }
table.data.kt td.txt { min-width: 140px; }
table.data.kt td.idc { font-weight: 700; color: var(--plum-deep); }
table.data.kv { border: 1px solid var(--rule); border-radius: var(--radius); }
table.data.kv th { text-align: start; width: 38%; background: #F7F7FA; }
table.data td.ed:not(.editing) { background-image: linear-gradient(to top, rgba(74,47,110,.06), rgba(74,47,110,.06)); }
.rcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rcard { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; display: flex; gap: 14px; }
.rnum { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--plum); color: #fff; font-weight: 700; display: grid; place-items: center; }
.rbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rbody h2 { margin: 0; font-size: 16px; color: var(--plum-deep); }
.rbody p { margin: 0; color: var(--muted); line-height: 1.55; }
.ractions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.ractions .btn svg { width: 17px; height: 17px; }
.rcount { font-weight: 600; }
.rcount.bad { color: var(--danger) !important; }
.rcount.ok { color: var(--laurel) !important; }
table.data.rmonth { width: auto; min-width: 260px; }
table.data.rmonth td { min-width: 120px; font-weight: 600; }
.guide { margin: 0; }
.guide a { color: var(--plum); }

/* find a teacher */
.vp-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vp-pct small { font-size: 11.5px; color: var(--muted); }
.vp-pct.fail { background: var(--danger-soft); border-color: #F1C2BC; }
.vp-pct.fail b { color: var(--danger); }
.vp-pct.top { background: var(--laurel-soft); border-color: #C8DCBD; }
.vp-pct.top b { color: var(--laurel); }
.vp-classes h3 { margin: 0 0 6px; font-size: 13px; color: var(--plum-deep); }
.vp-classes p { margin: 0; }
.vp-grade { margin-bottom: 6px; }
.vp-grade h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.vp-class small { font-size: 11px; font-weight: 400; display: block; text-align: center; }

.swatches-6 { grid-template-columns: repeat(6, 1fr); }
body.is-viewer #tabbar { display: none !important; }

@media (max-width: 1100px) {
  .key-grid, .rcards, .dash-charts { grid-template-columns: minmax(0, 1fr); }
  .kpis-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis-8 .kpi:nth-child(odd) { border-inline-start: 0; }
  .kpis-8 .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 700px) {
  .vp-stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-wrap { padding: 12px 10px 32px; }
}

/* Key page: the database card (path and saving) */
.dbcard { border-top: 3px solid var(--plum); }
.db-lines { display: flex; flex-direction: column; gap: 6px; background: var(--ground); border-radius: var(--radius); padding: 10px 12px; }
.db-lines > div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.db-lines > div > span { width: 90px; flex: none; color: var(--muted); font-size: 12.5px; }
.db-lines bdi { overflow-wrap: anywhere; font-size: 13px; }
.db-state.on { color: #1F6B3A; }
.db-state.off { color: #8A5A00; }
.dbfields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dbf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dbf > span { font-size: 12.5px; font-weight: 600; color: var(--plum-deep); }
.dbf input, .dbf select { height: 36px; border: 1px solid #C9CDD6; border-radius: var(--radius); padding: 0 10px; background: #fff; width: 100%; }
.dbf input:focus, .dbf select:focus { outline: 2px solid var(--plum); outline-offset: -1px; }
.dbf small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.msg-code { margin: 0; padding: 8px 10px; background: #1E2230; color: #E8EAF0; border-radius: var(--radius); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 1100px) { .dbfields { grid-template-columns: minmax(0, 1fr); } }

/* teacher report list */
table.data th.act, table.data td.act { width: 1%; cursor: default; }
table.data td.act .btn { height: 26px; padding: 0 8px; }
table.data td.act .btn svg { width: 15px; height: 15px; }


/* dashboard: chart kind, grid of analyses */
.dash-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; }
.dash-tools > span:first-child { color: var(--muted); font-size: 12.5px; }
.dash-tools .btn svg { width: 17px; height: 17px; }
.kseg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: #fff; }
.kseg button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: #fff; padding: 5px 9px; cursor: pointer; font-size: 12px; color: var(--muted); border-inline-end: 1px solid var(--rule); }
.kseg button:last-child { border-inline-end: 0; }
.kseg button svg { width: 16px; height: 16px; stroke: currentColor; }
.kseg button[aria-pressed="true"] { background: var(--plum); color: #fff; }
.chart-head .kseg button span { display: none; }
.chart-head .kseg button { padding: 4px 7px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.chart-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.chart-head h2 { flex: 1; margin: 0 !important; }
svg.chart-svg { display: block; width: 100%; max-width: 100%; height: auto; stroke: none; fill: initial; flex: initial; }
.dash-sec.chart { min-width: 0; }
.chart-empty { color: var(--muted); }
.dlg-dash { width: min(640px, 96vw); }
.dash-dlg-body { display: flex; flex-direction: column; gap: 12px; }
.dp-tools { display: flex; align-items: center; gap: 12px; }
.dp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 10px; }
.dp-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid #F0F1F4; }
.dp-list li:last-child { border-bottom: 0; }
.dp-list select { height: 30px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* one teacher popup (click on a name) */
button.tname { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; border-bottom: 1px dashed currentColor; }
button.tname:hover, button.tname:focus-visible { color: var(--plum); }
table.data td.tlink { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
table.data td.tlink:hover { color: var(--plum); }
.dlg-teacher { width: min(1080px, 97vw); max-height: 94vh; padding: 0; }
.dlg-teacher form { display: flex; flex-direction: column; max-height: 94vh; }
.tdl-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--rule); }
.tdl-title h2 { margin: 0 0 4px; font-size: 21px; }
.tdl-title p { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.tdl-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.tdl-sum > div { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; min-width: 84px; }
.tdl-sum span { display: block; font-size: 11.5px; color: var(--muted); }
.tdl-sum b { font-size: 18px; }
.tdl-sum small { display: block; font-size: 11px; color: var(--muted); }
.tdl-sum > .tdl-bad { background: #FDECEC; border-color: #F3B4B4; }
.tdl-sum > .tdl-bad b { color: #B42318; }
.tdl-sum > .tdl-ok { background: #EAF6EC; border-color: #A9D8B2; }
.tdl-sum > .tdl-ok b { color: #1E6B34; }
.tdl-body { overflow: auto; padding: 10px 20px 14px; flex: 1; }
.tdl-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.tdl-sec { margin-bottom: 14px; }
.tdl-sec h3 { margin: 0 0 8px; font-size: 14px; color: var(--plum); border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.tf-grid-g { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.tf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tf > span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf > span i { font-style: italic; font-weight: 700; color: #8A8FA0; margin-inline-end: 4px; }
.tf input, .tf select, .tf output { height: 32px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 8px; font: inherit; font-size: 13.5px; background: #fff; min-width: 0; width: 100%; box-sizing: border-box; }
.tf output { display: flex; align-items: center; background: #F3F4F7; color: #3C4150; border-style: dashed; overflow: hidden; white-space: nowrap; }
.tf input:focus, .tf select:focus { outline: 2px solid var(--plum); outline-offset: -1px; }
.tf.tf-bad output { background: #FDECEC; color: #B42318; font-weight: 700; }
.tf.tf-ok output { background: #EAF6EC; color: #1E6B34; font-weight: 700; }
.tf.upd output { background: #FFF6C2; border-color: #E4C64A; border-style: solid; }
/* recalculated from the boxes, not saved yet (teacherLive) */
.tf.live output { background: #E6F0FF; border-color: #6F9BE0; border-style: solid; color: #1B4F9C; font-weight: 700; }
.tf.live.tf-bad output { background: #FDECEC; color: #B42318; }
.tf.live.tf-ok output { background: #EAF6EC; color: #1E6B34; }
.tdl-sum b.live, .tdl-sum bdi.live { color: #1B4F9C; }
/* a character that is not a number was refused (numGuard) */
.tf.nonum input, input.nonum { animation: nonum .7s ease-out; }
@keyframes nonum { 0%, 55% { border-color: #D92D20; box-shadow: 0 0 0 3px rgba(217, 45, 32, .22); } 100% { box-shadow: none; } }
.tdl-sum > .tdl-bad b.live { color: #B42318; }
.tdl-sum > .tdl-ok b.live { color: #1E6B34; }
.tdl-sum b.live { text-decoration: underline 2px #6F9BE0; text-underline-offset: 4px; }
.tdl-note { font-size: 12.5px; color: var(--muted); }

/* Data tab: update from Excel, new teacher */
.vtools { display: inline-flex; gap: 6px; margin-inline-start: 8px; vertical-align: middle; }
.vtools .btn svg { width: 15px; height: 15px; }
.dlg-import { width: min(980px, 96vw); max-height: 94vh; }
.dlg-import form { display: flex; flex-direction: column; max-height: 90vh; }
.imp-body { overflow: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.imp-file { display: flex; align-items: center; gap: 6px; margin: 0; }
.imp-file svg { width: 18px; height: 18px; }
.imp-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.imp-stats > div { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; }
.imp-stats b { display: block; font-size: 20px; }
.imp-stats span { font-size: 11.5px; color: var(--muted); }
.imp-stats .hot { border-color: var(--plum); }
.imp-stats .warn { background: #FFF6DB; border-color: #E8C76A; }
.imp-cols { margin: 0; font-size: 13px; }
.imp-cols small { color: var(--muted); }
.imp-note { margin: 0; font-size: 12.5px; background: #FFF6DB; border: 1px solid #E8C76A; border-radius: 6px; padding: 6px 10px; }
.imp-body h3 { margin: 4px 0 0; font-size: 14px; }
.imp-table { max-height: 34vh; overflow: auto; border: 1px solid var(--rule); border-radius: 6px; }
.imp-table table.data { width: 100%; }
.imp-table td.old { color: #8A2B2B; text-decoration: line-through; text-decoration-color: rgba(138,43,43,.4); }
.imp-table td.new { color: #1E6B34; font-weight: 600; }
.imp-body details summary { cursor: pointer; font-size: 13px; }
.imp-body details p { font-size: 12.5px; margin: 6px 0 0; }
.tf.req > span { color: var(--ink); font-weight: 600; }
.tdl-note.bad { color: #B42318; font-weight: 600; }
@media (max-width: 800px) { .imp-stats { grid-template-columns: repeat(3, 1fr); } }

/* dashboard: the parts of the frontal hours (equation), stacked charts, tables */
.fp-sec > p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.fp-eq { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.fp-part { flex: 1 1 110px; min-width: 104px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.fp-part b { font-size: 20px; line-height: 1.2; }
.fp-part span { font-size: 12px; color: var(--ink); }
.fp-part small { font-size: 11px; color: var(--muted); }
.fp-part.fp-total { background: var(--plum); border-color: var(--plum); color: #fff; }
.fp-part.fp-total span, .fp-part.fp-total small { color: #E9E2F3; }
.fp-op { align-self: center; font-size: 20px; font-weight: 700; color: var(--muted); padding: 0 2px; }
.fp-diff { margin: 8px 0 0; color: #B42318; font-size: 12.5px; }
.dash-sec.wide { grid-column: 1 / -1; }
.mx-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--rule); border-radius: 6px; }
table.data.mx { width: 100%; }
table.data.mx td, table.data.mx th { padding: 4px 8px; }
table.data.mx thead th { white-space: normal; min-width: 64px; vertical-align: bottom; }
table.data.mx thead th { position: sticky; top: 0; z-index: 1; }
table.data.mx tfoot td { position: sticky; bottom: 0; background: #F1EEF6; font-weight: 700; }
table.data.mx .mx-tot { font-weight: 700; background: #F6F3FA; }
.mx-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 5px; vertical-align: middle; }
.vp-fp { margin: 10px 0; }
.vp-fp h3 { font-size: 13px; margin: 0 0 6px; }
.vp-fp .fp-part { flex-basis: 90px; min-width: 86px; padding: 6px 8px; }
.vp-fp .fp-part b { font-size: 16px; }
.tdl-fp .fp-part b { font-size: 17px; }

/* "סמל מוסד 248302" after the school name */
.school-num { font-weight: 500; font-size: 0.78em; opacity: 0.85; margin-inline-start: 6px; white-space: nowrap; }

/* a document sheet shown as a page (שלבי חישוב והנחיות משרד החינוך) */
.doc-wrap { max-width: 1040px; }
.doc-bar { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.doc-bar .btn svg { width: 16px; height: 16px; }
.doc { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 22px 28px 26px; }
.doc h1 { margin: 0 0 6px; font-size: 24px; color: var(--plum); background: #EDE7F4; padding: 10px 14px; border-radius: 8px; }
.doc h2 { margin: 22px 0 8px; font-size: 17px; color: var(--plum); border-bottom: 2px solid var(--plum); padding-bottom: 4px; }
.doc p { margin: 6px 0; line-height: 1.6; font-size: 14px; }
.doc p.doc-note { color: var(--muted); font-style: italic; font-size: 13px; }
.doc-tw { overflow-x: auto; margin: 8px 0 4px; }
table.doc-t { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.doc-t th { background: var(--plum); color: #fff; font-weight: 700; padding: 7px 10px; border: 1px solid #C9CCD6; text-align: center; }
table.doc-t td { border: 1px solid #C9CCD6; padding: 6px 10px; vertical-align: top; line-height: 1.5; }
table.doc-t td.num { text-align: center; white-space: nowrap; }
table.doc-t td.no { background: #EDE7F4; font-weight: 700; text-align: center; width: 3em; }
table.doc-t td.res { background: #EAF6EC; color: #1E6B34; font-weight: 700; text-align: center; font-size: 14.5px; }
table.doc-t td.res.flash { animation: docflash 0.9s ease-out; }
@keyframes docflash { from { background: #FFE58A; } to { background: #EAF6EC; } }
table.doc-t td.in { background: #FFF6C2; text-align: center; padding: 3px 6px; }
table.doc-t td.in input { width: 7em; height: 30px; border: 1px solid #E4C64A; border-radius: 6px; text-align: center; font: inherit; font-weight: 700; background: #fff; }
table.doc-t td.code { background: #F3F4F7; }
table.doc-t td.code { direction: ltr; text-align: left; }
table.doc-t td.code code { display: block; direction: ltr; unicode-bidi: isolate; text-align: left; font-family: Consolas, "Courier New", monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.doc-foot { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
@media print { .doc-bar, .doc-foot { display: none !important; } .doc { border: 0; padding: 0; } table.doc-t tr { break-inside: avoid; } }

/* "הגדרות": tabs per user type, order, start page */
.cfg-wrap { max-width: 1100px; }
.cfg-wrap h1 { display: flex; align-items: center; gap: 8px; font-size: 22px; margin: 0 0 6px; }
.cfg-wrap h1 svg { width: 22px; height: 22px; }
.cfg-hint { color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.cfg-tw { overflow-x: auto; background: #fff; border: 1px solid var(--rule); border-radius: 10px; }
table.cfg-t { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.cfg-t th { background: var(--panel); color: var(--ink); font-weight: 700; padding: 9px 8px; border-bottom: 1px solid var(--rule); text-align: center; white-space: nowrap; }
table.cfg-t td { padding: 7px 8px; border-bottom: 1px solid #EEF0F4; vertical-align: middle; }
table.cfg-t tr:last-child td { border-bottom: 0; }
table.cfg-t tbody tr.sortable-ghost { background: #F1EEF6; }
.cfg-grip { cursor: grab; color: var(--muted); font-weight: 700; width: 22px; text-align: center; user-select: none; }
.cfg-order { width: 58px; height: 30px; text-align: center; border: 1px solid var(--rule); border-radius: 6px; font: inherit; }
.cfg-names { min-width: 340px; }
.cfg-id { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.cfg-id svg { width: 16px; height: 16px; }
.cfg-id small { color: var(--muted); font-size: 11.5px; }
.cfg-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.cfg-langs input { height: 28px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 7px; font: inherit; font-size: 12.5px; min-width: 0; }
.cfg-c { text-align: center; }
.cfg-c input { width: 18px; height: 18px; accent-color: var(--plum); cursor: pointer; }
.cfg-c input:disabled { cursor: not-allowed; opacity: 0.6; }
.cfg-note { color: var(--muted); font-size: 12.5px; margin: 10px 0; }
.cfg-actions { display: flex; gap: 8px; justify-content: flex-end; }
table.data.kt tr.kt-default td { color: var(--muted); background: #FAFAFC; font-style: italic; }
table.data.kt tr.kt-default small { font-size: 11px; }
.kt-note { font-size: 12.5px; margin: 8px 0 0; }
@keyframes ktMoved { 0% { background: #FFE58A; } 100% { background: transparent; } }
table.data.kt tr.kt-moved td { animation: ktMoved 1.6s ease-out; }
.vt-warn { margin-inline-start: 8px; font-size: 12px; color: #9a5b00; background: #FFF4DE; border: 1px solid #F3D49A; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tf.bad > span { color: #B42318; }
.tf.bad input, .tf.bad select { border-color: #B42318; background: #FFF5F4; outline: 2px solid #F4B4AE; outline-offset: -1px; }

/* "הגדרות" › users (sheet users): bar, table, switch, popup */
.usr-box { margin-top: 28px; padding-top: 18px; border-top: 2px solid var(--rule); }
.sch-h { font-size: 15px; margin: 18px 0 8px; color: var(--plum); }
body.school-off #userRole { color: #b42318; font-weight: 600; }
.sch-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-bottom: 8px; }
.sch-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.sch-form .sch-wide { grid-column: span 2; }
.sch-form textarea { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font: inherit; resize: vertical; min-height: 34px; }
.sch-form .sch-logo input { height: auto; padding: 6px; }
.sch-form .sch-logo img { max-width: 96px; max-height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; background: #fff; }
.sch-msg { min-height: 14px; font-size: 11.5px; }
.sch-msg.bad { color: #b42318; font-weight: 600; }
.sch-msg.ok { color: #18794e; }
.sch-form input, .sch-form select { height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; font: inherit; color: var(--ink, inherit); background: var(--paper, #fff); }
.usr-box h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; margin: 0 0 6px; color: var(--plum); }
.usr-box h2 svg { width: 21px; height: 21px; stroke: currentColor; }
.usr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.usr-bar .grow { flex: 1; }
.usr-segs { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.usr-segs .seg { border: 0; background: #fff; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.usr-segs .seg + .seg { border-inline-start: 1px solid var(--rule); }
.usr-segs .seg b { display: inline-block; min-width: 18px; margin-inline-start: 4px; padding: 0 5px; border-radius: 9px; background: #EEF0F4; font-size: 11.5px; }
.usr-segs .seg.on { background: var(--plum); color: #fff; }
.usr-segs .seg.on b { background: rgba(255,255,255,.22); color: #fff; }
.usr-admins { font-size: 12.5px; color: var(--muted); }
.usr-q { height: 32px; min-width: 220px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 10px; font: inherit; font-size: 13.5px; }
table.usr-t td { white-space: nowrap; }
table.usr-t td.usr-info { white-space: normal; max-width: 220px; color: var(--muted); font-size: 12.5px; }
table.usr-t td.usr-d { font-size: 12.5px; color: var(--muted); }
table.usr-t tr.usr-off td { background: #FAFAFB; color: #8A8FA0; }
table.usr-t tr.usr-off b { text-decoration: line-through; text-decoration-color: rgba(138,143,160,.6); }
table.usr-t select { height: 30px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 6px; font: inherit; font-size: 13px; background: #fff; }
.usr-me { font-size: 11.5px; color: var(--plum); font-weight: 600; }
.usr-empty { text-align: center; color: var(--muted); padding: 18px !important; }
.usr-act { display: flex; gap: 4px; justify-content: center; }
.usr-act .btn { min-width: 32px; padding: 0 6px; }
.usr-del:not([disabled]):hover { background: #FDECEC; border-color: #F3B4B4; }
.usr-pw { font-size: 12.5px; color: var(--muted); }
.usr-pw-plain { color: #9A6700; }
/* a small on/off switch for the status */
.usr-sw { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.usr-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.usr-sw span { width: 34px; height: 19px; border-radius: 10px; background: #C9CDD6; position: relative; transition: background .15s; flex: none; }
.usr-sw span::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.usr-sw input:checked + span { background: #2E9D5B; }
.usr-sw input:checked + span::after { inset-inline-start: 17px; }
.usr-sw input:disabled + span { opacity: .5; }
.usr-sw input:focus-visible + span { outline: 2px solid var(--plum); outline-offset: 2px; }
.usr-sw em { font-style: normal; font-size: 12.5px; min-width: 48px; text-align: start; }
.dlg-user { width: min(640px, 96vw); }
.dlg-user form { display: flex; flex-direction: column; max-height: 90vh; }
.usr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.usr-pass { display: flex; gap: 4px; }
.usr-pass input { flex: 1; }
/* the password rules under the field: grey until met, then green with a check */
.pw-rules { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.pw-rules[hidden] { display: none; }
.pw-rules > span { display: inline-flex; align-items: center; gap: 5px; }
.pw-rules i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--rule); flex: none; box-sizing: border-box; }
.pw-rules > span.ok { color: var(--laurel); font-weight: 600; }
.pw-rules > span.ok i { border-color: var(--laurel); background: var(--laurel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
.tf.bad .pw-rules > span:not(.ok) { color: var(--danger); }
.tf.bad .pw-rules > span:not(.ok) i { border-color: var(--danger); }
.dlg-user textarea { border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 8px; font: inherit; font-size: 13.5px; resize: vertical; width: 100%; box-sizing: border-box; }
.dlg-user .tf.bad input, .dlg-user .tf.bad select { border-color: #D92D20; background: #FFF5F5; }
.usr-school { height: 32px; border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 8px; font: inherit; font-size: 13px; background: #fff; }
.usr-miss { display: inline-block; padding: 1px 8px; border-radius: 9px; background: #FFF4D6; color: #9A6700; font-size: 12px; font-weight: 600; }
.usr-miss-btn { border: 1px solid #E8C76A; background: #FFF6DB; color: #7A5200; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.usr-miss-btn.on { background: #E8C76A; color: #3D2A00; }

/* "הגדרות" › עיצוב הדוחות: 3 cards with a real sample page each */
.rs-box { margin-top: 28px; padding-top: 18px; border-top: 2px solid var(--rule); }
.rs-box h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; margin: 0 0 6px; color: var(--plum); }
.rs-box h2 svg { width: 21px; height: 21px; stroke: currentColor; }
.rs-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0; }
.rs-card { display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 2px solid var(--rule); border-radius: 12px; background: #fff; cursor: pointer; text-align: start; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rs-card:hover { border-color: #B9A9D3; transform: translateY(-1px); }
.rs-card.on { border-color: var(--plum); box-shadow: 0 0 0 3px rgba(74, 47, 110, .16); }
.rs-thumb { position: relative; overflow: hidden; border-radius: 6px; background: #fff; box-shadow: 0 1px 4px rgba(20, 20, 40, .14); height: 260px; }
.rs-scale { position: absolute; top: 0; inset-inline-start: 0; transform-origin: top right; pointer-events: none; }
[dir="ltr"] .rs-scale { transform-origin: top left; }
.rs-txt { display: flex; flex-direction: column; gap: 3px; }
.rs-txt b { font-size: 15px; }
.rs-txt small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.rs-txt em { font-style: normal; font-size: 12px; color: var(--plum); }
.rs-cur { align-self: flex-start; font-size: 11.5px; font-weight: 600; color: #fff; background: var(--plum); border-radius: 10px; padding: 1px 8px; }
.rs-card.on .rs-txt b { color: var(--plum); }
.rs-actions { align-items: center; flex-wrap: wrap; }
.rs-actions .grow { flex: 1; }
.rs-note { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .rs-cards { grid-template-columns: 1fr; } }
.logo-db-note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- "מחנך כיתה": the classes of the school and their class teachers (js/app.js renderClassesPage) ---------- */
.cls-wrap { max-width: 1320px; gap: 14px; }
.cls-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.cls-head h1 { display: flex; align-items: center; gap: 8px; font-size: 22px; margin: 0; }
.cls-head h1 svg { width: 24px; height: 24px; color: var(--plum); }
.cls-school { margin: 0; color: var(--muted); }
.cls-school b { color: var(--ink); font-weight: 600; }
.cls-wrap .cfg-hint { margin: 0; }
.cls-note { margin: 0; padding: 10px 14px; background: var(--plum-soft); border: 1px solid #DCD2EA; border-radius: 8px; color: var(--plum-deep); line-height: 1.55; }
.cls-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cls-stats > div { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; display: flex; align-items: baseline; gap: 8px; }
.cls-stats b { font-size: 24px; font-weight: 700; color: var(--plum); font-variant-numeric: tabular-nums; }
.cls-stats span { color: var(--muted); font-size: 12.5px; }
.cls-stats .ok b { color: var(--laurel); }
.cls-stats .warn { border-color: #F0C36D; background: #FFF8E6; }
.cls-stats .warn b { color: #9A6700; }
.cls-issues { background: #FFF8E6; border: 1px solid #F0C36D; border-radius: 10px; padding: 10px 16px; }
.cls-issues h3 { margin: 0 0 6px; font-size: 14.5px; color: #7A5200; }
.cls-issues ul { margin: 0; padding-inline-start: 20px; line-height: 1.6; }
.cls-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px; background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 14px; position: sticky; top: 0; z-index: 3; box-shadow: 0 2px 6px rgba(30,34,48,.05); }
.cls-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.cls-add label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.cls-add select, .cls-add input { height: 32px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 8px; font: inherit; color: var(--ink); background: #fff; }
.cls-add input[type=number] { width: 70px; text-align: center; }
.cls-add .btn { height: 32px; }
.cls-prev { margin-inline-start: 4px; padding: 1px 7px; border-radius: 9px; background: var(--plum-soft); color: var(--plum); font-size: 12px; }
.cls-or { color: var(--muted); font-size: 12px; padding-bottom: 8px; }
.cls-save { display: flex; align-items: center; gap: 8px; }
.cls-dirty { font-size: 12.5px; color: var(--muted); }
.cls-dirty.on { color: #9A6700; font-weight: 600; }
.cls-dirty.on::before { content: '● '; }
.cls-main { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.cls-layers { display: flex; flex-direction: column; gap: 14px; }
.cls-layer { background: #fff; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.cls-layer h3 { margin: 0; padding: 9px 14px; background: #EEEBF5; color: var(--plum-deep); font-size: 15px; display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid #DCD2EA; }
.cls-layer h3 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.cls-t { width: 100%; border-collapse: collapse; }
.cls-t th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--rule); background: #FAFAFC; }
.cls-t td { padding: 6px 10px; border-bottom: 1px solid #EEF0F4; vertical-align: middle; }
.cls-t tr:last-child td { border-bottom: 0; }
.cls-t td:nth-child(1) { width: 90px; white-space: nowrap; }
.cls-t td:nth-child(2) { min-width: 240px; }
.cls-t td:nth-child(4) { width: 120px; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.cls-t td:nth-child(5) { width: 44px; text-align: center; }
.cls-nm small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.cls-pill { display: inline-block; min-width: 46px; text-align: center; padding: 3px 9px; border-radius: 12px; background: var(--plum); color: #fff; font-weight: 700; font-size: 13.5px; }
.cls-not .cls-pill { background: #fff; color: var(--plum); box-shadow: inset 0 0 0 1.5px var(--plum); }
.cls-sel { width: 100%; height: 32px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 6px; font: inherit; background: #fff; }
.cls-not .cls-sel { border-color: #F0C36D; background: #FFFBF0; }
.cls-tid { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.cls-info { width: 100%; height: 30px; border: 1px solid transparent; border-radius: 6px; padding: 0 8px; font: inherit; background: transparent; }
.cls-info:hover, .cls-info:focus { border-color: var(--rule); background: #fff; outline: none; }
.cls-upd span { white-space: nowrap; }
.cls-new td { background: #F1F7EE; }
.cls-chg td { background: #FFF6DC; }
.cls-t tr.flash td { animation: clsflash 1.6s ease-out; }
@keyframes clsflash { 0% { background: #CDE6C1; } 100% { background: #F1F7EE; } }
.cls-side { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 12px; position: sticky; top: 70px; max-height: calc(100vh - var(--top-h) - 110px); display: flex; flex-direction: column; gap: 8px; }
.cls-side h3 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--plum); }
.cls-side .usr-segs { align-self: flex-start; }
.cls-side .usr-q { min-width: 0; width: 100%; }
.cls-tl { overflow-y: auto; margin: 0 -4px; }
.cls-tr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid #EEF0F4; }
.cls-tr > div { min-width: 0; }
.cls-tr .link-btn { font-weight: 600; text-align: start; padding: 0; }
.cls-tr small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls-tr.has .cls-sel-s { border-color: var(--plum); color: var(--plum); font-weight: 700; }
.cls-sel-s { width: 78px; flex: none; height: 30px; }
.tf-hr output { background: var(--plum-soft) !important; }
.tf-go { font-size: 12px; padding: 0 3px; text-decoration: none; }
@media (max-width: 1000px) { .cls-main { grid-template-columns: 1fr; } .cls-side { position: static; max-height: none; } .cls-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cls-side > * { flex: none; }
.cls-side > .cls-tl { flex: 1 1 auto; min-height: 120px; }
.cls-side .usr-segs .seg { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.cls-side { top: 84px; }
.cls-info::placeholder { color: #C3C7D0; }
.cls-head { align-items: center; }
.cls-print { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cls-print select { height: 32px; border: 1px solid var(--rule); border-radius: 6px; padding: 0 8px; font: inherit; background: #fff; }
.cls-print .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- small screens (a 14" notebook: about 1280 × 540 px inside the browser) ----------
   the head of a table page (title, filters) and the table scroll together when the screen is short,
   so the table always gets room for its rows; the print panel can be folded to a narrow strip */
.view { overflow-y: auto; }
.table-wrap { min-height: min(440px, calc(100vh - var(--top-h) - 120px)); }
.panel { position: relative; }
.panel-toggle { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 4; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); background: #fff; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 0 1px 3px rgba(30,34,48,.12); }
.panel-toggle svg { width: 16px; height: 16px; stroke: currentColor; }
[dir="rtl"] .panel-toggle svg { transform: scaleX(-1); }
.panel-toggle:hover { color: var(--plum); border-color: var(--plum); }
.panel-open { display: none; }
.layout.panel-min { grid-template-columns: minmax(0, 1fr) 46px; }
.layout.panel-min .panel > *:not(.panel-open) { display: none !important; }
.layout.panel-min .panel-open { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 14px 0; border: 0; background: none; color: var(--plum); cursor: pointer; font: inherit; font-weight: 600; }
.layout.panel-min .panel-open:hover { background: var(--plum-soft); }
.layout.panel-min .panel-open svg { width: 22px; height: 22px; stroke: currentColor; flex: none; }
.layout.panel-min .panel-open span { writing-mode: vertical-rl; white-space: nowrap; }
@media (max-height: 820px) {
  .view { padding: 10px 14px 8px; gap: 8px; }
  .thumb { height: 150px; }
  .thumb-area { padding: 10px 12px; gap: 8px; }
  .page-wrap { padding-top: 14px; }
}
@media (max-width: 1100px) { .panel-toggle, .layout .panel-open { display: none !important; } .table-wrap { min-height: 300px; } }
@media (max-height: 820px) {
  .login { padding: 10px; }
  .login-card { gap: 8px; padding-top: 18px; padding-bottom: 14px; }
  .login-card img { width: 60px; height: 60px; }
  .login-card .fld input { height: 34px; }
}

/* ---------- display size (js/app.js applyUiZoom): the bars, the page and the popups are zoomed together;
   the print preview (#preview) and the measuring box (#measure) are not, so printed pages keep their size ---------- */
body > .login, body > .topbar, body > .tabbar, body > .layout, body > dialog { zoom: var(--ui-z, 1); }
@media print { body > .login, body > .topbar, body > .tabbar, body > .layout, body > dialog { zoom: 1 !important; } }
.zoomsel { display: inline-flex; align-items: center; gap: 4px; color: rgba(255,255,255,.85); }
.zoomsel svg { width: 17px; height: 17px; stroke: currentColor; flex: none; }
.zoomsel select { height: 30px; border-radius: 6px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: #fff; padding: 0 6px; font: inherit; font-size: 12.5px; cursor: pointer; }
.zoomsel select option { color: var(--ink); background: #fff; }
@media (max-width: 1100px) { .zoomsel svg { display: none; } }

/* ---------- school year selector (top bar) + years panel (הגדרות) ---------- */
.yearsel { display: inline-flex; align-items: center; gap: 6px; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); border-radius: 8px; padding: 2px 4px 2px 8px; }
.yearsel svg { width: 17px; height: 17px; stroke: currentColor; flex: none; }
.yearsel-k { font-size: 12px; opacity: .85; white-space: nowrap; }
.yearsel select { height: 28px; border-radius: 6px; border: 0; background: transparent; color: #fff; padding: 0 4px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.yearsel select option { color: var(--ink); background: #fff; font-weight: 400; }
.yearsel.closed { background: rgba(255,196,0,.22); border-color: rgba(255,214,102,.7); }
@media (max-width: 1250px) { .yearsel-k { display: none; } }
.yr-list { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 13.5px; }
.yr-list th, .yr-list td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.yr-list th { font-size: 12px; color: var(--muted); font-weight: 600; }
.yr-list tr.on td { background: #f4effa; }
.yr-list .yr-name b { font-size: 14px; }
.yr-list .yr-name small { display: block; color: var(--muted); }
.yr-tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e8f5e9; color: #1b5e20; }
.yr-tag.closed { background: #fff3e0; color: #8a4b00; }
.yr-tag.cur { background: var(--plum, #4b2e6f); color: #fff; }
.yr-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.yr-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.yr-dlg { width: min(920px, 96vw); }
.yr-dlg .yr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 8px 0; }
.yr-dlg .yr-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.yr-dlg .yr-sum div { background: var(--soft, #f6f4fa); border-radius: 8px; padding: 8px 10px; }
.yr-dlg .yr-sum b { display: block; font-size: 20px; }
.yr-dlg .yr-sum span { font-size: 12px; color: var(--muted); }
.yr-dlg .yr-tl { max-height: 42vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.yr-dlg .yr-tl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.yr-dlg .yr-tl th, .yr-dlg .yr-tl td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: start; }
.yr-dlg .yr-tl th { position: sticky; top: 0; background: #fff; z-index: 1; }
.yr-dlg .yr-tl tr.has td { color: var(--muted); }
.yr-dlg .yr-cols { font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }
.yr-dlg .yr-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 6px 0; }
.yr-dlg .yr-row label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.yr-dlg .yr-row select, .yr-dlg .yr-row input[type=number], .yr-dlg .yr-row input[type=search] { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font: inherit; }
/* the school year shown, on every tab (js/app.js renderYearSel) */
.year-note { zoom: var(--ui-z, 1); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; background: #f1ebf8; color: #3b2459; border-bottom: 1px solid #ddd0ee; padding: 5px 16px; font-size: 13.5px; }
.year-note .yn-k { display: inline-flex; align-items: center; gap: 5px; }
.year-note .yn-k svg { width: 16px; height: 16px; stroke: currentColor; }
.year-note .yn-y { font-size: 15px; }
.year-note .yn-sw { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 10px; color: #6b5a80; }
.year-note .yn-sw .btn { height: 26px; padding: 0 10px; font-size: 12.5px; }
.year-note.other { background: #e8f0fe; color: #1a3a6b; border-bottom-color: #c6d6f5; }
.year-note.closed { background: #fff3d6; color: #6b4400; border-bottom-color: #f0d28a; }
.year-note.closed .yn-y::before { content: '🔒 '; }
.yr-tag.warn { background: #fde8e8; color: #8a1c1c; }
@media print { .year-note { display: none !important; } }
/* copying from another year (teacher window, Teken tab, copy window) */
.tdl-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px; background: #eef4ff; border: 1px solid #cddcf7; }
.tdl-copy b { color: #1a3a6b; }
.tdl-copy select { height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font: inherit; }
.tdl-copy small { color: var(--muted); flex-basis: 100%; }
.tf input::placeholder { color: #a99cc0; font-style: italic; opacity: 1; }
.tf.copied input { background: #eef4ff; border-color: #9db8ec; }
.yr-empty-note { display: inline-block; margin-inline-start: 8px; padding: 2px 10px; border-radius: 10px; background: #fff3d6; color: #6b4400; font-size: 12.5px; }
.yr-dlg .yr-groups { gap: 4px 16px; }
/* "השוואה": the teacher in two years side by side – the same card as "חיפוש מורה"; the parts of both cards share the
   rows of one grid (subgrid), so every part starts at the same height on both sides */
.tdl-ndiff { color: #a5520b; font-size: 12.5px; }
.dlg-ycmp { width: min(1120px, 97vw); max-height: 94vh; padding: 0; }
body > dialog.dlg-ycmp { zoom: calc(var(--ui-z, 1) * .85); }   /* 15% smaller than the other windows */
.dlg-ycmp form { display: flex; flex-direction: column; max-height: 94vh; padding: 0; gap: 0; }
.ycmp-head { display: block; padding: 14px 18px 10px; }
/* the same two columns as the cards: the teacher over the year shown, the year to compare over the other card */
.ycmp-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; align-items: end; }
.ycmp-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; border: 1px solid #DDD0EE; border-radius: 10px; background: #F7F3FB; }
.ycmp-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.ycmp-hint b { color: #8a4b00; font-weight: 600; }
.ycmp-body { flex: 1; overflow: auto; padding: 14px 18px; background: var(--ground); }
.ycmp-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); gap: 12px 14px; align-items: start; }
.ycmp-card { grid-row: span 7; display: grid; grid-template-rows: subgrid; align-content: start; }
.ycmp-card.other { border-top-color: #8C93A3; background: #FBFBFD; }
.ycmp-card .vp-fp { margin: 0; }
.ycmp-yhead { display: flex; align-items: flex-start; gap: 10px; }
.ycmp-yhead > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ycmp-yhead b { font-size: 17px; }
.ycmp-stamp { margin: 0; font-size: 11.5px; color: var(--muted); }
.ycmp-body .vp-stat.cmp-diff, .ycmp-body .vp-g.cmp-diff { border-color: #F0B45A; box-shadow: inset 0 0 0 1px #F0B45A; }
.ycmp-body .vp-g.cmp-diff, .ycmp-body .vp-stat.cmp-diff:not(.top):not(.fail) { background: #FFF5E3; }
.ycmp-body .vp-details > div.cmp-diff { background: #FFF5E3; border-radius: 6px; box-shadow: 0 0 0 4px #FFF5E3; }
.ycmp-body .vp-g.cmp-diff > b, .ycmp-body .vp-stat.cmp-diff:not(.top):not(.fail) > b, .ycmp-body .vp-details > .cmp-diff dd { color: #8A4B00; }
.cmp-d { font-size: 11.5px; font-weight: 700; color: #B45309; font-variant-numeric: tabular-nums; }
.vp-details .cmp-d { margin: 0 8px; }
.vp-stat > .cmp-d, .vp-g > .cmp-d { align-self: flex-start; line-height: 1.2; }
.ycmp-body.only-diff .vp-g.cmp-same, .ycmp-body.only-diff .vp-grade.cmp-same, .ycmp-body.only-diff .vp-details > .cmp-same { display: none; }
.ycmp-foot { flex-wrap: wrap; margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--rule); }
.ycmp-from { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ycmp-from select { font: inherit; font-weight: 600; padding: 5px 8px; border: 1px solid var(--plum); border-radius: var(--radius); background: var(--plum-soft); color: var(--plum-deep); }
.vp-cmp { flex: none; align-self: center; }
@media (max-width: 700px) {
  .ycmp-top { grid-template-columns: minmax(0, 1fr); }
  .ycmp-body { padding: 10px 8px; }
  .ycmp-cards { gap: 10px 8px; }
  .ycmp-card { padding: 10px 9px 12px; }
  .ycmp-card .vp-stat b { font-size: 17px; }
  .ycmp-card .vp-grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ycmp-card .vp-details { grid-template-columns: minmax(0, 1fr); }
}
.tf.cleared input { background: #fff7ed; border-color: #f3c9a0; }
/* מנחה משכורות: one teacher's salary row (click the name) – the field it opens on stands out */
.dlg-sal { width: min(880px, 96vw); }
.tf.sal-main > span { color: var(--plum-deep); font-weight: 700; }
.tf.sal-main input { border-color: var(--plum); box-shadow: 0 0 0 2px var(--plum-soft); font-weight: 700; }

/* הגדרות › מסד הנתונים */
.db-box .db-lines { margin: 4px 0 12px; }
.db-box .db-lines > div > span { width: 130px; }
.db-box .db-lines b[dir="ltr"], .db-box .db-lines span[dir="ltr"] { unicode-bidi: isolate; }

/* the sign-in session: the warning before the sign-out, the admin's list "who is signed in" */
.dlg-idle { width: min(440px, 94vw); }
.dlg-idle .msg-body p { margin: 0 0 6px; line-height: 1.5; }
.idle-count { font-size: 34px; font-weight: 700; text-align: center; color: var(--plum-deep); letter-spacing: 1px; font-variant-numeric: tabular-nums; padding: 6px 0 2px; }
#sessBox h2 { display: flex; align-items: center; gap: 8px; }
#sessBox .sess-refresh { margin-inline-start: auto; }
.sess-t td { vertical-align: top; }

/* the print panel: the preview button and the Excel button side by side */
.thumb-btns { display: flex; gap: 8px; align-items: stretch; }
.thumb-btns #btnPreview { flex: 1; min-width: 0; }
.btn-xls { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; background: #fff; color: #1D6F42; border: 1px solid #1D6F42; font-weight: 700; }
.btn-xls:hover { background: #E8F3EC; }
.btn-xls svg { width: 22px; height: 22px; flex: none; stroke: none; }
.btn-xls[hidden] { display: none; }
