/* Product-wide foundations. Sheet sizing and paint rules are intentionally separate. */
/* IBM Plex Sans Arabic (SIL Open Font License, fonts/IBM-Plex-Sans-Arabic-OFL.txt), served locally because the
   pages allow no outside sources. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* The institutional identity: deep green for the header and actions, a thin gold line to mark what is chosen or
   key, white surfaces on a quiet grey-green canvas. Gold is never text: it is 3.5:1 on white, enough for lines only.
   Every text pair below is checked at 4.5:1 or better. */
:root {
  --ui-font: "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  --ui-primary: #0b4f3c;
  --ui-primary-hover: #083d2e;
  --ui-primary-soft: #e5efea;
  --ui-tint: #f2f5f3;
  --ui-gold: #a8823f;
  --ui-gold-ink: #7a5a22;
  --ui-gold-soft: #f6efe1;
  --ui-ink: #13221b;
  --ui-ink-2: #2f4038;
  --ui-muted: #56645d;
  --ui-line: #e1e8e4;
  --ui-border: #dde5e1;
  --ui-border-strong: #c9d5cf;
  --ui-border-hover: #7d9287;
  --ui-canvas: #f4f6f5;
  --ui-head: #eef4f1;
  --ui-danger: #b83224;
  --ui-danger-soft: #fbebe8;
  --ui-danger-border: #f0c5be;
  --ui-danger-ink: #9c2a1d;
  --ui-warn: #c58a1c;
  --ui-warn-soft: #fbf1dc;
  --ui-warn-border: #ecd39c;
  --ui-warn-ink: #7d5300;
  --ui-info-soft: #e7eef8;
  --ui-info-border: #c3d4ec;
  --ui-info-ink: #1f4a80;
  --ui-radius: 8px;
  font-family: var(--ui-font);
  font-size: 15px; color: var(--ui-ink); background: var(--ui-canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.75; }
a { color: var(--ui-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:where(a,button,summary,input,select,textarea,[tabindex]):focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 3px; }
.skip-link { position: fixed; inset-inline-start: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: #fff; color: var(--ui-primary-hover); border: 2px solid var(--ui-primary); border-radius: 6px; font-weight: 700; }
.skip-link:focus { top: 12px; }
.site-header { background: #fff; color: var(--ui-ink); min-height: 76px; display: flex; align-items: center; gap: 24px; padding: 14px max(24px,calc((100vw - 1540px)/2)); border-bottom: 1px solid var(--ui-border); }
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: var(--ui-muted); font-size: 12px; }
.brand-mark { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--ui-primary-soft); color: var(--ui-primary); font-size: 24px; font-weight: bold; }
.site-header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-inline-start: auto; }
.site-header nav a,.text-button { color: var(--ui-ink-2); padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px; }
.site-header nav a:hover,.text-button:hover { background: var(--ui-primary-soft); text-decoration: none; }
.logout { margin: 0; }
.text-button { border: 0; background: none; cursor: pointer; min-height: 36px; }
.shell { max-width: 1600px; margin: 0 auto; padding: 32px 28px 72px; min-height: calc(100vh - 135px); min-width: 0; }
.site-footer { text-align: center; color: var(--ui-muted); padding: 18px; font-size: 12px; }
h1,h2,p { margin-top: 0; }
h1 { font-size: clamp(24px,2.2vw,30px); font-weight: 700; line-height: 1.45; margin-bottom: 6px; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 700; line-height: 1.55; margin-bottom: 18px; }
.eyebrow { color: var(--ui-gold-ink); font-size: 12px; font-weight: 600; letter-spacing: normal; margin-bottom: 4px; }
.muted { color: var(--ui-muted); font-size: 14px; }
.page-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-title>div { min-width: 0; }
.page-title p:last-child { margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ui-primary); background: var(--ui-primary); color: #fff; border-radius: 6px; padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px; white-space: nowrap; transition: background-color 120ms,border-color 120ms; }
.button:hover { background: var(--ui-primary-hover); border-color: var(--ui-primary-hover); color: #fff; text-decoration: none; }
.button:active { transform: scale(.98); }
.button.secondary { background: #fff; color: var(--ui-primary); border-color: var(--ui-border-strong); }
.button.secondary:hover { background: var(--ui-tint); border-color: var(--ui-border-hover); }
.button:disabled { opacity: .55; cursor: default; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.stats-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.stats-five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.stat { min-width: 0; background: #fff; border: 1px solid var(--ui-border); border-top: 3px solid var(--ui-primary); border-radius: var(--ui-radius); padding: 16px 18px; }
.stat small { display: block; color: var(--ui-muted); margin-bottom: 4px; font-size: 13px; font-weight: 500; }
.stat strong { font-size: 28px; font-weight: 700; color: var(--ui-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.card { min-width: 0; background: #fff; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); padding: 22px; margin-bottom: 18px; }
.card.narrow { max-width: 640px; }
.login-card { max-width: 460px; margin: 48px auto; padding: 32px; border-top: 3px solid var(--ui-primary); box-shadow: 0 8px 32px #163d2a0a; }
.login-card h1 { font-size: 27px; }
.login-card .muted { line-height: 1.9; }
.login-card form { margin-top: 24px; }
.login-card .button { margin-top: 4px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.section-title h2 { margin-bottom: 16px; }
.section-title strong { color: var(--ui-primary); font-size: 20px; }
.statement-action { margin-bottom: 16px; }
.alert { background: #fff2eb; color: #853b20; padding: 12px 16px; border: 1px solid #efd3bf; border-radius: 6px; }
.report-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.report-grid .card { display: flex; flex-direction: column; align-items: flex-start; }
.report-grid .button { margin-top: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 22px; align-items: end; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label,.inline-form label { min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ui-ink-2); }
.form-grid .full { grid-column: 1/-1; }
input,select,textarea { min-width: 0; width: 100%; min-height: 42px; border: 1px solid var(--ui-border-hover); border-radius: 6px; padding: 9px 12px; background: #fff; color: var(--ui-ink); font: inherit; font-size: 15px; }
input:hover,select:hover,textarea:hover { border-color: var(--ui-border-hover); }
input:focus,select:focus,textarea:focus { outline: 2px solid var(--ui-primary); outline-offset: 1px; border-color: var(--ui-primary); }
input::placeholder,textarea::placeholder { color: var(--ui-muted); opacity: 1; }
input:disabled,select:disabled,textarea:disabled { cursor: default; background: var(--ui-tint); color: var(--ui-muted); }
.form-grid button { align-self: end; }
.due-preview { border: 1px solid #e7d7bd; background: #fff9ef; border-radius: 6px; padding: 10px 14px; color: #805a24; font-size: 13px; align-self: end; min-height: 43px; }
.inline-form { display: flex; align-items: end; gap: 8px; }
.inline-form input { min-width: 170px; }
.filter-bar { flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar>* { min-width: 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; }
.notice { background: var(--ui-primary-soft); color: var(--ui-primary); padding: 12px 16px; border: 1px solid var(--ui-border-strong); border-radius: 6px; margin-bottom: 20px; }
.picker-results { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--ui-border-strong); border-radius: 6px; background: #fff; max-height: 260px; overflow: auto; }
.picker-results[hidden] { display: none; }
.picker-results li { margin: 0; }
.picker-results button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: 14px; color: var(--ui-ink); text-align: start; cursor: pointer; }
.picker-results button:hover,.picker-results button:focus-visible { background: var(--ui-primary-soft); outline: 2px solid var(--ui-border-hover); outline-offset: -2px; }
.picker-results .picker-phone { color: var(--ui-muted); font-size: 13px; direction: ltr; }
.picker-chosen { margin: 8px 0 0; }
.picker-chosen:empty { display: none; }
.picker-chosen strong { color: var(--ui-primary); }
.picker-chosen button { border: 0; background: none; color: var(--ui-primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 4px 8px; min-height: 32px; }
.status-new,.status-done { color: var(--ui-primary); font-weight: 700; }
.status-skip { color: var(--ui-muted); }
.status-error { color: #914528; font-weight: 700; }
td.wrap { white-space: normal; min-width: 220px; }
td.custom { white-space: normal; min-width: 200px; overflow-wrap: anywhere; }
td.custom span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.columns-note { margin: 12px 0 0; font-size: 13px; }
.new-customer { margin-top: 10px; }
.new-customer summary { cursor: pointer; color: var(--ui-primary); font-weight: 700; font-size: 14px; min-height: 36px; padding: 5px 0; }
.new-customer .form-grid { margin-top: 12px; }
.table-wrap { overflow: auto; max-height: min(72vh,760px); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { text-align: start; position: sticky; top: 0; z-index: 2; background: var(--ui-head); color: var(--ui-primary); font-weight: 600; border-bottom: 2px solid var(--ui-gold); }
th,td { padding: 9px 12px; line-height: 1.6; border-bottom: 1px solid var(--ui-line); border-inline-start: 1px solid var(--ui-line); }
td { background: #fff; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td:not(.state) { background: var(--ui-tint); }
.empty { text-align: center; color: var(--ui-muted); padding: 30px; }
.facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin: 0; }
.facts dt { color: var(--ui-muted); font-size: 13px; }
.facts dd { margin: 4px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.notes { margin: 20px 0 0; white-space: pre-wrap; }
.notes:empty { display: none; }
@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; gap: 12px; }
  .site-header nav { order: 3; width: 100%; margin: 0; overflow-x: auto; flex-wrap: nowrap; }
  .site-header nav a { white-space: nowrap; }
  .logout { margin-inline-start: auto; }
  .stats,.stats-five { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .shell { padding: 24px 14px 60px; }
  .site-header { padding: 12px 14px; }
  .page-title { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-title .form-actions { flex-wrap: wrap; }
  .button { min-height: 44px; padding: 8px 12px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 24px; }
  .card { padding: 18px; }
  .form-grid,.facts { grid-template-columns: 1fr; }
  .inline-form { width: 100%; flex-wrap: wrap; }
  .inline-form label { flex: 1 1 135px; }
  .inline-form input { min-width: 0; }
  input,select,textarea { font-size: 16px; }
  .login-card { margin: 24px auto; padding: 24px; }
  .section-title { align-items: flex-start; flex-direction: column; gap: 0; }
  /* Wide tables on a phone: the first column (the name or number) stays in view while the rest scrolls under it. */
  :is(.table-wrap, .master-scroll) > table :is(th, td):first-child { position: sticky; inset-inline-start: 0; z-index: 1; border-inline-end: 2px solid var(--ui-border); }
  :is(.table-wrap, .master-scroll) > table td:first-child { background: #fff; }
  :is(.table-wrap, .master-scroll) > table th:first-child { z-index: 3; }
}
/* Touch screens: links and buttons inside table rows get a finger-sized target. */
@media (pointer: coarse) {
  td :is(a, button, .button) { display: inline-flex; align-items: center; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
@media print { .skip-link { display: none; } .site-header { background: #fff; color: var(--ui-ink); border: 0; } }
.signature-field{display:flex;flex-direction:column;gap:8px;grid-column:1/-1;align-items:flex-start}.signature-pad{width:100%;max-width:480px;aspect-ratio:8/3;border:2px dashed var(--ui-border-hover);border-radius:10px;background:#fff;touch-action:none;cursor:crosshair}.signature-img{max-width:100%;height:auto;border:1px solid var(--ui-line);border-radius:10px;background:#fff}.signature-error{color:#a3321f;font-weight:600}
th:first-child,td:first-child{position:sticky;inset-inline-start:0;z-index:1;border-inline-start:0;border-inline-end:1px solid var(--ui-border-strong)}th:nth-child(2),td:nth-child(2){border-inline-start:0}thead th:first-child,tfoot td:first-child{z-index:3}th.num,td.num{text-align:end}tfoot td{position:sticky;bottom:0;z-index:2;background:var(--ui-tint);color:var(--ui-ink);font-weight:700;border-top:2px solid var(--ui-border-strong);border-bottom:0}td.state-late{background:#fbe9e3;color:#8a2f12}td.state-out{background:#e6eef9;color:#1d4a80}td.state-done{background:var(--ui-primary-soft);color:var(--ui-primary)}td.state-hold{background:#fbf0d9;color:#6e4a07}td.state-off{background:var(--ui-tint);color:var(--ui-muted)}@media(max-width:650px){th,td{padding:6px 9px}.table-wrap{max-height:none}}@page voucher{size:A4 portrait;margin:12mm}@media print{body:has(.voucher-sheet){page:voucher}.signatures{break-inside:avoid;margin-top:40px}td.custom{min-width:0}td.custom span{display:inline}.table-wrap{max-height:none;overflow:visible;border:0}th,tfoot td,th:first-child,td:first-child{position:static}}
.th-cell{display:flex;align-items:center;gap:4px}th.num .th-cell{justify-content:flex-end}a.sort{color:inherit;display:inline-flex;align-items:center;gap:4px}a.sort:focus-visible,.filter-btn:focus-visible{outline:2px solid var(--ui-primary);outline-offset:2px;border-radius:3px}.sort-mark{font-size:10px;color:var(--ui-primary)}.filter-btn{display:inline-grid;place-items:center;width:24px;height:24px;padding:0;border:1px solid var(--ui-border-hover);border-radius:4px;background:#fff;color:var(--ui-ink);font:inherit;font-size:11px;line-height:1;cursor:pointer}.filter-btn:hover{background:var(--ui-line)}.filter-btn.active{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}.filter-pop{width:min(280px,calc(100vw - 24px));padding:16px;border:1px solid var(--ui-border-strong);border-radius:8px;background:#fff;color:var(--ui-ink);box-shadow:0 12px 32px #0e3c3033;font-size:14px;font-weight:400;white-space:normal;text-align:start}.filter-title{font-weight:700;margin-bottom:12px}.filter-pop .form-grid{margin-bottom:14px}.filter-summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:-6px 0 14px;font-size:13px;color:var(--ui-muted)}.filter-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:2px 10px;border-radius:999px;background:#e6eef9;color:#1d4a80;font-weight:700}.filter-chip:hover{text-decoration:none;background:#d5e2f4}@media print{.filter-btn,.filter-chip span,.filter-summary>a:not(.filter-chip){display:none}.filter-chip{background:none;padding:0}}th{white-space:normal;padding-inline:8px}.filter-btn{flex-shrink:0}
.map-row{display:flex;flex-wrap:wrap;gap:8px;align-items:end}.map-row label{flex:1 1 220px;min-width:0;display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;color:var(--ui-ink-2)}.map-row .button{white-space:nowrap}.map-field small{display:block;margin-top:6px;font-size:13px}.map-form{margin-top:20px}p.contact{margin:16px 0 0;font-weight:700}td.contact{white-space:nowrap}
.cell-note{display:block;font-size:12px;color:var(--ui-muted)}.period-links{margin:-6px 0 14px;font-size:13px;color:var(--ui-muted)}.period-links a{font-weight:700}.period-note{margin:-4px 0 14px;font-size:13px}
.compare-bars{display:grid;gap:10px;margin:16px 0}.compare-bar{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,2fr) auto;gap:12px;align-items:center;font-size:13px}.compare-bar meter{width:100%;height:14px}.compare-bar b{font-size:16px;color:var(--ui-primary);min-width:3ch;text-align:end}td.delta-good{color:var(--ui-primary);font-weight:700}td.delta-bad{color:#8a2f12;font-weight:700}td.delta-same{color:var(--ui-muted)}.report-heading{margin:28px 0 4px}.compare-form{margin-bottom:12px}@media(max-width:650px){.compare-bar{grid-template-columns:minmax(0,1fr) auto}.compare-bar span{grid-column:1/-1}}@media print{.site-header nav,.site-header>a,.site-header form,.site-footer,.columns-note,.page-title .form-actions,.section-title .form-actions,.filter-bar,.period-links,.compare-form,.pager,.report-heading,.report-heading+.muted,.report-grid{display:none}.card{box-shadow:none;border:0;padding:0}body,.shell{background:#fff}.page-title p.muted{display:none}table{white-space:normal;font-size:11px}th,td{padding:4px 6px}}@page{size:A4 landscape;margin:12mm}
.paint-1,tbody tr td.paint-1,tbody tr:hover td.paint-1{--paint-background:#cdeed6;--paint-foreground:#12391f;background:var(--paint-background);color:var(--paint-foreground)}.paint-2,tbody tr td.paint-2,tbody tr:hover td.paint-2{--paint-background:#e4f0b8;--paint-foreground:#2f3a08;background:var(--paint-background);color:var(--paint-foreground)}.paint-3,tbody tr td.paint-3,tbody tr:hover td.paint-3{--paint-background:#fbefa6;--paint-foreground:#3d3200;background:var(--paint-background);color:var(--paint-foreground)}.paint-4,tbody tr td.paint-4,tbody tr:hover td.paint-4{--paint-background:#fcdcaa;--paint-foreground:#4a2c00;background:var(--paint-background);color:var(--paint-foreground)}.paint-5,tbody tr td.paint-5,tbody tr:hover td.paint-5{--paint-background:#fcd0b8;--paint-foreground:#5a2208;background:var(--paint-background);color:var(--paint-foreground)}.paint-6,tbody tr td.paint-6,tbody tr:hover td.paint-6{--paint-background:#f8c9c9;--paint-foreground:#6a1414;background:var(--paint-background);color:var(--paint-foreground)}.paint-7,tbody tr td.paint-7,tbody tr:hover td.paint-7{--paint-background:#f6cde3;--paint-foreground:#5e1338;background:var(--paint-background);color:var(--paint-foreground)}.paint-8,tbody tr td.paint-8,tbody tr:hover td.paint-8{--paint-background:#ded3f6;--paint-foreground:#34205f;background:var(--paint-background);color:var(--paint-foreground)}.paint-9,tbody tr td.paint-9,tbody tr:hover td.paint-9{--paint-background:#cddff9;--paint-foreground:#14335f;background:var(--paint-background);color:var(--paint-foreground)}.paint-10,tbody tr td.paint-10,tbody tr:hover td.paint-10{--paint-background:#c8eef2;--paint-foreground:#0c3d44;background:var(--paint-background);color:var(--paint-foreground)}td[class*="paint-"] a{color:inherit;text-decoration:underline}.paint-fab{min-height:44px;padding:8px 16px;border:1px solid var(--ui-primary);border-radius:5px;background:var(--ui-primary);color:#fff;font:inherit;font-size:14px;font-weight:700;cursor:pointer;touch-action:manipulation}.paint-fab:hover{background:var(--ui-primary)}.paint-fab:focus-visible{outline:2px solid #e0a75b;outline-offset:2px}.paint-panel{width:min(540px,100%);margin-block:0 12px;margin-inline-start:auto;padding:12px;border:1px solid var(--ui-border-strong);border-radius:6px;background:var(--ui-tint);color:var(--ui-ink);font-size:14px}.paint-panel[hidden],.paint-panel[popover]{display:none}.paint-panel fieldset{border:0;padding:0;margin:0 0 14px;min-width:0}.paint-panel legend{padding:0;margin-bottom:8px;font-size:13px;font-weight:700;color:var(--ui-ink-2)}.swatches{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.swatch{position:relative;display:flex;align-items:center;justify-content:center;min-height:40px;border:1px solid #18342f1f;border-radius:8px;font-size:12px;cursor:pointer}.swatch input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}.swatch:has(input:checked){outline:3px solid var(--ui-ink);outline-offset:1px;font-weight:700}.swatch:has(input:focus-visible){outline:3px solid #e0a75b;outline-offset:1px}.paint-modes input,.paint-auto input{flex-shrink:0;width:18px;height:18px;min-height:0;margin:0;padding:0;accent-color:var(--ui-primary)}.swatch input{width:100%;height:100%;min-height:0}.paint-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.paint-modes label{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border:1px solid var(--ui-border-strong);border-radius:8px;cursor:pointer}.paint-modes label:has(input:checked){border-color:var(--ui-primary);background:var(--ui-primary-soft);font-weight:700}.paint-auto{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer}.paint-hint{min-height:2.6em;margin:10px 0;font-size:13px;color:var(--ui-muted)}.paint-saved-title{margin:12px 0 6px;font-size:13px;font-weight:700}.paint-list{display:grid;gap:2px;margin:0 0 12px;padding:0;list-style:none}.paint-list li{min-width:0;display:flex;align-items:center;gap:8px;font-size:12px}.paint-list .dot{flex-shrink:0;width:14px;height:14px;border-radius:4px}.paint-list .text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paint-list button{min-width:32px;min-height:32px;border:0;border-radius:6px;background:none;color:#8a2f12;font:inherit;cursor:pointer}.paint-list button:hover{background:#fbe9e3}.paint-list button:focus-visible{outline:2px solid var(--ui-primary)}.paint-list .empty-note{color:var(--ui-muted)}.paint-panel [hidden],.paint-fab[hidden]{display:none}body.painting main tbody td{cursor:crosshair}body.painting main tbody td:hover{outline:2px dashed var(--ui-ink);outline-offset:-2px}@media print{.paint-fab,.paint-panel{display:none}td[class*="paint-"]{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
.bulk-grid td{padding:4px 6px;vertical-align:middle}.bulk-grid input,.bulk-grid select{min-width:120px;min-height:38px;padding:6px 9px}.bulk-grid td:nth-child(2) input,.bulk-grid td:nth-child(7) input{min-width:160px}.bulk-grid tr.row-error td{background:#fbe9e3}.bulk-grid input[aria-invalid=true]{border-color:#a3321f;outline:1px solid #a3321f}.bulk-grid td.bulk-note{min-width:160px;white-space:normal;color:#8a2f12;font-weight:700}.bulk-form .form-actions{margin-top:16px}
.table-wrap+form.form-actions{margin-top:16px}.signatures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;margin-top:72px}.signatures p{margin:0;padding-top:8px;border-top:1px solid var(--ui-border-hover);text-align:center;font-size:13px;color:var(--ui-ink-2)}
.page-title .form-actions{align-items:flex-end}
.table-paint-tools { display: flex; justify-content: flex-end; margin-block: 8px; }
/* An operation's page: its actions are a row of buttons that each open their form in place, and its records sit
   collapsed under «السجل», so the page starts with the operation itself. */
.rental-action-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.rental-action > summary, .rental-record > summary { list-style: none; }
.rental-action > summary::-webkit-details-marker, .rental-record > summary::-webkit-details-marker { display: none; }
.rental-action[open] { flex-basis: 100%; }
.rental-action[open] > summary { background: var(--ui-primary-soft); border-color: var(--ui-primary); }
.rental-action > .fold-body { margin-top: 10px; padding: 16px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius); background: #fff; }
.rental-action > .fold-body > .muted:first-child { margin-top: 0; }
.rental-history .rental-record { border-top: 1px solid var(--ui-line); }
.rental-record > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--ui-primary); }
.rental-record > summary::before { content: "◂"; display: inline-block; margin-inline-end: 8px; transition: transform .15s; }
.rental-record[open] > summary::before { transform: rotate(-90deg); }
.rental-record > .fold-body { padding-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .rental-record > summary::before { transition: none; } }
/* An empty notice under a picker takes no line, so the inputs beside it stay level. */
.form-grid > label > small.muted:empty { display: none; }
/* A customer's tabs stand apart from the buttons above them. */
.form-actions + nav.form-actions { margin-block-start: 14px; padding-block-start: 10px; border-block-start: 1px solid var(--ui-line); }
/* On narrow screens, keep primary register actions visible while folding secondary tools. */
.phone-tools-toggle { display: none; }
@media (max-width: 650px) {
  .phone-tools-toggle { display: inline-flex; }
  .tools-folded body:not(.table-only) .register-toolbar:has(> [data-register="save"]) >
    :not([data-register="save"], [data-register="add"], [data-register="void"], .register-width-toggle, .phone-tools-toggle),
  .tools-folded body:not(.table-only) :is(.register-page-title > .form-actions, .register-filters,
    .register-context:not(.register-told), .register-context > strong, .register-value-bar, #register-cell-lock, .register-format-panel, .sheet-size-shortcut),
  .tools-folded :is(.pickup-page > .page-title > .form-actions, .pickup-page > p.screen-only, .pickup-page > p.muted, .pickup-filters,
    .pickup-page .sheet-navigation, .pickup-page .sheet-tools, .pickup-page .table-tools) { display: none !important; }
}
.table-only-root .phone-tools-toggle { display: none; }
/* A step that asks before an action that cannot be taken back with one tap (a pickup): it opens under its button. */
.confirm-step > summary { list-style: none; }
.confirm-step > summary::-webkit-details-marker { display: none; }
.confirm-step form { display: grid; gap: 10px; margin-top: 8px; padding: 12px; max-width: 360px; border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius); background: #fff; white-space: normal; }
.confirm-step form p { margin: 0; }
/* Users page: each row's login edit and removal open in place under their button. */
.user-actions { align-items: flex-start; }
.user-actions > details > summary { list-style: none; }
.user-actions > details > summary::-webkit-details-marker { display: none; }
.user-actions > details[open] { flex-basis: 100%; }
.user-login-forms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.user-remove form { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--ui-danger-border); border-radius: var(--ui-radius); background: var(--ui-danger-soft); white-space: normal; }
.user-remove p { margin: 0 0 8px; color: var(--ui-danger-ink); }
.button.danger { background: var(--ui-danger); border-color: var(--ui-danger); color: #fff; }
.role-powers-title { margin: 24px 0 8px; font-size: 16px; }
/* An explanation, not a data table: kept out of .table-wrap so it gets no coloring or size tools. */
.role-powers { border: 1px solid var(--ui-border); border-radius: var(--ui-radius); overflow: hidden; background: #fff; }
.role-powers table { white-space: normal; }
.role-powers th { position: static; width: 7em; border-bottom: 1px solid var(--ui-line); }
.role-powers-note { margin: 8px 0 0; font-size: 13px; }
/* One row above a table: «تلوين» (first table) and «حجم الجدول», the same size, their panels opening below. */
.table-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-block: 8px;
  padding: 6px 10px; background: var(--toolbar-bg); border: 1px solid var(--ui-border-strong); border-radius: 8px; }
/* Each user picks the shade of the tools above the tables from the ten coloring colors («لون شريط الأدوات»). */
body { --toolbar-bg: var(--ui-primary-soft); }
body[data-toolbar="1"] { --toolbar-bg: #cdeed6; } body[data-toolbar="2"] { --toolbar-bg: #e4f0b8; }
body[data-toolbar="3"] { --toolbar-bg: #fbefa6; } body[data-toolbar="4"] { --toolbar-bg: #fcdcaa; }
body[data-toolbar="5"] { --toolbar-bg: #fcd0b8; } body[data-toolbar="6"] { --toolbar-bg: #f8c9c9; }
body[data-toolbar="7"] { --toolbar-bg: #f6cde3; } body[data-toolbar="8"] { --toolbar-bg: #ded3f6; }
body[data-toolbar="9"] { --toolbar-bg: #cddff9; } body[data-toolbar="10"] { --toolbar-bg: #c8eef2; }
.paint-toolbar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.paint-toolbar legend { float: inline-start; margin: 0; padding: 0; font-size: 13px; font-weight: 700; color: var(--ui-ink-2); }
.toolbar-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.toolbar-swatch { position: relative; width: 30px; height: 30px; border: 1px solid #18342f33; border-radius: 6px; cursor: pointer; }
.toolbar-swatch.toolbar-default { background: var(--ui-primary-soft); }
.toolbar-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.toolbar-swatch span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.toolbar-swatch:has(input:checked) { outline: 3px solid var(--ui-ink); outline-offset: 1px; }
.toolbar-swatch:has(input:focus-visible) { outline: 3px solid #e0a75b; outline-offset: 1px; }
.table-tools > .paint-panel { flex: 1 0 100%; order: 2; }
.table-tools > :is(.paint-fab, .table-size-open) { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.operation-suggestions { position: fixed; z-index: 60; overflow: auto; overscroll-behavior: contain; padding: 5px; border: 1px solid var(--ui-border-strong); border-radius: 8px; background: #fff; color: var(--ui-ink); box-shadow: 0 6px 22px #123e3529; font-size: 14px; }
.operation-suggestions[hidden],.operation-suggestions p:empty,.form-grid .operation-choice-original[hidden] { display: none; }
.operation-suggestions p { margin: 5px; }
.operation-suggestions [role="option"] { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; width: 100%; min-height: 40px; padding: 6px 8px; background: #fff; border: 0; border-radius: 4px; text-align: start; color: inherit; font: inherit; cursor: pointer; }
.operation-suggestions [role="option"]:is(:hover,[aria-selected="true"]) { background: var(--ui-primary-soft); }
.operation-suggestions [aria-disabled="true"] { color: var(--ui-muted); cursor: default; }
.operation-suggestions small { font-size: 12px; }
.operation-suggestions .operation-held small { color: #8a5a00; font-weight: 700; }
[data-table-font="system"] { --table-font-family: var(--ui-font); }
[data-table-font="tahoma"] { --table-font-family: Tahoma, Arial, sans-serif; }
[data-table-font="arial"] { --table-font-family: Arial, Tahoma, sans-serif; }
[data-table-font="times"] { --table-font-family: "Times New Roman", Tahoma, Arial, sans-serif; }
[data-table-font="segoe"] { --table-font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
[data-table-font="microsoft"] { --table-font-family: "Microsoft Sans Serif", Tahoma, Arial, sans-serif; }
[data-table-font="traditional"] { --table-font-family: "Traditional Arabic", Tahoma, Arial, serif; }
[data-table-font="simplified"] { --table-font-family: "Simplified Arabic", Tahoma, Arial, serif; }
[data-table-font="majalla"] { --table-font-family: "Sakkal Majalla", Tahoma, Arial, sans-serif; }
[data-table-font="courier"] { --table-font-family: "Courier New", Tahoma, monospace; }
.painting .table-paint-tools {
  position: sticky;
  inset-block-start: var(--paint-header-offset, 0px);
  scroll-margin-block-start: var(--paint-header-offset, 0px);
  z-index: 8;
  padding: 4px 8px;
  background: var(--ui-tint);
  border: 1px solid var(--ui-border-strong);
  border-radius: 6px;
}
.paint-head { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; }
.paint-head[hidden] { display: none; }
.paint-custom, th.paint-custom, tbody tr td.paint-custom, tbody tr:hover td.paint-custom {
  background: var(--paint-background);
  color: var(--paint-foreground);
}
.paint-panel .swatches { grid-template-columns: repeat(auto-fit,minmax(54px,1fr)); }
.paint-choice { min-width: 28px; min-height: 28px; border: 1px solid var(--ui-muted); border-radius: 4px; cursor: pointer; }
.paint-panel .swatches .paint-choice { min-height: 40px; }
.paint-choice:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.paint-extra { display: grid; gap: 8px; margin-block: 8px; }
.paint-custom-entry, .paint-recents, .paint-recents > div, .paint-column-options {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
}
.paint-extra [hidden], .paint-column-options[hidden] { display: none; }
.paint-custom-entry label, .paint-column-options label { display: flex; align-items: center; gap: 6px; }
.paint-custom-entry input { width: 112px; min-height: 36px; padding: 4px 6px; }
.paint-column-options { min-inline-size: 0; font-size: 13px; }
.paint-column-options input { width: 17px; min-height: 17px; padding: 0; margin: 0; accent-color: var(--ui-primary); }
.paint-column-options legend { font-weight: 700; }
@media print{body:has(.staff-statement) main>:not(.staff-statement):not(.page-title){display:none}}
.card form.form-grid+.table-wrap{margin-top:24px}
@media print{[data-print]{display:none}}
.payroll-form h3{margin:24px 0 8px;font-size:1rem}.payroll-form .bulk-grid select{min-width:9rem}.pads{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:16px;margin-top:8px}.pad{display:flex;flex-direction:column;gap:6px;align-items:flex-start;min-width:0}.pad>span{font-weight:600;color:var(--ui-ink-2)}.pad .signature-pad{max-width:100%}.pad img,.pad-blank{width:100%;max-width:280px;aspect-ratio:14/5;border-bottom:1px solid var(--ui-border-hover)}.pad img{height:auto;object-fit:contain}.pads.signed{margin-top:40px;break-inside:avoid}.payroll-total{margin:20px 0 4px;font-size:1.15rem;font-weight:700;color:var(--ui-ink)}.payroll-total.negative{color:#a3321f}.voucher-sheet .notes{margin-top:16px;white-space:pre-line}
@media print{.screen-only{display:none}.pads.signed{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Text for screen readers only (the search label, the register's keyboard hint). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* A quiet tool, not a primary action: it must not outrank the page's own buttons. */
.paint-fab { background: #fff; color: var(--ui-primary); }
.paint-fab:hover { background: var(--ui-tint); }
.status-pill { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--ui-border-strong); background: var(--ui-primary-soft); color: var(--ui-primary); }
.status-pill.status-late { background: var(--ui-danger-soft); border-color: var(--ui-danger-border); color: var(--ui-danger-ink); }
.status-pill.status-off { background: var(--ui-danger-soft); border-color: var(--ui-danger-border); color: var(--ui-danger-ink); }
.status-pill.status-done { background: var(--ui-tint); border-color: var(--ui-border-strong); color: var(--ui-muted); }
.status-pill.status-warn { background: var(--ui-warn-soft); border-color: var(--ui-warn-border); color: var(--ui-warn-ink); }

/* Section navigation inside stock and ledger pages: buttons, like the rest of the system, not dotted text links. */
.inventory-document > p.no-print:first-child, .ledger-document nav.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 0 14px; font-size: 0; }
.inventory-document > p.no-print:first-child a, .ledger-document nav.actions a { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border: 1px solid var(--ui-border-strong); border-radius: 6px; background: #fff; color: var(--ui-primary); font-size: 14px; font-weight: 600; text-decoration: none; }
.inventory-document > p.no-print:first-child a:hover, .ledger-document nav.actions a:hover { background: var(--ui-tint); }

/* Tiles. Every tile is white with a coloured line on top: green by default, gold for the key tile of a row, amber
   for a caution and red for what needs action (which also takes a pale red fill). Numbers stay dark and readable. */
:root {
  --tile-key: var(--ui-gold);
  --tile-alert: var(--ui-danger);
  --tile-warn-bg: var(--ui-warn-soft);
  --tile-warn-border: var(--ui-warn-border);
  --tile-warn-ink: var(--ui-warn-ink);
  --tile-info-bg: var(--ui-info-soft);
  --tile-info-border: var(--ui-info-border);
  --tile-info-ink: var(--ui-info-ink);
  --tile-ok-bg: var(--ui-primary-soft);
  --tile-ok-border: var(--ui-border-strong);
}
.stat.stat-key, .stats:not(:has(.stat-key)) > .stat:first-child:not(.warning, .stat-alert) { border-top-color: var(--ui-gold); }
.stat.stat-key strong, .stats:not(:has(.stat-key)) > .stat:first-child:not(.warning, .stat-alert) strong { color: var(--ui-primary); }
.stat.warning { border-top-color: var(--ui-warn); }
.stat.warning strong { color: var(--ui-warn-ink); }
.stat.stat-alert { border-top-color: var(--ui-danger); background: var(--ui-danger-soft); border-inline-color: var(--ui-danger-border); border-bottom-color: var(--ui-danger-border); }
.stat.stat-alert strong, .stat.stat-alert small { color: var(--ui-danger-ink); }
.stat small a { color: inherit; text-decoration: underline; }
@media print {
  .stat, .stat.warning, .stat.stat-key, .stat.stat-alert { background: #fff !important; border: 1px solid #000 !important; }
  .stat small, .stat strong, .stat a { color: #000 !important; }
}
/* Status cells and markers inside tables: pale fills with dark text of the same family. */
td.state-late, span.state-late { background: var(--ui-danger-soft); color: var(--ui-danger-ink); font-weight: 600; }
td.state-out, span.state-out { background: var(--ui-info-soft); color: var(--ui-info-ink); }
td.state-done, span.state-done { background: var(--ui-primary-soft); color: var(--ui-primary); }
td.state-hold, span.state-hold { background: var(--ui-warn-soft); color: var(--ui-warn-ink); }
td.state-off, span.state-off { background: var(--ui-tint); color: var(--ui-muted); }
td[class*="state-"] a, span[class*="state-"] a { color: inherit; }
span.state[class*="state-"] { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .85em; font-weight: 600; }
@media print {
  td[class*="state-"], span[class*="state-"] { background: #fff !important; color: #000 !important; }
}

/* Settings: quick links to its sections, which land clear of the sticky header. */
.settings-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 18px; }
.settings-jump a { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border: 1px solid var(--ui-border-strong); border-radius: 999px; background: #fff; color: var(--ui-primary); font-size: 13px; font-weight: 600; }
.settings-jump a:hover { background: var(--ui-primary-soft); text-decoration: none; }
:is(#settings-company, #settings-logo, #settings-identity, #settings-incentives, #settings-incentive-history, #company-transfer) { scroll-margin-top: 96px; }
/* Browsers without native popovers (popover-fallback.js): closed until opened, then the browser's own popover
   placement. :where keeps the open look as weak as the browser default, so each panel's own styles still win. */
.no-popover [popover]:not(.popover-open) { display: none; }
:where(.no-popover [popover].popover-open) { position: fixed; inset: 0; z-index: 1000; width: fit-content; height: fit-content;
  margin: auto; overflow: auto; padding: .25em; border: 1px solid; background: #fff; color: var(--ui-ink); }
/* Update notice (main.js): a quiet card at the bottom of the screen, never covering the page header. */
.update-notice { position: fixed; z-index: 1100; inset-inline: 16px; bottom: 16px; max-width: 560px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 16px; background: #fff;
  border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius); box-shadow: 0 6px 18px #13221b29; }
.update-notice p { flex: 1 1 240px; margin: 0; font-weight: 600; color: var(--ui-ink); }
.update-notice .button { min-height: 36px; }
@media print { .update-notice { display: none; } }
/* Drivers' accounts (drivers page): period shortcuts, then dates and one search field on one line. */
.driver-accounts-period { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 12px 0; }
.driver-accounts-period label { flex: 0 1 180px; min-width: 0; }
.driver-accounts-period label:has(input[name=who]) { flex: 1 1 220px; }
#driver-accounts .form-actions a[aria-current] { background: var(--ui-primary-soft); border-color: var(--ui-primary); }

/* Vehicles: the count beside the menu entry, the add form above the table, and rows that need action now. */
.nav-count { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 12px; background: #f5d4bc; color: #57250b; font-size: 12px; line-height: 1.7; }
.vehicle-add > summary { cursor: pointer; font-weight: 700; color: var(--ui-primary); }
.vehicle-add[open] > summary { margin-bottom: 12px; }
tr.vehicle-urgent > td { background: var(--ui-danger-soft); }

/* Drivers' profit: the driver opens his own table under his row; the deduction window asks driver or employee. */
.profit-open { color: var(--ui-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 0; padding: 2px 4px; }
tr.profit-detail > td { background: var(--ui-primary-soft); padding: 12px 16px 16px; }
tr.profit-detail h3 { margin: 12px 0 6px; font-size: 15px; }
tr.profit-detail table { background: #fff; }
.profit-general { margin: 8px 0 0; }
.profit-who { display: flex; flex-wrap: wrap; gap: 8px 20px; border: 0; padding: 0; margin: 0; grid-column: 1 / -1; }
.profit-who legend { font-weight: 700; margin-bottom: 6px; }
.profit-who label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.profit-who input { width: 18px; height: 18px; min-height: 0; margin: 0; }
[data-who][hidden] { display: none; }
/* Drivers: one bar of tabs over the list, accounts, profit, incentives, monthly report and commission. */
.section-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 14px; padding: 4px; border: 1px solid var(--ui-border); border-radius: 8px; background: #fff; scrollbar-width: thin; }
.section-tabs a { flex: 0 0 auto; padding: 8px 14px; border-radius: 6px; color: var(--ui-ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; }
.section-tabs a:hover { background: var(--ui-primary-soft); color: var(--ui-ink); }
.section-tabs a[aria-current=page] { background: var(--ui-primary); color: #fff; }
.section-tabs a:focus-visible { outline: 3px solid var(--ui-primary); outline-offset: 2px; }
/* The one expense form: who the voucher is for, then only that kind's fields. */
.expense-for { display: flex; flex-wrap: wrap; gap: 8px 20px; border: 0; padding: 0; margin: 0; grid-column: 1 / -1; }
.expense-for legend { font-weight: 700; margin-bottom: 6px; }
.expense-for label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.expense-for input { width: 18px; height: 18px; min-height: 0; margin: 0; }
.expense-part { display: contents; }
.expense-part[hidden], [data-expense-form] [hidden] { display: none; }

/* The expense register: one link per category with its total, which filters the table to it. */
.expense-category-totals { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px 14px; }
.expense-category-totals a { display: grid; gap: 2px; min-width: 120px; padding: 8px 12px; border: 1px solid var(--ui-border-strong);
  border-radius: 8px; color: var(--ui-ink); text-decoration: none; background: #fff; }
.expense-category-totals a:hover { border-color: var(--ui-primary); }
.expense-category-totals span { font-size: 13px; color: var(--ui-muted); }
.expense-category-totals small { font-size: 12px; color: var(--ui-muted); }
@media print { .expense-category-totals { display: none; } }

/* «ملء الشاشة» for the big tables: the table alone over the page, one thin bar on top, the tools behind a button. */
body.table-only { overflow: hidden; }
.table-only-root { position: fixed !important; inset: 0; z-index: 900; display: flex !important; flex-direction: column; gap: 6px;
  margin: 0 !important; padding: 6px 8px 8px !important; max-width: none !important; width: auto !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: #fff; }
.table-only-root > [data-table-only-area] { flex: 1 1 0; min-height: 0; height: auto !important; max-height: none !important;
  overflow: auto; margin: 0 !important; }
.table-only-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 44px; }
.table-only-bar strong { font-size: 17px; color: var(--ui-ink); }
.table-only-bar .button { min-height: 38px; padding: 5px 12px; font-size: 14px; }
.table-only-status { flex: 1 1 12ch; min-width: 0; font-size: 13px; color: var(--ui-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-only-bar strong + .button { margin-inline-start: auto; }
.table-only-tools { position: absolute; inset-inline: 8px; z-index: 5; overflow: auto;
  padding: 12px; background: #fff; border: 1px solid var(--ui-border-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.table-only-tools[hidden] { display: none; }
.table-only-shown { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.table-only-shown:empty { display: none; }
.table-only-shown > * { margin: 0 !important; }
/* The register's column titles stick to the top of the table itself here, not under the page's header. */
.table-only-root #register-grid .tabulator-header { top: 0; }
@media (max-width: 650px) {
  .table-only-status { display: none; }
  .table-only-bar strong { display: none; }
  .table-only-bar .button { min-height: 40px; padding: 4px 10px; }
}
@media print { .table-only-bar { display: none; } }
/* A customer's call and WhatsApp links, side by side in the list. */
.contact-links { display: inline-flex; gap: 10px; white-space: nowrap; }
.contact-links a { padding-block: 4px; }
/* A list whose last choice is «اسم آخر»: the field beside it appears with that choice. */
.other-choice { display: contents; }
.other-choice label:has([name$="_other"]) { display: none; }
.other-choice:has(option[value="other"]:checked) label:has([name$="_other"]) { display: block; }
label.check-label.check-label { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
label.check-label.check-label input[type="checkbox"], form:has([data-check-all]) tbody input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; }
.check-label span { margin: 0; }
/* A workbook page waits for its table (opening.js): the content is laid out but not seen, and one frame stands in its place. */
@media screen {
  .is-opening > main { position: relative; }
  .is-opening > main > * { visibility: hidden; opacity: 0; }
  .is-opening :is(#register-fallback, #sheet-fallback) { display: none; }
  .is-opening > main::before { content: "جارٍ فتح الجدول…"; position: absolute; inset: 28px 28px auto; min-height: min(420px, 60dvh); display: grid; place-items: center; border: 1px solid var(--ui-border-hover); border-radius: 6px; background: #fff; color: var(--ui-muted); font-size: 16px; }
}
@media screen and (max-width: 650px) { .is-opening > main::before { inset-inline: 14px; } }
