/* Naqar Client Portal — client interface
 * Graphite ink on warm paper, one copper accent. Hairline structure, no frozen panels.
 */

@font-face { font-family: "Cairo"; src: url("../fonts/cairo.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #f6f3ee;
  --sheet: #fffefc;
  --sunk: #efebe4;
  --ink: #1f2023;
  --ink-2: #4a4b50;
  --ink-3: #78756e;
  --line: rgba(31, 32, 35, 0.09);
  --line-2: rgba(31, 32, 35, 0.16);
  --copper: #d28a55;
  --copper-ink: #a2592a;
  --copper-wash: rgba(210, 138, 85, 0.14);
  --good: #2c7a50;
  --good-wash: rgba(44, 122, 80, 0.12);
  --warn: #9a6210;
  --warn-wash: rgba(201, 138, 30, 0.16);
  --bad: #c0151b;
  --bad-wash: rgba(211, 24, 32, 0.10);
  --lift: 0 0 0 1px rgba(31, 32, 35, 0.06), 0 1px 2px -1px rgba(31, 32, 35, 0.07), 0 3px 8px rgba(31, 32, 35, 0.04);
  --lift-2: 0 0 0 1px rgba(31, 32, 35, 0.08), 0 8px 24px -6px rgba(31, 32, 35, 0.16);
  --pop: #24252a;
  --pop-ink: #f6f3ee;
  --s1: #c27032; --s2: #2f6db5; --s3: #22977a; --s4: #9c5bb5; --s5: #b8862b; --s6: #c2577a;
  --client: #d28a55;
  --r-s: 8px;
  --r: 14px;
  --r-l: 20px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
html[lang="ar"] { --font: "Cairo", "Segoe UI", Tahoma, sans-serif; }

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --paper: #15171a; --sheet: #1d2024; --sunk: #191b1f; --ink: #f2efe9; --ink-2: #c9c5bd; --ink-3: #928e86;
    --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.15);
    --copper: #da9764; --copper-ink: #e8ab7d; --copper-wash: rgba(218, 151, 100, 0.16);
    --good: #63c08d; --good-wash: rgba(99, 192, 141, 0.14); --warn: #e3a74c; --warn-wash: rgba(227, 167, 76, 0.16); --bad: #f07070; --bad-wash: rgba(240, 112, 112, 0.14);
    --lift: 0 0 0 1px rgba(255, 255, 255, 0.07); --lift-2: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 12px 32px -8px rgba(0, 0, 0, 0.6);
    --pop: #f2efe9; --pop-ink: #1d2024;
    --s1: #c97a40; --s2: #4f84cf; --s3: #25a07f; --s4: #a870c7; --s5: #b08828; --s6: #cc6b8a;
    color-scheme: dark;
  }
}
:root.theme-dark {
  --paper: #15171a; --sheet: #1d2024; --sunk: #191b1f; --ink: #f2efe9; --ink-2: #c9c5bd; --ink-3: #928e86;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.15);
  --copper: #da9764; --copper-ink: #e8ab7d; --copper-wash: rgba(218, 151, 100, 0.16);
  --good: #63c08d; --good-wash: rgba(99, 192, 141, 0.14); --warn: #e3a74c; --warn-wash: rgba(227, 167, 76, 0.16); --bad: #f07070; --bad-wash: rgba(240, 112, 112, 0.14);
  --lift: 0 0 0 1px rgba(255, 255, 255, 0.07); --lift-2: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 12px 32px -8px rgba(0, 0, 0, 0.6);
  --pop: #f2efe9; --pop-ink: #1d2024;
  --s1: #c97a40; --s2: #4f84cf; --s3: #25a07f; --s4: #a870c7; --s5: #b08828; --s6: #cc6b8a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.ncp {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html[lang="ar"] body.ncp { font-size: 15.5px; line-height: 1.75; }
h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 650; }
h3 { font-size: 15.5px; line-height: 1.45; font-weight: 650; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.icon { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-s); z-index: 50; text-decoration: none; }
.skip:focus { top: 12px; }
[dir="ltr"] { unicode-bidi: isolate; }
.tabular, .kpis dd, .price, .big-number, .stat strong, .doc-amount, .invoice-money dd, .split-amount, .chart-range, .total-period strong { font-variant-numeric: tabular-nums; }

