/* נוכחות כולל יום — styles from the approved design canvas. */
:root {
  interpolate-size: allow-keywords;
  --bg: #F4F3EF; --card: #FFFFFF; --ink: #1C1C1A; --muted: #5E5C55; --line: #E2E0D8; --line-soft: #ECEAE3;
  --field: #D6D3C9; --primary: #1F4E8C; --primary-dark: #163A69; --primary-soft: #EEF3FA;
  --ok: #2E7D4F; --ok-soft: #F1F8F3; --print: #1E7A45; --good: #BFE3C9; --danger: #B42318; --danger-soft: #FDECEA;
  --radius: 14px; --font: Assistant, 'Noto Sans Hebrew', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
a { color: var(--primary); } a:hover { color: var(--primary-dark); }
h1 { margin: 2px 0 0; font-size: 36px; font-weight: 800; line-height: 1.1; }
h2 { margin: 0; font-size: 21px; font-weight: 800; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 40px); }
main.wrap { padding-top: 28px; padding-bottom: 48px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.muted { color: var(--muted); } .muted-num { font-weight: 600; color: var(--muted); font-size: 0.75em; }
.eyebrow { font-size: 15px; color: var(--muted); font-weight: 600; }
.strong { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.plain { margin: 0; padding-inline-start: 20px; }

/* buttons and fields */
.btn { height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field); background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-print { background: var(--print); border-color: var(--print); color: #fff; font-weight: 800; font-size: 16px; }
.btn-print:hover { background: #145531; color: #fff; }
.btn-wide { width: 100%; height: 50px; justify-content: center; font-size: 17px; }
.icon-only { width: 44px; padding: 0; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 700; }
.field input[type=text], .field input[type=password], .field input[type=file], input[type=search] {
  height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; }
.field input[type=file] { padding: 9px 12px; }
.hint { font-size: 14px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; }
.alert { border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #CFE7D7; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #F5C9C4; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .82); backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid rgba(0, 0, 0, .07); }
@media (prefers-reduced-transparency: reduce) { .topbar { background: #fff; backdrop-filter: none; } }
.topbar-row { height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { justify-self: start; }
.mainnav { display: flex; gap: 4px; background: rgba(118, 118, 128, .1); padding: 4px; border-radius: 14px; }
.nav-item { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; color: var(--muted);
  font-weight: 700; font-size: 15px; text-decoration: none; transition: background-color .18s ease, color .18s ease, transform .1s ease; }
.nav-item:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.nav-item:active { transform: scale(.96); }
.nav-item { position: relative; isolation: isolate; }
.nav-item.active { color: var(--primary); }
.mainnav { position: relative; isolation: isolate; }
.nav-pill { position: absolute; inset: 0; z-index: -1; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 1px rgba(0, 0, 0, .04); }
/* on click the pill leaves its item and slides to the new one at once (app.js) */
.nav-pill.moving { inset: auto; top: 4px; bottom: 4px; right: auto; left: 0; z-index: 0;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), width .26s cubic-bezier(.2, .8, .2, 1); }
.mainnav .nav-item { z-index: 1; }
.usermenu { justify-self: end; position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 12px; border: 0; border-radius: 22px; background: transparent;
  font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; transition: background-color .18s ease; }
.user-btn:hover, .user-btn[aria-expanded=true] { background: rgba(118, 118, 128, .12); }
.user-btn[aria-expanded=true] .chev { transform: rotate(180deg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(160deg, #3D6DB0, var(--primary)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.avatar.big { width: 44px; height: 44px; font-size: 19px; }
.user-pop { position: absolute; left: 0; top: calc(100% + 8px); width: 240px; background: #fff; border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .05); transform-origin: top left;
  opacity: 0; transform: scale(.96) translateY(-4px); transition: opacity .16s ease, transform .16s cubic-bezier(.2, .8, .2, 1); }
.user-pop.show { opacity: 1; transform: none; }
.user-pop-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.user-pop-head .strong, .user-pop-head .hint { display: block; }
.pop-item { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pop-item:hover { background: var(--bg); }
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.flash-wrap { padding-top: 16px; }
.menu { position: relative; }
.menu-pop { position: absolute; left: 0; top: calc(100% + 6px); min-width: 200px; background: #fff; border-radius: 14px; padding: 6px; z-index: 5;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .05); transform-origin: top left;
  opacity: 0; transform: scale(.96) translateY(-4px); transition: opacity .16s ease, transform .16s cubic-bezier(.2, .8, .2, 1); }
.menu-pop.show { opacity: 1; transform: none; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease; }
.choice:has(input:checked) { border: 2px solid var(--primary); background: var(--primary-soft); padding: 13px 15px; }
.choice input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }
.choice .strong, .choice .hint { display: block; }
@media (max-width: 980px) {
  .user-name, .usermenu .chev, .brand .brand-text { display: none; }
  .brand .brand-mark { display: block; }
  .nav-item { padding: 0 12px; }
}
@media (max-width: 520px) {
  .nav-label { display: none; }
  .topbar-row { grid-template-columns: auto 1fr auto; }
  .mainnav { justify-self: center; }
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; flex: none; display: none; }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.wordmark { display: block; height: 36px; width: auto; }
.wordmark.big { height: 76px; margin: 0 auto; }
.wordmark.small { height: 44px; margin: 0 auto 4px; }
.login-logo { margin: 0; line-height: 0; }
.sheet-title { display: flex; align-items: center; gap: 12px; }
.brand-sub { display: block; font-size: 13px; font-weight: 600; color: var(--muted); padding-inline-start: 2px; }
.credit { text-align: center; font-size: 12.5px; color: #8C8A82; padding: 28px 16px 22px; }
.credit-name { font-weight: 800; color: #1B3A6B; }
.past-banner { background: var(--danger); color: #fff; font-weight: 700; padding: 12px 0; }
.past-banner a { color: #fff; }
.test-banner { background: #FFF1DE; color: #8A4B00; font-weight: 700; padding: 10px 0; font-size: 15px; }
.select { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; }
.field input[type=month] { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-head h1 { font-size: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-left: 52px; }
.icon-btn { position: absolute; left: 2px; top: 1px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.center-link { align-self: center; font-weight: 600; padding: 10px; }

/* month */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { transition: border-color .25s ease, background-color .25s ease; }
.step-mark { transition: background-color .25s ease, color .25s ease; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.step.active { border: 2px solid var(--primary); padding: 13px 15px; }
.step-mark { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #ECEAE3; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.step.done .step-mark { background: var(--ok); color: #fff; }
.step.active .step-mark { background: var(--primary); color: #fff; }
.step-label { display: block; font-weight: 700; }
.step-sub { font-size: 14px; color: var(--muted); }
.strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.facts { display: flex; gap: 32px; flex-wrap: wrap; }
.fact-label { font-size: 14px; color: var(--muted); }
.fact-value { font-weight: 800; font-size: 20px; }
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; }
.list { padding: 0; overflow: hidden; }
.list-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.list-head input[type=search] { width: 220px; height: 44px; }
.counter { font-size: 15px; font-weight: 700; background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 10px; }
.counter.incomplete { background: var(--danger-soft); color: var(--danger); }

.cards-head, .avrech-row { display: grid; grid-template-columns: minmax(230px, 2.2fr) repeat(3, minmax(78px, 1fr)) 104px minmax(130px, 1fr) 160px 36px; gap: 16px; align-items: center; }
.cards-head { padding: 10px 20px; background: #F8F7F3; color: var(--muted); font-size: 14px; font-weight: 700; }

.avrech-row { padding: 8px 20px; cursor: pointer; transition: background-color .15s ease; }
.avrech:not(.open) .avrech-row:hover { background: #FAFAF8; }
.avrech { transition: margin .22s cubic-bezier(.2, .8, .2, 1), border-color .22s ease, box-shadow .22s ease, background-color .22s ease, border-radius .22s ease;
  border: 2px solid transparent; border-top: 1px solid var(--line-soft); }
.avrech.open { background: var(--primary-soft); border: 2px solid var(--primary); border-radius: 12px; margin: 10px 12px;
  box-shadow: 0 6px 20px rgba(31, 78, 140, 0.14); }
.avrech.open + .avrech { border-top-color: transparent; }
.avrech.open .avrech-row { padding: 8px; border-bottom: 1px solid #C9D6EA; }
.avrech.open .who-name { color: var(--primary); font-size: 18px; }
.avrech-toggle { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; font: inherit; color: inherit; cursor: pointer; text-align: right; min-height: 44px; }
.chev { flex: none; color: var(--muted); transition: transform .2s; }
.avrech.open .chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::details-content { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* quick, light feedback on press */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn:active:not(:disabled) { transform: scale(.97); }
.days-input { transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.days-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 78, 140, .15); }
.counter { transition: background-color .3s ease, color .3s ease; }
dialog.modal[open] { animation: modal-in .2s cubic-bezier(.2, .8, .2, 1); }
dialog.modal[open]::backdrop { animation: fade-in .2s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.alert { animation: fade-in .25s ease; }
.who-name { display: block; font-weight: 700; }
.who-phone { display: block; font-size: 14px; color: var(--muted); text-align: right; }
.pct, .calc { font-weight: 700; font-size: 16px; border-radius: 8px; padding: 4px 8px; justify-self: start; }
.calc { width: 56px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.pct { display: inline-flex; flex-direction: column; gap: 4px; min-width: 64px; }
.pbar { display: block; width: 64px; height: 4px; border-radius: 2px; background: #E9E7E0; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 2px; background: #9FB4D3; }
.pbar i.good { background: #3E9B66; }
.pbar i.bad { background: #D9534F; }
.spark { display: inline-flex; }
.spark svg { overflow: visible; }
.spark-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark-base { stroke: #E2E0D8; stroke-width: 1.5; stroke-dasharray: 3 3; }
.spark-dot { fill: #9A978D; }
.spark.up .spark-line { stroke: #2E7D4F; } .spark.up .spark-arrow { fill: #2E7D4F; }
.spark.down .spark-line { stroke: var(--danger); } .spark.down .spark-arrow { fill: var(--danger); }
.spark.flat .spark-line { stroke: #8A877E; } .spark.flat .spark-arrow { fill: #8A877E; }
.fact-pct { min-width: 150px; }
.fact-pct .pbar { width: 120px; margin-top: 6px; height: 5px; }
.delta { font-size: 13px; font-weight: 700; margin-inline-start: 6px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); } .delta.flat { color: var(--muted); }
.pct.good { color: #1E7A45; }
.pct.bad { color: var(--danger); }
.pct-label { display: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.days-input { width: 120px; height: 44px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--field); background: #fff;
  font: inherit; font-size: 18px; font-weight: 700; text-align: center; }
.days-input.done { border-color: var(--ok); background: var(--ok-soft); }
.days-input.saving { border-color: var(--primary); }
.days-input.error { border-color: var(--danger); background: var(--danger-soft); }
.days-input:disabled { background: #F4F3EF; color: var(--muted); }
.input-error { display: block; font-size: 13px; font-weight: 600; color: var(--danger); margin-top: 2px; }
.input-error:empty { display: none; }
.avrech-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .24s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.avrech.open .avrech-more { grid-template-rows: 1fr; opacity: 1; }
.avrech-more-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 0 20px; }
.avrech.open .avrech-more-inner { padding: 16px 8px 14px; }
.avrech[hidden] { display: none; }
.avrech { scroll-margin-top: 84px; }
.calc.alert { color: var(--danger); background: var(--danger-soft); font-weight: 800; }
.calc.zero { color: var(--ok); background: var(--ok-soft); font-weight: 800; }
.stat-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-group { background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05); padding: 12px 14px 6px; }
.stat-group h3 { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.stat-group dl { margin: 0; }
.stat-group dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.stat-group dl > div:first-child { border-top: 0; }
.stat-group dt { font-size: 15px; color: var(--ink); }
.stat-group dd { margin: 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-group .of { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-group .total dt { font-weight: 700; }
.stat-group dd .flag, .stat-group .flag { display: block; flex-basis: 100%; text-align: right; font-size: 12px; font-weight: 700; color: #8A4B00; background: #FFF1DE; padding: 2px 8px; border-radius: 6px; margin-top: 4px; white-space: normal; }
.stat-group dl > div:has(.flag) { flex-wrap: wrap; }
.head-note { display: block; font-size: 11px; font-weight: 600; color: #8A877E; }
.stat-group .total.alert dd { color: var(--danger); }
.stat-group .stay-low dd, .stat-group .stay-low dt { color: var(--danger); }
@media (max-width: 900px) { .stat-groups { grid-template-columns: 1fr; } }
.table-scroll { overflow-x: auto; }
table.reasons { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 760px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table.reasons th { text-align: right; font-size: 13px; color: var(--muted); background: #F8F7F3; padding: 8px 10px; }
table.reasons td { padding: 8px 10px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.bottom-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-danger { color: var(--danger); }

/* dialogs */
dialog.modal { border: 0; padding: 0; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(620px, calc(100vw - 32px)); color: var(--ink); }
dialog.modal::backdrop { background: rgba(28, 28, 26, .45); }
.modal-box { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-box h2 { font-size: 22px; }
.modal-box p { margin: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field input[type=number], .field input[type=email], .field input[type=time], .field input[type=date], .field select {
  height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.cal-w { font-size: 13px; font-weight: 700; color: var(--muted); }
.cal-day { height: 44px; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; border: 0; background: var(--primary); color: #fff; }
.cal-day.k-half { background: #6E8FBF; }
.cal-day.k-chanukah { background: #B8901E; }
.cal-day.k-off, .cal-day:disabled { background: #ECEAE3; color: #9A978D; cursor: default; }
.cal-day[aria-pressed=true] { background: #fff; border: 1px dashed #9A978D; color: var(--muted); text-decoration: line-through; }
.cal-day.out:not(:disabled) { background: #FAFAF8; border: 1px solid #ECEAE3; color: #B5B2A9; text-decoration: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw-study { background: var(--primary); } .sw-half { background: #6E8FBF; } .sw-chanukah { background: #B8901E; } .sw-off { background: #ECEAE3; }
.sw-ex { background: #fff; border: 1px dashed #9A978D; }
.totals { background: var(--primary-soft); border-radius: 12px; padding: 12px 16px; display: flex; gap: 28px; color: var(--primary); }
.totals .fact-label { color: var(--primary); }

/* statistics */
[data-panel][hidden], .select[hidden] { display: none !important; }
.segmented { display: inline-flex; gap: 4px; background: rgba(118, 118, 128, .1); padding: 4px; border-radius: 12px; align-self: flex-start; }
.segmented button { border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 700; color: var(--muted); padding: 0 18px; height: 40px; border-radius: 9px; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.segmented button[aria-selected=true], .segmented button[aria-pressed=true] { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented.small button { height: 36px; font-size: 14px; padding: 0 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-value { font-size: 32px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-trend { font-size: 13px; margin-top: 2px; }
.kpi-trend .delta { margin: 0; }
.chart-card { display: flex; flex-direction: column; gap: 10px; }
.chart-box { position: relative; }
.small-title { font-size: 14px; font-weight: 600; }
.legend-line { display: flex; gap: 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.legend-line span { display: flex; align-items: center; gap: 6px; }
.ln { width: 20px; height: 0; border-top: 3px solid; display: inline-block; }
.ln-a { border-color: #1F4E8C; } .ln-b { border-color: #6E8FBF; border-top-style: dashed; } .ln-h { border-color: #2E7D4F; border-top-style: dotted; }
.toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.tb-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.tb-divider { width: 1px; align-self: stretch; background: var(--line); }
.tb-select { height: 36px; font-weight: 700; }
.alert-box { border: 1px solid #F5C9C4; background: var(--danger-soft); color: #7A1A12; border-radius: var(--radius); padding: 12px 16px; line-height: 1.8; }
.alert-title { font-weight: 800; color: var(--danger); }
.top-box { border: 2px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius); padding: 10px 12px 6px; }
.top-title { font-weight: 800; color: var(--primary); padding: 2px 6px 6px; }
.st-caption { padding: 12px 16px; font-size: 14px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.st-table { overflow-x: auto; }
.st-row { display: grid; grid-template-columns: 40px minmax(220px, 2fr) repeat(6, minmax(84px, 1fr)) 150px; gap: 12px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; min-width: 1040px; font-variant-numeric: tabular-nums; }
.st-row:last-child { border-bottom: 0; }
.st-head { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.st-head small { display: block; font-weight: 600; font-size: 12px; color: #9A978D; }
.st-head .sorted { color: var(--primary); }
.st-row .cell.sorted { font-weight: 800; color: var(--ink); }
.st-row .rank { font-weight: 800; color: #9A978D; }
.st-row.top .rank { color: var(--primary); }
.st-row .nm { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.st-row .cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.st-row.faint { color: #9A978D; }
.out-note { display: block; font-size: 12px; font-weight: 600; color: #9A978D; }
.tag-red { font-size: 11px; font-weight: 800; color: #fff; background: var(--danger); padding: 1px 7px; border-radius: 6px; }
.trend-cell { display: flex; align-items: center; gap: 8px; }
.vs { font-size: 13px; font-weight: 800; white-space: nowrap; }
.vs.better { color: var(--ok); } .vs.worse { color: var(--danger); } .vs.same { color: #9A978D; }
.streak { position: relative; display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.streak svg { display: block; }
.streak path { fill: #178A45; }
.streak-word { position: relative; margin-top: -6px; font-size: 8.5px; font-weight: 800; color: #fff; background: #178A45; padding: 2px 4px 3px; border-radius: 5px; }
.top-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.top-title { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 800; color: var(--ink); padding: 16px 16px 6px; }
.top-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.top-box .st-head { border-bottom: 1px solid var(--line); }
.st-caption { padding: 14px 16px; font-size: 15px; font-weight: 800; border-bottom: 1px solid var(--line); }
[data-table][hidden] { display: none; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* statistics: three tables */
.pair { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pair { grid-template-columns: 1fr; } }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.tcard-title { font-size: 17px; font-weight: 800; }
.tcard-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.tcard-empty { padding: 16px; margin: 0; }
.tt { overflow-x: auto; }
.tr { display: grid; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; font-variant-numeric: tabular-nums; }
.tr:last-child { border-bottom: 0; }
.tr.th { font-size: 12.5px; font-weight: 700; color: var(--muted); background: #F8F7F3; padding-top: 7px; padding-bottom: 7px; }
.tr.th .sorted { color: var(--primary); }
.t-top { grid-template-columns: 30px minmax(170px, 2fr) repeat(3, minmax(60px, .7fr)) minmax(80px, .9fr); }
.t-top .weakest b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: #C9A227; }
.tcard-note { margin: 10px 4px 2px; font-size: 13px; }
[data-top] .tcard { border-color: #BFE3C9; background: #F6FBF7; }
[data-top] .tcard-head { background: #E8F5EC; border-bottom-color: #BFE3C9; }
[data-top] .tcard-title { color: #1E6B3E; }
[data-top] .tr { border-bottom-color: #DDEFE2; }
[data-top] .tr.th { background: #EEF8F1; color: #2E7D4F; }
[data-top] .tr:not(.th):hover { background: #EAF6EE; }
[data-top] .tcard-note { margin: 10px 16px 12px; }
.t-watch { grid-template-columns: 30px minmax(150px, 1.6fr) repeat(5, minmax(72px, 1fr)); min-width: 620px; }
#stats .field label { white-space: nowrap; }
.t-clk { grid-template-columns: minmax(160px, 1.4fr) 90px 110px 110px minmax(100px, 1fr); }
.tr .num { text-align: center; }
.tr .num small { font-size: 12px; color: #8A877E; font-weight: 600; }
.tr .num.sorted { font-weight: 800; }
.tr .red { color: var(--danger); }
.tr .rank { font-weight: 800; color: #9A978D; }
.tr .nm { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.absent-strip > summary { grid-template-columns: 1fr auto; }
.absent-body { background: #fff; padding-bottom: 6px; }
.ab-group { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; font-size: 14px; font-weight: 800; }
.ab-group.sep { border-top: 1px solid var(--line); margin-top: 6px; }
.zero { width: 28px; height: 28px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.t-zero { grid-template-columns: 30px minmax(170px, 1.3fr) minmax(260px, 2.4fr) 120px; }
.t-zero.no-prev { grid-template-columns: 30px minmax(170px, 1.3fr) minmax(260px, 2.4fr); }
.t-low { grid-template-columns: minmax(170px, 1.3fr) 170px 130px 90px 90px minmax(140px, 1fr); }
.nm-link { color: inherit; text-decoration: none; }
.nm-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.absent-strip { scroll-margin-top: 84px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 3px 8px; }
.pill-amber { background: #FFF1DE; color: #8A4B00; } .pill-gray { background: #F1EFE8; color: #5F5E5A; } .pill-red { background: var(--danger-soft); color: var(--danger); }
/* number in a fixed box, bar after it: every bar in the column starts at the same place */
.hbar { display: grid; grid-template-columns: 46px 96px; align-items: center; gap: 8px; }
.hbar b { text-align: right; }
.hbar i { display: block; height: 6px; border-radius: 3px; background: #E9E7E0; overflow: hidden; }
.hbar em { display: block; height: 100%; background: #D9534F; border-radius: 3px; }
.absent-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; background: #fff; }
.absent-item { display: inline-flex; gap: 8px; align-items: center; background: #F4F3EF; border-radius: 8px; padding: 5px 10px; font-size: 14px; }
.absent-item span { color: var(--muted); font-weight: 700; }

/* office grid preview */
.grid-scroll { overflow: auto; max-height: 70vh; }
table.grid { border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid var(--line); text-align: center; min-width: 26px; height: 24px; padding: 0 2px; }
table.grid thead th { position: sticky; top: 0; background: #F8F7F3; z-index: 1; font-weight: 700; }
table.grid .g-name { text-align: right; padding: 4px 10px; min-width: 190px; white-space: nowrap; position: sticky; right: 0; background: #fff; }
table.grid thead .g-name { z-index: 2; background: #F8F7F3; }
table.grid .g-sum { font-size: 17px; font-weight: 800; min-width: 54px; border-left: 2px solid var(--ink); }
table.grid tr.g-first td { border-top: 2px solid #C9C6BC; }
table.grid td.g-x { background: var(--danger-soft); color: var(--danger); font-weight: 800; }
table.grid td.g-off, table.grid th.g-off { background: #F4F3EF; color: #9A978D; }
table.grid td { color: var(--ok); font-weight: 700; }

/* settings: closed cards */
.settings { max-width: 1200px; }
.narrow { max-width: 760px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-group-title { font-size: 14px; font-weight: 700; color: var(--muted); padding: 0 18px; margin-bottom: -12px; }
.set-group { background: var(--card); border-radius: 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .04); overflow: hidden; }
.set-row + .set-row > summary::before { content: ""; position: absolute; top: 0; left: 0; right: 64px; border-top: 1px solid var(--line-soft); }
.set-row > summary { position: relative; list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  gap: 14px; padding: 0 18px; min-height: 60px; transition: background-color .15s ease; -webkit-tap-highlight-color: transparent; }
.set-row > summary::-webkit-details-marker { display: none; }
.set-row > summary:hover { background: #FAFAF8; }
.set-row > summary:active { background: #F0EFEA; }
.set-row > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.set-icon { width: 32px; height: 32px; border-radius: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.set-title { font-size: 17px; font-weight: 700; }
.set-sum { color: var(--muted); font-size: 15px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.set-chev { color: #C4C4C7; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.set-row[open] .set-chev { transform: rotate(-90deg); }
.set-row[open] > summary { background: var(--primary-soft); }
.set-row[open] .set-title { color: var(--primary); }
.set-body { padding: 18px 18px 20px 18px; padding-inline-start: 64px; display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line-soft); }
/* smooth open/close where the browser supports it */
.set-row::details-content { block-size: 0; overflow: clip; transition: block-size .24s cubic-bezier(.2, .8, .2, 1), content-visibility .24s allow-discrete; }
.set-row[open]::details-content { block-size: auto; }
.badge-dev { font-size: 12px; font-weight: 700; background: #FFF1DE; color: #8A4B00; padding: 3px 8px; border-radius: 6px; }
.text-danger { color: var(--danger); font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 16px; }
.fields .field input { width: 100%; }
.field input[type=time] { text-align: right; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 8px; display: flex; justify-content: flex-end; }
.save-bar .btn { height: 50px; padding: 0 28px; font-size: 17px; }
.small-input { width: 130px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--field); font: inherit; }
table.users { min-width: 820px; }
table.users td { vertical-align: middle; }
.add-user { border-top: 1px solid var(--line-soft); padding-top: 16px; gap: 14px; }
.totals.small { padding: 8px 14px; gap: 20px; }
.note-soft { background: var(--primary-soft); color: var(--primary-dark); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.inner-card { border-radius: 14px; background: #F8F7F3; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); overflow: hidden; }
.inner-card > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 16px; min-height: 64px; transition: background-color .15s ease; }
.inner-card > summary::-webkit-details-marker { display: none; }
.inner-card > summary:hover { background: #F1F0EA; }
.inner-card[open] > summary { background: #fff; border-bottom: 1px solid var(--line-soft); }
.inner-card[open] .set-chev { transform: rotate(-90deg); }
.inner-card .set-sub { display: block; font-size: 14px; color: var(--muted); }
.inner-card::details-content { block-size: 0; overflow: clip; transition: block-size .24s cubic-bezier(.2, .8, .2, 1), content-visibility .24s allow-discrete; }
.inner-card[open]::details-content { block-size: auto; }
.inner-card .table-scroll { background: #fff; }
.inner-body { background: #fff; padding: 16px; }
.inner-card .table-scroll { padding: 0 12px 12px; }
table.hol-table { min-width: 680px; }
table.hol-table td { vertical-align: middle; }
.hol-quiet td { color: var(--muted); }
.hol-select { height: 40px; min-width: 190px; font-weight: 700; }
.hol-select.mode-off { color: var(--danger); }
.hol-select.mode-half { color: #3C64A0; }
.hol-select.mode-full { color: var(--ok); }
.zmanim { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.zman { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.zman h3 { margin: 0; font-size: 18px; }
.zman fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.zman legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 6px; }
.zdate { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }
.zdate select { height: 44px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; padding: 0 8px; background: #fff; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.ymonth { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ycal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.yday { height: 38px; border: 0; border-radius: 7px; font: inherit; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; background: var(--primary); color: #fff; cursor: pointer; transition: background-color .18s ease, color .18s ease, transform .1s ease; }
.yday[data-toggle]:active { transform: scale(.92); }
.yday .yd { font-size: 14px; font-weight: 700; }
.yday .yh { font-size: 10px; opacity: .85; margin-top: 2px; }
.yday.k-half { background: #6E8FBF; }
.yday.k-chanukah { background: #B8901E; }
.yday.k-holiday { background: #F6E3C6; color: #7A4A0B; cursor: default; }
.yday.k-weekend { background: #ECEAE3; color: #9A978D; cursor: default; }
.yday.k-out { background: #FAFAF8; color: #B5B2A9; border: 1px solid #ECEAE3; cursor: default; }
.yday.k-excluded { background: #fff; border: 1px dashed #9A978D; color: var(--muted); }
.yday.k-excluded .yd { text-decoration: line-through; }
.sw-holiday { background: #F6E3C6; } .sw-out { background: #FAFAF8; border: 1px solid #ECEAE3; }
@media (max-width: 640px) {
  .set-sum { display: none; }
  .set-row > summary { grid-template-columns: auto 1fr auto; }
  .set-body { padding-inline-start: 18px; }
}

.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

@media (max-width: 1180px) {
  .cards-head, .avrech-row { grid-template-columns: minmax(170px, 1.6fr) repeat(3, minmax(64px, .7fr)) 96px 70px 130px 36px; gap: 10px; }
  .days-input { width: 110px; }
}
@media (max-width: 960px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-head { display: none; }
  /* two lines: name, the four numbers and the trend; then the calculation and the input */
  .avrech-row { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; grid-template-areas: "who who who who menu" "a b h tr tr" "calc calc decide decide decide"; row-gap: 10px; }
  .avrech-row > .row-menu { grid-area: menu; justify-self: end; }
  .avrech-toggle { grid-area: who; }
  .avrech-row > .pct:nth-of-type(1) { grid-area: a; } .avrech-row > .pct:nth-of-type(2) { grid-area: b; } .avrech-row > .pct:nth-of-type(3) { grid-area: h; }
  .avrech-row > .trend { grid-area: tr; }
  .avrech-row > .calc { grid-area: calc; justify-self: start; }
  .avrech-row > .decide { grid-area: decide; justify-self: end; }
  .pct-label { display: block; }
  .calc { width: auto; padding: 4px 10px; gap: 8px; height: auto; }
  .calc .pct-label { display: inline; }
  h1 { font-size: 30px; }
}

/* ---- print (screen-print) ---- */
.screen-print { background: #e9e8e4; }
.print-toolbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; gap: 12px; align-items: center; z-index: 2; }
.sheet { width: 297mm; min-height: 210mm; margin: 16px auto; background: #fff; padding: 9mm 10mm; color: #111; display: flex; flex-direction: column; gap: 3mm; }
.sheet.flow { min-height: 0; }
.sheet.fixed { height: 210mm; overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sheet-sub { font-size: 13px; font-weight: 600; color: #444; }
.sheet h1 { font-size: 26px; }
.boxes { display: flex; gap: 10px; }
.box { border: 2px solid #111; padding: 3px 16px; text-align: center; min-width: 120px; font-size: 13px; font-weight: 600; }
.box strong { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
table.detail, table.reasons-print { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
table.detail th, table.detail td, table.reasons-print th, table.reasons-print td { border: 1px solid #111; }
table.detail th { height: 46px; font-size: 12px; font-weight: 700; line-height: 1.15; background: #EFEFEF; padding: 2px; }
table.detail td { height: 9.3mm; text-align: center; padding: 0 2px; }
table.detail .right { text-align: right; padding: 0 6px; }
table.detail .who { line-height: 1.1; white-space: nowrap; overflow: hidden; }
table.detail .who .strong { font-size: 13.5px; }
table.detail .phone { font-size: 12.5px; color: #333; text-align: right; }
table.detail .box-col { border: 1.5px solid #111; background: #fff; padding: 2px 4px; }
.pen-box { height: 7.4mm; border: 1px solid #777; display: flex; align-items: center; justify-content: center; }
table.detail td.hl { background: var(--good); font-weight: 700; }
table.detail td.days { font-weight: 800; background: #F4F4F4; }
col.c-box { width: 21mm; } col.c-name { width: 42mm; }
table.reasons-print th { background: #EFEFEF; font-size: 12.5px; text-align: right; padding: 3px 5px; }
.clock-bad { color: #B42318; font-weight: 800; }
table.detail td.clock-bad { background: #F4B4AE; color: #7A0F08; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
table.reasons-print td { padding: 2px 5px; font-size: 13px; line-height: 1.15; vertical-align: top; }
.sheet.fixed { padding: 7mm 9mm 6mm; gap: 2mm; }
table.reasons-print .center { text-align: center; }
table.reasons-print .group { break-inside: avoid; }
table.reasons-print .group-head td { background: #E4E4E4; font-weight: 800; font-size: 13.5px; border-top: 2px solid #111; padding: 2px 5px; }
table.reasons-print .cont-note td { text-align: right; font-weight: 800; font-size: 12.5px; background: #F4F4F4; }
table.reasons-print .count { font-weight: 600; font-size: 13px; color: #333; }
col.c-date { width: 20mm; } col.c-seder { width: 14mm; } col.c-kind { width: 25mm; } col.c-other { width: 36mm; } col.c-time { width: 12mm; }
.sheet-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12.5px; color: #333; }

@page { size: A4 landscape; margin: 0; }
@media print {
  .credit { display: none; }
  .no-print { display: none !important; }
  .screen-print { background: #fff; }
  .sheet { margin: 0; width: 297mm; height: 210mm; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sheet:last-of-type { break-after: auto; }
  table.reasons-print thead { display: table-header-group; }
}
@media (max-width: 600px) {
  .t-top { grid-template-columns: 22px minmax(0, 1fr) repeat(3, 46px); column-gap: 6px; }
  .t-top > span:last-child { display: none; }
  .t-top .num b { font-size: 14px; }
}

/* card tags (spec §15): a click shows the rule in a floating note */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-wrap { position: relative; }
.ptag { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.ptag-red { background: #FCE4E2; color: #A32D2D; }
.ptag-amber { background: #FFF1DE; color: #8A4B00; }
.ptag-gray { background: #EFEDE7; color: #4A4945; }
.tag-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: 280px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.55; padding: 10px 12px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.14); }
.h3-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.h3-row h3 { margin: 0; }
.btn.small { min-height: 30px; padding: 2px 12px; font-size: 13px; }

/* punches window */
dialog.punches-modal { width: min(780px, calc(100vw - 24px)); }
.punches-modal .modal-box { max-height: calc(100vh - 48px); overflow-y: auto; }
.pg { display: grid; grid-template-columns: 52px 60px 60px 104px 1fr 60px 60px 104px 104px; column-gap: 6px; align-items: start; }
.ph { position: sticky; top: -22px; background: #fff; padding-top: 4px; z-index: 1; }
.ps { font-size: 14px; font-weight: 800; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.pc { font-size: 12px; color: var(--muted); padding: 8px 0 6px; }
.pr { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.pd { font-size: 13px; color: var(--muted); padding-top: 2px; }
.pv { min-height: 24px; }
.pv.tall { min-height: 42px; }
.pv + .pv { margin-top: 6px; }
.pt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt.bad { color: var(--danger); }
.pt.none { color: #C4C2BA; }
.pn { display: block; font-size: 12px; font-weight: 600; color: var(--danger); line-height: 1.3; }
dialog.punches-modal:focus, dialog.punches-modal:focus-visible { outline: none; }
@media (max-width: 600px) {
  .pg { grid-template-columns: 30px 1fr 1fr 64px 4px 1fr 1fr 64px 46px; column-gap: 3px; }
  .pst .st { min-width: 0; font-size: 10px; padding: 1px 4px; white-space: normal; line-height: 1.15; }
  .p-reason { font-size: 10.5px; padding: 2px 5px; white-space: normal; text-align: center; }
  .pt { font-size: 14px; }
  .pn { font-size: 11px; }
  .punches-modal .modal-box { padding: 16px 14px; }
}
.p-reason { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 700; color: #4A4945; background: #EFEDE7; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 0; cursor: pointer; }
.p-reason:hover { background: #E4E1D8; }
.p-reason svg { transition: transform .2s ease; }
.p-reason[aria-expanded=true] { background: #4A4945; color: #fff; }
.p-reason[aria-expanded=true] svg { transform: rotate(180deg); }
.pday { border-top: 1px solid var(--line-soft); transition: background-color .2s ease; }
.pday .pr { border-top: 0; }
.pday.open { background: #F4F3EF; border-radius: 10px; border-top-color: transparent; margin: 2px -8px; padding: 0 8px 10px; box-shadow: inset 0 0 0 1px #E2E0D9; }
.pday.open + .pday { border-top-color: transparent; }
.rb { border-top: 1px dashed #D4D1C8; padding-top: 10px; }
.rb-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.rb-item + .rb-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid #E2E0D9; }
.rb-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.rb-seder { font-weight: 600; color: var(--muted); }
.rb-fields { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 4px; }
.rf { display: flex; gap: 6px; font-size: 14px; }
.rf-l { color: var(--muted); }
.rf-v { font-weight: 600; }
@media (max-width: 600px) { .p-reason { font-size: 10.5px; padding: 2px 5px; white-space: normal; text-align: center; line-height: 1.2; } }

/* settings: avrechim who do not clock in */
.manual-list { display: grid; gap: 8px; }
.manual-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 44px; gap: 8px; align-items: center; }
.manual-row input { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; min-width: 0; }
.manual-head { font-size: 13px; font-weight: 700; color: var(--muted); }
@media (max-width: 640px) { .manual-row { grid-template-columns: 1fr 1fr 44px; } .manual-row input:nth-of-type(2) { grid-column: 1 / -1; } .manual-head { display: none; } }
.manual-note { margin: 4px 0 14px; }
.h3-actions { display: inline-flex; gap: 6px; }
.btn.small.left-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; color: var(--muted); }
.btn.left-btn:hover { color: var(--danger); }
.btn.left-btn.is-on { color: #fff; background: var(--danger); border-color: var(--danger); }
dialog.left-modal { width: min(400px, calc(100vw - 24px)); }
.left-modal .modal-box { display: grid; gap: 12px; }
.left-modal h2 { margin: 0; }

/* status tags (punches window and personal report) */
.st { display: inline-block; min-width: 84px; text-align: center; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.s-ok { background: #E7F4EC; color: #1E7A45; }
.s-late { background: #FFF6D9; color: #7A5B00; }
.s-late2 { background: #FFF1DE; color: #8A4B00; }
.s-late3, .s-abs { background: #FCE4E2; color: #A32D2D; }
.pst { padding-top: 1px; }
/* ⋮ on a card row */
.row-menu { position: relative; display: flex; justify-content: center; }
.kebab { width: 36px; min-height: 36px; height: 36px; color: var(--muted); }
.kebab:hover, .kebab[aria-expanded=true] { color: var(--ink); background: #EFEDE7; }
.row-pop { left: 0; top: calc(100% + 4px); min-width: 210px; }
.row-pop .pop-item { width: 100%; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; text-align: right; }

/* ---- personal report (one A4 page) ---- */
.screen-report { background: #E9E8E4; }
.rp-toolbar { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; gap: 12px; align-items: center; }
.rp-page { width: 210mm; min-height: 297mm; margin: 16px auto; background: #fff; padding: 9mm 11mm 7mm; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); display: flex; flex-direction: column; color: #1D1D1B; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #1B3A6B; padding-bottom: 6px; }
.rp-org { font-size: 13px; color: #6B6A64; }
.rp-head h1 { margin: 0; font-size: 22px; font-weight: 800; color: #1B3A6B; }
.rp-logo { height: 28px; display: block; }
.rp-who { display: flex; justify-content: space-between; align-items: flex-end; margin: 8px 0 8px; }
.rp-name { font-size: 20px; font-weight: 800; }
.rp-meta { font-size: 14px; color: #6B6A64; margin-top: 2px; }
.rp-period { text-align: left; font-size: 13px; color: #6B6A64; } .rp-period b { color: #1D1D1B; }
.rp-kpis { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 8px; }
.rp-kpi { border: 1px solid #E4E2DC; border-radius: 10px; padding: 6px 10px; }
.rp-kpi .l { font-size: 13px; color: #6B6A64; font-weight: 600; }
.rp-kpi .v { font-size: 22px; font-weight: 800; line-height: 1.1; }
.rp-kpi .sub { font-size: 12px; color: #6B6A64; }
.rp-kpi.main { background: #1B3A6B; border-color: #1B3A6B; color: #fff; }
.rp-kpi.main .l, .rp-kpi.main .sub { color: #C9D6EA; } .rp-kpi.main .v { font-size: 28px; }
.rp-calc { margin-top: 8px; background: #F6F5F1; border-radius: 10px; padding: 8px 12px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; font-size: 13px; }
.rp-page h2 { font-size: 14px; margin: 0 0 4px; font-weight: 800; }
.rp-calc p { margin: 0; line-height: 1.4; }
.rp-calc dl { margin: 0; display: grid; grid-template-columns: 1fr auto; row-gap: 1px; } .rp-calc dd { margin: 0; font-weight: 700; text-align: left; }
.rp-eq { margin-top: 4px; display: grid; row-gap: 1px; } .rp-eq div { display: flex; justify-content: space-between; }
.rp-eq .sum { border-top: 1px solid #D9D6CE; padding-top: 4px; margin-top: 2px; font-weight: 800; }
.rp-note { font-size: 13px; color: #6B6A64; margin-top: 4px !important; }
.rp-days { margin-top: 8px; }
.rp-days-head { display: flex; justify-content: space-between; align-items: baseline; } .rp-legend { font-size: 11.5px; color: #6B6A64; }
.rp-days table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; border: 1px solid #E4E2DC; border-radius: 10px; overflow: hidden; }
.rp-days col.c-day { width: 58px; } .rp-days col.c-t { width: 52px; } .rp-days col.c-st { width: 100px; }
.rp-days thead th { background: #F6F5F1; font-size: 11.5px; color: #6B6A64; font-weight: 700; padding: 3px 5px; text-align: center; }
.rp-days thead tr.g th { background: #1B3A6B; color: #fff; font-size: 12.5px; padding: 4px 5px; }
.rp-days thead tr.g th span { color: #C9D6EA; font-weight: 600; }
.rp-days th.s0, .rp-days td.s0 { border-right: 2px solid #E4E2DC; }
.rp-days thead tr.g th.s0 { border-right-color: #fff; }
.rp-days td { padding: 1px 5px; text-align: center; border-top: 1px solid #F0EEE9; vertical-align: middle; height: 21px; }
.rp-days tbody tr:nth-child(even) td { background: #FCFBF9; }
.rp-days tr.wk td { border-top: 2px solid #D9D6CE; }
.rp-days td.dd { text-align: right; white-space: nowrap; } .rp-days td.dd b { font-size: 13px; margin-left: 5px; } .rp-days td.dd span { font-size: 12px; color: #6B6A64; }
.rp-days td.t { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; line-height: 1.25; }
.rp-days .none { color: #C9C6BE; } .rp-days .miss { color: #A32D2D; font-weight: 800; }
.rp-days td.rs { text-align: right; } .rchip { display: inline-block; font-size: 11px; font-weight: 700; color: #4A4945; background: #EFEDE7; padding: 0 7px; line-height: 1.6; border-radius: 6px; margin: 1px 0 1px 4px; }
.rp-days tr.excused td { background: #F6F5F1 !important; }
.rp-days .st { min-width: 76px; font-size: 10.5px; padding: 0 6px; line-height: 1.6; }
.rp-foot { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: flex-end; font-size: 12px; color: #6B6A64; }
.rp-sign { font-size: 14px; color: #1D1D1B; } .rp-sign span { display: inline-block; width: 160px; border-bottom: 1px solid #1D1D1B; margin-right: 6px; }
@page report { size: A4 portrait; margin: 0; }
.rp-page { page: report; }
@media print {
  .screen-report { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .screen-report .rp-toolbar, .screen-report .credit { display: none; }
  .rp-page { margin: 0; box-shadow: none; min-height: 0; height: auto; }
  .rp-days tr { break-inside: avoid; }
}
.rp-toolbar .btn { order: 2; margin-inline-start: auto; }
/* red confirmation windows (delete a record, send with missing avrechim) */
dialog.danger-modal { width: min(440px, calc(100vw - 24px)); }
.danger-modal .modal-box { border-top: 5px solid #B42318; display: grid; gap: 10px; }
.danger-modal h2 { margin: 0; color: #8A1C12; }
.danger-modal p { margin: 0; line-height: 1.55; }
.danger-icon { width: 48px; height: 48px; border-radius: 50%; background: #FDECEA; color: #B42318; display: grid; place-items: center; }
.danger-note { font-size: 13.5px; color: var(--muted); }
.btn.btn-danger-solid { background: #B42318; border-color: #B42318; color: #fff; font-weight: 700; }
.btn.btn-danger-solid:hover { background: #8F1B12; border-color: #8F1B12; color: #fff; }
.hidden-list { display: grid; gap: 6px; }
.hidden-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.hidden-row .restore-btns { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hidden-row .restore-state { font-size: 13px; font-weight: 700; color: var(--ok, #1F7A3A); }
.sub-title { font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.manual-row.newav-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 44px; }
@media (max-width: 640px) { .manual-row.newav-row { grid-template-columns: 1fr 1fr 44px; } }
.hidden-row.restoring { background: var(--ok-soft); border-color: #BFE3C9; }
.danger-banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px; background: #FDECEA; border: 1px solid #F5C2BC; color: #8A1C12; }
.danger-banner .danger-icon { background: #fff; flex: none; }
.danger-banner a { color: #8A1C12; font-weight: 700; }
.missing-names { margin: 0; padding: 8px 14px; list-style: none; background: #FDF6F5; border-radius: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; font-weight: 600; font-size: 14px; }
.pg .pv { text-align: center; }
.pst { text-align: center; }
.manual-add-row { margin-top: 10px; display: flex; }
.btn.manual-add { width: auto; gap: 8px; }
.ph .pc { text-align: center; } .ph .pc:first-of-type { text-align: right; } .ps { text-align: center; }
.row-pop.up { top: auto; bottom: calc(100% + 4px); transform-origin: bottom left; }
.restore-btn { gap: 6px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px); opacity: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); padding: 12px 14px 12px 18px; border-radius: 14px; background: #1D1D1B; color: #fff; font-size: 15px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25); transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: #7BD69A; flex: none; }
.toast a { color: #A9C8F5; font-weight: 700; }
.toast .btn { background: #fff; color: #1D1D1B; border-color: #fff; flex: none; }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s ease; transform: translate(-50%, 0); } }

/* a new avrech's day before his first clock-in (100%) */
.pnote { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 1.2; }

/* updates: a green dot on the card, a note at the top of every screen */
.upd-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #34C759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .22); margin-inline-end: 7px; vertical-align: middle; }
.text-ok { color: #1F7A3A; font-weight: 700; }
.upd-box { border: 1px solid #BFE3C9; background: var(--ok-soft, #EAF7EE); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; }
.upd-notes { margin: 4px 0 0; font-size: 14px; }
.update-banner { background: #EAF7EE; border-bottom: 1px solid #BFE3C9; color: #1F5F33; font-size: 14px; font-weight: 600; }
.update-banner .wrap { display: flex; align-items: center; gap: 10px; padding-block: 8px; }
.update-banner .btn { margin-inline-start: auto; }
