:root {
  /* Calm office tool: muted sage-grey paper, deep teal accent, status carried by pills. Summary first, then the working table. */
  --paper: #f3f5f2;
  --surface: #ffffff;
  --ink: #1d2a2c;
  --muted: #5f6d70;
  --line: #dce2dc;
  --accent: #17666c;
  --accent-soft: #e2efee;
  --weekend: #f7f8f5;
  --st-none-bg: #eceeea; --st-none-fg: #5a6466;
  --st-draft-bg: #fbf0d9; --st-draft-fg: #7a5410;
  --st-sub-bg: #e1ebf8; --st-sub-fg: #1f4f8a;
  --st-ok-bg: #dff1e3; --st-ok-fg: #1e6b34;
  --st-ret-bg: #f8e1e1; --st-ret-fg: #9b2c2c;
  --danger: #b42318;
  --font-display: "Rubik", "Assistant", "Segoe UI", Arial, sans-serif;
  --font-body: "Assistant", "Segoe UI", Arial, sans-serif;
  color-scheme: light only;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .c-total, td.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px 48px; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 18px; }
.demo-pill { font-size: 12px; font-weight: 600; background: var(--st-draft-bg); color: var(--st-draft-fg); padding: 2px 10px; border-radius: 99px; }
.switch { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-inline-start: auto; }
.switch button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.demo-note { font-size: 13px; color: var(--muted); padding: 10px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 9px; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.link { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 2px 0; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.st-none { background: var(--st-none-bg); color: var(--st-none-fg); }
.st-draft { background: var(--st-draft-bg); color: var(--st-draft-fg); }
.st-sub { background: var(--st-sub-bg); color: var(--st-sub-fg); }
.st-ok { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.st-ret { background: var(--st-ret-bg); color: var(--st-ret-fg); }
input[type="text"], input[type="time"], select, textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 5px 7px; min-width: 0; }
input:disabled, select:disabled { background: transparent; border-color: transparent; }
input[type="time"] { width: 100%; max-width: 104px; }

/* employee header */
.emp-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; padding: 18px 20px; margin-top: 16px; align-items: center; }
.emp-head h2 { font-size: 22px; }
.who { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.who select { font-size: 13px; padding: 2px 6px; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav strong { font-family: var(--font-display); font-weight: 600; font-size: 17px; min-width: 120px; text-align: center; }
.stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.saved { font-size: 13px; color: var(--muted); align-self: end; margin-inline-start: auto; }

.banner { margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: 14.5px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.lock { background: var(--st-sub-bg); color: var(--st-sub-fg); }
.banner.ok { background: var(--st-ok-bg); color: var(--st-ok-fg); }
.banner.ret { background: var(--st-ret-bg); color: var(--st-ret-fg); }

.today { margin-top: 12px; padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; border-inline-start: 4px solid var(--accent); }
.today h3 { font-size: 16px; }
.today .segs-inline { display: flex; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.today .actions { display: flex; gap: 8px; margin-inline-start: auto; }

/* month grid */
.sheet { margin-top: 12px; overflow: hidden; }
.sheet-tools { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }
.sheet-tools h3 { font-size: 16px; }
.row { display: grid; grid-template-columns: 74px minmax(210px, 1.5fr) 62px minmax(150px, 1.2fr) minmax(110px, .9fr) minmax(110px, .9fr) minmax(120px, 1fr); gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.row.head { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--paper); position: sticky; top: 0; }
.row.weekend { background: var(--weekend); }
.row.weekend .c-date b { color: var(--muted); }
.row.has-error { box-shadow: inset 3px 0 0 var(--danger); }
.c-date b { font-variant-numeric: tabular-nums; }
.c-date .wd { display: block; font-size: 12.5px; color: var(--muted); }
.seg { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.seg.bad input { border-color: var(--danger); }
.seg .x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }
.c-total { font-weight: 600; padding-top: 6px; }
.c-abs { display: flex; flex-direction: column; gap: 4px; }
.c-sick label { display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.c-sick .file { font-size: 12.5px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.upload { font-size: 12.5px; color: var(--accent); font-weight: 600; cursor: pointer; display: inline-block; margin-top: 4px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.row input[type="text"] { width: 100%; }
.err-text { color: var(--danger); font-size: 12.5px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 16px; flex-wrap: wrap; align-items: center; }

.prev { margin-top: 16px; padding: 14px 20px; }
.prev h3 { font-size: 16px; margin-bottom: 8px; }
.prev ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prev li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

@media (max-width: 860px) {
  .row.head { display: none; }
  .row { grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 14px; }
  .c-date { grid-column: 1 / 2; display: flex; gap: 8px; align-items: baseline; }
  .c-date .wd { display: inline; }
  .c-total { grid-column: 2 / 3; text-align: left; padding-top: 0; }
  .c-segs, .c-abs, .c-sick { grid-column: 1 / -1; }
  .row.no-sick .c-sick { display: none; }
  .c-segs .link { margin-top: -2px; }
  [data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .c-segs[data-label]::before { display: none; }
  .c-total[data-label]::before { display: inline; margin-inline-end: 6px; }
  .row.empty-weekend .c-abs, .row.empty-weekend .c-sick, .row.empty-weekend .c-sub, .row.empty-weekend .c-notes { display: none; }
  .emp-head { grid-template-columns: 1fr; }
  input[type="time"] { max-width: none; }
}

/* admin */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 14px 16px; margin-top: 16px; }
.filters label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); font-weight: 600; gap: 3px; }
.filters select, .filters input { font-size: 14.5px; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tile { text-align: start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.tile b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile .bar { display: block; height: 4px; border-radius: 4px; margin-top: 8px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 9px 12px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list td .acts { display: flex; gap: 6px; flex-wrap: wrap; }
table.list tr:last-child td { border-bottom: 0; }
.reset { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(15, 25, 27, .45); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; width: min(920px, 100%); padding: 20px; display: grid; gap: 14px; }
.modal.narrow { width: min(520px, 100%); }
.modal header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.modal header h2 { font-size: 19px; }
.modal header .close { margin-inline-start: auto; }
.modal textarea { width: 100%; min-height: 80px; }
.modal .row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.preview-box { background: #e9ece8; border-radius: 10px; padding: 16px; overflow: auto; max-height: 60vh; }
.preview-box .pdf-page { margin: 0 auto; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.history { font-size: 13.5px; display: grid; gap: 4px; }
.history div { display: flex; gap: 10px; }
.history time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig-pad { border: 1px dashed var(--line); border-radius: 10px; background: var(--paper); touch-action: none; width: 100%; height: 150px; display: block; }
.summary-list { margin: 0; padding-inline-start: 18px; }
.errors { background: var(--st-ret-bg); color: var(--st-ret-fg); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.toast { position: fixed; bottom: 20px; inset-inline: 0; margin: 0 auto; width: fit-content; max-width: 90vw; background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 80; }

/* A4 report (always light, used for preview, PDF and print) */
.pdf-wrap { width: 794px; }
.pdf-page { width: 794px; height: 1123px; overflow: hidden; background: #fff; color: #1f2a2c; padding: 30px 36px 26px; font-family: "Assistant", Arial, sans-serif; font-size: 11px; direction: rtl; position: relative; display: flex; flex-direction: column; }
.pdf-page.pb { page-break-before: always; }
.pdf-page .r-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 3px solid #1f7480; }
.pdf-page .r-org { display: flex; align-items: center; gap: 10px; }
.pdf-page .r-org img { height: 46px; width: auto; }
.pdf-page .r-org div { display: flex; flex-direction: column; margin-inline-start: 6px; }
.pdf-page .r-org b { font-family: "Rubik", Arial, sans-serif; font-size: 16px; font-weight: 600; }
.pdf-page .r-org span { font-size: 10px; color: #66737a; }
.pdf-page .r-title { text-align: left; }
.pdf-page .r-title div { font-size: 11px; color: #66737a; letter-spacing: .3px; }
.pdf-page .r-title b { font-family: "Rubik", Arial, sans-serif; font-size: 20px; font-weight: 600; color: #1f7480; }
.pdf-page .r-who { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 10px; }
.pdf-page .r-who h1 { font-family: "Rubik", Arial, sans-serif; font-size: 22px; font-weight: 600; margin: 0; }
.pdf-page .r-who span { font-size: 11px; color: #5f6d70; }
.pdf-page .r-status { font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 99px; background: #eceeea; color: #5a6466; }
.pdf-page .r-status.s-approved { background: #dff1e3; color: #1e6b34; }
.pdf-page .r-status.s-submitted { background: #e1ebf8; color: #1f4f8a; }
.pdf-page .r-status.s-returned { background: #f8e1e1; color: #9b2c2c; }
.pdf-page .r-status.s-draft { background: #fbf0d9; color: #7a5410; }
.pdf-page .r-tiles { display: flex; gap: 8px; margin-bottom: 10px; }
.pdf-page .r-tiles div { flex: 1; background: #f1f6f5; border-radius: 8px; padding: 7px 10px; }
.pdf-page .r-tiles span { display: block; font-size: 9.5px; color: #5f6d70; font-weight: 600; }
.pdf-page .r-tiles b { font-family: "Rubik", Arial, sans-serif; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pdf-page .r-tiles div:first-child { background: #1f7480; color: #fff; }
.pdf-page .r-tiles div:first-child span { color: #d6eceb; }
.pdf-page .by-gan { font-size: 10.5px; margin: -2px 0 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pdf-page .by-gan span b { color: #1f7480; }
.pdf-page .r-table { width: 100%; border-collapse: collapse; }
.pdf-page .r-table th { font-size: 9.5px; font-weight: 700; color: #5f6d70; text-align: right; padding: 5px 6px; border-bottom: 1.5px solid #1f7480; background: #f7faf9; }
.pdf-page .r-table td { padding: 3px 6px; border-bottom: 1px solid #e3e8e5; font-size: 10.5px; vertical-align: top; height: 22px; font-variant-numeric: tabular-nums; }
.pdf-page .r-table td.d { white-space: nowrap; }
.pdf-page .r-table td.d b { display: inline-block; min-width: 16px; }
.pdf-page .r-table td.d span { color: #7b878a; font-size: 9.5px; margin-inline-start: 4px; }
.pdf-page .r-table td.t { direction: ltr; text-align: right; white-space: nowrap; }
.pdf-page .r-table td.h { font-weight: 700; }
.pdf-page .r-table td.c { text-align: center; }
.pdf-page .r-table td.nt { font-size: 9.5px; color: #4a5658; }
.pdf-page .r-table tr.sat td { background: #f6f7f5; color: #9aa4a6; height: 15px; padding-block: 1px; font-size: 9px; }
.pdf-page .r-table tr.sat td.d span { color: #9aa4a6; }
.pdf-page .r-table tr.hol td { background: #fdf5f6; }
.pdf-page .w-d { width: 62px; } .pdf-page .w-t { width: 74px; } .pdf-page .w-h { width: 42px; } .pdf-page .w-c { width: 38px; } .pdf-page .w-s { width: 92px; }
.pdf-page .chip { display: inline-block; font-size: 9px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 16px; }
.pdf-page .a-sick { background: #f8e1e1; color: #9b2c2c; }
.pdf-page .a-vac { background: #e1ebf8; color: #1f4f8a; }
.pdf-page .a-oth { background: #fbf0d9; color: #7a5410; }
.pdf-page .a-hol { background: #fbe4e8; color: #9b3a4d; }
.pdf-page .r-foot { display: flex; justify-content: space-between; gap: 30px; margin-top: auto; padding-top: 14px; font-size: 10.5px; }
.pdf-page .sig img { height: 44px; display: block; }
.pdf-page .sig-space { height: 44px; display: flex; align-items: flex-end; padding-bottom: 3px; }
.pdf-page .sig-space.ok { color: #1e6b34; font-weight: 700; }
.pdf-page .sig .line { border-top: 1px solid #b9c2c0; width: 220px; padding-top: 3px; color: #5f6d70; }
.pdf-page .printed { font-size: 8.5px; color: #9aa4a6; margin-top: 8px; text-align: center; }
.pdf-page.dense .r-table td { height: 18px; font-size: 9.6px; padding: 1px 5px; line-height: 1.15; }
.pdf-page.denser .r-table td { height: 15px; font-size: 8.8px; line-height: 1.1; }
.pdf-page.denser .r-tiles b { font-size: 14px; }
.pdf-page.densest .r-table td { height: 13px; font-size: 8px; line-height: 1.05; padding: 0 4px; }
.pdf-page.densest .r-head img { height: 36px; }
#pdf-stage { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; z-index: -1; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .2s ease-out; } @keyframes rise { from { transform: translateY(8px); opacity: 0; } } }

/* ---- real app additions ---- */
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a, .user a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 6px 12px; border-radius: 8px; }
.topbar nav a.active, .user a.active { background: var(--accent-soft); color: var(--accent); }
.topbar nav a:hover, .user a:hover { color: var(--ink); }
.user { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.card.pad, .pad { padding: 18px 20px; }
.card.pad, .card.auth, .narrow-card { margin-top: 16px; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.m0 { margin: 0; }
.between { display: flex; justify-content: space-between; align-items: center; }
.warn { color: var(--danger); }
.grow { flex: 1; }
.auth, .narrow-card { max-width: 440px; margin-inline: auto; padding: 24px; }
.auth h2 { font-size: 21px; margin-bottom: 6px; }
.auth form { display: grid; gap: 6px; margin-top: 14px; }
.auth label { font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.auth input { padding: 9px 11px; font-size: 16px; }
.btn.wide { width: 100%; margin-top: 12px; padding: 11px; font-size: 16px; }
.auth-switch { margin-top: 14px; font-size: 14px; }
.check { display: inline-flex !important; flex-direction: row !important; gap: 6px; align-items: center; font-weight: 500; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid > label { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 600; }
.form-grid input[type="text"], .form-grid input[type="email"], .form-grid select { padding: 8px 10px; font-size: 15px; }
.form-grid .span2 { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0; }
legend { font-weight: 600; font-size: 13.5px; padding: 0 6px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.perm-grid label { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13.5px; }
@media (max-width: 640px) { .form-grid, .perm-grid { grid-template-columns: 1fr; } }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; letter-spacing: 4px; text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 14px; font-weight: 700; }
#code-msg { font-size: 14px; }
tr.inactive td, li.inactive { opacity: .6; }
.ltr-cell { text-align: right; unicode-bidi: plaintext; }
.inline-form { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; padding: 8px 10px; }
.gan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gan-list li { display: flex; gap: 12px; align-items: center; }
.gan-list input[type="text"] { flex: 1; max-width: 360px; padding: 7px 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.toast.error { background: var(--danger); color: #fff; }
.files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.prev .mlabel { min-width: 120px; }
code { background: var(--paper); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 860px) {
  .topbar .wrap { gap: 8px; }
  .user { font-size: 13px; }
}
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surface); border-color: var(--line); margin-top: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.privacy { max-width: 760px; margin: 24px auto; line-height: 1.7; }
.privacy h3 { font-size: 17px; margin-top: 20px; }
.pill.holiday { background: #fbe4e8; color: #9b3a4d; margin-bottom: 4px; }
.row.saturday { background: var(--weekend); padding-block: 6px; }
.row.saturday .c-rest { grid-column: 2 / -1; padding-top: 2px; }
.row.closed { background: #fdf6f7; }
.brand { gap: 8px; }
.brand img { height: 34px; width: auto; }
.wrap-row { flex-wrap: wrap; gap: 10px; }
@media (max-width: 860px) {
  .row.saturday { grid-template-columns: 1fr 1fr; }
  .row.saturday .c-rest { grid-column: 2 / 3; text-align: left; }
  .brand img { height: 26px; }
}

/* header: logos on both sides of the title, tabs on a row below */
.topbar { position: static; }
.topbar .brand-row { display: flex; align-items: center; justify-content: center; gap: 28px; padding-block: 12px 8px; flex-wrap: nowrap; }
.brand-row h1 { font-size: 28px; white-space: nowrap; text-align: center; }
.brand-logo { height: 76px; width: auto; flex: none; }
.nav-row { border-top: 1px solid var(--line); background: var(--surface); }
.topbar .nav-row .wrap { display: flex; align-items: center; gap: 12px; padding-block: 6px; flex-wrap: wrap; }
.nav-row:empty, .nav-row .wrap:has(#nav:empty):has(#user:empty) { display: none; }
@media (max-width: 640px) {
  .topbar .brand-row { gap: 10px; padding-block: 10px 6px; }
  .brand-row h1 { font-size: 18px; }
  .brand-logo { height: 42px; }
  .topbar nav a, .user a { padding: 5px 8px; font-size: 14px; }
}
@media (max-width: 380px) { .brand-row h1 { font-size: 16px; } .brand-logo { height: 34px; } }
.upload-big { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; font-weight: 600; color: var(--accent); cursor: pointer; }
.upload-big:hover { border-color: var(--accent); }
.upload-big input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.imp-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.imp-table { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
tr.bad-row td { background: var(--st-ret-bg); }
table.matrix td.c, table.matrix th { text-align: center; }
table.matrix td:first-child, table.matrix th:first-child { text-align: start; }
table.matrix input { width: 18px; height: 18px; }
.ov-list { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }

/* print */
@page { size: A4; margin: 0; }
@media print {
  .print-body { background: #fff; margin: 0; }
  .print-body .pdf-page { page-break-after: always; box-shadow: none; }
  .print-body .pdf-page:last-child { page-break-after: auto; }
}
.role-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.role-list li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.role-list input[type="text"] { width: 220px; padding: 7px 10px; }
.card.pad + .card.pad { margin-top: 12px; }
.seg-sub { border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-bottom: 6px; }
.seg-sub.bad { border-color: var(--danger); }
.seg-sub .seg { margin-bottom: 4px; }
.seg-where { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-where select, .seg-where input { flex: 1; min-width: 110px; }
.row.sub-mode { grid-template-columns: 74px minmax(320px, 2.6fr) 62px minmax(140px, 1fr); }
.row.sub-mode .c-abs, .row.sub-mode .c-sick, .row.sub-mode .c-sub { display: none; }
@media (max-width: 860px) { .row.sub-mode { grid-template-columns: 1fr 1fr; } }
.pdf-page .r-table .rl { font-size: 8.5px; color: #1f7480; font-weight: 700; direction: rtl; unicode-bidi: isolate; }

/* ---- always light, clean and readable ---- */
html { color-scheme: light only; }
:root { --paper: #f5f7f6; --line: #dfe5e2; --accent: #1f7480; --accent-soft: #e3f1f0; }
.topbar { background: linear-gradient(90deg, #fbe7ec 0%, #fdf5f7 22%, #ffffff 42%, #ffffff 58%, #f2f8f6 78%, #dff0ec 100%); border-bottom: 0; }
.topbar .brand-row { position: relative; }
.brand-row h1 { color: #1d4f56; letter-spacing: .2px; }
.nav-row { border-top: 0; background: #fff; box-shadow: 0 1px 0 var(--line); position: relative; }
.nav-row::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 3px; background: linear-gradient(90deg, #e2849a 0%, #b9cf7a 50%, #3e9aa8 100%); }
.topbar nav a.active { background: var(--accent); color: #fff; }
/* phones: larger, clearer fields */
@media (max-width: 860px) {
  body { font-size: 16px; }
  input[type="text"], input[type="time"], input[type="email"], input[type="password"], select, textarea { font-size: 16px; padding: 9px 10px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
  .card { border-radius: 14px; }
  .row { background: #fff; }
  .row.saturday { background: #f3f5f4; }
  [data-label]::before { font-size: 13px; color: #4f5d60; }
  .c-date b { font-size: 17px; }
}

/* equipment order form */
.ord-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding: 4px 16px 10px; }
.ord-row { display: grid; grid-template-columns: 26px 1fr 120px auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ord-row .n { color: var(--muted); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.ord-row label { font-weight: 500; }
.ord-row input { width: 100%; }
.ord-row.has label, .ord-row.has .n { color: var(--accent); font-weight: 700; }
.ord-row.has input { border-color: var(--accent); background: var(--accent-soft); }
.ord-row.custom { grid-template-columns: 26px 1fr 120px; }
.pad-x { padding-inline: 16px; display: block; }
h3.pad-x { margin: 10px 0 0; font-size: 15px; }
.pad-x textarea { width: 100%; margin-top: 4px; }
@media (max-width: 860px) { .ord-list { grid-template-columns: 1fr; } .ord-row { grid-template-columns: 26px 1fr 110px auto; } }
.prod-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.prod-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prod-list .n { width: 24px; color: var(--muted); font-size: 13px; text-align: center; }
.prod-list input[type="text"] { flex: 1; min-width: 160px; max-width: 320px; padding: 6px 9px; }
.prod-list input.unit, .inline-form input.unit { max-width: 120px; min-width: 90px; flex: none; }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gan-list input[type="text"] + input[type="text"] { max-width: 300px; }
/* order PDF */
.pdf-page .o-table td { height: 24px; font-size: 11.5px; vertical-align: middle; }
.pdf-page .o-table td.n { color: #7b878a; width: 28px; }
.pdf-page .o-table td.q { font-weight: 700; }
.pdf-page .w-n { width: 28px; } .pdf-page .w-q { width: 120px; } .pdf-page .w-k { width: 60px; }
.pdf-page .o-table td.k { text-align: center; }
.pdf-page .box { display: inline-block; width: 15px; height: 15px; border: 1.5px solid #9aa6a8; border-radius: 4px; line-height: 13px; font-size: 11px; font-weight: 700; }
.pdf-page .box.on { border-color: #1e6b34; color: #1e6b34; background: #dff1e3; }
.pdf-page .o-notes { margin-top: 12px; padding: 8px 12px; background: #f7faf9; border-radius: 8px; font-size: 11px; }

/* home dashboard */
.home-hero { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 14px; }
.home-hero h2 { font-size: 26px; color: #1d4f56; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.hcard { padding: 16px 18px; display: grid; gap: 12px; }
.hcard.wide { grid-column: span 2; }
.hcard.tasks { grid-row: span 2; }
.hcard header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hcard h3 { font-size: 16px; }
.hstats { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.hstats div { display: flex; flex-direction: column; }
.hstats b { font-family: var(--font-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hstats b.hl { color: #b25d00; }
.hstats span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.meter { height: 8px; border-radius: 8px; background: #e7ecea; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #3e9aa8, #1f7480); border-radius: 8px; }
.hnote { background: #fff6e8; color: #6b4a0f; border-radius: 9px; padding: 8px 12px; font-size: 14px; }
.hlist { list-style: none; margin: 0; padding: 0; display: grid; }
.hlist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hlist.plain li:first-child { border-top: 0; }
.hlist .acts { display: flex; gap: 6px; }
.task-form { display: flex; gap: 6px; flex-wrap: wrap; }
.task-form input[type="text"] { flex: 1; min-width: 150px; }
.task-form input[type="date"] { width: 150px; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; }
.tlist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.tlist li:first-child { border-top: 0; }
.tlist li .check { flex: 1; font-weight: 500; align-items: flex-start !important; }
.tlist li .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.tlist li.done .check span { text-decoration: line-through; color: var(--muted); }
.tlist li .due { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.tlist li.late .due { color: var(--danger); }
.tlist li.late .check span { color: var(--danger); }
.tlist li .x { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 0 4px; }
.tlist li.empty { border: 0; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hcard.tasks { grid-row: auto; } }
@media (max-width: 680px) { .home-grid { grid-template-columns: 1fr; } .hcard.wide { grid-column: auto; } .home-hero h2 { font-size: 22px; } }
@media (max-width: 860px) {
  .topbar .nav-row .wrap { flex-wrap: nowrap; gap: 6px; }
  .topbar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; flex: 1; min-width: 0; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; flex: none; }
  .user { flex: none; }
  .user a { display: none; }
}

/* ---- home v2 ---- */
.sheet-tools .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-align: start; font: inherit; color: inherit; position: relative; overflow: hidden; }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(31,116,128,.10); }
.kpi::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #3e9aa8, #1f7480); }
.kpi.alert::before { background: linear-gradient(180deg, #f2a43a, #d9822b); }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: #1d2a2c; }
.kpi b small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.kpi.alert em { color: #b25d00; font-weight: 600; }
.ring-kpi { flex-direction: row; align-items: center; gap: 12px; }
.ring { width: 64px; height: 64px; flex: none; }
.sbar { display: flex; gap: 2px; height: 16px; border-radius: 8px; overflow: hidden; background: #eef2f0; }
.sbar i { display: block; min-width: 6px; }
.sbar i:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.sbar i:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: #3c4a4d; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { font-variant-numeric: tabular-nums; }
.sub-h { font-size: 13px; font-weight: 700; color: var(--muted); }
.who-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #e3f1f0, #fbe7ec); color: #1f7480; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cols { width: 100%; height: auto; display: block; }
.cols .col:hover path { filter: brightness(.92); }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(70px, 110px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hb .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb .track { height: 10px; background: #eef2f0; border-radius: 6px; overflow: hidden; }
.hb .track i { display: block; height: 100%; background: linear-gradient(90deg, #6fb3bc, #1f7480); border-radius: 6px; }
[dir="rtl"] .hb .track i { background: linear-gradient(270deg, #6fb3bc, #1f7480); }
.hb b { font-variant-numeric: tabular-nums; font-size: 13px; }
.gan-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gan-status li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.gan-status i { width: 12px; height: 12px; border-radius: 50%; }
.gan-status em { font-style: normal; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cal-list li { display: flex; gap: 12px; align-items: center; }
.cal-list li > span:last-child { display: flex; flex-direction: column; }
.cal { width: 46px; height: 46px; border-radius: 10px; background: #fbe7ec; color: #9b3a4d; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; flex: none; }
.cal b { font-size: 18px; font-family: var(--font-display); }
.cal small { font-size: 11px; font-weight: 600; }
.tlist li.today .due { color: #b25d00; }
.tip { position: fixed; z-index: 90; background: #1d2a2c; color: #fff; font-size: 12.5px; font-weight: 600; padding: 5px 9px; border-radius: 7px; pointer-events: none; white-space: nowrap; }
.skeleton { min-height: 140px; background: linear-gradient(90deg, #f1f4f3, #f8faf9, #f1f4f3); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s infinite; } @keyframes shimmer { to { background-position: -200% 0; } } }
@media (max-width: 680px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 24px; } .ring-kpi { grid-column: 1 / -1; } }
.ring-kpi > div { display: flex; flex-direction: column; gap: 2px; }
.home-grid { grid-auto-flow: dense; }

/* quick clock in/out */
.clock-card { margin: 18px auto 12px; max-width: 560px; background: #fff; border-radius: 22px; padding: 22px 22px 18px; box-shadow: 0 6px 28px rgba(31, 116, 128, .12); border: 1px solid var(--line); display: grid; gap: 14px; text-align: center; }
.clock-head { display: flex; justify-content: space-between; align-items: center; text-align: start; }
.clock-head h2 { font-size: 22px; color: #1d4f56; }
.clock-head p { margin: 2px 0 0; color: var(--muted); }
.clock-time { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: #1f7480; font-variant-numeric: tabular-nums; }
.clock-state { margin: 0; font-size: 17px; color: #3c4a4d; }
.clock-state.on { color: #1e6b34; }
.clock-state.on i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2f9e57; margin-inline-end: 8px; box-shadow: 0 0 0 4px #dff1e3; }
.clock-state.off { color: var(--muted); padding: 18px 0; }
.clock-btn { margin: 6px auto; width: 210px; height: 210px; border-radius: 50%; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-display); box-shadow: 0 10px 26px rgba(0,0,0,.16), inset 0 -6px 0 rgba(0,0,0,.08); transition: transform .1s; }
.clock-btn span { font-size: 40px; font-weight: 600; }
.clock-btn small { font-size: 16px; opacity: .92; font-family: var(--font-body); }
.clock-btn.in { background: radial-gradient(circle at 35% 30%, #4fb0a0, #1f7480 70%); }
.clock-btn.out { background: radial-gradient(circle at 35% 30%, #f0a35e, #d9662b 70%); }
.clock-btn:active { transform: scale(.97); }
.clock-btn:focus-visible { outline: 4px solid #b9cf7a; outline-offset: 4px; }
.clock-extra { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.clock-extra label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: start; min-width: 150px; flex: 1; }
.clock-segs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.clock-segs li { background: var(--accent-soft); color: #1d4f56; border-radius: 99px; padding: 5px 14px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; }
.clock-segs em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 13px; }
.clock-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.install-tip { max-width: 560px; margin: 0 auto; display: grid; gap: 6px; background: #fbfdfc; }
@media (max-width: 480px) { .clock-card { margin-top: 12px; padding: 18px 16px; } .clock-btn { width: 190px; height: 190px; } .clock-time { font-size: 30px; } }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
#join-msg, #code-msg { width: 100%; font-size: 14px; line-height: 1.6; }