/* ---------- Logos ---------- */
.naqar-logo { display: inline-flex; align-items: center; }
.naqar-logo img { height: 26px; width: auto; display: block; }
.naqar-logo.small img { height: 18px; }
.naqar-logo.large img { height: 34px; }
.naqar-logo .on-dark { display: none; }
:root.theme-dark .naqar-logo .on-light { display: none; }
:root.theme-dark .naqar-logo .on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .naqar-logo .on-light { display: none; }
  :root:not(.theme-light) .naqar-logo .on-dark { display: block; }
}
.client-logo { display: block; height: auto; max-height: 44px; max-width: 168px; width: auto; object-fit: contain; background: none; }
.client-monogram { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--copper-wash); color: var(--copper-ink); font-weight: 700; font-size: 18px; }

/* ---------- Buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 10px; font-weight: 650; font-size: 14.5px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--copper)); }
.btn-secondary { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunk); color: var(--ink); }
.btn-danger { background: var(--bad-wash); color: var(--bad); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
@media (pointer: coarse) { .btn-small { min-height: 44px; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer; transition: background-color 160ms var(--ease);
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0;
  background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.chip-btn:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.chip-btn .icon { width: 18px; height: 18px; }
[data-theme-toggle] .icon-sun { display: none; }
:root.theme-dark [data-theme-toggle] .icon-sun { display: block; }
:root.theme-dark [data-theme-toggle] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) [data-theme-toggle] .icon-sun { display: block; }
  :root:not(.theme-light) [data-theme-toggle] .icon-moon { display: none; }
}
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--copper-ink); font-weight: 650; text-decoration: none; font-size: 14px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link .icon { width: 16px; height: 16px; }
form.inline { display: inline; margin: 0; }

.badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.badge-good { background: var(--good-wash); color: var(--good); }
.badge-warn { background: var(--warn-wash); color: var(--warn); }
.badge-bad { background: var(--bad-wash); color: var(--bad); }
.badge-muted { background: var(--sunk); color: var(--ink-3); }
.badge-neutral { background: var(--sunk); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--copper-wash); color: var(--copper-ink); }
.tag-current { background: var(--ink); color: var(--paper); }
.tag-wait { background: var(--warn-wash); color: var(--warn); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; }
.alert .icon { margin-top: 2px; }
.alert-error { background: var(--bad-wash); color: var(--bad); }
.alert-ok { background: var(--good-wash); color: var(--good); }
.alert-info { background: var(--sunk); color: var(--ink-2); }

/* Info popovers */
.info { position: relative; display: inline-flex; vertical-align: middle; margin-inline-start: 4px; }
.info-btn {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; border: 0; background: transparent;
  color: var(--ink-3); cursor: pointer; padding: 0;
}
.info-btn .icon { width: 17px; height: 17px; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--copper-ink); background: var(--copper-wash); }
.info-pop {
  position: absolute; top: calc(100% + 6px); inset-inline-start: calc(-12px + var(--shift, 0px)); z-index: 30; width: max-content; max-width: min(300px, calc(100vw - 32px));
  padding: 10px 12px; border-radius: 10px; background: var(--pop); color: var(--pop-ink); font-size: 13px; line-height: 1.6; font-weight: 500;
  box-shadow: var(--lift-2); transform-origin: top; animation: pop-in 160ms var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Forms */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--sunk);
  font-size: 15.5px; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-wash); background: var(--sheet); }
