/* SmartBook design system v3 — "Royal Glass"
   Pure white + royal navy + warm metallic gold, with frosted glass surfaces, ambient glows
   and restrained motion. Light theme only, by design. Motion is disabled for users who ask for it. */
:root {
  color-scheme: light;
  /* Surfaces */
  --bg: #f7f8fc; --surface: #ffffff; --surface-2: #fafbfe; --glass: rgba(255, 255, 255, .72); --glass-strong: rgba(255, 255, 255, .86);
  --line: rgba(19, 38, 92, .09); --line-strong: rgba(19, 38, 92, .16); --line-gold: rgba(201, 162, 74, .35);
  /* Ink */
  --ink: #0d1736; --ink-2: #34405f; --muted: #75809b;
  /* Navy */
  --navy-950: #070f2b; --navy-900: #0b1840; --navy-800: #13265c; --navy-700: #1b3478; --navy-600: #2547a3; --navy-500: #3a5fd0; --navy-50: #eef2fc; --navy-100: #dde5f8;
  /* Gold */
  --gold-800: #7a5813; --gold-700: #94701f; --gold-600: #b8892b; --gold-500: #c9a24a; --gold-400: #ddbd6c; --gold-200: #f1e1b5; --gold-100: #f8efd8; --gold-50: #fdf9ef;
  /* Used for gold text: dark enough to read on white, with a brighter band for the sheen */
  --gold-grad: linear-gradient(120deg, #7f5b12 0%, #a87a1f 30%, #d1a94d 48%, #a87a1f 66%, #7f5b12 100%);
  --gold-flat: linear-gradient(135deg, #b8892b 0%, #e3c26b 55%, #c49a3f 100%);
  --navy-grad: linear-gradient(135deg, #2547a3 0%, #13265c 55%, #0b1840 100%);
  /* States */
  --pos: #0f8a62; --pos-bg: #e7f7f0; --neg: #c3352b; --neg-bg: #fdeceb; --warn-ink: #7a5310; --warn-bg: #fdf3dc;
  /* Shape & depth */
  --r-sm: 12px; --r: 18px; --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(13, 23, 54, .05);
  --shadow: 0 0 0 1px rgba(13, 23, 54, .02), 0 1px 1px rgba(13, 23, 54, .03), 0 2px 4px -1px rgba(13, 23, 54, .04), 0 8px 16px -6px rgba(13, 23, 54, .05), 0 20px 25px -5px rgba(13, 23, 54, .04);
  --shadow-hover: 0 0 0 1px rgba(37, 71, 163, .06), 0 2px 4px -1px rgba(13, 23, 54, .05), 0 12px 24px -8px rgba(19, 38, 92, .14), 0 28px 40px -12px rgba(19, 38, 92, .12);
  --border: #e5e8f1; --border-hover: #c9d2ea;
  --shadow-lg: 0 30px 60px -15px rgba(7, 15, 43, .28);
  --glow-navy: 0 10px 30px -8px rgba(37, 71, 163, .55);
  --glow-gold: 0 10px 30px -8px rgba(201, 162, 74, .6);
  --ring: 0 0 0 4px rgba(37, 71, 163, .14);
  --blur: saturate(170%) blur(18px);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --header-h: 68px; --side-w: 252px; --gap: 14px;
  font-family: "Plus Jakarta Sans", "Noto Sans Arabic", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; position: relative; overflow-x: hidden; }
[dir=rtl] body { font-family: "Noto Sans Arabic", "Plus Jakarta Sans", Tahoma, sans-serif; }

/* Ambient background: two soft orbs (royal blue, faint gold) and a fine dot grid. Fixed, behind everything. */
body::before, body::after { content: ""; position: fixed; z-index: 0; pointer-events: none; border-radius: 50%; filter: blur(60px); }
body::before { width: 720px; height: 720px; top: -260px; inset-inline-end: -180px; background: radial-gradient(circle at 40% 40%, rgba(58, 95, 208, .22), rgba(58, 95, 208, 0) 65%); animation: drift 26s var(--ease) infinite alternate; }
body::after { width: 620px; height: 620px; bottom: -260px; inset-inline-start: 120px; background: radial-gradient(circle at 50% 50%, rgba(221, 189, 108, .24), rgba(221, 189, 108, 0) 65%); animation: drift 32s var(--ease) infinite alternate-reverse; }
#app { position: relative; z-index: 1; }
#app::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(rgba(19, 38, 92, .07) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0) 70%); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0) 70%); }
@keyframes drift { to { transform: translate3d(-60px, 50px, 0) scale(1.08); } }

a { color: var(--navy-600); text-decoration: none; transition: color .2s; }
a:hover { color: var(--navy-800); text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; margin: 0 0 22px; color: var(--ink); }
h2 { font-size: 1.12rem; font-weight: 750; letter-spacing: -.02em; margin: 30px 0 14px; color: var(--ink); }
h3 { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; margin: 16px 0 10px; color: var(--ink); }
[dir=rtl] h1, [dir=rtl] h2, [dir=rtl] h3 { letter-spacing: 0; }
.mt0 { margin-top: 0; } .center { text-align: center; } .right { text-align: end; } .grow { flex: 1; }
.sub-title { margin: -16px 0 18px; font-weight: 500; } .w80 { width: 84px; } .wrap { white-space: normal; max-width: 380px; }
::selection { background: var(--gold-200); color: var(--ink); }
.gold-text { background: var(--gold-grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Scaled-view notice: always clearly visible */
#scale-banner { position: sticky; top: 0; z-index: 45; background: linear-gradient(90deg, #fdf3dc, #fbe9bd, #fdf3dc); color: var(--warn-ink); padding: 9px 16px; font-weight: 650; font-size: .9rem; text-align: center; border-bottom: 1px solid var(--line-gold); }

/* ---------- Brand: logo with drop shadow and a slow metallic shine ---------- */
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none !important; color: var(--ink); }
.brand .mark { position: relative; display: inline-block; width: 36px; height: 36px; border-radius: 11px; overflow: hidden; flex: none; box-shadow: 0 6px 16px -4px rgba(11, 24, 64, .45), 0 0 0 1px rgba(221, 189, 108, .45); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.brand .mark img { width: 100%; height: 100%; display: block; }
.brand .mark::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%); transform: translateX(-70%); animation: shine 6s ease-in-out infinite; }
.brand:hover .mark { transform: rotate(-4deg) scale(1.06); box-shadow: 0 10px 22px -6px rgba(11, 24, 64, .5), 0 0 0 1px rgba(221, 189, 108, .7), var(--glow-gold); }
@keyframes shine { 0%, 70% { transform: translateX(-70%); } 100% { transform: translateX(70%); } }
.brand .word { font-weight: 800; font-size: 1.2rem; letter-spacing: -.035em; color: var(--navy-800); }
.brand .word b { font-weight: 800; background: var(--gold-grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 8s linear infinite; }
@keyframes sheen { to { background-position: 200% center; } }
.brand.big .mark { width: 50px; height: 50px; border-radius: 15px; }
.brand.big .word { font-size: 1.75rem; }
.brand.light .word { color: #fff; }

/* ---------- Floating glass header ---------- */
.topbar { position: sticky; top: var(--gap); z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--header-h); margin: var(--gap) var(--gap) 0; padding: 0 20px; border-radius: var(--r); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.topbar .divider { width: 1px; height: 26px; background: linear-gradient(180deg, transparent, var(--line-gold), transparent); }
.org-name { color: var(--ink-2); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.who { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: .88rem; font-weight: 650; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); }
[dir=rtl] .who { padding: 4px 4px 4px 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-grad); color: #fff; font-weight: 750; font-size: .8rem; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--gold-400); text-transform: uppercase; }
.menu-btn { display: none; }
select.lang { padding: 8px 32px 8px 14px; border-radius: 999px; background-color: rgba(255, 255, 255, .7); font-size: .85rem; font-weight: 600; }

/* ---------- Layout & floating glass sidebar ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) 1fr; gap: var(--gap); padding: var(--gap); min-height: calc(100vh - var(--header-h) - var(--gap)); }
nav.side { position: sticky; top: calc(var(--header-h) + var(--gap) * 2); align-self: start; height: calc(100vh - var(--header-h) - var(--gap) * 3); overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 18px 12px; border-radius: var(--r); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow), 0 0 0 1px var(--line); scrollbar-width: thin; scrollbar-color: var(--navy-100) transparent; }
nav.side .side-user { padding: 6px 12px 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-weight: 750; color: var(--ink); letter-spacing: -.01em; }
nav.side .side-user .muted { font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.side a { position: relative; display: flex; align-items: center; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 560; transition: background .25s var(--ease), color .25s, transform .25s var(--ease), box-shadow .25s; }
nav.side a:hover { background: rgba(238, 242, 252, .9); color: var(--navy-800); text-decoration: none; }
nav.side a.on { color: var(--navy-900); font-weight: 750; background: linear-gradient(135deg, rgba(221, 229, 248, .95), rgba(253, 249, 239, .95)); box-shadow: 0 6px 14px -8px rgba(19, 38, 92, .35), 0 0 0 1px rgba(201, 162, 74, .28) inset; }
nav.side a.on::after { content: ""; margin-inline-start: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-flat); box-shadow: 0 0 0 3px rgba(221, 189, 108, .25), 0 0 10px rgba(221, 189, 108, .8); }
nav.side .sec { font-size: .68rem; font-weight: 800; text-transform: uppercase; color: var(--muted); padding: 18px 12px 6px; letter-spacing: .14em; }
[dir=rtl] nav.side .sec, [dir=rtl] nav.side .side-user .muted { text-transform: none; letter-spacing: 0; }
nav.side #logout { margin-top: 10px; color: var(--muted); border-top: 1px solid var(--line); border-radius: 0; padding-top: 14px; }
nav.side #logout:hover { background: none; color: var(--neg); }
main { padding: 18px 20px 48px; max-width: 1260px; width: 100%; min-width: 0; }
main.wide { margin: 0 auto; padding: 24px var(--gap) 48px; }

/* Page entrance: content slides up and fades in, staggered */
main > * { animation: rise .4s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .05s; } main > *:nth-child(3) { animation-delay: .1s; } main > *:nth-child(4) { animation-delay: .15s; } main > *:nth-child(n+5) { animation-delay: .2s; }
#c > *, .kpis > * { animation: rise .5s var(--ease) both; }
.kpis > *:nth-child(2) { animation-delay: .06s; } .kpis > *:nth-child(3) { animation-delay: .12s; } .kpis > *:nth-child(4) { animation-delay: .18s; } .kpis > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 900px) {
  :root { --gap: 10px; --header-h: 60px; }
  .layout { grid-template-columns: 1fr; padding: var(--gap); }
  .menu-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; }
  .who .name, .topbar .divider, .org-name { display: none; }
  .who { padding: 3px; }
  .topbar { padding: 0 12px; gap: 10px; }
  nav.side { position: fixed; top: var(--gap); bottom: var(--gap); inset-inline-start: var(--gap); width: min(82%, 300px); height: auto; z-index: 50; transform: translateX(calc(-100% - 30px)); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); background: var(--glass-strong); }
  [dir=rtl] nav.side { transform: translateX(calc(100% + 30px)); }
  nav.side.open, [dir=rtl] nav.side.open { transform: none; }
  main { padding: 10px 4px 40px; }
  h1 { font-size: 1.5rem; }
}

/* ---------- Glass cards ---------- */
.card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); transition: box-shadow .3s var(--ease), border-color .3s; }
/* Hairline gold-to-blue highlight along the top edge of every card */
.card::before { content: ""; position: absolute; top: -1px; left: 24px; right: 24px; height: 1px; background: linear-gradient(90deg, transparent, rgba(221, 189, 108, .7), rgba(58, 95, 208, .5), transparent); opacity: .7; pointer-events: none; }
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.card.alert { background: linear-gradient(135deg, #fff5f4, #fdeceb); color: var(--neg); font-weight: 650; box-shadow: 0 0 0 1px #f3c3be; }

/* KPI tiles: thin gradient border, lift + glow on hover, gold gradient on the headline metric */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; padding: 20px 22px 22px; border-radius: 16px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); transition: box-shadow .3s var(--ease), border-color .3s; }
.kpi:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); }
.kpi:first-child { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, rgba(221, 189, 108, .9), rgba(255, 255, 255, .6) 50%, rgba(221, 189, 108, .5)) border-box; border-color: transparent; }
.kpi::before { content: ""; position: absolute; width: 140px; height: 140px; inset-inline-end: -50px; top: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(58, 95, 208, .16), transparent 70%); transition: transform .5s var(--ease); }
.kpi:hover::before { transform: scale(1.3); }
.kpi:first-child::before { background: radial-gradient(circle, rgba(221, 189, 108, .32), transparent 70%); }
.kpi .l { position: relative; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.kpi .l::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--navy-grad); }
.kpi:first-child .l::before { background: var(--gold-flat); }
[dir=rtl] .kpi .l { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.kpi .v { position: relative; font-size: 1.75rem; font-weight: 800; margin-top: 8px; letter-spacing: -.035em; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.kpi:first-child .v { background: var(--gold-grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 8s linear infinite; }
.kpi .v .neg { color: var(--neg); -webkit-text-fill-color: var(--neg); }

/* ---------- Forms ---------- */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row.between { justify-content: space-between; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: .8rem; font-weight: 650; color: var(--ink-2); }
label.chk { flex-direction: row; align-items: center; gap: 9px; color: var(--ink); font-weight: 550; font-size: .9rem; }
input, select, textarea { font: inherit; font-size: .92rem; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: rgba(255, 255, 255, .85); color: var(--ink); min-width: 0; transition: border-color .2s, box-shadow .25s var(--ease), background .2s; }
input::placeholder { color: #a5aec3; }
input:hover, select:hover, textarea:hover { border-color: rgba(37, 71, 163, .32); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); background: #fff; box-shadow: var(--ring), 0 8px 18px -10px rgba(37, 71, 163, .35); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy-700); padding: 0; }
input[type=file] { padding: 9px; background: rgba(250, 251, 254, .8); border-style: dashed; border-color: var(--line-gold); }
input.pin { letter-spacing: .5em; font-size: 1.3rem; text-align: center; font-weight: 800; color: var(--navy-800); }
select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2375809b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-inline-end: 36px; }
[dir=rtl] select { background-position: left 13px center; }

/* ---------- Buttons: lift, glow and a gold sheen sweep ---------- */
button { position: relative; overflow: hidden; font: inherit; font-size: .9rem; font-weight: 700; letter-spacing: -.005em; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .85); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s; }
button:hover { background: #fff; border-color: var(--border-hover); box-shadow: 0 1px 2px rgba(13, 23, 54, .06), 0 6px 14px -8px rgba(19, 38, 92, .3); }
button:active { background: var(--navy-50); box-shadow: inset 0 2px 4px rgba(19, 38, 92, .12); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
button::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60%; left: -80%; background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-18deg); transition: left .7s var(--ease); pointer-events: none; }
button.primary:hover::after, button.gold:hover::after, button.bio:hover::after { left: 130%; }
button.primary { background: var(--navy-grad); color: #fff; border-color: rgba(11, 24, 64, .9); box-shadow: 0 8px 20px -10px rgba(19, 38, 92, .7), inset 0 1px 0 rgba(255, 255, 255, .18); }
button.primary:hover { background: var(--navy-grad); border-color: var(--navy-900); filter: brightness(1.12); box-shadow: var(--glow-navy), 0 0 0 1px rgba(221, 189, 108, .35), inset 0 1px 0 rgba(255, 255, 255, .2); }
button.primary:active { filter: brightness(.95); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .3); }
button.gold { background: var(--gold-flat); color: #3a2804; border-color: #b8892b; box-shadow: 0 8px 20px -10px rgba(184, 137, 43, .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
button.gold:hover { background: var(--gold-flat); filter: brightness(1.06); box-shadow: var(--glow-gold), inset 0 1px 0 rgba(255, 255, 255, .45); }
button.danger { color: var(--neg); }
button.danger:hover { background: var(--neg-bg); border-color: #f3c3be; }
button.sm { padding: 6px 11px; font-size: .78rem; border-radius: 9px; }

/* Segmented tabs with a sliding feel */
.tabs { display: inline-flex; padding: 4px; gap: 4px; background: rgba(238, 242, 252, .8); border-radius: 14px; border: 1px solid var(--navy-100); }
.tabs button { border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--ink-2); padding: 8px 16px; }
.tabs button::after { display: none; }
.tabs button:hover { background: rgba(255, 255, 255, .7); transform: none; box-shadow: none; }
.tabs button.on { background: #fff; color: var(--navy-800); box-shadow: 0 4px 12px -4px rgba(19, 38, 92, .25), 0 0 0 1px rgba(201, 162, 74, .3); animation: pop .3s var(--ease); }
@keyframes pop { from { transform: scale(.94); } }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.tablewrap { padding: 8px 0 6px; }
.card.tablewrap > h2, .card.tablewrap > h3, .card.tablewrap > p { padding: 0 24px; }
.card.tablewrap > h3.mt0, .card.tablewrap > h2.mt0 { padding-top: 16px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
th:first-child, td:first-child { padding-inline-start: 24px; } th:last-child, td:last-child { padding-inline-end: 24px; }
th { font-size: .68rem; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .1em; background: transparent; }
[dir=rtl] th { text-transform: none; letter-spacing: 0; font-size: .8rem; }
tr:last-child td { border-bottom: 0; }
table tr td { transition: background .2s; }
table tr:hover td { background: linear-gradient(90deg, rgba(238, 242, 252, .55), rgba(253, 249, 239, .55)); }
td.n, th.n { text-align: end; }
td.n, .kpi .v, .price, .otp { unicode-bidi: plaintext; }
td.n { font-weight: 600; color: var(--navy-900); }
tr.tot td { font-weight: 800; color: var(--navy-900); border-top: 1px solid var(--line-gold); background: linear-gradient(90deg, rgba(253, 249, 239, .9), rgba(238, 242, 252, .6)); }
tr.sub td { font-weight: 750; background: rgba(238, 242, 252, .7); color: var(--navy-800); }
tr.void td { text-decoration: line-through; color: #a5aec3; }
td .muted { font-size: .8rem; font-weight: 500; }
.neg { color: var(--neg); }
.muted { color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 750; background: rgba(238, 242, 252, .9); color: var(--navy-700); border: 1px solid var(--navy-100); text-decoration: none !important; white-space: nowrap; transition: transform .25s var(--ease), box-shadow .25s; }
a.badge:hover { box-shadow: 0 6px 14px -8px rgba(19, 38, 92, .4); }
.badge.ok { background: var(--pos-bg); color: var(--pos); border-color: #c4ead9; }
.badge.bad { background: var(--neg-bg); color: var(--neg); border-color: #f3c3be; }
.badge.ok::before, .badge.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
/* Gold "premium" badges: gold gradient border and gradient text */
.badge.warn, .badge.gold { border: 1px solid transparent; background: linear-gradient(#fffaf0, #fffaf0) padding-box, var(--gold-flat) border-box; }
.badge.warn > *, .badge.warn, .badge.gold { color: var(--gold-800); }
.badge.warn::before, .badge.gold::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-flat); box-shadow: 0 0 8px rgba(221, 189, 108, .9); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.8); } }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(440px, 1.05fr); gap: var(--gap); padding: var(--gap); }
.auth-brand { position: relative; overflow: hidden; border-radius: var(--r-lg); background: radial-gradient(120% 80% at 0% 0%, #2a4fb3 0%, #13265c 45%, #070f2b 100%); color: #dfe6f7; padding: 48px 52px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-lg); }
.auth-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%); -webkit-mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%); }
.auth-brand::after { content: ""; position: absolute; width: 560px; height: 560px; inset-inline-end: -200px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(231, 200, 115, .38), rgba(231, 200, 115, 0) 62%); filter: blur(10px); animation: drift 18s var(--ease) infinite alternate; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .tagline { font-size: 2.35rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.12; color: #fff; max-width: 460px; margin: 0 0 26px; text-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
[dir=rtl] .auth-brand .tagline { letter-spacing: 0; line-height: 1.4; }
.auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; align-items: center; gap: 12px; font-weight: 600; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px); max-width: 360px; transition: transform .3s var(--ease), background .3s; animation: rise .6s var(--ease) both; }
.auth-brand li:nth-child(2) { animation-delay: .08s; } .auth-brand li:nth-child(3) { animation-delay: .16s; } .auth-brand li:nth-child(4) { animation-delay: .24s; }
.auth-brand li:hover { transform: translateX(4px); background: rgba(255, 255, 255, .1); }
[dir=rtl] .auth-brand li:hover { transform: translateX(-4px); }
.auth-brand li::before { content: "✓"; width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #3a2804; background: var(--gold-flat); box-shadow: 0 0 12px rgba(231, 200, 115, .55); }
.auth-brand .foot { font-size: .8rem; color: #9fb0d8; }
.auth-form { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 32px clamp(20px, 5vw, 72px); }
.auth-form .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.auth-form .panel { width: 100%; max-width: 420px; margin: 0 auto; padding: 34px 32px; border-radius: var(--r-lg); background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow), 0 0 0 1px var(--line); animation: rise .6s var(--ease) both; }
.auth-form h1 { font-size: 1.9rem; margin-bottom: 18px; }
.auth-form .tabs { width: 100%; margin-bottom: 18px; } .auth-form .tabs button { flex: 1; }
.auth-form button.primary { padding: 13px 16px; font-size: .95rem; }
.auth-form .alt { margin-top: 22px; text-align: center; font-size: .88rem; }
.auth-form .alt:empty { display: none; }
.auth-mobile-brand { display: none; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-brand { display: inline-flex; }
  .auth-form { padding: 18px 6px; justify-content: flex-start; }
  .auth-form .top { margin-bottom: 22px; }
  .auth-form .panel { padding: 26px 20px; }
}

/* PIN pad */
.pin-entry { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 4px 0 2px; }
.pin-label { font-size: .8rem; font-weight: 650; color: var(--ink-2); align-self: stretch; }
.pin-dots { display: flex; gap: 14px; justify-content: center; min-height: 18px; direction: ltr; }
.pin-dots span { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; transition: background .2s, border-color .2s, transform .3s var(--ease), box-shadow .3s; }
.pin-dots span.on { background: var(--gold-flat); border-color: var(--gold-600); transform: scale(1.15); box-shadow: 0 0 12px rgba(221, 189, 108, .75); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; width: 100%; max-width: 300px; direction: ltr; }
.keypad .key { height: 58px; font-size: 1.4rem; font-weight: 750; color: var(--navy-900); border-radius: 16px; background: linear-gradient(180deg, #fff, #f6f8fd); border: 1px solid var(--line); box-shadow: 0 6px 14px -10px rgba(19, 38, 92, .35), inset 0 1px 0 #fff; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; user-select: none; }
.keypad .key::after { display: none; }
.keypad .key { touch-action: manipulation; }
.keypad .key:hover { border-color: var(--line-gold); box-shadow: 0 8px 16px -10px rgba(19, 38, 92, .4), 0 0 0 3px rgba(221, 189, 108, .15); }
.keypad .key.pressed { animation: keyPress .22s var(--ease); }
@keyframes keyPress { 0% { background: var(--gold-100); box-shadow: inset 0 2px 6px rgba(184, 137, 43, .35), 0 0 0 4px rgba(221, 189, 108, .3); } 100% { background: linear-gradient(180deg, #fff, #f6f8fd); } }
.keypad .key.fn { font-size: .82rem; font-weight: 650; color: var(--muted); background: rgba(250, 251, 254, .8); }
.keypad .key.fn[data-k=back] { font-size: 1.2rem; }

/* "or" divider and biometric button */
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
[dir=rtl] .or { text-transform: none; letter-spacing: 0; }
button.bio { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 16px; font-size: .95rem; color: var(--navy-800); border: 1px solid transparent; background: linear-gradient(#fffaf0, #fffaf0) padding-box, var(--gold-flat) border-box; }
button.bio svg { color: var(--gold-600); transition: transform .35s var(--ease); }
button.bio:hover { background: linear-gradient(#fff6e2, #fff6e2) padding-box, var(--gold-flat) border-box; box-shadow: var(--glow-gold); }
button.bio:hover svg { transform: scale(1.15); }

/* ---------- Plans & billing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; margin-bottom: 18px; }
.plan { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 28px; border-radius: var(--r-lg); }
.plan:hover { box-shadow: var(--shadow-hover); }
.plan h3 { font-size: 1.08rem; font-weight: 800; color: var(--navy-800); }
.plan.current { box-shadow: var(--shadow), 0 0 0 2px var(--navy-600); }
.plan.premium { background: linear-gradient(170deg, rgba(253, 246, 226, .95), rgba(255, 255, 255, .85) 45%) padding-box, var(--gold-flat) border-box; border: 1.5px solid transparent; }
.plan.premium:hover { box-shadow: var(--shadow-hover), var(--glow-gold); }
.plan.premium::after { content: "★"; position: absolute; top: 20px; inset-inline-end: 22px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-flat); color: #fff; font-size: .9rem; box-shadow: 0 6px 16px rgba(184, 137, 43, .45); animation: pulse 3s ease-in-out infinite; }
.plan .price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.04em; color: var(--navy-900); }
.plan.premium .price { background: var(--gold-grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 8s linear infinite; }
.plan .price .muted { font-size: .9rem; font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 8px 0 12px; flex: 1; display: grid; gap: 9px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-weight: 500; }
.plan li::before { content: "✓"; flex: none; width: 19px; height: 19px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 800; background: var(--gold-100); color: var(--gold-700); box-shadow: 0 0 0 1px var(--gold-200) inset; }
.plan button { width: 100%; padding: 12px; }
.progress { height: 10px; background: rgba(238, 242, 252, .9); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; box-shadow: inset 0 1px 2px rgba(19, 38, 92, .08); }
.progress div { height: 100%; background: var(--gold-grad); background-size: 200% auto; border-radius: 99px; box-shadow: 0 0 12px rgba(221, 189, 108, .6); animation: sheen 4s linear infinite, grow 1s var(--ease) both; transform-origin: left; }
[dir=rtl] .progress div { transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } }
.otp { font-size: 2.2rem; font-weight: 800; letter-spacing: .32em; text-align: center; font-family: ui-monospace, "SF Mono", Consolas, monospace; color: var(--navy-800); background: var(--gold-50); border: 1px dashed var(--gold-400); border-radius: var(--r-sm); padding: 14px; }

/* ---------- Toast, modal ---------- */
#toast { pointer-events: none; position: fixed; top: 22px; left: 50%; transform: translateX(-50%); background: rgba(11, 24, 64, .92); backdrop-filter: blur(12px); color: #fff; padding: 13px 20px; border-radius: 14px; z-index: 70; max-width: 90vw; font-weight: 600; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(221, 189, 108, .4); animation: toastIn .4s var(--ease); }
#toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } }
.modal-bg { position: fixed; inset: 0; background: rgba(7, 15, 43, .32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .25s ease; }
.modal { background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-radius: var(--r-lg); padding: 30px; width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .7), 0 0 0 2px var(--line); animation: modalIn .4s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal h2 { margin-top: 0; font-size: 1.3rem; font-weight: 800; }
.modal form > label { margin-top: 14px; }

/* ---------- Chart: rounded gradient bars, pill legend ---------- */
.bars { display: flex; gap: 12px; align-items: end; height: 200px; padding: 14px 6px 0; margin-bottom: 26px; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 50px; background-position: bottom; }
.bars .m { flex: 1; display: flex; gap: 4px; align-items: end; height: 100%; position: relative; padding: 0 4px; border-radius: 12px 12px 0 0; transition: background .25s; }
.bars .m:hover { background: linear-gradient(180deg, rgba(238, 242, 252, 0), rgba(238, 242, 252, .8)); }
.bars .b { flex: 1; max-width: 22px; border-radius: 999px 999px 6px 6px; min-height: 3px; transform-origin: bottom; animation: barUp .9s var(--ease) both; transition: filter .25s, transform .25s var(--ease); }
.bars .m:nth-child(2) .b { animation-delay: .04s; } .bars .m:nth-child(3) .b { animation-delay: .08s; } .bars .m:nth-child(4) .b { animation-delay: .12s; } .bars .m:nth-child(5) .b { animation-delay: .16s; } .bars .m:nth-child(n+6) .b { animation-delay: .2s; }
.bars .m:hover .b { filter: brightness(1.08) saturate(1.1); transform: scaleY(1.02); }
@keyframes barUp { from { transform: scaleY(0); } }
.bars .r { background: linear-gradient(180deg, #4a6fe0 0%, #1b3478 100%); box-shadow: 0 6px 14px -6px rgba(37, 71, 163, .6); }
.bars .e { background: linear-gradient(180deg, #f0d68e 0%, #b8892b 100%); box-shadow: 0 6px 14px -6px rgba(184, 137, 43, .6); }
span.key { display: inline-block; width: 22px; height: 9px; border-radius: 999px; margin-inline: 16px 7px; vertical-align: middle; }
span.key.r { background: linear-gradient(90deg, #4a6fe0, #1b3478); } span.key.e { background: linear-gradient(90deg, #f0d68e, #b8892b); }
.bars .lbl { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700; }

/* ---------- Accessibility & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body::before, body::after, #app::before { display: none; }
  nav.side, .topbar, .noprint, button { display: none !important; }
  body { background: #fff; }
  .layout { display: block; padding: 0; } main { padding: 0; } .card, .kpi { border: 0; box-shadow: none; backdrop-filter: none; background: #fff; }
  .kpi .v, .kpi:first-child .v { color: #000; -webkit-text-fill-color: #000; }
  #scale-banner { position: static; }
}

/* ---------- Feedback states ---------- */
/* Busy buttons: label fades, a spinner takes its place; clicks are ignored until done */
button.loading { color: transparent !important; pointer-events: none; }
button.loading > * { visibility: hidden; }
button.loading::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(37, 71, 163, .25); border-top-color: var(--navy-700); animation: spin .7s linear infinite; }
button.primary.loading::before { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
button.gold.loading::before, button.bio.loading::before { border-color: rgba(122, 88, 19, .25); border-top-color: var(--gold-800); }
button:disabled.loading { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Inline form errors */
.form-error { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--neg-bg); color: var(--neg); font-weight: 600; font-size: .88rem; border: 1px solid #f3c3be; }
.form-error::before { content: "!"; flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--neg); color: #fff; font-size: .75rem; font-weight: 800; }
.form-error[hidden] { display: none; }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
/* Switching Password/PIN redraws the form without replaying the entrance animation */
.auth.still .panel, .auth.still .auth-brand li, .auth.still .tabs button.on { animation: none; }
/* Keyboard focus is always visible */
a:focus-visible, select:focus-visible, .keypad .key:focus-visible { outline: none; box-shadow: var(--ring); }
.modal.wide { max-width: 1040px; }

/* ---------- Receipt picker: camera + files ---------- */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.filepick { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pick-label { font-size: .8rem; font-weight: 650; color: var(--ink-2); }
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { position: relative; flex-direction: row; align-items: center; justify-content: center; gap: 9px; padding: 14px 12px; border-radius: var(--r-sm); border: 1.5px dashed var(--line-strong); background: var(--surface-2); color: var(--navy-800); font-size: .9rem; font-weight: 700; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.pick:hover { border-color: var(--navy-500); background: var(--navy-50); }
.pick:focus-within { box-shadow: var(--ring); border-color: var(--navy-600); }
.pick:active { background: var(--navy-100); }
.pick.cam { border-style: solid; border-color: transparent; background: linear-gradient(#fffaf0, #fffaf0) padding-box, var(--gold-flat) border-box; color: var(--gold-800); }
.pick.cam:hover { box-shadow: var(--glow-gold); }
.pick .ico { font-size: 1.15rem; }
.picked { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--pos-bg); color: var(--pos); font-size: .85rem; font-weight: 600; }
.picked .names { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Subscription expired notice ---------- */
.expired { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 8px 0 4px; }
.expired-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: linear-gradient(#fffaf0, #fffaf0) padding-box, var(--gold-flat) border-box; border: 2px solid transparent; box-shadow: var(--glow-gold); }
.expired-msg { margin: 4px 0 0; font-size: 1.05rem; font-weight: 700; color: var(--navy-900); }
.expired .row { justify-content: center; margin-top: 8px; }

/* ---------- Single plan ---------- */
.feature-list { list-style: none; padding: 0; margin: 16px 0 4px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 18px; }
.feature-list li { display: flex; gap: 10px; align-items: center; color: var(--ink-2); font-weight: 550; }
.feature-list li::before { content: "✓"; flex: none; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 800; background: var(--gold-100); color: var(--gold-700); box-shadow: 0 0 0 1px var(--gold-200) inset; }
