/* Recuvara : mise en page et composants. Les couleurs et polices sont dans brand.css. */

:root { color-scheme: dark; }
body { background: var(--b-background); }
::selection { background: var(--b-primary); color: var(--b-on-primary); }

/* ---------------------------------------------------------------- type */
.display { font-weight: 650; letter-spacing: -0.045em; line-height: 1.02; font-size: clamp(2.6rem, 1.2rem + 4.6vw, 4.8rem); }
.h2 { font-weight: 650; letter-spacing: -0.035em; }
html[lang="ar"] .display, html[lang="ar"] .h2, html[lang="ar"] main h1 { font-family: var(--b-font-arabic); letter-spacing: 0; line-height: 1.35; font-weight: 800; }
.link { color: var(--b-primary); text-decoration-color: color-mix(in srgb, var(--b-primary) 45%, transparent); }

/* -------------------------------------------------------- surfaces in the dark */
.bg-white { background-color: var(--b-surface); }
.bg-white\/55 { background-color: color-mix(in srgb, var(--b-surface-2) 70%, transparent); }
.panel, .tally-card, .choice, .copy-white, .dialog, .plan-option, .segmented, .menu, .lang-menu, .trail-dot {
  background: var(--b-surface);
}
.panel, .tally-card, .choice, .plan-option { box-shadow: 0 0 0 1px var(--b-border); }
.menu, .lang-menu { box-shadow: 0 0 0 1px var(--b-border), 0 24px 50px -20px rgb(0 0 0 / 0.8); }
.lang-option:hover { background: var(--b-surface-2); }
.lang-option[aria-current="true"] { background: color-mix(in srgb, var(--b-primary) 16%, transparent); }
.glass {
  background: color-mix(in srgb, var(--b-surface) 88%, transparent);
  box-shadow: 0 0 0 1px var(--b-border), 0 40px 90px -40px rgb(255 178 36 / 0.35);
}
.inv-row:hover { background: var(--b-surface-2); }
.inv-row[aria-pressed="true"] { background: var(--b-surface-2); box-shadow: 0 0 0 1px var(--b-border); }
.skeleton { background: linear-gradient(90deg, var(--b-surface), var(--b-surface-2), var(--b-surface)); background-size: 200% 100%; }
.image-slot { background-color: var(--b-surface-2); }
.bank-row { border-top-color: var(--b-border); }
.state-draft { color: var(--b-muted); }
.dialog::backdrop { background: rgb(0 0 0 / 0.65); }

/* ------------------------------------------------------------- controls */
.btn { border-radius: 0.65rem; font-weight: 600; }
.btn-primary { background: var(--b-primary); color: var(--b-on-primary); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08) inset, 0 10px 28px -12px rgb(255 178 36 / 0.6); }
.btn-primary:hover { background: var(--b-primary-deep); color: var(--b-on-primary); }
.btn-quiet { background: var(--b-surface); color: var(--b-ink); box-shadow: inset 0 0 0 1px var(--b-border); }
.btn-quiet:hover { background: var(--b-surface-2); box-shadow: inset 0 0 0 1px var(--b-second); }
.btn-light { background: var(--b-ink); color: var(--b-background); }
.btn-light:hover { background: var(--b-primary); color: var(--b-on-primary); }
.btn-ink, .avatar, .skip-link, .toast { background: var(--b-ink); color: var(--b-background); }
.btn-ink:hover { background: var(--b-primary); color: var(--b-on-primary); }
.avatar { background: linear-gradient(135deg, var(--b-primary), var(--b-accent)); color: var(--b-on-primary); }
.input { background: var(--b-surface-2); color: var(--b-ink); box-shadow: inset 0 0 0 1px var(--b-border); }
.input::placeholder { color: #6B7385; }
.input:hover { box-shadow: inset 0 0 0 1px var(--b-second); }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--b-primary), 0 0 0 4px rgb(255 178 36 / 0.14); }
.check input { accent-color: var(--b-primary); }
.icon-btn:hover, .nav-link:hover, .row-action:hover { background: rgb(255 255 255 / 0.06); }
.nav-link { color: var(--b-muted); }
.filter { background: var(--b-surface); box-shadow: inset 0 0 0 1px var(--b-border); color: var(--b-muted); }
.filter:hover { background: var(--b-surface-2); }
.filter[aria-pressed="true"], .segmented input:checked + span { background: var(--b-primary); color: var(--b-on-primary); }
.pill-pending { background: rgb(122 162 255 / 0.14); color: var(--b-accent); }
.pill-paid, .pill-accepted { background: rgb(61 214 140 / 0.14); }
.pill-overdue, .pill-declined { background: rgb(255 107 107 / 0.14); }
.pill-draft, .pill-expired, .pill-credited, .pill-issued { background: rgb(255 255 255 / 0.07); }
.alert-error { background: rgb(255 107 107 / 0.1); box-shadow: inset 0 0 0 1px rgb(255 107 107 / 0.35); }
.alert-preview { background: var(--b-accent-soft); box-shadow: inset 0 0 0 1px rgb(122 162 255 / 0.4); }
.demo-banner { background: var(--b-accent-soft); border-bottom-color: var(--b-border); color: var(--b-ink); }
.sub-banner { background: var(--b-second-soft); border-bottom-color: var(--b-border); }
.sub-banner.is-ended { background: rgb(255 107 107 / 0.12); }