.field-hint { font-size: 12.5px; color: var(--ink-3); }
.field input.otp { font-size: 24px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.password { position: relative; display: block; }
.password input { padding-inline-end: 52px; }
.password .reveal { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 8px; }
.password .reveal[aria-pressed="true"] { color: var(--copper-ink); }
.strength { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.strength i { display: block; height: 100%; width: 0; background: var(--bad); transition: width 200ms var(--ease), background-color 200ms; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--copper); flex: none; margin: 0; }

/* ---------- Guest screens ---------- */
body.page-guest { min-height: 100dvh; }
.guest-layout { display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; min-height: 100dvh; }
.guest-side { background: var(--sunk); border-inline-end: 1px solid var(--line); position: relative; overflow: hidden; }
.guest-side::after {
  content: ""; position: absolute; inset-inline-end: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%;
  border: 1px solid var(--copper-wash); box-shadow: 0 0 0 40px var(--copper-wash), 0 0 0 41px transparent, 0 0 0 90px rgba(210, 138, 85, 0.06);
  opacity: 0.7; pointer-events: none;
}
.guest-side-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; padding: 56px 48px; height: 100%; }
.guest-client { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.guest-client .client-logo { max-height: 64px; max-width: 240px; }
.guest-client-name { font-weight: 700; font-size: 20px; }
.guest-lead { font-size: 22px; line-height: 1.5; font-weight: 600; color: var(--ink); max-width: 22ch; }
.guest-points { display: grid; gap: 14px; color: var(--ink-2); font-size: 14.5px; }
.guest-points li { display: flex; gap: 12px; align-items: center; }
.guest-points .icon { color: var(--copper-ink); }
.guest-powered { margin-top: auto; }
.guest-main { display: flex; flex-direction: column; align-items: center; padding: 24px; }
.guest-top { width: 100%; max-width: 480px; display: flex; justify-content: flex-end; gap: 8px; margin-bottom: auto; }
.guest-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 24px; gap: 16px; }
.guest-wrap .guest-top { margin-bottom: 0; }
.guest-card { width: 100%; max-width: 440px; margin: 32px 0; display: grid; gap: 18px; }
.guest-card.wide { max-width: 640px; background: var(--sheet); box-shadow: var(--lift); padding: 32px; border-radius: var(--r-l); }
.guest-card.narrow { background: var(--sheet); box-shadow: var(--lift); padding: 32px; border-radius: var(--r-l); }
.guest-card h1 { font-size: 26px; }
.guest-card .lead { color: var(--ink-2); }
.guest-card .eyebrow { color: var(--copper-ink); font-weight: 650; font-size: 13.5px; }
.guest-links { font-size: 14px; }
.guest-links a { color: var(--copper-ink); font-weight: 600; }
.guest-note { font-size: 13px; color: var(--ink-3); }
.invite-email { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--sunk); border-radius: 10px; font-weight: 600; justify-self: start; }
.setup-key { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--sunk); }
.setup-key code { font-size: 15px; letter-spacing: 0.08em; word-break: break-all; }
.guest-main .site-foot { width: 100%; max-width: 480px; border: 0; padding: 16px 0 8px; margin-top: auto; }
.chooser { display: grid; gap: 10px; }
.chooser-item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); text-decoration: none; transition: box-shadow 160ms var(--ease); }
.chooser-item:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.chooser-item span { display: grid; flex: 1; }
.chooser-item small { color: var(--ink-3); }
.chooser-item .client-logo { max-height: 32px; max-width: 110px; }

/* ---------- App shell (nothing is fixed or sticky) ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.rail { display: flex; flex-direction: column; gap: 28px; padding: 28px 16px 24px; border-inline-end: 1px solid var(--line); }
.rail-brand { display: grid; gap: 16px; padding: 4px 10px 22px; border-bottom: 1px solid var(--line); }
.rail-brand .client-logo { max-height: 48px; max-width: 190px; }
.rail-client { display: grid; gap: 2px; margin-top: 16px; }
.rail-client strong { font-size: 15px; line-height: 1.4; }
.rail-client small { color: var(--ink-3); font-size: 12.5px; }
.rail-nav { display: grid; gap: 2px; }
.rail-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; text-decoration: none;
  color: var(--ink-2); font-weight: 600; font-size: 14.5px; transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.rail-link:hover { background: var(--sunk); color: var(--ink); }
.rail-link.is-active { background: var(--sheet); color: var(--ink); box-shadow: var(--lift); }
.rail-link.is-active .icon { color: var(--copper-ink); }
.rail-foot { margin-top: auto; display: grid; gap: 20px; }
.rail-powered { display: grid; gap: 8px; padding: 16px 12px 0; border-top: 1px solid var(--line); }
.rail-powered small { font-size: 11.5px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 40px; border-bottom: 1px solid var(--line); min-height: 68px; }
.topbar .menu-btn, .topbar-client { display: none; }
.topbar-client { align-items: center; gap: 12px; min-width: 0; }
.topbar-client .client-logo { max-height: 30px; max-width: 120px; }
.topbar-client strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--copper-wash); color: var(--copper-ink); font-weight: 700; flex: none; }
.who { display: grid; line-height: 1.3; }
.who strong { font-size: 14px; }
.who small { font-size: 12px; color: var(--ink-3); }
.topbar-tools { display: flex; align-items: center; gap: 6px; padding-inline-start: 12px; margin-inline-start: 6px; border-inline-start: 1px solid var(--line); }
.preview-bar { display: flex; gap: 8px; align-items: center; padding: 10px 40px; background: var(--copper-wash); color: var(--copper-ink); font-size: 13.5px; font-weight: 600; }
.content { width: 100%; max-width: 1180px; padding: 36px 40px 56px; outline: none; }
.site-foot { display: flex; align-items: center; gap: 20px; padding: 24px 40px 40px; border-top: 1px solid var(--line); margin-top: auto; }
.foot-legal { font-size: 12px; line-height: 1.7; color: var(--ink-3); max-width: 90ch; }

/* Mobile menu sheet */
.menu-sheet {
  width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink);
  inset: 0;
}
.menu-sheet[open] { display: flex; flex-direction: column; animation: sheet-in 220ms var(--ease); }
.menu-sheet::backdrop { background: rgba(0, 0, 0, 0.3); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.sheet-head .topbar-client { display: flex; }
.sheet-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
.sheet-link {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 92px; padding: 14px; border-radius: 14px;
  background: var(--sheet); box-shadow: var(--lift); text-decoration: none; font-weight: 650; font-size: 14.5px; color: var(--ink);
}
.sheet-link .icon { color: var(--ink-3); width: 22px; height: 22px; }
.sheet-link.is-active { box-shadow: inset 0 0 0 2px var(--ink); }
.sheet-link.is-active .icon { color: var(--copper-ink); }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 24px; }

