@font-face { font-family: Tajawal; font-weight: 800; font-display: swap; src: url(fonts/tajawal-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Tajawal; font-weight: 800; font-display: swap; src: url(fonts/tajawal-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Tajawal; font-weight: 400; font-display: swap; src: url(fonts/tajawal-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Tajawal; font-weight: 800; font-display: swap; src: url(fonts/tajawal-arabic-800-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Tajawal; font-weight: 800; font-display: swap; src: url(fonts/tajawal-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Tajawal; font-weight: 400; font-display: swap; src: url(fonts/tajawal-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Tajawal; font-weight: 500; font-display: swap; src: url(fonts/tajawal-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Tajawal; font-weight: 500; font-display: swap; src: url(fonts/tajawal-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: Tajawal; font-weight: 700; font-display: swap; src: url(fonts/tajawal-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Tajawal; font-weight: 700; font-display: swap; src: url(fonts/tajawal-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
:root {
  /* DOFIED ALL tokens: green-deep carries white text, green is for graphics, green-light for glows */
  --accent: #008752; --accent-2: #00995c; --brand: #00b068; --brand-light: #28d68c; --soft: #e2f6ec; --ink: #141614; --muted: #7e827e; --line: #e6e7e3;
  --bg: #fafaf7; --card: #fff; --good: #15803d; --good-bg: #e7f6ec; --bad: #c81e1e; --bad-bg: #fde8e8; --warn: #a16207; --warn-bg: #fef3c7;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
}
* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
html { scrollbar-width: thin; scrollbar-color: #d9d9de transparent; }
html::-webkit-scrollbar { display: block; width: 8px; }
html::-webkit-scrollbar-thumb { background: #d9d9de; border-radius: 4px; }
html, body { margin: 0; height: 100%; }
body { font-family: Tajawal, "Segoe UI", Tahoma, sans-serif; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 18px; margin: 0; font-weight: 800; } h2 { font-size: 15px; margin: 0; } h3 { font-size: 13px; margin: 0; color: var(--muted); font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); } .good { color: var(--good); } .bad { color: var(--bad); }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; transition: grid-template-columns .28s cubic-bezier(.4,0,.2,1); }
.shell.nav-off { grid-template-columns: 0 1fr; }
.shell.nav-off .side { transform: translateX(100%); opacity: 0; visibility: hidden; }
.side { background: var(--card); padding: 16px 12px 12px; position: sticky; top: 0; height: 100vh; width: 232px; display: flex; flex-direction: column;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s, visibility .28s; }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 16px; }
.brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand img { height: 26px; min-width: 120px; display: block; }
.login .brand { align-items: center; padding: 6px 0 8px; } .login .brand img { height: 40px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
/* menu hierarchy: main section = bold row with icon; its screens = lighter rows hanging on a guide line */
.side-nav .ico { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--bg); color: var(--ink); transition: background .15s, color .15s; }
.nav-top, .nav-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; margin-top: 4px; border: 0; border-radius: 12px; background: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); text-align: start; }
.nav-top:hover, .nav-head:hover { background: var(--bg); } .nav-top:hover .ico, .nav-head:hover .ico { background: var(--card); }
.nav-head:focus-visible, .nav-top:focus-visible, .nav-items a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-head > span:nth-child(2), .nav-top > span:nth-child(2) { flex: 1; }
.nav-head .cnt { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; min-width: 20px; padding: 1px 6px; text-align: center; }
.nav-head .chev { color: var(--muted); transition: transform .22s; transform: rotate(90deg); } .nav-group.open .nav-head .chev { transform: none; }
.nav-group.open .nav-head .cnt { display: none; }
.nav-group.has-on .nav-head { color: var(--accent); } .nav-group.has-on .nav-head .ico { background: var(--soft); color: var(--accent); }
.nav-top.on { background: var(--accent); color: #fff; } .nav-top.on .ico, .nav-top.on:hover .ico { background: rgba(255,255,255,.18); color: #fff; }
.nav-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s cubic-bezier(.4,0,.2,1); }
.nav-group.open .nav-items { grid-template-rows: 1fr; }
.nav-items > div { overflow: hidden; min-height: 0; margin-inline-start: 22px; padding-inline-start: 12px; border-inline-start: 2px solid var(--line); }
.nav-group.has-on .nav-items > div { border-color: #bfe8d4; }
.nav-items a { display: block; position: relative; padding: 7px 10px; margin: 2px 0; border-radius: 9px; color: #3d413d; font-size: 14px; }
.nav-items a:hover { background: var(--bg); color: var(--ink); }
.nav-items a.on { background: var(--soft); color: var(--accent); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .nav-items, .nav-head .chev { transition: none; } }
.main { min-width: 0; padding: 14px 18px 40px; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.top .sp { flex: 1; }
.menu-btn { display: none; width: 40px; height: 40px; flex: none; place-items: center; cursor: pointer; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
/* Menu handle: a green round button sitting on the menu's edge, always visible. Hidden menu -> a green tab on the screen edge. */
.nav-handle { position: fixed; z-index: 12; top: 50%; inset-inline-start: 214px; width: 36px; height: 36px; margin-top: -18px; padding: 0; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: var(--accent); border: 3px solid var(--bg); border-radius: 50%; box-shadow: 0 3px 10px rgba(0,135,82,.35);
  transition: inset-inline-start .28s cubic-bezier(.4,0,.2,1), background .15s, width .18s, transform .15s, border-radius .28s; }
.nav-handle svg { width: 17px; height: 17px; transition: transform .28s; }
.nav-handle:hover, .nav-handle:focus-visible { background: #00744a; transform: scale(1.08); outline: none; }
.nav-handle:focus-visible { box-shadow: 0 0 0 3px var(--brand-light); }
.shell.nav-off .nav-handle { inset-inline-start: 0; width: 28px; height: 68px; margin-top: -34px; border-radius: 14px 0 0 14px; border-width: 0; }
.shell.nav-off .nav-handle:hover, .shell.nav-off .nav-handle:focus-visible { width: 36px; transform: none; }
.shell.nav-off .nav-handle svg { transform: rotate(180deg); }

/* user block pinned to the bottom of the menu; the sign-out pill echoes the capsule in the logo */
.side-user { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.side-user .who { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; color: var(--ink); }
.side-user a.who:hover, .side-user a.who.on { background: var(--bg); }
.side-user .who i { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; }
.side-user .who b { display: block; line-height: 1.2; } .side-user .who small { color: var(--muted); font-size: 11px; }
.side-user .logout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 9px 14px; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink);
  border: 2px solid transparent; border-radius: 999px;
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(270deg, rgba(20,194,124,.15), #14c27c 55%, #00a864) border-box; transition: color .15s, background .15s; }
.side-user .logout:hover, .side-user .logout:focus-visible { color: #fff; background: linear-gradient(var(--accent), var(--accent)) padding-box, linear-gradient(var(--accent), var(--accent)) border-box; outline: none; }

/* blocks */
.card { background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; }
.card > h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g21 { grid-template-columns: 2fr 1fr; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi b { font-size: 19px; font-weight: 700; }
.kpi small { color: var(--muted); }
.kpi.hot { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.kpi.hot h3, .kpi.hot small { color: rgba(255,255,255,.9); }
.pill { display: inline-block; white-space: nowrap; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); }
.pill.good { background: var(--good-bg); } .pill.bad { background: var(--bad-bg); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.acc { background: var(--soft); color: var(--accent); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alerts a { display: flex; justify-content: space-between; align-items: center; color: var(--ink); }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tw tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: #fafafa; }
td.n, th.n { text-align: end; }
/* a number cell is written left-to-right, which flips what "start" and "end" mean inside it: pin it to the same side as its column title */
td.num { text-align: right; } td.num.n { text-align: left; }
tr.parent td { font-weight: 600; background: #fafafa; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list small { display: block; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--bg); margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* forms */
.btn { border: 1px solid #d9dbd6; background: var(--card); border-radius: 7px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.pri:hover { background: #00744a; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid #d9dbd6; border-radius: 7px; padding: 6px 8px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #5d615d; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; }
.form .wide { grid-column: span 2; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 10px; }
.filters label { min-width: 130px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.lines input, .lines select { padding: 6px 7px; border-radius: 7px; }
.lines td { padding: 3px 3px; } .lines th { padding: 5px 4px; }
.lines .w-mat { min-width: 210px; } .lines .w-s { width: 82px; } .lines .w-m { min-width: 120px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; max-width: 340px; margin-inline-start: auto; }
.totals b { text-align: end; } .totals .big { font-size: 18px; color: var(--accent); }

/* bill entry: quick-add box, and discount / payment / totals pinned to the bottom of the screen */
.quick { display: flex; align-items: center; gap: 8px; padding: 4px 10px; margin-bottom: 8px; border: 1.5px solid var(--brand); border-radius: 8px; background: #f4fbf7; color: var(--accent); }
.quick input { border: 0; background: transparent; font-size: 14px; padding: 4px; } .quick input:focus { outline: none; } .quick:focus-within { box-shadow: 0 0 0 3px rgba(0,176,104,.18); }
.quick span { white-space: nowrap; font-size: 12px; }
.bill-foot { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; align-items: center; gap: 8px 20px; flex-wrap: wrap; margin: 8px -12px -12px; padding: 6px 12px; background: var(--card); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -8px 18px rgba(20,22,20,.05); }
.bill-foot .totals { margin: 0; max-width: none; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; }
.totals .t { display: inline-flex; align-items: baseline; gap: 6px; } .totals .t small { color: var(--muted); font-size: 12px; } .totals .t b { font-size: 14px; } .totals .t b.big { font-size: 16px; }
.totals b.bad { color: var(--bad); }
#lines tr.flash td { animation: flash 1s ease-out; } @keyframes flash { from { background: var(--soft); } to { background: transparent; } }
@media (max-width: 760px) { .quick span { display: none; } .bill-foot { position: static; } }
/* modal + toast + login */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: start center; padding: 5vh 12px; overflow-y: auto; z-index: 20; }
.modal { background: var(--card); border-radius: var(--radius); width: min(760px, 100%); padding: 20px; }
.modal header, .modal footer { display: flex; align-items: center; gap: 10px; }
.modal header { margin-bottom: 16px; } .modal footer { margin-top: 18px; justify-content: flex-start; }
#toast { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 30; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 420px; box-shadow: var(--shadow); }
#toast div.err { background: var(--bad); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }

/* charts */
.chart svg { width: 100%; height: auto; display: block; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-inline-start: auto; }
.donut { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }

@media (prefers-reduced-motion: reduce) { .shell, .side, .nav-handle, .nav-handle svg { transition: none; } }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g21 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 250px; z-index: 15; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .shell.nav-off { grid-template-columns: 1fr; } .shell.nav-off .side { opacity: 1; visibility: visible; transform: translateX(100%); } .shell.nav-off .side.open { transform: none; }
  .menu-btn { display: grid; } .nav-handle { display: none; }
  .main { padding: 14px 12px 40px; }
  .form .wide { grid-column: auto; }
  .donut { grid-template-columns: 1fr; }
}
@media print {
  .side, .top, .no-print, #toast, .nav-handle { display: none !important; }
  .shell { display: block; } .main { padding: 0; } body { background: #fff; }
  .card { box-shadow: none; padding: 0; margin-bottom: 14px; }
  input, select { border: 0; padding: 0; appearance: none; }
}

#view.busy { opacity: .45; pointer-events: none; cursor: progress; transition: opacity .15s .25s; }
/* dashboard */
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
.dash-tabs a { padding: 10px 16px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.dash-tabs a:hover { color: var(--ink); } .dash-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.dash-tabs a i { font-style: normal; font-size: 11px; background: var(--bad-bg); color: var(--bad); border-radius: 999px; padding: 1px 7px; margin-inline-start: 4px; }
.dash-tabs .note { margin-inline-start: auto; color: var(--muted); font-size: 13px; padding: 6px 2px; }
.chart-head { display: flex; align-items: baseline; gap: 6px 22px; flex-wrap: wrap; margin-bottom: 6px; } .chart-head h2 { margin-inline-end: auto; } .chart-head span { color: var(--muted); font-size: 13px; } .chart-head b { color: var(--ink); }
.rank { list-style: none; margin: 0; padding: 0; } .rank li { padding: 9px 0; } .rank li + li { border-top: 1px solid var(--line); }
.rk-top { display: flex; align-items: baseline; gap: 10px; } .rk-top > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-top b { font-weight: 700; } .rk-top em { font-style: normal; color: var(--muted); font-size: 12px; min-width: 34px; text-align: left; }
.bar { display: flex; justify-content: flex-start; } /* bars grow from the reading side (right, in Arabic) */
.rank .bar { margin-top: 6px; } .rank li.rest .rk-top > :first-child, .rank li.rest b { color: var(--muted); font-weight: 500; } .rank small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
a.kpi.link { color: var(--ink); transition: box-shadow .15s; } a.kpi.link:hover { box-shadow: 0 2px 4px rgba(20,22,20,.06), 0 12px 28px rgba(20,22,20,.09); } a.kpi.link small { color: var(--accent); }
.kpi b.bad { color: var(--bad); } .kpi b.warn-t { color: var(--warn); }
@media (max-width: 1100px) { .g2 { grid-template-columns: 1fr; } .dash-tabs .note { margin-inline-start: 0; width: 100%; } }
/* dashboard: sections, small figures, charts */
.jump { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.jump button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink); }
.jump button:hover { border-color: var(--brand); color: var(--accent); } .jump button i { font-style: normal; font-size: 11px; background: var(--bad-bg); color: var(--bad); border-radius: 999px; padding: 1px 7px; }
.jump span { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
h2.sec { font-size: 18px; font-weight: 800; margin: 26px 2px 12px; padding-top: 14px; border-top: 1px solid var(--line); scroll-margin-top: 10px; } h2.sec small { font-size: 12px; font-weight: 500; color: var(--muted); margin-inline-start: 8px; }
.minis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0; margin-top: 14px; }
.mini { padding: 12px 16px; } .mini + .mini { border-inline-start: 1px solid var(--line); }
.mini span { display: block; color: var(--muted); font-size: 12.5px; } .mini b { display: block; font-size: 19px; font-weight: 800; margin-top: 2px; } .mini small { display: block; color: var(--muted); font-size: 11.5px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 8px; font-size: 13px; color: var(--muted); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; } .legend-row i { width: 14px; height: 4px; border-radius: 2px; } .legend-row b { color: var(--ink); }
/* the legend may never push past the card: names shorten, numbers stay whole; in a narrow card the ring sits above its legend */
.donut-box { container-type: inline-size; }
.donut { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; } .donut svg { width: 132px; height: 132px; }
.donut .legend { min-width: 0; } .donut .legend b { white-space: nowrap; }
@container (max-width: 400px) { .donut { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; } .donut .legend { width: 100%; } }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.legend li { display: flex; align-items: center; gap: 8px; } .legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .legend b { font-weight: 700; margin: 0; } .legend em { font-style: normal; color: var(--muted); font-size: 12px; min-width: 32px; text-align: left; }
.split { display: flex; gap: 2px; height: 18px; border-radius: 6px; overflow: hidden; margin: 4px 0 14px; } .split i { min-width: 3px; }
#tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 260px; }
#tip b { display: block; margin-bottom: 2px; } #tip span { display: block; opacity: .9; }
[data-tip] rect, circle[data-tip], .split i { cursor: default; } svg g[data-tip]:hover rect[fill=transparent] { fill: rgba(20,22,20,.04); }
@media (max-width: 1100px) { .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mini:nth-child(4) { border-inline-start: 0; } .mini:nth-child(n+4) { border-top: 1px solid var(--line); } .jump span { margin-inline-start: 0; width: 100%; } }
@media (max-width: 760px) { .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mini { border-inline-start: 0 !important; border-top: 1px solid var(--line); } .donut { grid-template-columns: 1fr; justify-items: center; } }
/* dashboard: "show all" on every card, and the full-list window */
h2.ch { display: flex; align-items: center; gap: 10px; } h2.ch > span { flex: 1; min-width: 0; }
h2.ch .all { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--accent); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
h2.ch .all:hover, h2.ch .all:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; outline: none; }
.modal.wide-modal { width: min(1100px, 100%); } .wide-modal header { flex-wrap: wrap; } .wide-modal header .sp { flex: 1; }
.wide-modal .tw { max-height: calc(100vh - 220px); overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
table.da th { position: sticky; top: 0; background: #fbfbf9; z-index: 1; } table.da th.sortable { cursor: pointer; user-select: none; } table.da th.sortable:hover { color: var(--ink); }
table.da tfoot td { position: sticky; bottom: 0; background: #fbfbf9; } table.da .barcol { width: 150px; } table.da .bar { margin: 0; }
@media print { .modal-bg { position: static; background: none; padding: 0; } body:has(.wide-modal) #app { display: none; } .wide-modal .tw { max-height: none; overflow: visible; border: 0; } table.da .barcol { display: none; } }
/* dashboard period picker */
.period { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 12px 14px; }
.period .tabs a { padding: 6px 13px; font-size: 14px; }
.period .range { display: flex; align-items: end; gap: 8px; } .period .range label { flex-direction: row; align-items: center; gap: 6px; } .period .range input { width: 150px; padding: 6px 8px; }
h3.sect { margin: 20px 2px 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.kpi .up { color: var(--good); font-weight: 700; } .kpi .down { color: var(--bad); font-weight: 700; } .kpi.hot .up, .kpi.hot .down { color: #fff; }

/* permissions table in the user form */
.perm-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.perm-table { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.perm-table th { position: sticky; top: 0; background: var(--card); z-index: 1; } .perm-table th:not(:first-child), .perm-table td:not(:first-child) { text-align: center; width: 70px; }
.perm-table td { padding: 6px 10px; } .perm-table tr.parent td { padding: 5px 10px; font-size: 12px; color: var(--muted); }
.perm-table label.chk { justify-content: center; } .perm-table input { width: 17px; height: 17px; accent-color: var(--accent); }
/* financial statements */
tr.total td { font-weight: 700; border-top: 1px solid var(--line); background: #fbfbf9; } tr.grand td { font-weight: 800; font-size: 16px; border-top: 2px solid var(--ink); border-bottom: 0; }
/* profile page */
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; max-width: 980px; align-items: start; }
.who-big { display: flex; align-items: center; gap: 14px; } .who-big i { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 22px; }
.who-big h2 { font-size: 19px; font-weight: 800; } .who-big p { margin: 2px 0 0; }
.stack { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chips span { background: var(--bg); border-radius: 8px; padding: 4px 10px; font-size: 13px; }

/* printed invoice (driven by the saved design) */
#print-root { display: none; }
.doc { --dc: #008752; color: #000; position: relative; line-height: 1.45; }
.doc .num { font-variant-numeric: tabular-nums; }
.doc-wm { position: absolute; inset: 0; margin: auto; width: 62%; max-height: 60%; object-fit: contain; opacity: .07; pointer-events: none; }
.doc header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 10px; border-bottom: 3px solid var(--dc); }
.doc header h1 { font-size: 1.9em; color: var(--dc); line-height: 1.2; } .doc header p { margin: 2px 0 0; color: #333; font-size: .92em; }
.doc header .h-ar { flex: 1; } .doc header .h-en { flex: 1; text-align: left; } .doc-logo { object-fit: contain; max-width: 34%; }
.doc-title { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 8px; }
.doc-title h2 { font-size: 1.25em; padding: 4px 22px; border-radius: 6px; border: 1.5px solid var(--dc); color: var(--dc); }
.doc.fill .doc-title h2 { background: var(--dc); color: #fff; } .doc-bar { fill: #000; }
.doc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px 16px; margin-bottom: 10px; }
.doc-meta span:first-child { color: #444; font-size: .9em; }
.doc-lines { border-collapse: collapse; width: 100%; position: relative; }
.doc-lines th { background: #eee; color: #000; text-align: center; border: 1px solid #999; padding: 5px 4px; font-size: .92em; white-space: normal; }
.doc.fill .doc-lines th { background: var(--dc); color: #fff; border-color: var(--dc); }
.doc-lines td { border: 1px solid #aaa; padding: 4px 6px; text-align: center; } .doc-lines td.name { text-align: start; font-weight: 500; }
.doc-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 12px; break-inside: avoid; }
.doc-foot .words { flex: 1; } .doc-foot .words span { display: block; font-size: .85em; color: #444; margin-top: 6px; } .doc-foot .words span:first-child { margin-top: 0; }
.doc-foot table { width: 46%; max-width: 300px; flex: none; border-collapse: collapse; align-self: flex-start; }
.doc-foot th, .doc-foot td { border: 1px solid #aaa; padding: 4px 9px; color: #000; font-size: 1em; text-align: start; white-space: nowrap; } .doc-foot td { text-align: end; }
.doc-foot tr.net th, .doc-foot tr.net td { font-weight: 700; font-size: 1.12em; border: 2px solid var(--dc); }
.doc-note { margin-top: 14px; padding-top: 8px; border-top: 1px dashed #888; white-space: pre-line; font-size: .92em; break-inside: avoid; }
.doc footer { display: flex; justify-content: space-around; margin-top: 44px; break-inside: avoid; } .doc footer div { border-top: 1px solid #000; padding-top: 5px; min-width: 22%; text-align: center; }
.doc-copy { margin-top: 12px; text-align: center; font-size: .85em; color: #333; }

/* designer screen */
.designer { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 14px; align-items: start; }
.designer #d-form { max-height: calc(100vh - 150px); overflow-y: auto; }
.designer .form { grid-template-columns: 1fr 1fr; }
#d-prev { background: #e9e9ec; border-radius: 10px; padding: 14px; overflow: hidden; }
.doc-sheet { background: #fff; padding: 34px; box-shadow: 0 2px 14px rgba(0,0,0,.12); margin: 0 auto; }
.d-col { display: grid; grid-template-columns: 22px 1fr 34px 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.d-col input[type=checkbox], label.chk input { width: auto; }
label.chk { flex-direction: row; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; }
@media (max-width: 1000px) { .designer { grid-template-columns: 1fr; } .designer #d-form { max-height: none; } }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-doc #app, body.print-doc #modal-root { display: none; } body.print-doc #print-root { display: block; }
}

/* account picker (replaces the browser list): shows the top accounts before typing */
#acc-pop { position: fixed; z-index: 50; background: var(--card); border: 1px solid #cfd2cc; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); max-height: 360px; overflow-y: auto; min-width: 320px; font-size: 13.5px; }
#acc-pop .ap-h { padding: 5px 10px; font-size: 11.5px; color: var(--muted); background: #fafaf7; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
#acc-pop .ap-i { display: grid; grid-template-columns: auto 1fr auto; gap: 1px 10px; padding: 5px 10px; cursor: pointer; border-bottom: 1px solid #f1f1ee; }
#acc-pop .ap-i.on, #acc-pop .ap-i:hover { background: var(--soft); }
#acc-pop .ap-i .n { color: var(--muted); font-variant-numeric: tabular-nums; } #acc-pop .ap-i small { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; }
#acc-pop .ap-i .b { white-space: nowrap; font-size: 12.5px; } #acc-pop .ap-x { padding: 6px 10px; color: var(--muted); font-size: 12px; }
/* table tools: search, count, sort, export */
.tt { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; } .tt input { max-width: 260px; padding: 4px 8px; } .tt .cnt { color: var(--muted); font-size: 12px; } .tt .sp { flex: 1; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--ink); } th.sorted-asc::after { content: ' ▲'; font-size: 9px; } th.sorted-desc::after { content: ' ▼'; font-size: 9px; }
.tw { max-height: calc(100vh - 230px); overflow: auto; } .tw thead th { position: sticky; top: 0; background: var(--card); z-index: 1; } .tw tfoot td { position: sticky; bottom: 0; background: #fbfbf9; }
#lines.tw { max-height: none; }
/* chart of accounts as folders */
#acc-tree tr.fold { display: none; } #acc-tree.searching tr.fold:not([hidden]) { display: table-row; }
.fold-btn { border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-align: start; }
.fold-btn:hover { color: var(--accent); } .fold-btn .chev { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--soft); color: var(--accent); font-size: 14px; line-height: 1; transition: transform .15s; }
.fold-btn .chev.open { transform: rotate(-90deg); } .leaf { padding-inline-start: 24px; }
#acc-tree { max-height: none; }
.move-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 10px; background: var(--soft); border-radius: 10px; } .move-bar select { width: auto; min-width: 200px; }
td.ck, th.ck { width: 30px; } td.ck input, th.ck input { width: 16px; height: 16px; accent-color: var(--accent); }
/* a list that scrolls inside its card must show that it scrolls (the app hides scrollbars elsewhere) */
.tw { scrollbar-width: thin; scrollbar-color: #c5c8c2 transparent; } .tw::-webkit-scrollbar { display: block; width: 8px; height: 8px; } .tw::-webkit-scrollbar-thumb { background: #c5c8c2; border-radius: 4px; }
.adv.off { display: none; }
.filters .chk { flex-direction: row; align-items: center; gap: 6px; min-width: 0; padding-bottom: 6px; } .filters .chk input { width: auto; }
/* compact figures row (instead of big cards) */
.figs { display: flex; flex-wrap: wrap; background: var(--card); border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 10px; }
.figs > div { padding: 7px 14px; border-inline-start: 1px solid var(--line); } .figs > div:first-child { border-inline-start: 0; }
.figs > div > span { display: block; font-size: 11.5px; color: var(--muted); }
#bill-head { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 6px 8px; } .figs b { font-size: 15px; font-weight: 700; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; } @media (max-width: 1000px) { .cols2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 4px 14px; font-size: 13.5px; } .kv span { color: var(--muted); }
@media (max-width: 760px) { .kv { grid-template-columns: max-content 1fr; } }
.mbar { display: inline-block; height: 8px; background: var(--brand); border-radius: 2px; vertical-align: middle; }
.card > h2.sub { font-size: 14px; margin-bottom: 8px; }
@media print { .tt, #acc-pop { display: none !important; } .tw { max-height: none; overflow: visible; } .tw thead th, .tw tfoot td { position: static; } }

/* top menu bar (replaces the side menu): the work area gets the full width */
.shell { display: block; min-height: 100%; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px 10px; padding: 0 14px; min-height: 48px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.tb-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 0; margin-inline-end: 8px; color: var(--ink); }
.tb-brand img { height: 20px; display: block; } .tb-brand small { font-size: 10.5px; color: var(--muted); max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-menu { display: flex; align-items: stretch; gap: 2px; flex: 1; min-width: 0; flex-wrap: wrap; }
.tb-g { position: relative; }
.tb-h { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 10px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.tb-h .ico { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--bg); } .tb-h .ico svg { width: 15px; height: 15px; }
.tb-h:hover, .tb-g.open > .tb-h, .tb-g:focus-within > .tb-h { background: var(--bg); }
.tb-g.on > .tb-h, .tb-h.on { color: var(--accent); border-bottom-color: var(--accent); } .tb-g.on > .tb-h .ico, .tb-h.on .ico { background: var(--soft); color: var(--accent); }
.tb-h .chev { color: var(--muted); }
.tb-dd { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 210px; padding: 6px; background: var(--card); border: 1px solid #d9dbd6; border-radius: 0 0 10px 10px; box-shadow: 0 10px 28px rgba(0,0,0,.13); z-index: 31; }
.tb-g.open > .tb-dd { display: block; }
@media (hover: hover) and (min-width: 901px) { .tb-g:hover > .tb-dd { display: block; } }
.tb-dd a { display: block; padding: 7px 12px; border-radius: 7px; color: var(--ink); font-size: 14px; white-space: nowrap; } .tb-dd a:hover, .tb-dd a:focus-visible { background: var(--soft); color: var(--accent); outline: none; }
.tb-dd a.on { background: var(--soft); color: var(--accent); font-weight: 700; }
.tb-user { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.tb-user .who { display: flex; align-items: center; gap: 7px; color: var(--ink); padding: 4px 6px; border-radius: 8px; font-weight: 600; font-size: 13.5px; } .tb-user .who:hover, .tb-user .who.on { background: var(--bg); }
.tb-user .who i { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; }
.topbar .menu-btn { display: none; width: 38px; height: 38px; border-radius: 8px; }
.main { padding: 10px 16px 30px; }
.tw { max-height: calc(100vh - 210px); }
@media (max-width: 1250px) { .tb-h > span:not(.ico) { font-size: 13px; } .tb-h { padding: 0 7px; } .tb-brand small { display: none; } }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; padding: 4px 10px; } .topbar .menu-btn { display: grid; order: -1; } .tb-user .who span { display: none; }
  .tb-menu { display: none; order: 9; flex-basis: 100%; flex-direction: column; padding: 6px 0 10px; border-top: 1px solid var(--line); max-height: calc(100vh - 60px); overflow-y: auto; }
  .topbar.open .tb-menu { display: flex; }
  .tb-h { height: 40px; width: 100%; border-bottom: 0; } .tb-dd { position: static; box-shadow: none; border: 0; padding: 0 30px 4px 0; min-width: 0; }
  .tb-g.on > .tb-dd { display: block; }
  .main { padding: 10px 10px 30px; }
}
@media print { .topbar { display: none !important; } }

/* plain business look: thin borders instead of shadows, small corners, colour only where it means something */
body { background: #f3f4f2; }
.card { border-radius: 5px; box-shadow: none; border: 1px solid #dfe1dc; }
.figs { border-radius: 5px; box-shadow: none; border: 1px solid #dfe1dc; }
.btn { border-radius: 4px; } .btn.sm { border-radius: 3px; }
input, select, textarea { border-radius: 4px; }
.pill { border-radius: 3px; padding: 1px 6px; font-weight: 500; }
.quick { border-radius: 4px; border-width: 1px; background: #fff; }
.kpi.hot { background: var(--card); color: var(--ink); } .kpi.hot h3, .kpi.hot small { color: var(--muted); } .kpi.hot b { color: var(--accent); }
.tb-h .ico { background: none !important; width: auto; } .tb-h { font-weight: 600; }
.tb-dd { border-radius: 0 0 5px 5px; } .tb-dd a { border-radius: 3px; }
#acc-pop { border-radius: 4px; } .modal { border-radius: 6px; } .move-bar { border-radius: 5px; }
.tabs a { border-radius: 4px; } .fold-btn .chev { border-radius: 3px; }
/* page bar: a title only when it adds something (bill number, customer name) and the page buttons */
.pbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .pbar h1 { font-size: 16px; }
.pbar .acts, .filters .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-inline-start: auto; }
.filters .acts { align-self: flex-end; }
/* logo: smaller, centred in the bar; user menu: one quiet button with a drop-down (profile, sign out) */
.tb-brand { flex-direction: row; align-items: center; align-self: stretch; padding: 0; margin-inline-end: 14px; } .tb-brand img { height: 17px; min-width: 0; }
.tb-user { margin-inline-start: auto; } .tb-user > .tb-h { gap: 7px; font-weight: 600; color: #3d413d; } .tb-user > .tb-h span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.tb-user .tb-dd { inset-inline-start: auto; inset-inline-end: 0; min-width: 230px; }
.tb-who { padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); } .tb-who b { display: block; } .tb-who small { color: var(--muted); font-size: 12px; }
.tb-out { display: block; width: 100%; text-align: start; padding: 7px 12px; border: 0; border-radius: 3px; background: none; font: inherit; font-size: 14px; color: var(--bad); cursor: pointer; margin-top: 4px; border-top: 1px solid var(--line); }
.tb-out:hover { background: var(--bad-bg); }
@media (max-width: 900px) { .tb-user .tb-dd { position: absolute; box-shadow: 0 10px 28px rgba(0,0,0,.13); border: 1px solid #d9dbd6; padding: 6px; } .tb-user > .tb-h { width: auto; height: 40px; } .tb-user > .tb-h span { display: none; } }
@media (max-width: 900px) { .tb-user.on:not(.open) > .tb-dd { display: none; } }
/* user page: permissions as a grid of section tables */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
.perm-g { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.perm-g table th { background: #f7f8f6; } .perm-g th:not(:first-child), .perm-g td:not(:first-child) { text-align: center; width: 62px; }
.perm-g th:first-child { color: var(--ink); font-size: 13px; } .perm-g th .btn { margin-inline-start: 6px; padding: 1px 7px; font-weight: 500; }
.perm-g td { padding: 4px 8px; } .perm-g input { width: 16px; height: 16px; accent-color: var(--accent); } .perm-g label.chk { justify-content: center; }
.u-lim label.chk { padding: 3px 0; }

/* header in the logo's language: the menu sits in a capsule whose green stroke fades in from the logo side
   and closes with a round end, like the "ALL" capsule; items are small capsules inside it */
.topbar { min-height: 58px; gap: 10px 14px; box-shadow: none; }
.tb-brand img { height: 19px; }
.tb-menu { flex: 0 1 auto; align-self: center; align-items: center; gap: 2px; padding: 3px 4px 3px 6px; min-height: 42px;
  border: 2px solid transparent; border-inline-start-width: 0; border-radius: 0 999px 999px 0;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(to left, rgba(20,194,124,0) 0%, #14c27c 40%, #00a864 100%) border-box; }
[dir="rtl"] .tb-menu, html[dir="rtl"] .tb-menu { border-radius: 999px 0 0 999px; }
.tb-h { height: 34px; padding: 0 12px; border: 0; border-radius: 999px; font-weight: 600; }
.tb-h .ico { color: var(--muted); }
.tb-h:hover, .tb-g.open > .tb-h, .tb-g:focus-within > .tb-h { background: #f1faf5; }
.tb-g.on > .tb-h, .tb-h.on { background: var(--soft); color: var(--accent); border: 0; } .tb-g.on > .tb-h .ico, .tb-h.on .ico { color: var(--accent); background: none; }
.tb-dd { top: calc(100% + 8px); border-radius: 12px; border: 1px solid #cfeedd; padding: 6px; box-shadow: 0 12px 30px rgba(0,80,48,.12); }
.tb-dd::before { content: ''; position: absolute; inset: -9px 0 auto 0; height: 9px; } /* keeps the drop-down open while the pointer moves down to it */
.tb-dd a { border-radius: 999px; padding: 7px 14px; }
.tb-user > .tb-h { border: 2px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(to left, #14c27c, #00a864) border-box; height: 36px; }
.tb-user > .tb-h:hover, .tb-user.open > .tb-h { background: linear-gradient(#f1faf5, #f1faf5) padding-box, linear-gradient(to left, #14c27c, #00a864) border-box; }
.tb-user .tb-dd { border-radius: 12px; } .tb-out { border-radius: 999px; }
@media (max-width: 900px) {
  .tb-menu { border: 0; background: none; border-radius: 0; padding: 6px 0 10px; border-top: 1px solid var(--line); }
  .tb-h { border-radius: 8px; } .tb-dd { border: 0; box-shadow: none; } .tb-dd::before { display: none; }
  .tb-user .tb-dd { border: 1px solid #cfeedd; box-shadow: 0 12px 30px rgba(0,80,48,.12); }
}
/* the user's end of the bar mirrors the menu: name in a green capsule, sign-out in a capsule whose red stroke fades out toward the screen edge */
.tb-user { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.tb-me { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; color: #3d413d; font-weight: 600; font-size: 13.5px;
  border: 2px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(to left, #14c27c, #00a864) border-box; }
.tb-me:hover, .tb-me.on { color: var(--accent); background: linear-gradient(#f1faf5, #f1faf5) padding-box, linear-gradient(to left, #14c27c, #00a864) border-box; }
.tb-me span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-logout { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 18px 0 14px; cursor: pointer; font: inherit; font-weight: 700; font-size: 13.5px; color: #c81e1e;
  border: 2px solid transparent; border-inline-end-width: 0; border-radius: 999px 0 0 999px;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(to left, #e23b3b 0%, #e23b3b 55%, rgba(226,59,59,0) 100%) border-box; }
html[dir="rtl"] .tb-logout { border-radius: 0 999px 999px 0; }
.tb-logout:hover, .tb-logout:focus-visible { outline: none; background: linear-gradient(#fdf1f1, #fdf1f1) padding-box, linear-gradient(to left, #e23b3b 0%, #e23b3b 55%, rgba(226,59,59,0) 100%) border-box; }
@media (max-width: 900px) { .tb-me span, .tb-logout span { display: none; } .tb-logout { padding: 0 12px; } }

/* the whole header is one capsule (logo, menu, user, sign-out), with the logo's green stroke:
   faint at the logo's end, full green at the far end, round at both ends */
.topbar { position: sticky; top: 8px; margin: 8px 12px 0; padding: 0 8px 0 18px; min-height: 56px; border-radius: 999px; border: 2px solid transparent; border-bottom-width: 2px;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(to left, rgba(20,194,124,.25) 0%, #14c27c 55%, #00a864 100%) border-box;
  box-shadow: 0 4px 14px rgba(0,80,48,.07); }
html[dir="rtl"] .topbar { padding: 0 18px 0 8px; }
.tb-menu, html[dir="rtl"] .tb-menu { border: 0; border-radius: 0; background: none; padding: 0; min-height: 0; }
.tb-logout, html[dir="rtl"] .tb-logout { border: 2px solid #e23b3b; border-radius: 999px; background: #fff; padding: 0 14px; height: 36px; }
.tb-logout:hover, .tb-logout:focus-visible { background: #fdf1f1; }
.main { padding-top: 12px; }
@media (max-width: 900px) {
  .topbar { border-radius: 22px; margin: 6px 6px 0; padding: 4px 10px; top: 6px; }
  html[dir="rtl"] .topbar { padding: 4px 10px; }
  .tb-menu, html[dir="rtl"] .tb-menu { border-top: 1px solid var(--line); padding: 6px 0 10px; }
}
/* header outline a little lighter */
.topbar { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(to left, rgba(40,214,140,.18) 0%, #6fe0b0 55%, #3ccf8e 100%) border-box; }
/* lists are not boxed: the page itself scrolls and every row shows; no inner scrollbar.
   Column titles stay visible under the header bar while scrolling. */
.tw { max-height: none; overflow: visible; scrollbar-width: none; } .tw::-webkit-scrollbar { display: none; }
.tw thead th { top: 70px; z-index: 2; } .tw tfoot td { bottom: 0; }
@media (max-width: 900px) { .tw { overflow-x: auto; } .tw thead th { position: static; } .tw tfoot td { position: static; } }
/* while scrolling, the strip above the floating header stays page-coloured (rows do not show through) */
.topbar::before { content: ''; position: absolute; inset: -12px -12px auto -12px; height: 12px; background: #f3f4f2; }
@media (max-width: 900px) { .topbar::before { inset: -8px -6px auto -6px; height: 8px; } }
/* calmer header: thin neutral line + soft shadow; green only marks the current section */
.topbar { border: 1px solid #e1e4df; background: #fff; box-shadow: 0 2px 12px rgba(20,22,20,.06); }
.tb-me { border: 1px solid #dfe2dd; background: #fff; } .tb-me:hover, .tb-me.on { border-color: #bfe8d4; background: #f1faf5; }
.tb-logout, html[dir="rtl"] .tb-logout { border-width: 1px; border-color: #efb4b4; } .tb-logout:hover, .tb-logout:focus-visible { border-color: #e23b3b; }
.tb-h:focus { outline: none; } .tb-h:focus-visible { box-shadow: 0 0 0 2px #bfe8d4; }
/* trial: thin, light navy outline on the header capsule */
.topbar { border: 1px solid rgba(30,58,110,.28); }
.topbar { border: 1px solid rgba(30,58,110,.5); }
/* the cover strip above the header ends just above its outline, so the top line shows */
.topbar::before { inset: -13px -12px auto -12px; height: 12px; }
@media (max-width: 900px) { .topbar::before { inset: -9px -6px auto -6px; height: 8px; } }

/* ===== dark theme (html[data-theme=dark]); printed documents and the invoice designer stay on white paper ===== */
html[data-theme="dark"] { color-scheme: dark;
  --ink: #e4e9e6; --muted: #8f9b95; --line: #2b332f; --bg: #1d2421; --card: #171d1a; --soft: #16382a; --accent: #1fb877; --accent-2: #22c27a;
  --good: #4ade80; --good-bg: #123323; --bad: #f87171; --bad-bg: #3b1a1a; --warn: #e5b94e; --warn-bg: #3a2f12; --shadow: none; }
html[data-theme="dark"] body, html[data-theme="dark"] .login { background: #0f1412; }
html[data-theme="dark"] .card, html[data-theme="dark"] .figs { border-color: #29312d; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #121815; border-color: #333c37; color: var(--ink); }
html[data-theme="dark"] .btn { background: #1d2421; border-color: #333c37; color: var(--ink); } html[data-theme="dark"] .btn:hover { background: #242c28; }
html[data-theme="dark"] .btn.pri { background: #0f8f58; border-color: #0f8f58; color: #fff; } html[data-theme="dark"] .btn.pri:hover { background: #12a366; }
html[data-theme="dark"] .btn.danger { color: var(--bad); }
html[data-theme="dark"] a { color: #3ccf8e; }
html[data-theme="dark"] tbody tr.click:hover { background: #1f2724; }
html[data-theme="dark"] tr.parent td, html[data-theme="dark"] .tw tfoot td, html[data-theme="dark"] table.da th, html[data-theme="dark"] table.da tfoot td, html[data-theme="dark"] tr.total td { background: #1b221f; }
html[data-theme="dark"] .tw thead th, html[data-theme="dark"] .perm-g table th { background: var(--card); }
html[data-theme="dark"] .topbar { background: #171d1a; border-color: rgba(120,150,210,.45); box-shadow: 0 2px 14px rgba(0,0,0,.4); }
html[data-theme="dark"] .topbar::before { background: #0f1412; }
html[data-theme="dark"] .tb-h { color: var(--ink); } html[data-theme="dark"] .tb-h:hover, html[data-theme="dark"] .tb-g.open > .tb-h { background: #1f2a25; }
html[data-theme="dark"] .tb-g.on > .tb-h, html[data-theme="dark"] .tb-h.on { background: #16382a; color: #3ccf8e; } html[data-theme="dark"] .tb-g.on > .tb-h .ico { color: #3ccf8e; }
html[data-theme="dark"] .tb-dd { background: #1a211e; border-color: #2e3a34; box-shadow: 0 12px 30px rgba(0,0,0,.5); } html[data-theme="dark"] .tb-dd a { color: var(--ink); }
html[data-theme="dark"] .tb-dd a:hover, html[data-theme="dark"] .tb-dd a.on { background: #16382a; color: #3ccf8e; }
html[data-theme="dark"] .tb-me { background: #1a211e; border-color: #333c37; color: var(--ink); } html[data-theme="dark"] .tb-me:hover, html[data-theme="dark"] .tb-me.on { background: #16382a; border-color: #23573f; color: #3ccf8e; }
html[data-theme="dark"] .tb-logout { background: #1a211e; border-color: #6b2a2a; color: #f87171; } html[data-theme="dark"] .tb-logout:hover { background: #2a1717; border-color: #f87171; }
html[data-theme="dark"] .tb-brand img, html[data-theme="dark"] .login .brand img { filter: invert(1) hue-rotate(180deg) brightness(1.1); }
html[data-theme="dark"] .quick { background: #121815; border-color: #1f8f5c; }
html[data-theme="dark"] .bill-foot { background: var(--card); box-shadow: 0 -8px 18px rgba(0,0,0,.35); }
html[data-theme="dark"] #acc-pop { background: #1a211e; border-color: #333c37; } html[data-theme="dark"] #acc-pop .ap-h { background: #151b18; } html[data-theme="dark"] #acc-pop .ap-i { border-color: #232b27; }
html[data-theme="dark"] #acc-pop .ap-i.on, html[data-theme="dark"] #acc-pop .ap-i:hover { background: #16382a; }
html[data-theme="dark"] .modal-bg { background: rgba(0,0,0,.6); }
html[data-theme="dark"] .move-bar { background: #16382a; }
html[data-theme="dark"] .tabs a { background: var(--card); border-color: #333c37; color: var(--ink); } html[data-theme="dark"] .tabs a.on { background: #e4e9e6; color: #0f1412; border-color: #e4e9e6; }
html[data-theme="dark"] .side-user .who i, html[data-theme="dark"] .who-big i { background: #2b332f; }
html[data-theme="dark"] h2.ch .all { background: transparent; border-color: #333c37; color: #3ccf8e; }
html[data-theme="dark"] .kpi.hot { background: var(--card); } html[data-theme="dark"] .kpi.hot b { color: #3ccf8e; }
html[data-theme="dark"] #tip { background: #e4e9e6; color: #0f1412; }
html[data-theme="dark"] #toast div { background: #e4e9e6; color: #0f1412; } html[data-theme="dark"] #toast div.err { background: #b91c1c; color: #fff; }
/* charts drawn with fixed colours */
html[data-theme="dark"] svg text[fill="#141614"] { fill: var(--ink); } html[data-theme="dark"] svg text[fill="#7e827e"] { fill: var(--muted); }
html[data-theme="dark"] svg [stroke="#eeefeb"], html[data-theme="dark"] svg [stroke="#d6d8d3"] { stroke: #2b332f; }
html[data-theme="dark"] svg circle[stroke="#f0f0ee"] { stroke: #232b27; } html[data-theme="dark"] svg [stroke="#fff"] { stroke: var(--card); }
/* paper stays white */
html[data-theme="dark"] #d-prev { background: #2a302d; } html[data-theme="dark"] .doc-sheet, html[data-theme="dark"] .doc-sheet * { color-scheme: light; }
@media print { html[data-theme="dark"] body { background: #fff; color: #000; } }
/* theme switch in the header */
.tb-theme { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid #dfe2dd; background: #fff; color: #3d413d; cursor: pointer; padding: 0; }
.tb-theme:hover { background: #f1faf5; border-color: #bfe8d4; color: var(--accent); }
html[data-theme="dark"] .tb-theme { background: #1a211e; border-color: #333c37; color: #e5b94e; } html[data-theme="dark"] .tb-theme:hover { background: #242c28; }
html[data-theme="dark"] label { color: #aab5af; } html[data-theme="dark"] label.chk { color: var(--ink); }

/* theme list in the header */
.tb-tm { position: relative; } .tb-tm .tb-dd { inset-inline-start: auto; inset-inline-end: 0; min-width: 180px; }
.tb-themes button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; text-align: start; }
.tb-themes button i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #b9bfbb; flex: none; }
.tb-themes button:hover, .tb-themes button.on { background: var(--soft); color: var(--accent); } .tb-themes button.on { font-weight: 700; }
html[data-theme="dark"] .tb-themes button:hover, html[data-theme="dark"] .tb-themes button.on { background: #16382a; color: #3ccf8e; }

/* black tone: neutral black and greys */
html[data-tone="black"] { --bg: #1a1a1a; --card: #111111; --line: #262626; --muted: #9a9a9a; --ink: #ececec; }
html[data-tone="black"] body { background: #000; } html[data-tone="black"] .topbar { background: #111; } html[data-tone="black"] .topbar::before { background: #000; }
html[data-tone="black"] .card, html[data-tone="black"] .figs { border-color: #242424; }
html[data-tone="black"] input, html[data-tone="black"] select, html[data-tone="black"] textarea { background: #0b0b0b; border-color: #303030; }
html[data-tone="black"] .btn, html[data-tone="black"] .tb-me, html[data-tone="black"] .tb-theme, html[data-tone="black"] .tb-logout { background: #161616; border-color: #303030; }
html[data-tone="black"] .tb-logout { border-color: #5a2424; }
html[data-tone="black"] .btn:hover, html[data-tone="black"] tbody tr.click:hover, html[data-tone="black"] .tb-h:hover, html[data-tone="black"] .tb-g.open > .tb-h { background: #1e1e1e; }
html[data-tone="black"] tr.parent td, html[data-tone="black"] .tw tfoot td, html[data-tone="black"] table.da th, html[data-tone="black"] tr.total td { background: #161616; }
html[data-tone="black"] .tb-dd, html[data-tone="black"] #acc-pop { background: #141414; border-color: #2c2c2c; } html[data-tone="black"] #acc-pop .ap-h { background: #101010; }
html[data-tone="black"] .bill-foot, html[data-tone="black"] .quick { background: #111; }

/* navy tone: deep blue surfaces */
html[data-tone="navy"] { --bg: #18233b; --card: #111a2e; --line: #23304a; --muted: #93a1bb; --ink: #e5eaf3; }
html[data-tone="navy"] body { background: #0a1120; } html[data-tone="navy"] .topbar { background: #111a2e; border-color: rgba(140,170,230,.5); } html[data-tone="navy"] .topbar::before { background: #0a1120; }
html[data-tone="navy"] .card, html[data-tone="navy"] .figs { border-color: #22304b; }
html[data-tone="navy"] input, html[data-tone="navy"] select, html[data-tone="navy"] textarea { background: #0d1526; border-color: #2c3b5a; }
html[data-tone="navy"] .btn, html[data-tone="navy"] .tb-me, html[data-tone="navy"] .tb-theme, html[data-tone="navy"] .tb-logout { background: #16213a; border-color: #2c3b5a; }
html[data-tone="navy"] .tb-logout { border-color: #6b2a3a; }
html[data-tone="navy"] .btn:hover, html[data-tone="navy"] tbody tr.click:hover, html[data-tone="navy"] .tb-h:hover, html[data-tone="navy"] .tb-g.open > .tb-h { background: #1b2946; }
html[data-tone="navy"] tr.parent td, html[data-tone="navy"] .tw tfoot td, html[data-tone="navy"] table.da th, html[data-tone="navy"] tr.total td { background: #152039; }
html[data-tone="navy"] .tb-dd, html[data-tone="navy"] #acc-pop { background: #131d33; border-color: #2a3956; } html[data-tone="navy"] #acc-pop .ap-h { background: #0f182b; }
html[data-tone="navy"] .bill-foot, html[data-tone="navy"] .quick { background: #111a2e; }
html[data-tone="navy"] label { color: #a9b6cc; } html[data-tone="black"] label { color: #b0b0b0; }
html[data-tone] label.chk { color: var(--ink); }
/* navy: a clearer blue */
html[data-tone="navy"] { --bg: #1c2d52; --card: #14223f; --line: #2a3d66; --muted: #9fb0d0; }
html[data-tone="navy"] body { background: #0c1730; } html[data-tone="navy"] .topbar { background: #14223f; } html[data-tone="navy"] .topbar::before { background: #0c1730; }
html[data-tone="navy"] .card, html[data-tone="navy"] .figs { border-color: #26385e; }
html[data-tone="navy"] input, html[data-tone="navy"] select, html[data-tone="navy"] textarea { background: #0f1b35; border-color: #31466f; }
html[data-tone="navy"] .btn, html[data-tone="navy"] .tb-me, html[data-tone="navy"] .tb-theme { background: #1a2a4c; border-color: #31466f; }
html[data-tone="navy"] tr.parent td, html[data-tone="navy"] .tw tfoot td, html[data-tone="navy"] table.da th, html[data-tone="navy"] tr.total td { background: #182848; }
html[data-tone="navy"] .tb-dd, html[data-tone="navy"] #acc-pop { background: #16264a; }
html[data-tone="navy"] .bill-foot, html[data-tone="navy"] .quick { background: #14223f; }

/* light tone "sky": cool blue-grey paper */
html[data-tone="sky"] { --bg: #e9eff6; --card: #ffffff; --line: #dbe3ed; --muted: #6d7a8c; --soft: #e1f3ea; }
html[data-tone="sky"] body { background: #edf2f8; } html[data-tone="sky"] .topbar::before { background: #edf2f8; }
html[data-tone="sky"] .card, html[data-tone="sky"] .figs { border-color: #d7e0eb; }
html[data-tone="sky"] input, html[data-tone="sky"] select, html[data-tone="sky"] textarea, html[data-tone="sky"] .btn { border-color: #cdd8e5; }
html[data-tone="sky"] tr.parent td, html[data-tone="sky"] .tw tfoot td, html[data-tone="sky"] table.da th, html[data-tone="sky"] tr.total td { background: #f3f6fa; }
html[data-tone="sky"] tbody tr.click:hover { background: #f2f6fb; }
/* light tone "cream": warm ivory paper */
html[data-tone="cream"] { --bg: #f2ece0; --card: #fffdf8; --line: #ebe3d4; --muted: #857c6d; --ink: #1f1b14; }
html[data-tone="cream"] body { background: #f6f1e7; } html[data-tone="cream"] .topbar { background: #fffdf8; } html[data-tone="cream"] .topbar::before { background: #f6f1e7; }
html[data-tone="cream"] .card, html[data-tone="cream"] .figs { border-color: #e8dfcd; }
html[data-tone="cream"] input, html[data-tone="cream"] select, html[data-tone="cream"] textarea { background: #fffefb; border-color: #e0d6c3; }
html[data-tone="cream"] .btn, html[data-tone="cream"] .tb-me, html[data-tone="cream"] .tb-theme { background: #fffdf8; border-color: #e0d6c3; }
html[data-tone="cream"] tr.parent td, html[data-tone="cream"] .tw tfoot td, html[data-tone="cream"] table.da th, html[data-tone="cream"] tr.total td { background: #faf6ee; }
html[data-tone="cream"] tbody tr.click:hover { background: #faf5ea; }
html[data-tone="cream"] .tb-dd, html[data-tone="cream"] #acc-pop, html[data-tone="cream"] .tb-logout { background: #fffdf8; }
/* main buttons keep their green on every tone */
html[data-tone] .btn.pri { background: #008752; border-color: #008752; color: #fff; } html[data-tone] .btn.pri:hover { background: #00744a; }
html[data-theme="dark"][data-tone] .btn.pri { background: #0f8f58; border-color: #0f8f58; } html[data-theme="dark"][data-tone] .btn.pri:hover { background: #12a366; }
/* sky a little bluer so it reads as its own theme */
html[data-tone="sky"] { --bg: #e3ebf6; --line: #d2deec; } html[data-tone="sky"] body { background: #e4edf8; } html[data-tone="sky"] .topbar::before { background: #e4edf8; }
html[data-tone="sky"] .card, html[data-tone="sky"] .figs { border-color: #cfdbea; }
html[data-tone="sky"] tr.parent td, html[data-tone="sky"] .tw tfoot td, html[data-tone="sky"] table.da th, html[data-tone="sky"] tr.total td { background: #eef3fa; }
/* dark themes: the current section is a quiet translucent capsule with white text; only its icon keeps the green */
html[data-theme="dark"] .tb-g.on > .tb-h, html[data-theme="dark"] .tb-h.on { background: rgba(255,255,255,.09); color: #fff; }
html[data-theme="dark"] .tb-g.on > .tb-h .ico, html[data-theme="dark"] .tb-h.on .ico { color: #3ccf8e; }
html[data-theme="dark"] .tb-h:hover, html[data-theme="dark"] .tb-g.open > .tb-h { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .tb-dd a:hover, html[data-theme="dark"] .tb-dd a.on { background: rgba(255,255,255,.08); color: #fff; }
html[data-theme="dark"] .tb-dd a.on { box-shadow: inset -3px 0 0 #3ccf8e; }
html[data-theme="dark"] .tb-me:hover, html[data-theme="dark"] .tb-me.on { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
html[data-theme="dark"] .tb-dd a.on { box-shadow: none; font-weight: 700; }
html[data-theme="dark"] .move-bar { background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.cur { color: var(--warn); font-weight: 700; font-size: 11px; margin-inline-start: 3px; }
/* phone: the logo shrinks with the bar instead of pushing the page wider; the account list fits the screen */
@media (max-width: 900px) { .tb-brand { min-width: 0; flex: 0 1 auto; margin-inline-end: 4px; } .tb-brand img { height: 16px; width: auto; max-width: 112px; } .tb-user { gap: 6px; } }
@media (max-width: 600px) { #acc-pop { min-width: 0; } }
@media (max-width: 600px) { .period .range { width: 100%; flex-wrap: wrap; } .period .range label { flex: 1 1 140px; min-width: 0; } .period .range input { width: 100%; min-width: 0; } }
.lines select.w-s { width: auto; min-width: 96px; }
/* number / date / time boxes (plain text boxes with 0-9; the date one opens the calendar from its button) */
input[data-kind] { text-align: right; font-variant-numeric: tabular-nums; }
.date-wrap { position: relative; display: block; min-width: 0; } .date-wrap > input[data-kind="date"] { width: 100%; padding-inline-end: 30px; }
.date-btn { position: absolute; top: 50%; inset-inline-end: 4px; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.date-btn:hover { color: var(--accent); background: var(--soft); }
.date-pick { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.period .range .date-wrap { width: 150px; } @media (max-width: 600px) { .period .range .date-wrap { width: 100%; } }
@media print { .date-btn { display: none; } }

/* sign-out: the logo's capsule with an exit arrow (no frame, no fill: the stroke is the button) */
html .topbar button.tb-logout, html .topbar button.tb-logout:hover, html .topbar button.tb-logout:focus-visible {
  position: relative; width: 66px; height: 38px; padding: 0; border: 0; border-radius: 0; background: none; color: #c81e1e; display: grid; place-items: center; cursor: pointer; overflow: visible; }
.tb-logout .lo-cap { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tb-logout .lo-line { stroke-dasharray: 120; stroke-dashoffset: 0; transition: stroke-width .2s; }
.tb-logout .lo-ico { position: relative; margin-inline-start: 10px; transition: transform .25s ease; }
.tb-logout:hover .lo-line, .tb-logout:focus-visible .lo-line { animation: lo-draw .7s ease both; stroke-width: 3; }
.tb-logout:hover .lo-arrow, .tb-logout:focus-visible .lo-arrow { animation: lo-step .9s ease-in-out infinite; }
.tb-logout:active .lo-ico { transform: scale(.92); }
@keyframes lo-draw { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes lo-step { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) { .tb-logout:hover .lo-line, .tb-logout:hover .lo-arrow { animation: none; } }
html[data-theme="dark"] .topbar button.tb-logout { color: #f87171; }
@media (max-width: 900px) { html .topbar button.tb-logout { width: 56px; } }

/* colour switch next to sign-out: a capsule track in the logo's green stroke; the knob (sun / moon) sits on the light side
   for the light themes and slides to the other side for the dark ones, turning as it goes */
.topbar .tb-theme.sw { position: relative; width: 56px; height: 30px; padding: 0; border-radius: 999px; border: 1.5px solid transparent; color: #b45309; cursor: pointer;
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(to left, rgba(20,194,124,.2), #14c27c 60%, #00a864) border-box; }
.topbar .tb-theme.sw:hover { background: linear-gradient(#f1faf5, #f1faf5) padding-box, linear-gradient(to left, rgba(20,194,124,.35), #14c27c 60%, #00a864) border-box; }
.sw-knob { position: absolute; top: 2px; inset-inline-start: 2px; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center;
  background: #fff4d6; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: inset-inline-start .4s cubic-bezier(.34,1.45,.5,1), background .3s, color .3s; }
.sw-knob svg { width: 14px; height: 14px; }
.sw-knob.spin { animation: sw-spin .5s ease; } @keyframes sw-spin { from { transform: rotate(-180deg) scale(.6); } to { transform: none; } }
html[data-tone="sky"] .sw-knob { background: #dceafb; color: #1d4ed8; } html[data-tone="cream"] .sw-knob { background: #f3e6c8; color: #92400e; }
html[data-theme="dark"] .topbar .tb-theme.sw { color: #fde68a; background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(to left, rgba(20,194,124,.2), #14c27c 60%, #00a864) border-box; }
html[data-theme="dark"] .sw-knob { inset-inline-start: 28px; background: #26302c; }
html[data-tone="black"] .sw-knob { background: #262626; } html[data-tone="navy"] .sw-knob { background: #1e3a8a; color: #fde68a; }
@media (prefers-reduced-motion: reduce) { .sw-knob { transition: none; } .sw-knob.spin { animation: none; } }

/* the colour switch has no outline of its own: a soft track that the sign-out capsule's fading red line runs into */
.topbar .tb-theme.sw, .topbar .tb-theme.sw:hover, html[data-theme="dark"] .topbar .tb-theme.sw {
  width: 50px; height: 26px; border: 0; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.topbar .tb-theme.sw:hover { box-shadow: inset 0 1px 2px rgba(0,0,0,.12), 0 0 0 3px rgba(20,194,124,.15); }
.topbar .tb-theme.sw .sw-knob { top: 2px; width: 22px; height: 22px; }
html[data-theme="dark"] .topbar .tb-theme.sw .sw-knob { inset-inline-start: 26px; }
html[data-theme="dark"] .topbar .tb-theme.sw { background: rgba(255,255,255,.08); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.tb-user { gap: 2px; }
.kvt { width: auto; min-width: 50%; } .kvt th { text-align: start; color: var(--muted); font-weight: 600; padding: 4px 10px; } .kvt td { padding: 4px 10px; }
/* a printed list (print / save as PDF) */
.rep-print { color: #000; font-size: 11px; direction: rtl; }
.rep-print header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid #008752; }
.rep-print h1 { font-size: 16px; margin: 0; color: #008752; } .rep-print h2 { font-size: 14px; margin: 2px 0 0; color: #000; }
.rep-print .rp-meta { display: flex; gap: 14px; font-size: 10.5px; color: #333; } .rep-print .rp-filter { margin: 0 0 8px; font-size: 10.5px; color: #333; }
.rep-print table { width: 100%; border-collapse: collapse; } .rep-print th, .rep-print td { border: 1px solid #999; padding: 3px 5px; color: #000; background: #fff !important; position: static !important; }
.rep-print th { background: #eef3ef !important; font-weight: 700; } .rep-print tfoot td { font-weight: 700; background: #f4f4f4 !important; }
.rep-print .pill { background: none !important; padding: 0; color: #000; } .rep-print tr { break-inside: avoid; }

/* ===== printed documents, official A4 layout (.doc.v2) ===== */
@media print { html, body, html[data-theme] body, html[data-tone] body { background: #fff !important; color: #000 !important; } }
#print-root { background: #fff; }
.doc.v2 { --dc: #008752; color: #111; line-height: 1.5; font-family: Tajawal, "Segoe UI", Tahoma, sans-serif; position: relative; }
.doc.v2 .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.doc.v2 .dh { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 10px; border-bottom: 2.5px solid var(--dc); }
.doc.v2 .dh-co { flex: 1; } .doc.v2 .dh-co h1 { font-size: 1.75em; line-height: 1.2; margin: 0; color: var(--dc); font-weight: 800; }
.doc.v2 .dh-co p { margin: 1px 0 0; font-size: .9em; color: #333; } .doc.v2 .dh-tag { font-weight: 600; color: #222 !important; }
.doc.v2 .dh-logo { max-width: 30%; object-fit: contain; } .doc.v2 .dh-en { flex: 1; text-align: left; } .doc.v2 .dh-en h1 { font-size: 1.45em; margin: 0; color: var(--dc); }
.doc.v2 .dt { display: flex; align-items: center; gap: 14px; margin: 12px 0 10px; }
.doc.v2 .dt h2 { margin: 0; font-size: 1.25em; font-weight: 800; padding: 3px 18px; border-radius: 999px; border: 1.5px solid var(--dc); color: var(--dc); }
.doc.v2.fill .dt h2 { background: var(--dc); color: #fff; }
.doc.v2 .dt-no { margin-inline-start: auto; display: flex; align-items: baseline; gap: 8px; border: 1.5px solid #222; border-radius: 6px; padding: 2px 12px; }
.doc.v2 .dt-no span { font-size: .85em; color: #444; } .doc.v2 .dt-no b { font-size: 1.25em; }
.doc.v2 .di { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.doc.v2 .di-box { border: 1px solid #bbb; border-radius: 6px; padding: 8px 12px; break-inside: avoid; }
.doc.v2 .di-box h4 { margin: 0 0 2px; font-size: .82em; color: #555; font-weight: 600; } .doc.v2 .di-name { display: block; font-size: 1.15em; font-weight: 800; }
.doc.v2 .di-box p { margin: 2px 0 0; font-size: .92em; color: #222; }
.doc.v2 .di-party:only-child { grid-column: 1 / -1; }
.doc.v2 .di-t { width: 100%; border-collapse: collapse; } .doc.v2 .di-t th { text-align: start; font-weight: 500; color: #555; padding: 2px 0; width: 36%; font-size: .9em; border: 0; background: none; }
.doc.v2 .di-t td { padding: 2px 0; font-weight: 600; border: 0; text-align: start; }
.doc.v2 .doc-lines { width: 100%; border-collapse: collapse; font-size: .95em; }
.doc.v2 .doc-lines thead { display: table-header-group; } /* the column titles repeat on every page */
.doc.v2 .doc-lines th { background: #eef1ef; color: #000; border: 1px solid #9aa09c; padding: 5px 4px; font-weight: 700; text-align: center; }
.doc.v2.fill .doc-lines th { background: var(--dc); color: #fff; border-color: var(--dc); }
.doc.v2 .doc-lines td { border: 1px solid #b5bab6; padding: 4px 6px; text-align: center; } .doc.v2 .doc-lines td.name { text-align: start; font-weight: 600; }
.doc.v2 .doc-lines tbody tr:nth-child(even) td { background: #f6f8f6; } .doc.v2 .doc-lines tr { break-inside: avoid; }
.doc.v2 .doc-lines .c-idx { width: 30px; color: #444; }
.doc.v2 .doc-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-top: 10px; break-inside: avoid; }
.doc.v2 .doc-foot .words { flex: 1; border: 1px dashed #aaa; border-radius: 6px; padding: 8px 12px; min-height: 40px; }
.doc.v2 .doc-foot .words span { display: block; font-size: .82em; color: #555; margin-top: 6px; } .doc.v2 .doc-foot .words span:first-child { margin-top: 0; }
.doc.v2 .doc-foot .words small { font-weight: 500; color: #444; }
.doc.v2 .dtot { width: 42%; max-width: 300px; flex: none; border-collapse: collapse; }
.doc.v2 .dtot th, .doc.v2 .dtot td { border: 1px solid #b5bab6; padding: 4px 10px; font-size: 1em; white-space: nowrap; color: #000; } .doc.v2 .dtot th { text-align: start; font-weight: 600; background: #f6f8f6; }
.doc.v2 .dtot td { text-align: end; font-weight: 600; } .doc.v2 .dtot tr.net th, .doc.v2 .dtot tr.net td { font-weight: 800; font-size: 1.12em; border: 2px solid var(--dc); }
.doc.v2.fill .dtot tr.net th { background: var(--dc); color: #fff; }
.doc.v2 .doc-note { margin-top: 12px; padding: 6px 10px; border-inline-start: 3px solid var(--dc); background: #f7f8f7; white-space: pre-line; font-size: .9em; break-inside: avoid; }
.doc.v2 .doc-sign { display: flex; justify-content: space-around; gap: 20px; margin-top: 46px; break-inside: avoid; }
.doc.v2 .doc-sign div { min-width: 24%; text-align: center; font-size: .92em; } .doc.v2 .doc-sign span { display: block; border-top: 1px solid #000; margin-bottom: 4px; }
.doc.v2 .doc-end { margin-top: 18px; padding-top: 6px; border-top: 1px solid #ddd; text-align: center; font-size: .78em; color: #666; }
.doc.v2 .doc-bar { height: 30px; }
html[data-theme="dark"] #d-prev .doc.v2, html[data-theme="dark"] .doc-sheet { color: #111; }
.doc.v2 .doc-sign div { border-top: 0; padding-top: 0; } .doc.v2 .dtime { color: #555; font-weight: 500; margin-inline-start: 6px; }
.doc.v2 .dh-lines { white-space: pre-line; text-align: start; } .doc.v2 .dh-ph { font-variant-numeric: tabular-nums; letter-spacing: .2px; }

/* accounting map */
.mp-cycle { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; padding: 14px; margin-bottom: 10px; }
.mp-node { flex: 1 1 140px; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; color: var(--ink);
  border: 1.5px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(to left, rgba(20,194,124,.25), #14c27c 60%, #00a864) border-box; }
.mp-node:hover { background: linear-gradient(#f1faf5, #f1faf5) padding-box, linear-gradient(to left, rgba(20,194,124,.25), #14c27c 60%, #00a864) border-box; }
.mp-node span { font-weight: 700; } .mp-node b { font-size: 17px; } .mp-node small { color: var(--muted); font-size: 12px; }
.mp-arrow { flex: 0 1 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; min-width: 90px; }
.mp-arrow i { display: block; width: 100%; height: 2px; background: #9fb3a8; position: relative; }
.mp-arrow i::after { content: ''; position: absolute; left: -2px; top: -4px; border: 5px solid transparent; border-right: 8px solid #9fb3a8; } /* points left: the flow reads right to left */
.mp-arrow span { font-size: 12px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.mp-back { flex-basis: 100%; text-align: center; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.mp-rule { font-size: 13px; line-height: 1.8; margin: 0 0 6px; }
.mp-g { margin: 16px 2px 8px; font-size: 15px; color: var(--ink); }
.mp-list { display: grid; gap: 8px; }
.mp-op { display: grid; grid-template-columns: minmax(200px, 1.1fr) minmax(320px, 2fr) minmax(200px, 1fr); gap: 12px; background: var(--card); border: 1px solid #dfe1dc; border-radius: 6px; padding: 10px 12px; align-items: start; break-inside: avoid; }
.mp-h a { color: var(--ink); } .mp-h a:hover b { color: var(--accent); } .mp-h b { font-size: 14.5px; } .mp-h p { margin: 3px 0 4px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.mp-fig { font-size: 12px; color: var(--muted); } .mp-fig b { color: var(--ink); }
.mp-entry { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mp-entry h5 { margin: 0; padding: 4px 10px; font-size: 12px; } .mp-dr h5 { background: #e7f6ec; color: #15803d; } .mp-cr h5 { background: #fde8e8; color: #b91c1c; }
.mp-cr { border-inline-start: 1px solid var(--line); }
.mp-entry ul { list-style: none; margin: 0; padding: 4px 10px 6px; } .mp-entry li { padding: 3px 0; font-size: 13px; } .mp-entry li small { display: block; color: var(--muted); font-size: 11.5px; }
.mp-none { display: block; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; background: var(--bg); }
.mp-meta { display: grid; gap: 6px; font-size: 12.5px; } .mp-meta span { display: block; color: var(--muted); font-size: 11.5px; }
html[data-theme="dark"] .mp-dr h5 { background: #123323; color: #4ade80; } html[data-theme="dark"] .mp-cr h5 { background: #3b1a1a; color: #f87171; } html[data-theme="dark"] .mp-op { border-color: var(--line); }
@media (max-width: 1000px) { .mp-op { grid-template-columns: 1fr; } .mp-arrow { flex-basis: 100%; min-width: 0; padding: 6px 0; } .mp-arrow i { width: 2px; height: 22px; } .mp-arrow i::after { left: -4px; top: auto; bottom: -4px; border: 5px solid transparent; border-top: 8px solid #9fb3a8; } }
@media print { .mp-op { border-color: #999; } .mp-node { border: 1px solid #999; background: #fff; } }
.mp-n { color: var(--muted); font-size: 11.5px; margin-inline-start: 4px; }

/* accounting map as a plain tree: system → branches → operations, then the chosen operation in plain words */
.tr-wrap { padding: 16px 12px 14px; margin-bottom: 10px; }
.tr-root { width: max-content; margin: 0 auto; padding: 7px 22px; border-radius: 999px; font-weight: 800; color: #fff; background: var(--accent); position: relative; }
.tr-root::after { content: ''; position: absolute; left: 50%; bottom: -16px; width: 2px; height: 16px; background: #b9cbbf; }
.tr-branches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding-top: 16px; position: relative; }
.tr-branches::before { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 2px; background: #b9cbbf; }
.tr-branch { position: relative; display: flex; flex-direction: column; align-items: stretch; }
.tr-branch::before { content: ''; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px; background: #b9cbbf; }
.tr-g { text-align: center; font-weight: 800; padding: 6px 8px; border-radius: 8px; background: var(--soft); color: var(--accent); }
.tr-leaves { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; padding-inline-start: 12px; border-inline-start: 2px solid #d6e3da; }
.tr-leaf { display: block; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; background: var(--card); position: relative; }
.tr-leaf::before { content: ''; position: absolute; inset-inline-start: -14px; top: 50%; width: 12px; height: 2px; background: #d6e3da; }
.tr-leaf:hover { border-color: #14c27c; } .tr-leaf.on { border-color: var(--accent); background: var(--soft); color: var(--accent); font-weight: 700; }
.tr-sel { padding: 14px 16px; }
.tr-sel-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.tr-sel-h h2 { margin: 2px 0 4px; font-size: 19px; } .tr-sel-h p { margin: 0; color: #444; font-size: 14px; }
.tr-sel-acts { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.tr-q { margin: 16px 0 8px; font-size: 14px; }
.fx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fx { display: inline-flex; flex-direction: column; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); min-width: 150px; font-size: 14px; }
.fx b { font-size: 15px; } .fx small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fx.up { background: #ecf8f1; border-color: #bfe8d4; color: #15803d; } .fx.down { background: #fdf0f0; border-color: #f3c4c4; color: #b91c1c; } .fx.same { background: var(--bg); color: var(--ink); }
.fx.up b, .fx.down b { color: var(--ink); }
.tr-shows { margin: 14px 0 0; font-size: 13.5px; }
.tr-acc { margin-top: 14px; } .tr-acc summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
html[data-theme="dark"] .fx.up { background: #123323; border-color: #1f5a3c; color: #4ade80; } html[data-theme="dark"] .fx.down { background: #3b1a1a; border-color: #6b2a2a; color: #f87171; }
html[data-theme="dark"] .tr-sel-h p { color: var(--muted); }
@media (max-width: 1000px) { .tr-branches { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tr-branches::before, .tr-branch::before, .tr-root::after { display: none; } }
.tr-branches { grid-template-columns: repeat(6, minmax(0, 1fr)); } @media (max-width: 1000px) { .tr-branches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc.v2 .dt-no { font-family: Tajawal, "Segoe UI", sans-serif; letter-spacing: .6px; } .doc.v2 .dt-no b { font-size: 1.2em; font-weight: 800; font-variant-numeric: tabular-nums; }
.modal-bg { z-index: 60; } /* above the floating header */