/* -------------------------------------------------------- public pages */
.nav-glass {
  background: rgb(13 15 20 / 0.78);
  border-bottom: 1px solid var(--b-border);
}
.site-body .hero .mesh {
  background:
    radial-gradient(40rem 26rem at 78% 30%, rgb(255 178 36 / 0.16), transparent 65%),
    radial-gradient(36rem 26rem at 12% 90%, rgb(122 162 255 / 0.16), transparent 65%),
    linear-gradient(to bottom, transparent 0 calc(100% - 1px), var(--b-border) calc(100% - 1px)) 0 0 / 100% 4.5rem,
    linear-gradient(to right, transparent 0 calc(100% - 1px), var(--b-border) calc(100% - 1px)) 0 0 / 4.5rem 100%,
    var(--b-background);
}
.site-body .hero .mesh { -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.hero { background: var(--b-background); }
.mesh-soft { background: radial-gradient(40rem 26rem at 50% 0%, rgb(255 178 36 / 0.08), transparent 70%); }
.site-body .mesh:not(.hero .mesh) { background: radial-gradient(40rem 24rem at 50% 0%, rgb(122 162 255 / 0.12), transparent 70%), var(--b-background); }
.page-index section { border-top-color: var(--b-border) !important; }
.page-index section.bg-canary, .page-index section:last-of-type {
  background: linear-gradient(120deg, var(--b-primary), #FF8A3D) !important;
  color: var(--b-on-primary);
  --color-ink: var(--b-on-primary); --color-muted: #3B2A00;
}
.page-index section:last-of-type .btn-primary { background: var(--b-background); color: var(--b-ink); box-shadow: none; }
.page-index section:last-of-type .btn-quiet { background: transparent; color: var(--b-on-primary); box-shadow: inset 0 0 0 1.5px var(--b-on-primary); }
.plan-featured { background: var(--b-surface-2); color: var(--b-ink); box-shadow: inset 0 0 0 1.5px var(--b-primary); }
.plan-featured .plan-muted { color: var(--b-muted); }
.plan-featured .plan-check { color: var(--b-primary); }
footer { background: var(--b-background) !important; border-top-color: var(--b-border) !important; }

/* ------------------------------------------- application : the icon rail */
.app-bar { background: var(--b-surface); }
.ledger {
  background:
    radial-gradient(40rem 18rem at 100% 0%, rgb(255 178 36 / 0.12), transparent 65%),
    var(--b-surface);
  border-bottom: 1px solid var(--b-border);
}
.ledger-select { background: var(--b-surface-2); box-shadow: inset 0 0 0 1px var(--b-border); }
.metrics { border-top-color: var(--b-border); }
.metric { border-color: var(--b-border); }
.metric-lead .metric-value { color: var(--b-primary); }

@media (min-width: 64rem) {
  .app-body { padding-inline-start: 5.75rem; }
  .app-bar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 5.75rem;
    z-index: 50;
    border-bottom: 0;
    border-inline-end: 1px solid var(--b-border);
  }
  .app-bar > div { height: 100%; max-width: none; flex-direction: column; align-items: stretch; gap: 0; padding: 1.1rem 0.45rem 0.9rem; }
  .app-bar > div > a:first-child { justify-content: center; padding-bottom: 1.4rem; }
  .app-bar > div > a:first-child img { height: 2.4rem; }
  .app-bar > div > a:first-child > span { display: none; }
  .app-bar nav { flex-direction: column; align-items: stretch; gap: 0.3rem; margin: 0; }
  .app-bar nav .nav-link {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    padding: 0.6rem 0.2rem; border-radius: 0.75rem;
    font-size: 0.6875rem; font-weight: 600; line-height: 1.15; text-align: center; white-space: normal;
  }
  .app-bar nav .nav-link::before {
    content: ""; width: 1.35rem; height: 1.35rem; flex-shrink: 0; background: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain;
  }
  .app-bar nav .nav-link[aria-current="page"] { color: var(--b-primary); background: rgb(255 178 36 / 0.1); }
  .app-bar > div > div:last-child { margin: auto 0 0; flex-direction: column-reverse; gap: 0.6rem; }
  .app-bar .icon-btn { padding-inline: 0.3rem; font-size: 0.75rem; }
  .app-bar .icon-btn .lucide:last-of-type { display: none; }
  .app-bar .menu, .app-bar .lang-menu { top: auto; bottom: 0; inset-inline-start: calc(100% + 0.9rem); inset-inline-end: auto; }
}
@media (max-width: 63.99rem) {
  .app-bar { background: rgb(21 25 34 / 0.92); border-bottom: 1px solid var(--b-border); }
  .app-bar .nav-link[aria-current="page"] { color: var(--b-primary); }
}
.app-bar nav a[href^="dashboard.html"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%227%22%20height%3D%229%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%227%22%20height%3D%225%22%20x%3D%2214%22%20y%3D%223%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%227%22%20height%3D%229%22%20x%3D%2214%22%20y%3D%2212%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%227%22%20height%3D%225%22%20x%3D%223%22%20y%3D%2216%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%227%22%20height%3D%229%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%227%22%20height%3D%225%22%20x%3D%2214%22%20y%3D%223%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%227%22%20height%3D%229%22%20x%3D%2214%22%20y%3D%2212%22%20rx%3D%221%22%2F%3E%3Crect%20width%3D%227%22%20height%3D%225%22%20x%3D%223%22%20y%3D%2216%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E"); }
.app-bar nav a[href^="invoice_builder.html"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V7Z%22%2F%3E%3Cpath%20d%3D%22M14%202v4a2%202%200%200%200%202%202h4%22%2F%3E%3Cpath%20d%3D%22M9%2015h6%22%2F%3E%3Cpath%20d%3D%22M12%2018v-6%22%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V7Z%22%2F%3E%3Cpath%20d%3D%22M14%202v4a2%202%200%200%200%202%202h4%22%2F%3E%3Cpath%20d%3D%22M9%2015h6%22%2F%3E%3Cpath%20d%3D%22M12%2018v-6%22%2F%3E%3C%2Fsvg%3E"); }
.app-bar nav a[href^="clients.html"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M22%2021v-2a4%204%200%200%200-3-3.87%22%2F%3E%3Cpath%20d%3D%22M16%203.13a4%204%200%200%201%200%207.75%22%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M22%2021v-2a4%204%200%200%200-3-3.87%22%2F%3E%3Cpath%20d%3D%22M16%203.13a4%204%200%200%201%200%207.75%22%2F%3E%3C%2Fsvg%3E"); }
.app-bar nav a[href^="expenses.html"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%202v20l2-1%202%201%202-1%202%201%202-1%202%201%202-1%202%201V2l-2%201-2-1-2%201-2-1-2%201-2-1-2%201Z%22%2F%3E%3Cpath%20d%3D%22M16%208h-6a2%202%200%201%200%200%204h4a2%202%200%201%201%200%204H8%22%2F%3E%3Cpath%20d%3D%22M12%2017.5v-11%22%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%202v20l2-1%202%201%202-1%202%201%202-1%202%201%202-1%202%201V2l-2%201-2-1-2%201-2-1-2%201-2-1-2%201Z%22%2F%3E%3Cpath%20d%3D%22M16%208h-6a2%202%200%201%200%200%204h4a2%202%200%201%201%200%204H8%22%2F%3E%3Cpath%20d%3D%22M12%2017.5v-11%22%2F%3E%3C%2Fsvg%3E"); }
.app-bar nav a[href^="products.html"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7.5%204.27%209%205.15%22%2F%3E%3Cpath%20d%3D%22M21%208a2%202%200%200%200-1-1.73l-7-4a2%202%200%200%200-2%200l-7%204A2%202%200%200%200%203%208v8a2%202%200%200%200%201%201.73l7%204a2%202%200%200%200%202%200l7-4A2%202%200%200%200%2021%2016Z%22%2F%3E%3Cpath%20d%3D%22m3.3%207%208.7%205%208.7-5%22%2F%3E%3Cpath%20d%3D%22M12%2022V12%22%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7.5%204.27%209%205.15%22%2F%3E%3Cpath%20d%3D%22M21%208a2%202%200%200%200-1-1.73l-7-4a2%202%200%200%200-2%200l-7%204A2%202%200%200%200%203%208v8a2%202%200%200%200%201%201.73l7%204a2%202%200%200%200%202%200l7-4A2%202%200%200%200%2021%2016Z%22%2F%3E%3Cpath%20d%3D%22m3.3%207%208.7%205%208.7-5%22%2F%3E%3Cpath%20d%3D%22M12%2022V12%22%2F%3E%3C%2Fsvg%3E"); }
.app-bar nav a[href^="reports.html"]::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18%22%2F%3E%3Cpath%20d%3D%22M18%2017V9%22%2F%3E%3Cpath%20d%3D%22M13%2017V5%22%2F%3E%3Cpath%20d%3D%22M8%2017v-3%22%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18%22%2F%3E%3Cpath%20d%3D%22M18%2017V9%22%2F%3E%3Cpath%20d%3D%22M13%2017V5%22%2F%3E%3Cpath%20d%3D%22M8%2017v-3%22%2F%3E%3C%2Fsvg%3E"); }
/* paper stays paper: the invoice, the documents and the landing page sample are printed on white */
.sheet, .paper, .doc-paper {
  --color-ink: #14161C; --color-muted: #5B6170; --color-rule: #DDE1E8; --color-desk: #F4F5F8;
  --color-pen: #1F2533; --color-canary-soft: #FFF1D6;
  color-scheme: light;
  background: #fff;
  color: #14161C;
}


/* ------------------------------------------------------ the invoice sheet */
.sheet-stack::before, .sheet-stack::after { display: none; }
.sheet { border-radius: 0.9rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 0 70px -18px rgb(255 178 36 / 0.45); }
.sheet-title { font-weight: 700; letter-spacing: -0.03em; }
html[lang="ar"] .sheet-title { letter-spacing: 0; }
.sheet-items th { background: #14161C; color: #fff; border-bottom: 0; padding-inline: 0.6rem; font-weight: 600; }
.sheet-items th:first-child { border-start-start-radius: 0.4rem; border-end-start-radius: 0.4rem; }
.sheet-items th:last-child { border-start-end-radius: 0.4rem; border-end-end-radius: 0.4rem; }
.sheet-items td { padding-inline: 0.6rem; border-bottom: 1px solid #E6E8EE; }