/* ---------- Page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.page-titles { display: grid; gap: 6px; }
.page-sub { color: var(--ink-3); font-size: 15px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--ink-3); text-decoration: none; font-weight: 600; font-size: 14px; min-height: 40px; }
.back-link:hover { color: var(--ink); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 14px; }
.section-head:first-child { margin-top: 0; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; }
.card { background: var(--sheet); border-radius: var(--r); box-shadow: var(--lift); padding: 24px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { display: inline-flex; align-items: center; }
.prose p + p { margin-top: 10px; }
.prose p, .prose li { color: var(--ink-2); }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; border-radius: var(--r); background: var(--sheet); box-shadow: var(--lift); }
.empty-icon { width: 36px; height: 36px; color: var(--ink-3); }
.empty p { color: var(--ink-3); max-width: 46ch; }
.source-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.source-note .icon { width: 17px; height: 17px; margin-top: 3px; }

/* ---------- Overview ---------- */
.attention { margin-bottom: 32px; }
.attention .section-head { margin-top: 0; }
.tasks { display: grid; gap: 10px; }
.task {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r);
  background: var(--sheet); box-shadow: var(--lift); position: relative;
}
.task.is-urgent::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--bad); }
.task-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--copper-wash); color: var(--copper-ink); }
.task-body { display: grid; gap: 2px; min-width: 0; }
.task-body small { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.task-body strong { font-size: 15.5px; overflow-wrap: anywhere; }
.task-meta { font-size: 13px; color: var(--ink-2); }
.task.is-urgent .task-meta { color: var(--bad); font-weight: 600; }
.calm { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: var(--r); background: var(--sheet); box-shadow: var(--lift); }
.calm .icon { color: var(--good); width: 24px; height: 24px; }
.calm p { color: var(--ink-3); font-size: 14px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; margin-bottom: 20px; align-items: stretch; }
.overview-grid > .side-stack:only-child { grid-column: 1 / -1; }
.side-stack { display: grid; gap: 20px; align-content: stretch; }
.side-stack:only-child { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.overview-grid .card, .side-stack .card { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.overview-grid .card .card-head { margin: 0; }
.overview-grid .text-link, .side-stack .text-link { margin-top: auto; }
.plan-when { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.plan-when strong { font-size: 24px; font-weight: 700; }
.plan-when span { color: var(--ink-3); font-size: 14px; }
.ticks { display: flex; gap: 4px; }
.ticks i { flex: 1; height: 6px; border-radius: 6px; background: var(--line-2); }
.ticks i.done { background: color-mix(in srgb, var(--copper) 40%, var(--line-2)); }
.ticks i.now { background: var(--copper); }
.kpis { display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpis > div { background: var(--sheet); padding: 14px 16px; display: grid; gap: 4px; }
.kpis dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; display: flex; align-items: center; }
.kpis dd { font-size: 21px; font-weight: 700; line-height: 1.3; }
.plan-focus { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 14.5px; color: var(--ink-2); }
.plan-focus span { font-size: 12px; font-weight: 700; color: var(--copper-ink); background: var(--copper-wash); padding: 2px 8px; border-radius: 999px; }
.plan-focus b { font-weight: 600; color: var(--ink); }
.pkg-name { font-size: 20px; font-weight: 700; }
.pkg-name.small { font-size: 17px; }
.pkg-price { font-size: 15px; font-weight: 650; color: var(--ink-2); }
.pkg-price span { font-weight: 500; color: var(--ink-3); }
.big-number { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

/* Timeline */
.timeline { display: grid; gap: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 14px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 15px; height: 15px; margin-top: 5px; border-radius: 999px; background: var(--sheet); box-shadow: inset 0 0 0 2px var(--copper); }
.timeline strong { font-size: 14.5px; }
.timeline p { color: var(--ink-2); font-size: 14px; }
.timeline time { color: var(--ink-3); font-size: 12.5px; }

/* ---------- Growth plan ---------- */
.plan-month { padding-bottom: 28px; }
.strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.strip-month {
  display: grid; justify-items: center; gap: 6px; padding: 10px 2px 8px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  color: var(--ink-3); transition: background-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease); min-height: 44px;
}
.strip-month:hover { background: var(--sunk); color: var(--ink); }
.strip-bar { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 72px; }
.strip-bar i { display: block; width: min(22px, 60%); border-radius: 4px 4px 1px 1px; background: color-mix(in srgb, var(--ink-3) 45%, transparent); transition: background-color 160ms var(--ease); }
.strip-month:hover .strip-bar i { background: var(--ink-3); }
.strip-name { font-size: 12.5px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.strip-num { font-size: 11px; line-height: 1; opacity: 0.8; }
.strip-month.is-now .strip-num { color: var(--copper-ink); font-weight: 700; opacity: 1; }
.strip-month[aria-pressed="true"] { background: var(--copper-wash); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--copper); }
.strip-month[aria-pressed="true"] .strip-bar i { background: var(--copper); }
.month-detail { display: grid; gap: 16px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.month-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.month-title strong { font-size: 22px; font-weight: 700; }
.month-title span { color: var(--ink-3); font-size: 14px; }
.month-detail.is-swapping .kpis dd, .month-detail.is-swapping .month-title strong { animation: swap 220ms var(--ease); }
@keyframes swap { from { opacity: 0.2; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.channels { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.channels h3 { display: flex; align-items: center; margin-bottom: 14px; }
.split { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 18px; }
.split-seg { flex-basis: 0; min-width: 4px; }
.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); }
.s4 { background: var(--s4); } .s5 { background: var(--s5); } .s6 { background: var(--s6); }
.split-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 24px; }
.split-legend li { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; }
.swatch { width: 12px; height: 12px; border-radius: 4px; }
.split-name { font-weight: 650; font-size: 14.5px; }
.split-share { font-weight: 700; font-size: 14.5px; }
.split-amount { grid-column: 2 / 4; font-size: 13.5px; color: var(--ink-2); }
.split-scope { grid-column: 2 / 4; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.plan-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--sheet); box-shadow: var(--lift); }
.stat small { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat strong { font-size: 20px; font-weight: 700; }
.stat-hero strong { font-size: 28px; }
.charts-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.charts-row .card { margin-bottom: 20px; }

/* Line charts */
.chart { margin: 0; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chart-title { font-weight: 650; font-size: 15px; }
.chart-range { display: inline-flex; gap: 8px; align-items: baseline; color: var(--ink-3); font-size: 14px; }
.chart-range b { color: var(--ink); font-size: 17px; }
.chart-body { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; direction: ltr; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: 11.5px; color: var(--ink-3); text-align: right; transform: translateY(-0.6em); }
.chart-plot { position: relative; height: 200px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-plot .grid { stroke: var(--line); stroke-width: 1; }
.chart-plot .stroke { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-orders { --series: var(--s2); }
.series-cpa { --series: var(--s1); }
.chart-plot .stroke { stroke: var(--series); }
.chart-plot .area { fill: var(--series); opacity: 0.1; }
.pt { position: absolute; left: var(--x); top: var(--y); width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 999px; background: var(--series); box-shadow: 0 0 0 2px var(--sheet); transition: transform 160ms var(--ease); pointer-events: none; }
.pt.is-active { transform: scale(1.6); box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--series); }
.end-label { position: absolute; right: -4px; top: var(--y); transform: translate(100%, -50%); font-size: 12.5px; font-weight: 700; color: var(--ink); padding-left: 8px; display: none; }
.hits { position: absolute; inset: 0; display: block; }
.hit { position: absolute; top: 0; bottom: 0; left: var(--x); width: 9%; transform: translateX(-50%); cursor: crosshair; }
.crosshair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-3); opacity: 0; pointer-events: none; transition: opacity 120ms; }
.chart-tip {
  position: absolute; top: -8px; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; background: var(--pop); color: var(--pop-ink);
  font-size: 12.5px; line-height: 1.5; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 120ms; z-index: 5;
}
.chart-tip b { display: block; font-size: 13.5px; }
.chart-plot.is-hover .crosshair, .chart-plot.is-hover .chart-tip { opacity: 1; }
.line-chart { container-type: inline-size; }
.chart-x { position: relative; height: 22px; margin-inline-start: 52px; direction: ltr; margin-top: 8px; }
html[dir="rtl"] .chart-x { margin-inline-start: 0; margin-left: 52px; }
.chart-x span { position: absolute; left: var(--x); transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* Phases */
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.phase { display: grid; gap: 8px; padding: 18px; border-radius: 12px; background: var(--sunk); }
.phase.is-now { box-shadow: inset 0 0 0 1.5px var(--copper); background: var(--copper-wash); }
.phase-index { font-size: 12.5px; font-weight: 700; color: var(--copper-ink); }
.phase strong { font-size: 16px; }
.phase-dates { font-size: 13px; color: var(--ink-3); }
.phase p { font-size: 14px; color: var(--ink-2); }
.phase-track { display: flex; gap: 3px; direction: ltr; }
.phase-track i { flex: 1; height: 5px; border-radius: 5px; background: var(--line-2); }
.phase-track i.on { background: color-mix(in srgb, var(--copper) 55%, var(--line-2)); }
.phase-track i.now { background: var(--ink); }
.deliverables { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.deliverables li { display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: var(--sunk); align-content: start; }
.deliverables strong { font-size: 26px; font-weight: 700; color: var(--copper-ink); line-height: 1.2; }
.deliverables span { font-weight: 650; }
.deliverables small { color: var(--ink-3); font-size: 13px; line-height: 1.6; }

/* ---------- Filters and lists ---------- */
.filter-box { margin-bottom: 4px; }
.filter-box > summary { list-style: none; display: none; width: fit-content; margin-bottom: 12px; }
.filter-box > summary::-webkit-details-marker { display: none; }
.filter-active { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--copper); color: #fff; font-size: 11.5px; }
.filter-active[hidden] { display: none; }
@media (max-width: 760px) { .filter-box > summary { display: inline-flex; } }
.filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 28px; margin-bottom: 12px; }
.filter-group { display: grid; gap: 8px; }
.filter-label { font-size: 12.5px; font-weight: 650; color: var(--ink-3); }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.filter:hover { box-shadow: inset 0 0 0 1px var(--ink-3); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.filter-count { font-size: 12px; opacity: 0.65; font-variant-numeric: tabular-nums; }
.filter[disabled] { opacity: 0.45; cursor: default; }
@media (pointer: coarse) { .filter { min-height: 44px; } }
.filter-reset { align-self: flex-end; }
.filter-result { font-size: 13px; color: var(--ink-3); margin: 4px 0 16px; min-height: 1em; }
.sort { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.sort .filter-label { margin-inline-end: 4px; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.doc-card {
  display: grid; gap: 12px; align-content: start; padding: 20px; border-radius: var(--r); background: var(--sheet); box-shadow: var(--lift); text-decoration: none;
  transition: box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.doc-card:hover { box-shadow: var(--lift-2); transform: translateY(-1px); }
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--sunk); color: var(--ink-2); }
.doc-card h3 { font-size: 16.5px; }
.doc-amount { font-weight: 700; }
.doc-amount span, .doc-kind { font-weight: 500; color: var(--ink-3); font-size: 13.5px; }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc-meta dt { font-size: 12px; color: var(--ink-3); }
.doc-meta dd { font-size: 13.5px; font-weight: 600; }
.doc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: -12px 0 24px; color: var(--ink-3); font-size: 13.5px; }
.doc-facts span { display: inline-flex; align-items: center; gap: 6px; }
.doc-facts .icon { width: 17px; height: 17px; }

/* Invoices */
.invoice-list { display: grid; gap: 12px; }
.invoice { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; padding: 20px 22px; border-radius: var(--r); background: var(--sheet); box-shadow: var(--lift); }
.invoice-main { display: grid; gap: 10px; align-content: start; }
.invoice-id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.invoice-id strong { font-size: 16px; }
.invoice-desc { color: var(--ink-2); font-size: 14px; }
.invoice-money { display: grid; gap: 14px; align-content: start; }
.invoice-money dl { display: grid; gap: 6px; }
.invoice-money dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.invoice-money dt { color: var(--ink-3); }
.invoice-money .remaining { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; font-size: 15.5px; }
.invoice-money .remaining dt { color: var(--ink); }
.invoice-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Packages and quotes ---------- */
.pkg-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 8px; }
.pkg-top .card { margin-bottom: 20px; display: grid; gap: 8px; align-content: start; }
.pkg-top .card-head { margin-bottom: 6px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 4px; }
.steps li { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.steps li span { height: 5px; border-radius: 5px; background: var(--line-2); }
.steps li.done span { background: color-mix(in srgb, var(--copper) 55%, var(--line-2)); }
.steps li.now { color: var(--ink); }
.steps li.now span { background: var(--copper); }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 20px; }
.pkg { position: relative; display: grid; gap: 10px; align-content: start; padding: 22px; border-radius: var(--r); background: var(--sheet); box-shadow: var(--lift); }
.pkg.is-recommended { box-shadow: inset 0 0 0 1.5px var(--copper), var(--lift); }
.pkg.is-current { box-shadow: inset 0 0 0 2px var(--ink); }
.pkg-tags { display: flex; gap: 6px; min-height: 24px; }
.pkg h3 { font-size: 19px; font-weight: 700; }
.was { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-3); }
.was span { color: var(--good); background: var(--good-wash); padding: 1px 8px; border-radius: 999px; font-weight: 650; font-size: 12.5px; }
.price { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; line-height: 1.25; }
.price span { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.diff { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.pkg-features { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.pkg-features li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14px; color: var(--ink); align-items: start; }
.pkg-features .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--good); }
.pkg-features li.v-no { color: var(--ink-3); }
.pkg-features li.v-no .icon { color: var(--ink-3); opacity: 0.6; }
.pkg-features li.v-task .icon { color: var(--warn); }
.pkg-features em { font-style: normal; color: var(--warn); font-size: 12.5px; font-weight: 600; }
.pkg.is-choice { cursor: pointer; transition: box-shadow 160ms var(--ease), background-color 160ms var(--ease); }
.pkg.is-choice:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3), var(--lift); }
.pkg.is-choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--copper), var(--lift); background: color-mix(in srgb, var(--copper-wash) 50%, var(--sheet)); }
.choice { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border-radius: 10px; background: var(--sunk); font-weight: 650; font-size: 14px; margin-top: 6px; }
.choice input { width: 20px; height: 20px; accent-color: var(--copper); margin: 0; }
.pkg.is-choice:has(input:checked) .choice { background: var(--ink); color: var(--paper); }
.request-form { margin-top: 6px; }
.request-form summary { list-style: none; }
.request-form summary::-webkit-details-marker { display: none; }
.request-form[open] summary { margin-bottom: 14px; background: var(--sunk); color: var(--ink); }
.compare { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.compare th, .compare td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.compare thead th { font-size: 13px; color: var(--ink-3); font-weight: 650; }
.compare th[scope="row"], .compare thead th:first-child { text-align: start; width: 46%; font-weight: 550; color: var(--ink); padding-inline-start: 0; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare td.v-yes .icon { color: var(--good); }
.compare td.v-no .icon { color: var(--ink-3); opacity: 0.5; }
.per-task { font-size: 12px; color: var(--warn); font-weight: 650; line-height: 1.4; }
.extras { display: grid; gap: 12px; }
.extras li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.extras li:last-child { border-bottom: 0; }
.qty input { width: 84px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--sunk); text-align: center; }
.terms ul { display: grid; gap: 8px; }
.terms li { position: relative; padding-inline-start: 18px; color: var(--ink-2); font-size: 14.5px; }
.terms li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 0.75em; width: 6px; height: 6px; border-radius: 2px; background: var(--copper); }
.tax-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.tax-note .icon { width: 17px; height: 17px; margin-top: 3px; }
.decide-bar { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; padding: 20px 22px; border-radius: var(--r); background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--ink), var(--lift); margin-bottom: 20px; }
.decide-bar p.small { grid-column: 1 / -1; }
.decide-bar form { display: contents; }
.decide-total { display: grid; gap: 4px; font-size: 14px; color: var(--ink-3); }
.decide-total strong { font-size: 22px; color: var(--ink); }
.decide-total small { font-size: 12.5px; }
.approve { box-shadow: inset 0 0 0 2px var(--copper), var(--lift); }
.reject summary { cursor: pointer; font-weight: 650; color: var(--ink-2); min-height: 44px; display: flex; align-items: center; }
.reject[open] summary { margin-bottom: 12px; }
.reject { padding-block: 10px; }
.receipt blockquote { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); }
.totals { display: grid; gap: 8px; margin-bottom: 16px; }
.total-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.total-period { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--sunk); }
.total-period span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.total-period strong { font-size: 24px; }
.total-period small { font-size: 12.5px; color: var(--ink-3); }
.file-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.file-card > div:first-of-type { flex: 1; min-width: 180px; }
.file-icon { width: 32px; height: 32px; color: var(--copper-ink); }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Team and account */
.members { display: grid; }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member-who { display: grid; flex: 1; min-width: 180px; }
.member-who small { color: var(--ink-3); }
.member-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.member-edit { flex-basis: 100%; }
.member-edit summary { list-style: none; display: inline-flex; }
.member-edit[open] summary { margin-bottom: 10px; }
.member-edit .row { display: flex; gap: 8px; flex-wrap: wrap; }
.plain-list { display: grid; }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list li > span:first-child { flex: 1; min-width: 160px; font-weight: 600; }
.plain-list li p { flex-basis: 100%; }
.devices li > span { display: grid; flex: 1; }
.devices small { color: var(--ink-3); }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.account-grid .card { margin: 0; }

