/* SGA ERP / app.css — components (docs/DESIGN.md). Reads ONLY the custom properties of static/css/tokens.css (loaded
   first), plus a few theme-scoped rules on html[data-theme="dark"] where glass needs more than a colour (blur, glow,
   aurora). Logical properties only, so Arabic (dir=rtl) mirrors without a second sheet. No inline styles anywhere (CSP):
   bar widths come from data-w (app.js) or SVG geometry.
   Layout (1440 wide, light): sidebar 248 + canvas (28 + content + 28), content max 1360. Dark: the same grid, with the
   sidebar floating 16px off the edges. Tablet ≤ 1100: the sidebar becomes a full-screen sheet behind the menu button.
   Phone ≤ 640: top bar (menu · title · one action), floating bottom bar with the raised red + in the middle. */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--text); font: var(--fs-body)/var(--lh-body) var(--font); -webkit-font-smoothing: antialiased; min-height: 100svh; min-height: 100dvh; overscroll-behavior-y: none; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd, pre { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, table, .kpi-value, .totals, .kv dd, .fig { font-variant-numeric: tabular-nums; }
.ltr, bdi.num { direction: ltr; unicode-bidi: isolate; }
.ltr { display: inline-block; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; inset-block-start: -60px; inset-inline-start: 8px; background: var(--surface-solid); color: var(--text); padding: 10px 14px; border-radius: var(--radius-control); z-index: 60; box-shadow: var(--popover-shadow); }
.skip-link:focus { inset-block-start: 8px; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.tiny { width: 14px; height: 14px; }
.ic.lg { width: 22px; height: 22px; }
html[dir="rtl"] .ic-flip { transform: scaleX(-1); }
.muted, .sub-muted { color: var(--text-2); }
.pos { color: var(--green-ink); }
.neg, .row-end.neg, td.neg { color: var(--red-ink); }
.zero { color: var(--text-2); }

/* ---------- the light behind the glass (dark only) ---------- */
.aurora { display: none; }
html[data-theme="dark"] .aurora { display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 32px 32px; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.42; }
.aurora .a1 { width: 620px; height: 620px; inset-block-start: -240px; inset-inline-start: 140px; background: radial-gradient(circle, #C4161C 0%, transparent 65%); }
.aurora .a2 { width: 680px; height: 680px; inset-block-end: -320px; inset-inline-end: -140px; background: radial-gradient(circle, #1F4F9A 0%, transparent 65%); }
.aurora .a3 { width: 420px; height: 420px; inset-block-start: 40%; inset-inline-start: 44%; background: radial-gradient(circle, #5B2A86 0%, transparent 70%); opacity: 0.26; }
@media (prefers-reduced-transparency: reduce) { .aurora i { display: none; } }

/* glass: a panel is frosted only where it sits on the ground (never nested) */
.glass, .panel, .kpis, .settings-panel, .kpi-card, .cash-card, .login-card, .offline-card, .error-card {
  background: var(--panel-bg); border: 1px solid var(--panel-line); border-radius: var(--radius-card); box-shadow: var(--panel-shadow); }
html[data-theme="dark"] :is(.glass, .panel, .kpis, .settings-panel, .kpi-card, .cash-card, .login-card, .offline-card, .error-card) {
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%); backdrop-filter: blur(var(--blur)) saturate(140%); border-radius: var(--radius-xl); }
html[data-theme="dark"] :is(.panel, .kpis, .settings-panel, .kpi-card, .cash-card) :is(.panel, .kpis, .settings-panel) {
  -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--inner-bg); box-shadow: none; }

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; min-height: 100dvh; }
/* light: the charcoal column runs the full page height, also past a sticky sidebar on a long page */
html:not([data-theme="dark"]) .app { background: linear-gradient(to right, var(--shell) var(--sidebar-width), transparent var(--sidebar-width)); }
html:not([data-theme="dark"])[dir="rtl"] .app { background: linear-gradient(to left, var(--shell) var(--sidebar-width), transparent var(--sidebar-width)); }
.sidebar { position: sticky; inset-block-start: 0; height: 100svh; height: 100dvh; display: flex; flex-direction: column; gap: 2px; padding: 22px 14px 14px;
  overflow-y: auto; overscroll-behavior: contain; background: var(--shell); color: var(--on-shell-2); scrollbar-width: thin; scrollbar-color: var(--shell-line) transparent; }
.sidebar > * { flex-shrink: 0; }
html[data-theme="dark"] .app { gap: 16px; padding: 16px; }
html[data-theme="dark"] .sidebar { inset-block-start: 16px; height: calc(100dvh - 32px); border: 1px solid var(--panel-line); border-radius: 24px; box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%); backdrop-filter: blur(var(--blur)) saturate(140%); }
.brand { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 2px 8px 20px; }
.brand-link { display: block; border-radius: 8px; }
.brand-lockup { display: block; width: 168px; height: auto; }
.icon-btn.sheet-close { display: none; }
.sidebar .nav-search { display: none; }
.group-label { padding: 16px 10px 6px; font-size: var(--fs-tiny); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-shell-3); }
html[lang="ar"] .group-label { letter-spacing: 0; text-transform: none; font-size: var(--fs-small); }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--nav-row); padding: 0 10px; border-radius: 8px; color: var(--on-shell-2);
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.nav-item .ic { color: var(--on-shell-3); transition: color var(--t-hover) ease; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--shell-3); color: var(--on-shell); }
.nav-item:hover .ic { color: var(--on-shell); }
.nav-item[aria-current="page"] { background: var(--shell-3); color: #FFFFFF; font-weight: 600; }
.nav-item[aria-current="page"] .ic { color: #FFFFFF; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -14px; inset-block: 8px; width: 3px; border-start-end-radius: 3px; border-end-end-radius: 3px; background: var(--red); }
html[data-theme="dark"] .nav-item { border-radius: 12px; }
html[data-theme="dark"] .nav-item[aria-current="page"] { background: linear-gradient(90deg, rgba(229, 72, 77, 0.28), rgba(229, 72, 77, 0.06)); box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.35), 0 0 18px -6px rgba(229, 72, 77, 0.55); }
html[data-theme="dark"][dir="rtl"] .nav-item[aria-current="page"] { background: linear-gradient(-90deg, rgba(229, 72, 77, 0.28), rgba(229, 72, 77, 0.06)); }
html[data-theme="dark"] .nav-item[aria-current="page"]::before { display: none; }
html[data-theme="dark"] .nav-item[aria-current="page"] .ic { color: #FF8A8E; }
.nav-count { min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--radius-pill); background: var(--red); color: #FFFFFF; font: 700 var(--fs-tiny)/1 var(--font-figure); }
.sidebar .bottom { margin-block-start: auto; padding-block-start: 12px; border-block-start: 1px solid var(--shell-line); display: grid; gap: 2px; }
.sidebar .bottom .nav-list { margin-block-end: 6px; }
.lang-toggle { display: flex; gap: 6px; align-items: center; padding: 6px 10px; color: var(--on-shell-3); font-size: 13px; }
.lang-toggle a, .lang-toggle button { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 32px; padding: 4px 8px; border-radius: 8px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.lang-toggle a:hover, .lang-toggle button:hover { color: var(--on-shell); background: var(--shell-3); }
.lang-toggle a[aria-current="true"], .lang-toggle button[aria-current="true"] { color: var(--on-shell); font-weight: 700; }
.lang-toggle form { display: contents; }
.lang-toggle.centered { justify-content: center; margin-block-start: 8px; color: var(--text-2); }
.lang-toggle.centered a:hover { color: var(--text); background: var(--surface-2); }
.lang-toggle.centered a[aria-current="true"] { color: var(--text); }

/* the user block: avatar + name; opens a small menu (profile, password, sign out) */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--on-shell); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--shell-3); }
.user-menu > summary .ic { margin-inline-start: auto; color: var(--on-shell-3); transition: transform var(--t-ui) var(--ease-out); }
.user-menu[open] > summary .ic { transform: rotate(180deg); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #FFFFFF; font: 700 13px/1 var(--font-figure); letter-spacing: 0.02em; }
html[data-theme="dark"] .avatar { border-radius: 12px; background: linear-gradient(135deg, #E5484D, #8E1015); box-shadow: 0 6px 16px -6px rgba(229, 72, 77, 0.7); }
.user-name { display: grid; min-width: 0; line-height: 1.3; font-weight: 600; }
.user-name .sub { display: block; font-weight: 400; font-size: var(--fs-small); color: var(--on-shell-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .popover { position: absolute; inset-inline: 0; inset-block-end: calc(100% + 6px); z-index: 40; }
.user-menu .popover a, .user-menu .popover button { width: 100%; }

/* popovers and menus (user menu, "+ New", module menus) */
.popover { padding: 6px; border-radius: var(--radius-card); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--popover-shadow); color: var(--text); }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--radius-inner); background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.menu-item .ic { color: var(--text-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item:hover .ic { color: var(--text); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.popover form { margin: 0; }

/* ---------- work column: top bar + canvas ---------- */
.work { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px var(--pad) 0; }
html[data-theme="dark"] .topbar { padding: 0; }
.topbar .menu-btn, .topbar-title, .topbar-action { display: none; }
.today { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-tint); flex: none; }
html[data-theme="dark"] .live-dot { box-shadow: 0 0 0 4px rgba(61, 214, 140, 0.15), 0 0 12px var(--green); }
.gsearch { flex: 1; max-width: 540px; margin-inline-start: auto; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 16px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease; }
html[dir="rtl"] .gsearch { padding: 0 16px 0 8px; }
html[data-theme="dark"] .gsearch { background: var(--panel-bg); border-color: var(--panel-line); box-shadow: var(--panel-shadow); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.gsearch:focus-within { border-color: var(--text-2); }
.gsearch input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); }
.gsearch input::placeholder { color: var(--text-3); opacity: 1; }
.gsearch input::-webkit-search-cancel-button { filter: grayscale(1); }
.gsearch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.gsearch kbd { font: 600 var(--fs-tiny)/1 var(--font); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; color: var(--text-2); }
.btn-new { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-pill); background: var(--hot-bg); color: var(--hot-ink); font-weight: 700; cursor: pointer; box-shadow: var(--hot-glow); white-space: nowrap; transition: background var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn-new:hover { background: var(--hot-bg-hover); }
.btn-new:active { transform: translateY(1px); }
.btn-new[aria-expanded="true"] .ic { transform: rotate(45deg); }
.btn-new .ic { transition: transform var(--t-ui) var(--ease-out); }
.canvas { min-width: 0; padding: 18px var(--pad) 40px; display: block; }
html[data-theme="dark"] .canvas { padding: 16px 0 24px; }
.canvas > * { max-width: var(--content-max); }
.bare-canvas { max-width: none; padding: 0; }
.bottombar, .scrim { display: none; }
.flash { margin-block-end: var(--gap); padding: 10px 14px; border: 1px solid var(--green-tint); border-radius: var(--radius-control); background: var(--green-tint); color: var(--green-ink); font-weight: 600; }

/* "+ New" menu: a popover under the top-bar button on PC, a bottom sheet on phones */
.new-menu { position: fixed; z-index: 45; inset-block-start: 70px; inset-inline-end: var(--pad); width: 280px; max-height: calc(100dvh - 90px); overflow-y: auto; }
html[data-theme="dark"] .new-menu { inset-block-start: 68px; inset-inline-end: 16px; }
.new-menu-title { padding: 8px 10px 6px; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); }
.new-list { display: grid; gap: 2px; }
.new-list .menu-item .ic { width: 20px; height: 20px; }

/* ---------- title row and page header ---------- */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-block-end: 20px; }
.title-row h1, .page-title { font: 800 var(--fs-title)/1.2 var(--font-display); letter-spacing: -0.01em; }
html[lang="ar"] :is(.title-row h1, .page-title, h1, h2, h3) { letter-spacing: 0; font-weight: 700; line-height: 1.4; }
.title-row .sub, p.sub { margin-block-start: 4px; color: var(--text-2); }
.title-row .actions { display: flex; gap: 8px; flex: none; align-items: center; }
.title-row .pill { vertical-align: middle; margin-inline-start: 8px; }
.stamp { color: var(--text-2); font-size: var(--fs-small); }

/* summary band: the dark "position" strip a list page may open with (DESIGN.md §5.1) */
.band { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 24px 26px; background-color: var(--shell); color: var(--on-shell);
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px; }
html[data-theme="dark"] .band { background-color: var(--panel-bg); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); -webkit-backdrop-filter: blur(var(--blur)) saturate(140%); backdrop-filter: blur(var(--blur)) saturate(140%); }
.band .lab, .band .note, .band .sub { color: var(--on-shell-2); }
.band-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px 24px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 24px; border-block-end: 1px solid var(--line); margin-block-end: var(--gap); overflow-x: auto; scrollbar-width: none; }
.tabs a { position: relative; padding: 10px 0; color: var(--text-2); white-space: nowrap; font-weight: 500; transition: color var(--t-hover) ease; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: 2px; border-radius: 2px; background: var(--red); }
html[data-theme="dark"] .tabs a[aria-current="page"]::after { box-shadow: 0 0 10px rgba(229, 72, 77, 0.7); }

/* ---------- filters ---------- */
.filters { display: flex; align-items: center; gap: 8px; margin-block-end: var(--gap); flex-wrap: wrap; }
.filters .input { height: var(--input-height); max-width: 220px; }
.filters .input.search, .filters input[type="search"] { max-width: 300px; border-radius: var(--radius-pill); padding-inline: 16px; }
.filters .spacer { flex: 1; }

/* ---------- panels and grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-block-start: var(--gap); }
.grid.top { align-items: start; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-7 { grid-column: span 7; } .col-6 { grid-column: span 6; } .col-5 { grid-column: span 5; } .col-4 { grid-column: span 4; }
.stack { display: grid; gap: var(--gap); }
.panel { padding: var(--card-pad); min-width: 0; }
.panel + .panel, .kpis + .panel, .panel + .kpis { margin-block-start: var(--gap); }
.grid > .panel + .panel { margin-block-start: 0; }
.panel > header, .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-block-end: 14px; }
.panel h2, .panel-title { font: 700 var(--fs-section)/1.3 var(--font-display); }
.panel h3 { font-size: var(--fs-body); font-weight: 600; }
.panel .meta, .panel header small { display: block; color: var(--text-2); font-size: var(--fs-small); margin-block-start: 2px; }
.sub-head { font-size: var(--fs-body); font-weight: 600; color: var(--text-2); margin: 16px 0 8px; }
.inner { border: 1px solid var(--inner-line); border-radius: var(--radius-inner); background: var(--inner-bg); padding: 14px 16px; }
.chart-panel { margin-block-start: var(--gap); }
.chart { position: relative; min-width: 0; }
.chart > svg { direction: ltr; }
.chart-note { margin-block-start: 8px; color: var(--text-2); font-size: var(--fs-small); }
.chart-legend, .legend-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-small); line-height: 16px; color: var(--text-2); }
.chart-legend li, .legend-row li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.chart-legend svg { flex: none; overflow: visible; }
.card-link, .link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; white-space: nowrap; flex: none; padding: 0; border: 0; background: none; color: var(--text); font-weight: 600; cursor: pointer; text-underline-offset: 3px; }
.card-link::after { content: ""; width: 12px; height: 12px; flex: none; background: currentColor; -webkit-mask: var(--chevron) center / 12px no-repeat; mask: var(--chevron) center / 12px no-repeat; }
html[dir="rtl"] .card-link::after { transform: scaleX(-1); }
.card-link:hover, .link:hover { text-decoration: underline; }

/* list rows */
.rows { display: grid; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 0; }
.row + .row { border-block-start: 1px solid var(--line-soft); }
.row-main { display: grid; min-width: 0; }
.row-title { font-weight: 600; }
.rows > .row { position: relative; }
.rows > .row .row-main > a::after { content: ""; position: absolute; inset: 0; }
.rows > .row .row-main > a:focus-visible { outline: none; }
.rows > .row .row-main > a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.row-main .sub, td .sub { display: block; font-size: var(--fs-small); color: var(--text-2); }
.row-end { flex: none; color: var(--text-2); font-size: 13px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
.kv dt { color: var(--text-2); } .kv dd { text-align: end; }

/* ---------- KPIs ---------- */
/* .kpis: one divided strip (module list pages); .kpi-card: a stand-alone card with an optional sparkline (dashboard) */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); overflow: hidden; }
.kpi { padding: 16px var(--card-pad); min-width: 0; }
.kpi + .kpi { border-inline-start: 1px solid var(--line); }
.kpi-label, .lab { color: var(--text-2); font-size: 13px; }
.kpi-value, .val { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin-block-start: 4px; font: 700 var(--fs-kpi)/1.15 var(--font-figure); letter-spacing: -0.01em; white-space: nowrap; }
.kpi.lead .kpi-value { font-size: 30px; font-weight: 800; }
.kpis-5 { grid-auto-flow: row; grid-template-columns: minmax(0, 1.45fr) repeat(4, minmax(0, 1fr)); }
.kpi-value small, .val small, .unit { font: 600 var(--fs-small) var(--font); color: var(--text-2); letter-spacing: 0; }
.kpi-value.zero { color: var(--text-2); font-weight: 500; }
.kpi-value.neg { color: var(--red-ink); }
.delta, .note { margin-block-start: 4px; font-size: var(--fs-small); color: var(--text-2); }
.delta .up, .up { color: var(--green-ink); font-weight: 600; } .delta .down, .down { color: var(--red-ink); font-weight: 600; }
.kpi-card { position: relative; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr) 104px; grid-template-rows: auto auto 1fr; column-gap: 10px; align-items: end; min-width: 0; }
.kpi-card .lab { grid-column: 1 / -1; font: 500 13px/1.4 var(--font); }
.kpi-card .val { grid-column: 1 / -1; }
.kpi-card .note { grid-column: 1; align-self: end; }
.kpi-card .spark { grid-column: 2; grid-row: 3; width: 104px; height: 32px; align-self: end; }
.kpi-card a.kpi-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kpi-card a.kpi-link:focus-visible { outline: none; }
.kpi-card:has(a.kpi-link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.kpi-card:has(a.kpi-link):hover { border-color: var(--control); }

/* sparklines and the chart palette (classes, so SVG needs no inline style) */
.spark .sline { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark.s-blue .sline { stroke: var(--blue); } .spark.s-blue .sfill { fill: var(--blue-tint); }
.spark.s-amber .sline { stroke: var(--amber); } .spark.s-amber .sfill { fill: var(--amber-tint); }
.spark.s-violet .sline { stroke: var(--violet); } .spark.s-violet .sfill { fill: var(--violet-tint); }
.spark.s-red .sline { stroke: var(--red); } .spark.s-red .sfill { fill: var(--red-tint); }
.spark.s-green .sline { stroke: var(--green); } .spark.s-green .sfill { fill: var(--green-tint); }
.spark .sbase { stroke: var(--chart-grid); stroke-width: 1; }
.c-blue { color: var(--blue); } .c-amber { color: var(--amber); } .c-violet { color: var(--violet); } .c-red { color: var(--red); } .c-steel { color: var(--steel); } .c-green { color: var(--green); }

/* ---------- pills and chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: var(--fs-small); font-weight: 600; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; flex: none; }
.pill.pos { background: var(--green-tint); color: var(--green-ink); }
.pill.neg { background: var(--red-tint); color: var(--red-ink); }
.pill.warn { background: var(--amber-tint); color: var(--amber-ink); }
.pill.info { background: var(--blue-tint); color: var(--blue-ink); }
html[data-theme="dark"] .pill.pos { box-shadow: inset 0 0 0 1px rgba(61, 214, 140, 0.35); }
html[data-theme="dark"] .pill.neg { box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.35); }
html[data-theme="dark"] .pill.warn { box-shadow: inset 0 0 0 1px rgba(245, 179, 66, 0.3); }
html[data-theme="dark"] .pill.info { box-shadow: inset 0 0 0 1px rgba(91, 155, 255, 0.3); }
.pill.verify { margin-inline-start: 8px; }
.pill.on-dark { background: rgba(30, 107, 69, 0.24); color: #9FE3BD; }
.chip { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.chip.red { background: var(--red-tint); color: var(--red-ink); }
.chip.amber { background: var(--amber-tint); color: var(--amber-ink); }
.chip.blue { background: var(--blue-tint); color: var(--blue-ink); }
.chip.green { background: var(--green-tint); color: var(--green-ink); }
html[data-theme="dark"] .chip.red { box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.3); }
html[data-theme="dark"] .chip.amber { box-shadow: inset 0 0 0 1px rgba(245, 179, 66, 0.28); }
html[data-theme="dark"] .chip.blue { box-shadow: inset 0 0 0 1px rgba(91, 155, 255, 0.28); }
.count { min-width: 28px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: var(--radius-pill); background: var(--red); color: #FFFFFF; font: 700 13px/1 var(--font-figure); }
html[data-theme="dark"] .count { border-radius: 10px; background: var(--hot-bg); box-shadow: 0 6px 14px -6px rgba(229, 72, 77, 0.9); }
.count.zero { background: var(--surface-3); color: var(--text-2); box-shadow: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--input-height); padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--control);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
html[data-theme="dark"] :where(.btn) { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] :where(.btn):hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.24); }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; box-shadow: var(--primary-glow); }
.btn.primary:hover { background: var(--primary-bg-hover); }
.btn.hot { background: var(--hot-bg); color: var(--hot-ink); border-color: transparent; box-shadow: var(--hot-glow); }
.btn.hot:hover { background: var(--hot-bg-hover); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.negative { color: var(--red-ink); }
.btn.small { height: var(--control-height); padding: 0 14px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.55; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar .icon-btn { color: var(--on-shell-2); }
.sidebar .icon-btn:hover { background: var(--shell-3); color: var(--on-shell); }
/* row action: the compact pill button of an action queue / project card (aka .abtn in the prototypes) */
.abtn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; background: var(--surface); color: var(--text); transition: border-color var(--t-hover) ease, background var(--t-hover) ease; }
.abtn:hover { border-color: var(--line-strong); }
.abtn.primary { background: var(--primary-bg); border-color: transparent; color: var(--primary-ink); box-shadow: var(--primary-glow); }
.abtn.hot { background: var(--hot-bg); border-color: transparent; color: var(--hot-ink); box-shadow: var(--hot-glow); }
html[data-theme="dark"] :where(.abtn) { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.2); }
html[data-theme="dark"] :where(.abtn):hover { background: rgba(255, 255, 255, 0.14); }
html[data-theme="dark"] .abtn.primary, html[data-theme="dark"] .abtn.hot { background: var(--hot-bg); border-color: transparent; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field label, .field .label { font-weight: 600; font-size: 13px; color: var(--text); }
.field .req { color: var(--red-ink); }
.field .hint { color: var(--text-2); font-size: var(--fs-small); }
.field .error { color: var(--red-ink); font-size: var(--fs-small); font-weight: 600; }
.field .static { min-height: var(--input-height); display: flex; align-items: center; }
.input, select.input { height: var(--input-height); padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); width: 100%; min-width: 0;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease; }
select.input { appearance: none; -webkit-appearance: none; padding-inline-end: 34px; background-image: var(--select-chevron); background-repeat: no-repeat; background-size: 12px; background-position: right 12px center; }
html[dir="rtl"] select.input { background-position: left 12px center; }
html[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23B4BAC3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="dark"] :where(.input) { background-color: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); }
html[data-theme="dark"] select.input option { background: #171B21; color: var(--text); }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--red-tint); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
textarea.input { height: auto; padding: 8px 12px; line-height: 20px; resize: vertical; }
.input.file { padding: 7px 12px; line-height: 22px; }
.input::placeholder { color: var(--text-3); opacity: 1; }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text); }
.input.invalid, .has-error .input, .input[aria-invalid="true"] { border-color: var(--red-ink); }
.input.num { text-align: end; direction: ltr; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--red); width: 16px; height: 16px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-block-start: 6px; }
.field-check label { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; min-height: 24px; }
summary { padding-block: 2px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-block-start: 18px; }
.form-narrow { max-width: 520px; }
.form-error { margin-block-end: 16px; padding: 10px 14px; border-radius: var(--radius-control); background: var(--red-tint); color: var(--red-ink); font-weight: 600; }
.param { display: grid; gap: 4px; align-content: start; }
.logout-all { margin-block-start: 24px; }
.logo-preview { max-height: 72px; width: auto; margin-block-end: 12px; }
.prefix { max-width: 110px; }
/* segmented choice (theme / language on the profile page): radio-like buttons in one pill */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row form { margin: 0; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--control); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; }
html[data-theme="dark"] :where(.choice) { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.16); }
.choice:hover { border-color: var(--line-strong); }
.choice[aria-current="true"] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.choice[aria-current="true"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* settings: label column beside a panel */
.settings-section { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 24px; padding: 24px 0; border-block-end: 1px solid var(--line); }
.settings-section:first-of-type { padding-block-start: 8px; }
.settings-label h2 { font: 700 var(--fs-section)/1.3 var(--font-display); margin-block-start: 6px; }
.settings-label p { color: var(--text-2); margin-block-start: 6px; }
.settings-panel { padding: 18px; min-width: 0; }
.settings-actions { position: sticky; inset-block-end: 0; padding: 12px 0; background: var(--canvas); z-index: 5; }
.panel.danger h2 { color: var(--red-ink); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.param-gap { margin-block-start: 16px; }
.param-sub { font-size: 14px; font-weight: 600; margin-block: 20px 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.param-set { border: 0; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.param-set legend { font-weight: 600; padding: 0; margin-block-end: 2px; }
.param-table { width: auto; min-width: 280px; }
.param-table td { padding-block: 6px; vertical-align: top; }
.param-table .input.num { width: 104px; }
.param-from { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.param-table .param-from .input[type=date] { width: 160px; }
.param > .pill.verify, .param-sub .pill.verify { justify-self: start; margin-inline-start: 0; }
.param-confirm { display: grid; gap: 2px; margin-block-start: 16px; padding-block-start: 12px; border-block-start: 1px solid var(--line-soft); }
.licence-days.neg { color: var(--red-ink); font-weight: 600; }
.licence-days.warn { color: var(--amber-ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; }
th { height: 38px; padding: 0 12px; text-align: start; font-weight: 600; font-size: var(--fs-small); color: var(--text-2); border-block-end: 1px solid var(--line); white-space: nowrap; }
td { padding: calc((var(--row-height) - 20px) / 2) 12px; border-block-end: 1px solid var(--line-soft); vertical-align: baseline; }
tbody tr:last-child td { border-block-end: 0; }
tbody tr { transition: background-color var(--t-hover) ease; }
.rows-table tbody tr:hover td { background: var(--surface-2); }
tbody tr[aria-selected="true"] td { background: var(--surface-3); }
th.num, td.num { text-align: end; }
td.num { font-family: var(--font-figure); font-weight: 500; }
td a { font-weight: 600; }
td a:hover { color: var(--red-ink); }
td.wrap { white-space: normal; }
.truncate { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows-table td:first-child, .rows-table th:first-child { padding-inline-start: 4px; }
.rows-table td:last-child, .rows-table th:last-child { padding-inline-end: 4px; }
.money-total { font-family: var(--font-figure); font-weight: 700; }
.audit-data summary { color: var(--text-2); font-size: var(--fs-small); }
.audit-data pre { font-size: var(--fs-small); white-space: pre-wrap; max-height: 200px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 6px; margin-block-start: 4px; }

/* ---------- the line-item editor ---------- */
.lines-table th.num, .lines-table td.num { text-align: end; }
.lines-table td { padding: 6px; vertical-align: top; }
.lines-table td.desc { min-width: 240px; }
.lines-table td.desc .input + .input { margin-block-start: 6px; }
.lines-table .idx { padding-block-start: 14px; color: var(--text-2); width: 2.5ch; }
.lines-table td[data-line-amount] { padding-block-start: 14px; font-weight: 600; }
.lines-table input.num { width: 110px; }
.lines [data-line-add] { margin: 12px 0 16px; }
.totals { display: grid; grid-template-columns: max-content minmax(140px, 200px); gap: 8px 24px; justify-content: end; align-items: center; }
.totals dt { color: var(--text-2); text-align: end; }
.totals dd { text-align: end; font-family: var(--font-figure); font-weight: 600; }
.totals .grand { font: 800 var(--fs-section) var(--font-figure); color: var(--text); }
.totals dt.grand { font-family: var(--font-display); }
.totals .input { height: var(--control-height); }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 12px; color: var(--text-2); font-size: 13px; }
.pager-links { display: flex; gap: 8px; }

/* empty state keeps the frame */
.empty { display: grid; place-items: center; gap: 6px; min-height: 104px; padding: 18px; border: 1px dashed var(--control); border-radius: var(--radius-inner); color: var(--text-2); text-align: center; }
.empty.all-clear { border-style: solid; border-color: var(--green-tint); background: var(--green-tint); color: var(--green-ink); font-weight: 600; }
.rows .empty, .grid > .empty, li > .empty { grid-column: 1 / -1; width: 100%; }
.skeleton { background: var(--surface-2); border-radius: 4px; }

/* ---------- dashboard ---------- */
.dash { display: grid; gap: var(--gap); }
.dash > * { min-width: 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); }
.hero.solo { grid-template-columns: minmax(0, 1fr); }
.cash-card { padding: 24px 26px 12px; display: grid; gap: 10px; align-content: start; min-width: 0; }
/* light: the cash card is the dark "company position" band with the blueprint grid */
html:not([data-theme="dark"]) .cash-card { background-color: var(--shell); border-color: var(--shell); color: var(--on-shell); border-radius: var(--radius-xl);
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px); background-size: 24px 24px;
  --text: #F3F1EC; --text-2: #B9BCC2; --text-3: #9A9EA5; --chart-grid: #33373D; --chart-tick: #9EA2A9; --chart-base: #6B7078;
  --chart-line: #FF5A5F; --chart-area-top: rgba(255, 90, 95, 0.32); --chart-in: #6E9BD6; --chart-out: #7D8592; --focus: #FF8A8E; }
.cash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cash-head h1 { font: 800 26px/1.2 var(--font-display); letter-spacing: -0.01em; }
html[data-theme="dark"] .cash-head h1 { font-size: 22px; }
html[lang="ar"] .cash-head h1 { font-weight: 700; letter-spacing: 0; }
.cash-head p { margin-block-start: 4px; color: var(--text-2); max-width: 64ch; }
.runway { background: rgba(30, 107, 69, 0.24); color: #9FE3BD; }
html[data-theme="dark"] .runway { background: rgba(61, 214, 140, 0.14); color: #9FF0C6; box-shadow: inset 0 0 0 1px rgba(61, 214, 140, 0.35); }
.runway.short { background: rgba(229, 72, 77, 0.22); color: #FFB3B5; }
.cash-fig { display: grid; gap: 2px; margin-block-start: 4px; }
.big { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; font: 800 var(--fs-hero)/1.05 var(--font-figure); letter-spacing: -0.02em; color: var(--text); }
.big small { font: 600 15px var(--font); color: var(--text-2); letter-spacing: 0; }
.big.zero { color: var(--text-2); }
.big.neg { color: var(--red-ink); }
.neg-cash { margin-block-start: 4px; }
.legend-row .lk { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
.lk.line { height: 3px; border-radius: 3px; background: var(--chart-line); }
html[data-theme="dark"] .lk.line { background: linear-gradient(90deg, #FF8A8E, #E5484D); box-shadow: 0 0 8px #E5484D; }
.lk.in { background: var(--chart-in); } .lk.out { background: var(--chart-out); }
.lk.c-blue { background: var(--blue); } .lk.c-amber { background: var(--amber); } .lk.c-violet { background: var(--violet); } .lk.c-steel { background: var(--steel); }
.legend-row bdi { color: var(--text); font-weight: 600; }
.area { width: 100%; height: auto; display: block; overflow: visible; }
.area .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.area .base-line { stroke: var(--chart-base, var(--line-strong)); stroke-width: 1.2; }
.area .tick { fill: var(--chart-tick); font: 11px var(--font); }
html[lang="ar"] .area .tick { font-size: 12px; }
.area .bin { fill: var(--chart-in); } .area .bout { fill: var(--chart-out); }
.area .aline { fill: none; stroke: var(--chart-line); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .area .aline { filter: drop-shadow(0 0 6px rgba(255, 90, 95, 0.75)); }
.area .stop-top { stop-color: var(--chart-line); stop-opacity: 0.32; }
html[data-theme="dark"] .area .stop-top { stop-opacity: 0.45; }
.area .stop-bottom { stop-color: var(--chart-line); stop-opacity: 0; }
.area .halo { fill: var(--chart-line); opacity: 0.28; }
.area .dot { fill: #FFFFFF; stroke: var(--chart-line); stroke-width: 2.5; }
.chart-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; min-height: 140px; border: 1px dashed var(--chart-grid); border-radius: var(--radius-inner); color: var(--text-2); text-align: center; padding: 16px; }
.kpi-col { display: grid; gap: var(--gap); grid-auto-rows: 1fr; }

.lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); grid-template-areas: "act proj" "act owed"; gap: var(--gap); align-items: start; }
.lower > .panel { margin: 0; }
.lower > .actions-panel { grid-area: act; align-self: stretch; }
.lower > .projects-panel { grid-area: proj; }
.lower > .owed-panel { grid-area: owed; }
.lower.no-act { grid-template-columns: minmax(0, 1fr); grid-template-areas: "proj" "owed"; }
.lower.no-proj { grid-template-areas: "act owed" "act owed"; }
.lower.no-owed { grid-template-areas: "act proj" "act proj"; }
.lower.only-act { grid-template-columns: minmax(0, 1fr); grid-template-areas: "act"; }

/* action queue */
.actions-panel { display: flex; flex-direction: column; }
.act-list { display: grid; margin-block-end: 8px; }
.act { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; }
.act + .act { border-block-start: 1px solid var(--line-soft); }
.act-text { display: grid; min-width: 0; }
.act-text b { font-weight: 600; overflow-wrap: anywhere; }
.act-text small { color: var(--text-2); font-size: var(--fs-small); }
.act-foot { margin-block-start: auto; padding-block-start: 10px; border-block-start: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--text-2); font-size: var(--fs-small); flex-wrap: wrap; }

/* project cards with the certified-% ring */
.projects-panel { display: grid; gap: 12px; }
.projects-panel > header { margin-block-end: 0; }
.proj { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 16px; border-radius: var(--radius-inner); border: 1px solid var(--inner-line); background: var(--inner-bg); }
.proj.alert { border-color: var(--red-line); background: color-mix(in srgb, var(--red-tint) 45%, transparent); }
.gwrap { position: relative; width: 86px; height: 86px; }
.gauge { width: 86px; height: 86px; }
.gauge .gtrack { stroke: var(--chart-track); fill: none; }
.gauge .gval { stroke: var(--blue); fill: none; stroke-linecap: round; }
html[data-theme="dark"] .gauge .gval { filter: drop-shadow(0 0 5px rgba(91, 155, 255, 0.6)); }
.gauge-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.gauge-text b { font: 700 15px var(--font-figure); }
.gauge-text small { font-size: var(--fs-tiny); color: var(--text-2); }
.proj-body { display: grid; gap: 10px; min-width: 0; }
.proj-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.proj h3 { font: 700 15px/1.3 var(--font-display); }
.proj h3 a:hover { text-decoration: underline; }
.proj-top small { display: block; color: var(--text-2); font-size: var(--fs-small); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 14px; }
.stats span { display: block; color: var(--text-2); font-size: var(--fs-small); }
.stats b { font: 700 15px var(--font-figure); white-space: nowrap; }
.stats em { display: block; font-style: normal; color: var(--text-2); font-size: var(--fs-small); }
.budget { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--fs-small); color: var(--text-2); }
.budget bdi { color: var(--text); font-weight: 600; }
.track { height: 8px; border-radius: var(--radius-pill); background: var(--chart-track); display: flex; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; }
.track .spent { background: var(--shell); border-start-end-radius: 0; }
html[data-theme="dark"] .track .spent { background: linear-gradient(90deg, #E5484D, #FF8A8E); box-shadow: 0 0 10px rgba(229, 72, 77, 0.6); }
.track .spent.over { background: var(--red); }
.track .comm { background: var(--blue-2); }
.warnline { display: flex; align-items: center; gap: 6px; color: var(--red-ink); font-size: var(--fs-small); font-weight: 600; }

/* owed to us: donut + legend + VAT bars */
.owed-panel { display: grid; grid-template-columns: 168px minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "h h h" "d l v"; gap: 14px 24px; align-items: center; }
.owed-panel.no-vat { grid-template-columns: 168px minmax(0, 1fr); grid-template-areas: "h h" "d l"; }
.owed-panel.only-vat { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "v"; }
.owed-panel > header { grid-area: h; margin-block-end: 0; }
.owed-panel .dwrap { grid-area: d; }
.owed-panel .dleg { grid-area: l; }
.owed-panel .vat-box { grid-area: v; border-inline-start: 1px solid var(--line); padding-inline-start: 20px; }
.owed-panel.only-vat .vat-box { border: 0; padding: 0; }
.dwrap { position: relative; width: 168px; height: 168px; margin-inline: auto; }
.donut { width: 168px; height: 168px; }
.donut .dtrack { stroke: var(--chart-track); fill: none; }
.donut .dseg { fill: none; stroke-linecap: round; }
.donut .dseg.c-blue { stroke: var(--blue); } .donut .dseg.c-amber { stroke: var(--amber); } .donut .dseg.c-violet { stroke: var(--violet); }
html[data-theme="dark"] .donut .dseg { filter: drop-shadow(0 0 5px currentColor); }
.dcenter { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dcenter b { font: 800 18px var(--font-figure); }
.dcenter small { color: var(--text-2); font-size: var(--fs-small); }
.dleg { display: grid; gap: 10px; }
.dleg li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 1px; align-items: baseline; }
.dleg li > i { width: 12px; height: 12px; border-radius: 4px; align-self: center; }
.dleg li > small { grid-column: 2 / -1; }
.dleg li > i.c-blue { background: var(--blue); } .dleg li > i.c-amber { background: var(--amber); } .dleg li > i.c-violet { background: var(--violet); }
.dleg small { display: block; color: var(--text-2); font-size: var(--fs-small); }
.dleg bdi { font: 700 14px var(--font-figure); }
.vat-box { display: grid; gap: 9px; }
.vhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: var(--fs-small); color: var(--text-2); flex-wrap: wrap; }
.vhead b { color: var(--text); font-size: 14px; }
.vrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l a" "b b"; gap: 4px 10px; align-items: baseline; font-size: var(--fs-small); color: var(--text-2); }
.vrow > span:first-child { grid-area: l; } .vrow > .vbar { grid-area: b; } .vrow > bdi { grid-area: a; }
.vrow bdi { color: var(--text); font: 600 13px var(--font-figure); }
.vbar { height: 8px; border-radius: var(--radius-pill); background: var(--chart-track); overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; border-radius: inherit; }
.vbar .vo { background: var(--violet); } .vbar .vi { background: var(--steel); }
html[data-theme="dark"] .vbar .vo { background: linear-gradient(90deg, #A78BFA, #C4B5FD); }
.vrow.total { grid-template-areas: "l a"; border-block-start: 1px dashed var(--control); padding-block-start: 9px; }
.vrow.total > span:empty { display: none; }
.vrow.total span:first-child { color: var(--text); font-weight: 600; }
.vrow.total bdi { font-size: 15px; font-weight: 800; }

/* search results */
.search-page .search-again { max-width: 640px; margin-inline-start: 0; margin-block-end: var(--gap); }
.result-group + .result-group { margin-block-start: var(--gap); }
.result-list .row-main a { font-weight: 600; }
mark { background: var(--amber-tint); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- login, offline and error pages ---------- */
.bare-wrap { position: relative; z-index: 1; min-height: 100svh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.brand-side { position: relative; display: grid; align-content: space-between; gap: 32px; padding: 48px; color: var(--on-shell); background-color: var(--shell);
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px); background-size: 24px 24px; }
html[data-theme="dark"] .brand-side { background-color: transparent; }
.brand-side img { width: 240px; height: auto; }
.brand-side .tagline { max-width: 34ch; font: 700 26px/1.3 var(--font-display); }
.brand-side .tagline span { color: #FF8A8E; }
.brand-side .company { color: var(--on-shell-2); font-size: var(--fs-small); }
.form-side { display: grid; place-items: center; padding: 32px 20px; }
.login-wrap { display: grid; place-content: center; gap: 16px; justify-items: center; min-height: 100%; }
.login-card { width: min(420px, 100%); display: grid; gap: 14px; padding: 32px; }
.login-card h1 { font: 800 24px/1.2 var(--font-display); }
.login-card .sub { margin-block-start: -6px; }
.login-foot { color: var(--text-2); font-size: var(--fs-small); text-align: center; }
.offline-card, .error-card { max-width: 480px; margin: 12vh auto; display: grid; gap: 16px; padding: 28px; }
.offline-card img { width: 160px; height: auto; }
.offline-card .logo-plate { justify-self: start; }
.offline-card h1, .offline-card h2 { font: 800 20px/1.3 var(--font-display); }
.error-page { max-width: 560px; margin: 8vh auto; display: grid; gap: 8px; justify-items: start; }
.error-code { font: 800 var(--fs-kpi) var(--font-figure); color: var(--text-2); }
.error-page h1 { font: 800 var(--fs-title)/1.2 var(--font-display); }
.error-actions { display: flex; gap: 8px; margin-block-start: 12px; }

/* ---------- chart helpers used by charts.js (classes, so no inline styles are needed under the CSP) ---------- */
.chart-tip { position: absolute; top: 0; left: 0; pointer-events: none; padding: 6px 8px; font-size: 12px; line-height: 1.35; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity 120ms ease; background: var(--surface-solid); color: var(--text); border: 1px solid var(--line); box-shadow: var(--popover-shadow); }
.ch-dim { opacity: .7; } .ch-b { font-weight: 600; } .ch-b5 { font-weight: 500; } .ch-muted { color: var(--text-2); } .ch-neg { color: var(--red-ink); }
.ch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-variant-numeric: tabular-nums; }
.ch-list.plan { gap: 14px; } .ch-list.bars { gap: 2px; } .ch-list.bars-thin { gap: 10px; }
.ch-row-top { display: flex; justify-content: space-between; gap: 12px; margin-block-end: 6px; }
.ch-track { position: relative; height: 8px; border-radius: 999px; background: var(--chart-track); overflow: visible; }
.ch-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--chart-1); }
.ch-fill.committed { border-radius: 0; opacity: .35; }
.ch-over-mark { position: absolute; inset-block: -3px; inset-inline-start: 100%; width: 1px; background: var(--text); }
.ch-over { position: absolute; inset-block: 0; inset-inline-start: calc(100% + 2px); background: var(--red-ink); border-start-end-radius: 999px; border-end-end-radius: 999px; }
.ch-ring { position: relative; } .ch-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-variant-numeric: tabular-nums; }
.ch-ring-label { font-weight: 600; line-height: 1; } .ch-ring-sub { font-size: 12px; opacity: .7; margin-block-start: 4px; }
.ch-bar-row { display: grid; align-items: center; column-gap: 12px; }
.ch-bar-label { position: relative; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bar-value { font-weight: 500; text-align: end; }
.ch-bar-thin { grid-column: 1 / -1; height: 2px; margin-block-start: 4px; background: var(--chart-muted); }
.ch-bar-thin.top { background: var(--text); }
.ch-bar-track { position: relative; padding: 10px 12px; border-radius: 6px; isolation: isolate; min-width: 0; }
.ch-bar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; z-index: -1; background: color-mix(in srgb, var(--chart-1) 12%, transparent); }
.ch-bullet-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 12px; }
.ch-bullet-track { position: relative; height: 10px; background: var(--chart-track); border-radius: 2px; }
.ch-bullet-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--chart-1); border-radius: 2px; }
.ch-bullet-target { position: absolute; inset-block: -4px; width: 2px; margin-inline-start: -1px; background: var(--text); }

/* ---------- wide tablet (≤ 1280): the dashboard's lower grid stacks ---------- */
@media (max-width: 1280px) {
  .lower, .lower.no-proj, .lower.no-owed { grid-template-columns: minmax(0, 1fr); grid-template-areas: "act" "proj" "owed"; }
  .lower.no-act { grid-template-areas: "proj" "owed"; }
}

/* ---------- tablet (≤ 1100): the sidebar folds into a top bar + full-screen sheet ---------- */
@media (max-width: 1100px) {
  :root { --pad: 20px; }
  .app, html[data-theme="dark"] .app { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  html:not([data-theme="dark"]) .app, html:not([data-theme="dark"])[dir="rtl"] .app { background: none; }
  .topbar, html[data-theme="dark"] .topbar { position: sticky; inset-block-start: 0; z-index: 20; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px;
    min-height: calc(var(--topbar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
    background: var(--canvas); border-block-end: 1px solid var(--line); }
  html[data-theme="dark"] .topbar { background: rgba(10, 12, 16, 0.72); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
  .topbar .menu-btn { display: inline-flex; width: 44px; height: 44px; }
  .topbar-title { display: block; font: 700 16px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .today { display: none; }
  .topbar .gsearch { display: none; }
  .btn-new { height: 40px; padding: 0 16px; }
  .sidebar, html[data-theme="dark"] .sidebar { position: fixed; inset: 0; z-index: 50; width: 100%; height: 100%; border-radius: 0; border: 0;
    padding: calc(16px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    transform: translateX(-100%); visibility: hidden; transition: transform var(--t-ui) var(--ease-out), visibility 0s linear var(--t-ui); }
  html[data-theme="dark"] .sidebar { background: rgba(14, 16, 21, 0.94); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  html .sidebar.open, html[data-theme="dark"] .sidebar.open, html[dir="rtl"] .sidebar.open { transform: none; visibility: visible; transition: transform var(--t-ui) var(--ease-out), visibility 0s; }
  .icon-btn.sheet-close { display: inline-flex; width: 44px; height: 44px; }
  .sidebar .nav-search { display: flex; margin: 0 0 8px; height: 46px; background: var(--shell-3); border-color: var(--shell-line); color: var(--on-shell-2); max-width: none; }
  .nav-search input { color: var(--on-shell); font-size: 16px; }
  .nav-search input::placeholder { color: var(--on-shell-3); }
  .nav-search kbd { display: none; }
  .nav-item { min-height: 46px; font-size: 15px; }
  .nav-item[aria-current="page"]::before { inset-inline-start: -16px; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 44; background: var(--overlay); }
  .canvas, html[data-theme="dark"] .canvas { padding: 16px var(--pad) 32px; }
  .grid > * { grid-column: 1 / -1; }
  .title-row { flex-wrap: wrap; align-items: flex-start; }
  .settings-section { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .form-grid.three, .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis, .kpis-5 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi + .kpi { border-inline-start: 0; }
  .kpi:nth-child(2n) { border-inline-start: 1px solid var(--line); }
  .kpi:nth-child(n + 3) { border-block-start: 1px solid var(--line); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .kpi-col { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }
  .new-menu { inset-block-start: calc(var(--topbar) + env(safe-area-inset-top) + 8px); inset-inline-end: 12px; }
  .bare-wrap { grid-template-columns: minmax(0, 1fr); }
  .brand-side { padding: 28px 24px; gap: 16px; }
  .brand-side img { width: 180px; }
  .brand-side .tagline { font-size: 20px; }
}

/* ---------- phone (≤ 640): floating bottom bar with the raised +, cards instead of tables ---------- */
@media (max-width: 640px) {
  :root { --fs-title: 22px; --fs-kpi: 22px; --fs-hero: 38px; --input-height: 44px; --control-height: 44px; --row-height: 48px; --pad: 14px; }
  body { padding-block-end: calc(var(--bottombar) + 24px + env(safe-area-inset-bottom)); }
  .canvas, html[data-theme="dark"] .canvas { padding: 14px var(--pad) 24px; }
  .title-row h1 { font-size: 22px; }
  .title-row .actions { flex: 1 1 100%; flex-wrap: wrap; }
  body:has(.topbar-action > *) .title-row .actions .btn.primary { display: none; }
  .topbar, html[data-theme="dark"] .topbar { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .topbar .btn-new { display: none; }
  .topbar-action { display: inline-flex; justify-content: flex-end; min-width: 44px; }
  .btn.small { min-width: 44px; }
  .input, select.input, textarea.input, .gsearch input { font-size: 16px; }
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: minmax(0, 1fr); }
  .kpi.lead { grid-column: 1 / -1; border-block-end: 1px solid var(--line); }
  .kpi.lead ~ .kpi:nth-child(even) { border-inline-start: 0; }
  .kpi.lead ~ .kpi:nth-child(odd) { border-inline-start: 1px solid var(--line); }
  .kpi.lead + .kpi, .kpi.lead + .kpi + .kpi { border-block-start: 0; }
  .kpi.lead ~ .kpi:last-child:nth-child(odd) { grid-column: auto; }
  .kpi.lead ~ .kpi:last-child:nth-child(even) { grid-column: 1 / -1; border-inline-start: 0; }
  .kpi.lead .kpi-value { font-size: 28px; }
  .btn, .icon-btn, .abtn { min-height: 44px; }
  .btn.small { min-height: 44px; }
  .field-check label { min-height: 44px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .input, .filters .input.search, .filters .input.narrow { max-width: none; min-width: 0; width: 100%; }
  .filters input[type="search"], .filters .input.search { grid-column: 1 / -1; }
  .filters .spacer { display: none; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) thead { display: none; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines), .lines:not(.sales-lines) .lines-table:not(.card-lines) tbody { display: block; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) tr[data-line] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; margin-block-end: 10px; border: 1px solid var(--inner-line); border-radius: var(--radius-inner); background: var(--inner-bg); }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) td { display: block; padding: 0; border: 0; min-width: 0; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) td.idx { display: none; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) td.desc { grid-column: 1 / -1; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) td[data-line-amount] { grid-column: 1 / span 2; align-self: center; font-weight: 700; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) td:last-child { justify-self: end; }
  .lines:not(.sales-lines) .lines-table:not(.card-lines) .input { width: 100%; }
  .lines:not(.sales-lines) .table-wrap { overflow: visible; }
  .lines .lines-table td[data-label]::before { content: attr(data-label); display: block; margin-block-end: 4px; color: var(--text-2); font-size: var(--fs-small); }
  .lines .lines-table td.desc .input + .input, .lines .lines-table td .input + select, .lines .lines-table td select + select { margin-block-start: 8px; }
  summary { padding-block: 12px; }
  .user-menu > summary { padding-block: 6px; }
  .tabs a { display: inline-flex; align-items: center; min-height: 44px; }
  .card-link, .link { min-height: 44px; }
  .skip-link { min-height: 44px; display: inline-flex; align-items: center; }
  .lang-toggle a, .lang-toggle button { min-width: 44px; min-height: 44px; }
  .totals { grid-template-columns: max-content minmax(0, 1fr); }
  .pager { flex-wrap: wrap; }
  .settings-actions { inset-block-end: calc(var(--bottombar) + 20px + env(safe-area-inset-bottom)); }
  .rows-table thead { display: none; }
  .rows-table tr { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(55%); gap: 2px 12px; padding: 12px 4px; border-block-end: 1px solid var(--line-soft); }
  .rows-table tr:last-child { border-block-end: 0; }
  .rows-table td { display: block; padding: 0; border: 0; }
  .rows-table td:first-child { grid-column: 1; grid-row: 1 / span 3; }
  .rows-table td:not(:first-child) { grid-column: 2; text-align: end; font-size: 13px; color: var(--text-2); }
  .rows-table td.num { color: var(--text); }
  .rows-table tbody tr:hover td { background: none; }
  .rows-table td[data-label]::before { content: attr(data-label) "\00a0\00a0"; color: var(--text-2); font-size: var(--fs-small); font-weight: 400; font-family: var(--font); white-space: nowrap; }
  /* the floating bottom bar: four destinations and the raised red + in the middle */
  .bottombar { position: fixed; z-index: 30; inset-inline: 10px; inset-block-end: calc(10px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center;
    min-height: var(--bottombar); padding: 6px; border-radius: 22px; background: var(--shell); color: var(--on-shell-2); box-shadow: 0 16px 32px -12px rgba(21, 23, 26, 0.5); }
  html[data-theme="dark"] .bottombar { background: rgba(22, 26, 32, 0.72); border: 1px solid var(--panel-line); box-shadow: var(--panel-shadow); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
  .bottombar a, .bottombar button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 50px; padding: 0 2px; font-size: 11.5px; font-weight: 500; color: var(--on-shell-2); border: 0; background: none; border-radius: 14px; cursor: pointer; }
  html[lang="ar"] .bottombar a, html[lang="ar"] .bottombar button { font-size: 12px; }
  .bottombar a span, .bottombar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottombar .ic { width: 22px; height: 22px; }
  .bottombar a[aria-current="page"] { color: #FFFFFF; font-weight: 700; }
  .bottombar a[aria-current="page"] .ic { color: #FF6B6F; }
  .bottombar .fab { justify-self: center; width: 56px; height: 56px; min-height: 56px; margin-block-start: -26px; border-radius: 50%; background: var(--red); color: #FFFFFF; box-shadow: 0 10px 22px -6px rgba(196, 22, 28, 0.6), 0 0 0 4px var(--canvas); }
  html[data-theme="dark"] .bottombar .fab { border-radius: 18px; background: var(--hot-bg); box-shadow: 0 12px 24px -8px rgba(229, 72, 77, 0.9); }
  .bottombar .fab .ic { width: 24px; height: 24px; color: #FFFFFF; }
  .bottombar .fab[aria-expanded="true"] .ic { transform: rotate(45deg); }
  /* the New menu becomes a bottom sheet */
  .new-menu, html[data-theme="dark"] .new-menu { inset: auto 0 0 0; width: auto; max-height: 80dvh; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
  .new-menu::before { content: ""; display: block; width: 40px; height: 4px; margin: 2px auto 8px; border-radius: 4px; background: var(--control); }
  .new-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .new-list .menu-item { min-height: 52px; border: 1px solid var(--line); }
  /* dashboard */
  .cash-card { padding: 18px 16px 8px; }
  .cash-head { flex-direction: column; gap: 8px; }
  .cash-head h1 { font-size: 22px; }
  .kpi-col { grid-template-columns: minmax(0, 1fr); }
  .lower > section { padding: 16px; }
  .proj { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .gwrap, .gauge { width: 70px; height: 70px; }
  .gauge-text b { font-size: 13px; }
  .proj-top { flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget { grid-template-columns: minmax(0, 1fr) auto; } .budget > span:first-child { grid-column: 1 / -1; }
  .owed-panel, .owed-panel.no-vat { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "d" "l" "v"; }
  .owed-panel .vat-box { border-inline-start: 0; padding-inline-start: 0; border-block-start: 1px solid var(--line); padding-block-start: 12px; }
  .area .tick { font-size: 19px; }
  html[lang="ar"] .area .tick { font-size: 20px; }
  .act { gap: 10px; }
  .brand-side .tagline { display: none; }
  .login-card { padding: 22px; }
}

/* ---------- motion and print ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; scroll-behavior: auto !important; } }
@media print {
  .sidebar, .topbar, .bottombar, .aurora, .scrim, .new-menu, .skip-link { display: none !important; }
  .app { display: block; padding: 0; }
  body, html { background: #FFFFFF; color: #000000; }
}
.bare-canvas > .error-page { padding-inline: 20px; }
.lines-table select.input { min-width: 76px; }
.input.file::file-selector-button, input[type="file"]::file-selector-button { margin-inline-end: 10px; padding: 4px 12px; border: 1px solid var(--control); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.dl-name { font-weight: 500; }