/* Print view */
.print { max-width: 820px; margin: 0 auto; padding: 40px 32px; display: grid; gap: 16px; }
.print-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.print-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.print-table th, .print-table td { border-bottom: 1px solid var(--line-2); padding: 8px; text-align: start; }
.print-foot { margin-top: 24px; font-size: 11.5px; color: var(--ink-3); }
@media print {
  body.ncp { background: #fff; color: #111; }
  .rail, .topbar, .site-foot, .page-actions, .filters, .sort, .decide-bar, .reject, .menu-sheet, .info-btn { display: none !important; }
  .card, .doc-card, .pkg, .stat { box-shadow: 0 0 0 1px #ddd; break-inside: avoid; }
  .app { display: block; }
  .content { padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .content { padding: 32px 28px 48px; }
  .topbar, .site-foot, .preview-bar { padding-inline: 28px; }
}
/* Tablet: an icon rail with short labels, still in the page flow. */
@media (max-width: 1080px) {
  .app { grid-template-columns: 92px minmax(0, 1fr); }
  .rail { padding: 20px 8px; gap: 20px; align-items: stretch; }
  .rail-brand { justify-items: center; padding: 0 0 18px; }
  .rail-brand .client-logo { max-width: 72px; max-height: 32px; }
  .rail-client, .rail-powered small { display: none; }
  .rail-link { flex-direction: column; gap: 4px; min-height: 60px; padding: 8px 4px; justify-content: center; text-align: center; font-size: 11.5px; line-height: 1.3; }
  .rail-link .icon { width: 22px; height: 22px; }
  .rail-powered { justify-items: center; padding: 14px 0 0; }
  .rail-powered .naqar-logo img { height: 12px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .who small { display: none; }
}
/* Phone: no rail; a menu button opens a full sheet of buttons. */
@media (max-width: 760px) {
  body.ncp { font-size: 15px; }
  h1 { font-size: 24px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar { padding: 10px 12px; gap: 8px; min-height: 60px; }
  .topbar .menu-btn, .topbar .topbar-client { display: flex; }
  .topbar-user { display: none; }
  .topbar-tools { margin-inline-start: auto; border: 0; padding: 0; }
  .topbar-tools .chip-btn span { display: none; }
  .topbar-tools .chip-btn { width: 42px; padding: 0; justify-content: center; box-shadow: none; }
  .preview-bar { padding: 10px 16px; }
  .content { padding: 22px 16px 40px; }
  .site-foot { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px 16px 32px; }
  .card { padding: 18px; border-radius: 14px; }
  .page-head { margin-bottom: 20px; }
  .task { grid-template-columns: auto 1fr; }
  .task .btn { grid-column: 1 / -1; width: 100%; }
  .kpis.three { grid-template-columns: 1fr; }
  .kpis > div { display: flex; justify-content: space-between; align-items: center; }
  .kpis dd { font-size: 18px; }
  .strip { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 8px; }
  .strip-bar { height: 52px; }
  .strip-name { font-size: 11.5px; }
  html[lang="ar"] .strip-name { font-size: 11px; }
  .split-legend { grid-template-columns: 1fr; }
  .chart-plot, .chart-y { height: 170px; }
  .invoice { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .decide-bar { grid-template-columns: 1fr; }
  .decide-bar .btn { width: 100%; }
  .doc-grid { grid-template-columns: 1fr; }
  .compare { font-size: 13px; }
  .compare th[scope="row"], .compare thead th:first-child { width: 40%; }
  .compare th, .compare td { padding: 10px 4px; }
  .account-grid { grid-template-columns: 1fr; }
  .filters { gap: 14px; }
  .guest-layout { grid-template-columns: 1fr; }
  .guest-side { border: 0; border-bottom: 1px solid var(--line); }
  .guest-side::after { display: none; }
  .guest-side-inner { padding: 22px 18px; gap: 12px; }
  .guest-client { flex-direction: row; align-items: center; gap: 16px; }
  .guest-client .client-logo { max-height: 40px; max-width: 150px; }
  .guest-client-name { font-size: 16px; }
  .guest-lead { font-size: 16px; max-width: none; }
  .guest-points, .guest-powered { display: none; }
  .guest-main { padding: 16px; }
  .guest-card { margin: 16px 0; }
  .guest-card.wide, .guest-card.narrow { padding: 22px 18px; }
}
@media (min-width: 761px) and (max-width: 960px) {
  .guest-layout { grid-template-columns: 1fr; }
  .guest-side-inner { padding: 32px; }
  .guest-points { grid-template-columns: repeat(3, 1fr); }
  .guest-powered { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

@container (max-width: 620px) { .chart-x span:nth-child(even) { visibility: hidden; } }
@media (min-width: 761px) { .site-foot .naqar-logo { display: none; } }
@media (max-width: 1080px) { .plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
