/* ==========================================================================
   Ledgerline — design system v1.1 "Aurora ledger"
   --------------------------------------------------------------------------
   Identity : an ink-indigo aurora band (iris → lagoon → saffron) carries page
              titles; content sheets float over it on a cool mist canvas.
   Type     : Fraunces (display) + Manrope (UI, tabular figures);
              Amiri (display) + IBM Plex Sans Arabic (UI) for Arabic.
   Rules    : gradients on structure (band, totals, active state), never on
              every surface; figures always tabular and end-aligned; logical
              properties everywhere for RTL.
   ========================================================================== */
:root {
  /* palette */
  --ink: #17153b;
  --ink-2: #24215a;
  --iris: #6c5ce7;
  --iris-2: #8b7cf6;
  --lagoon: #12a594;
  --saffron: #e9a23b;
  --rose: #b4335a;
  --mist: #eef0f8;
  --paper: #ffffff;
  --paper-2: #f8f8fd;
  --lilac: #f3f1ff;
  --line: #e4e3f1;
  --line-2: #d3d1e6;
  --text: #1d1b3a;
  --text-2: #504d72;
  --muted: #8b88a8;
  --success: #0e8a6e;
  --success-50: #e6f6f1;
  --danger: #b4335a;
  --danger-50: #fbecf1;
  --warning: #a8670c;
  --warning-50: #fdf3e2;
  --info: #5246d1;
  --info-50: #eeecff;
  --purple: #7a4fc4;

  /* signature gradients */
  --aurora: linear-gradient(120deg, #6c5ce7 0%, #3f8fd8 38%, #12a594 66%, #e9a23b 100%);
  --aurora-soft: linear-gradient(120deg, rgba(108,92,231,.9), rgba(18,165,148,.85) 65%, rgba(233,162,59,.85));
  --keystone: linear-gradient(90deg, rgba(108,92,231,.10), rgba(18,165,148,.07) 70%, rgba(233,162,59,.06));

  /* depth */
  --r-xl: 26px; --r-lg: 20px; --r: 14px; --r-s: 10px; --r-xs: 7px;
  --sh-1: 0 1px 2px rgba(23,21,59,.05), 0 4px 14px -6px rgba(23,21,59,.10);
  --sh-2: 0 2px 4px rgba(23,21,59,.04), 0 18px 40px -18px rgba(23,21,59,.28);
  --sh-3: 0 30px 80px -20px rgba(18,14,60,.45);
  --glass: rgba(255,255,255,.72);
  --glass-dark: rgba(30,27,78,.55);

  /* type */
  --font: 'Manrope', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --band-h: 300px;
  --ease: cubic-bezier(.2,.8,.2,1);
}
html[dir=rtl] {
  --font: 'IBM Plex Sans Arabic', 'Manrope', system-ui, Arial, sans-serif;
  --font-display: 'Amiri', 'IBM Plex Sans Arabic', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--mist);
  background-image: radial-gradient(1200px 600px at 110% 40%, rgba(108,92,231,.07), transparent 60%), radial-gradient(900px 500px at -10% 90%, rgba(18,165,148,.06), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4, h5 { margin: 0; letter-spacing: -0.01em; }
h1 { font: 600 34px/1.1 var(--font-display); letter-spacing: -0.02em; font-variation-settings: 'opsz' 96, 'SOFT' 50; }
h2 { font: 600 24px/1.2 var(--font-display); }
h3 { font-size: 15px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.h3 { font: 600 19px/1.25 var(--font-display); } .h4 { font-size: 15px; font-weight: 700; } .h5 { font-size: 13px; font-weight: 700; }
html[dir=rtl] h1 { font-size: 36px; font-weight: 700; letter-spacing: 0; }
html[dir=rtl] .h3, html[dir=rtl] h2 { font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 8px; }
.display { font: 600 40px/1.08 var(--font-display); letter-spacing: -0.025em; margin-bottom: 6px; }
html[dir=rtl] .display { font-weight: 700; letter-spacing: 0; font-size: 42px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.danger { color: var(--danger); } .success { color: var(--success); }
.nowrap { white-space: nowrap; } .center { text-align: center; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap-xs { gap: 4px; } .gap-s { gap: 8px; } .gap-m { gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.pad { padding: 10px 18px; } .pad-s { padding: 6px 14px; }
.icon { flex: none; vertical-align: -3px; }
.is-loading { opacity: .5; pointer-events: none; transition: opacity .2s; }
kbd { font: 600 11px var(--font); padding: 2px 6px; border-radius: 6px; background: rgba(23,21,59,.06); color: var(--muted); border: 1px solid var(--line); }

/* ------------------------------------------------------------------ aurora band */
.band-bg { position: absolute; inset: 0 0 auto 0; height: var(--band-h); overflow: hidden; z-index: 0; background: var(--ink); -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent); }
.aurora { position: absolute; inset: -40% -10%; filter: blur(46px) saturate(120%); opacity: .95;
  background:
    radial-gradient(40% 55% at 18% 40%, rgba(108,92,231,.85), transparent 70%),
    radial-gradient(35% 50% at 52% 70%, rgba(18,165,148,.55), transparent 70%),
    radial-gradient(30% 45% at 86% 35%, rgba(233,162,59,.45), transparent 70%),
    radial-gradient(50% 60% at 70% 0%, rgba(63,143,216,.45), transparent 70%); }
.band-bg::after { content: ''; position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(23,21,59,0) 55%, rgba(23,21,59,.35)),
  repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 88px); }
html[dir=rtl] .aurora { transform: scaleX(-1); }

/* ------------------------------------------------------------------ app frame */
.app { position: relative; min-height: 100vh; }
.content { position: relative; max-width: 1480px; margin: 0 auto; padding: 26px 32px 80px; }
.page { display: flex; flex-direction: column; gap: 18px; }
.page.narrow { max-width: 560px; }
.page-enter { animation: pageIn .38s var(--ease) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.boot-mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }

/* page header lives on the aurora band */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: #fff; min-height: 96px; padding: 8px 2px 6px; }
.page-head h1 { color: #fff; text-shadow: 0 2px 30px rgba(10,8,40,.35); }
.page-sub { color: rgba(236,234,255,.78); margin-top: 8px; font-size: 13.5px; max-width: 760px; }
.page-sub span { color: rgba(236,234,255,.95); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .btn:not(.btn-primary) { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); color: #fff; backdrop-filter: blur(10px); }
.page-head .btn:not(.btn-primary):hover:not(:disabled) { background: rgba(255,255,255,.2); }
.page-head .btn-primary { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 8px 24px -10px rgba(0,0,0,.5); }
.page-head .btn-primary:hover:not(:disabled) { background: #f1efff; }
.page-head .input, .page-head .combo-btn { background: rgba(255,255,255,.95); }
.page-head .tabs { border: 0; }

/* ------------------------------------------------------------------ dock (navigation) */
.dock-wrap { position: sticky; top: 12px; z-index: 50; max-width: 1480px; margin: 12px auto 0; padding: 0 20px; }
.dock { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px; border-radius: 18px;
  background: rgba(28,25,72,.58); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 18px 50px -24px rgba(5,3,30,.8), inset 0 1px 0 rgba(255,255,255,.08); color: #fff; }
html[dir=rtl] .dock { padding: 7px 12px 7px 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none !important; }
.brand-mark { display: inline-flex; filter: drop-shadow(0 6px 14px rgba(108,92,231,.45)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font: 600 17px var(--font-display); letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; opacity: .65; }
.dock .brand-sub { display: none; }
.dock .brand { padding-inline-end: 10px; border-inline-end: 1px solid rgba(255,255,255,.12); margin-inline-end: 2px; }
.dock-sections { display: flex; gap: 2px; }
.dock-tab { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: rgba(255,255,255,.78); padding: 8px 12px; border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 13.5px; transition: background .18s, color .18s; position: relative; }
.dock-tab:hover, .dock-tab.open { background: rgba(255,255,255,.1); color: #fff; }
.dock-tab.current { color: #fff; }
.dock-tab.current::after { content: ''; position: absolute; inset-inline: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--aurora); }
.dock-tab .icon { opacity: .6; transition: transform .2s var(--ease); }
.dock-tab.open .icon { transform: rotate(180deg); }
.dock-search { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; min-width: 200px; flex: none; height: 36px; padding: 0 10px; border-radius: 11px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: rgba(255,255,255,.7); cursor: pointer; font-size: 13px; transition: background .18s; }
.dock-search:hover { background: rgba(255,255,255,.13); color: #fff; }
.dock-search span { flex: 1; text-align: start; }
.dock-search kbd { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }
.dock-end { display: flex; align-items: center; gap: 6px; }
.dock .dock-burger { display: none; color: #fff; }
.company-chip { display: flex; align-items: center; gap: 8px; max-width: 230px; min-width: 0; height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #fff; cursor: pointer; font-weight: 600; font-size: 13px; }
.company-chip:hover { background: rgba(255,255,255,.13); }
.company-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 0 3px rgba(255,255,255,.12); flex: none; }
.cc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: rgba(233,162,59,.18); color: #b87809; border: 1px solid rgba(233,162,59,.35); white-space: nowrap; }
.dock .sample-tag { color: #ffd38a; background: rgba(233,162,59,.16); }
.lang-pill { width: 36px; height: 36px; border-radius: 11px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #fff; cursor: pointer; font-weight: 700; font-size: 14px; font-family: 'IBM Plex Sans Arabic', 'Manrope', sans-serif; }
.lang-pill:hover { background: rgba(255,255,255,.15); }
.auth-panel .lang-pill { color: var(--text); border-color: var(--line-2); background: var(--paper); }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff; background: var(--aurora); box-shadow: 0 0 0 2px rgba(255,255,255,.25); }

/* mega panel */
.mega { position: absolute; inset-inline: 20px; top: calc(100% + 10px); max-width: 920px; margin-inline: auto; border-radius: 22px; padding: 18px; background: rgba(255,255,255,.9); backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%); border: 1px solid rgba(255,255,255,.7); box-shadow: var(--sh-3); }
.mega::before { content: ''; position: absolute; inset: 0 22px auto; height: 2px; border-radius: 2px; background: var(--aurora); opacity: .8; }
.mega-head { padding: 2px 6px 10px; }
.mega-title { font: 600 20px var(--font-display); color: var(--ink); }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px; }
.mega-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; color: var(--text); text-decoration: none !important; transition: background .16s; }
.mega-item:hover { background: var(--lilac); }
.mega-item.current { background: var(--lilac); box-shadow: inset 0 0 0 1px rgba(108,92,231,.18); }
.mega-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--iris); background: linear-gradient(140deg, #f1efff, #e7f7f4); box-shadow: inset 0 0 0 1px rgba(108,92,231,.12); }
.mega-icon.sm { width: 28px; height: 28px; border-radius: 8px; }
.mega-label { display: block; font-weight: 700; font-size: 14px; }
.mega-desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pop { animation: popIn .22s var(--ease) both; transform-origin: top center; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

.mobile-nav { position: absolute; inset-inline: 12px; top: calc(100% + 8px); max-height: calc(100vh - 100px); overflow: auto; border-radius: 20px; padding: 14px; background: rgba(255,255,255,.96); backdrop-filter: blur(24px); box-shadow: var(--sh-3); display: grid; gap: 12px; }
.mn-title { font: 600 15px var(--font-display); color: var(--ink); padding: 4px 8px; }
.mn-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none !important; }
.mn-item.current, .mn-item:hover { background: var(--lilac); color: var(--iris); }

/* command palette */
.palette-overlay { align-items: flex-start; padding-top: 12vh; }
.palette { width: min(640px, 100%); border-radius: 22px; background: rgba(255,255,255,.94); backdrop-filter: blur(26px); box-shadow: var(--sh-3); overflow: hidden; border: 1px solid rgba(255,255,255,.7); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; color: var(--text); }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette-kind { font-size: 12px; color: var(--muted); font-weight: 700; padding: 10px 10px 4px; }
.palette-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 9px 10px; border-radius: 12px; cursor: pointer; text-align: start; }
.palette-item.active { background: var(--lilac); }
.pi-label { font-weight: 600; white-space: nowrap; }
.pi-hint { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.palette-empty { padding: 24px; text-align: center; color: var(--muted); }

/* user menu */
.menu-wrap { position: relative; }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); background: rgba(255,255,255,.97); backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-3); min-width: 260px; padding: 8px; z-index: 60; color: var(--text); }
.menu-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.menu-item { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 11px; cursor: pointer; text-align: start; font-weight: 600; font-size: 13.5px; }
.menu-item:hover { background: var(--lilac); }
.menu-item kbd { margin-inline-start: auto; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-foot { font-size: 11.5px; color: var(--muted); padding: 6px 12px 4px; }

/* ------------------------------------------------------------------ buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; font-weight: 700; font-size: 13.5px; white-space: nowrap; color: var(--text); transition: background .16s, border-color .16s, box-shadow .2s, transform .12s; }
.btn:hover:not(:disabled) { background: var(--paper-2); border-color: #c4c1df; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { border: 0; color: #fff; background: linear-gradient(120deg, #6c5ce7, #4b6fe0 55%, #12a594); box-shadow: 0 10px 24px -12px rgba(108,92,231,.75), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(120deg, #5f4fe0, #3f62d6 55%, #0f9686); box-shadow: 0 14px 28px -12px rgba(108,92,231,.85); }
.btn-danger { border: 0; background: linear-gradient(120deg, #c03e66, #a32c50); color: #fff; box-shadow: 0 10px 22px -12px rgba(180,51,90,.7); }
.btn-danger:hover:not(:disabled) { background: linear-gradient(120deg, #b03358, #8f2445); }
.btn-danger-ghost { color: var(--danger); border-color: #ecc2d0; background: #fff; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-50); }
.btn-sm { height: 31px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; height: 44px; font-size: 14.5px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover:not(:disabled) { background: var(--lilac); color: var(--iris); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.link, .link-btn { background: none; border: 0; padding: 0; color: var(--info); cursor: pointer; text-align: start; font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.input { height: 38px; border: 1px solid var(--line-2); border-radius: 11px; padding: 0 12px; background: var(--paper); width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: #c2bfdd; }
.input:focus, .combo-btn:focus { outline: none; border-color: var(--iris); box-shadow: 0 0 0 4px rgba(108,92,231,.14); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { padding-inline-end: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b88a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
html[dir=rtl] .select { background-position: left 11px center; }
.input:disabled { background: var(--paper-2); color: var(--muted); }
input[type=date].input { min-width: 140px; font-variant-numeric: tabular-nums; }
.num-input { text-align: end; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--danger); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.check input { appearance: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; display: grid; place-items: center; cursor: pointer; transition: all .15s; margin: 0; flex: none; }
.check input:checked { border: 0; background: var(--aurora); }
.check input:checked::after { content: ''; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-inline-end: 0; transform: rotate(-45deg) translate(1px, -1px); }
html[dir=rtl] .check input:checked::after { transform: rotate(45deg) translate(-1px, -1px) scaleX(-1); }
.check input:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px 20px; align-items: start; }
.form-grid.one { grid-template-columns: 1fr; }
.span-2 { grid-column: span 2; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.form-foot.sticky { position: sticky; bottom: 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.req { color: var(--danger); margin-inline-start: 3px; }

/* combo / multiselect */
.combo { position: relative; min-width: 180px; }
.combo-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: start; cursor: pointer; }
.combo-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-btn .icon { color: var(--muted); }
.combo-pop { position: absolute; z-index: 70; top: calc(100% + 6px); inset-inline-start: 0; min-width: 100%; width: max-content; max-width: min(480px, 90vw); background: rgba(255,255,255,.97); backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-3); padding: 8px; animation: popIn .18s var(--ease) both; }
.combo-list { max-height: 310px; overflow-y: auto; margin-top: 6px; }
.combo-item { padding: 8px 11px; border-radius: 9px; cursor: pointer; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item:hover { background: var(--lilac); }
.combo-item.sel { background: var(--lilac); color: var(--iris); font-weight: 700; }
.check-item { display: flex; gap: 9px; align-items: center; }
.check-item input { accent-color: var(--iris); }

/* ------------------------------------------------------------------ surfaces */
.card { position: relative; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid rgba(214,211,238,.7); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.card-head h3 { font: 600 17px var(--font-display); letter-spacing: -0.01em; }
html[dir=rtl] .card-head h3 { font-weight: 700; font-size: 19px; }
.card-head + .card-body { padding-top: 2px; }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px 20px; }
.card-lite { border-radius: var(--r); padding: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.card-lite-title { font-weight: 700; margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: #efeef8; color: var(--text-2); white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-purple { background: #f2ecfd; color: var(--purple); }
.badge-neutral { background: #efeef8; color: var(--text-2); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); font-size: 13.5px; background: var(--paper); box-shadow: var(--sh-1); border: 1px solid var(--line); position: relative; overflow: hidden; }
.alert::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; }
.alert .icon { margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body ul { margin: 6px 0 0; padding-inline-start: 18px; }
.alert-title { font-weight: 800; margin-bottom: 2px; }
.alert-info::before { background: var(--iris); } .alert-info .icon { color: var(--iris); }
.alert-success::before { background: var(--lagoon); } .alert-success .icon { color: var(--success); }
.alert-warning::before { background: var(--saffron); } .alert-warning .icon { color: var(--warning); } .alert-warning { background: #fffcf6; }
.alert-danger::before { background: var(--rose); } .alert-danger .icon { color: var(--danger); } .alert-danger { background: #fffafb; }
.reconcile { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 12px 6px 10px; border-radius: 30px; align-self: flex-start; }
.reconcile.ok { color: var(--success); background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1px rgba(14,138,110,.2), var(--sh-1); }
.reconcile.big { font-size: 14px; padding: 9px 16px 9px 12px; }

/* loading & empty */
.loading { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid rgba(214,211,238,.7); }
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.sk-row { display: flex; gap: 22px; align-items: center; }
.sk { display: block; height: 12px; border-radius: 8px; background: linear-gradient(90deg, #eceaf6 0%, #f6f5fc 40%, #eceaf6 80%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk-label { flex: none; } .sk-num { width: 110px; margin-inline-start: auto; } .sk-num + .sk-num { margin-inline-start: 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.loading-label { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-weight: 600; font-size: 13px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid transparent; border-top-color: var(--iris); border-right-color: var(--lagoon); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; border-top-color: currentColor; border-right-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; }
.empty-orb { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--aurora); box-shadow: 0 14px 30px -12px rgba(108,92,231,.6); margin-bottom: 4px; }
.empty-title { font: 600 17px var(--font-display); color: var(--text); }
.empty-text { color: var(--muted); max-width: 440px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: rgba(239,238,248,.9); border-radius: 13px; align-self: flex-start; max-width: 100%; }
.tab { border: 0; background: none; padding: 7px 14px; cursor: pointer; color: var(--text-2); font-weight: 700; border-radius: 10px; white-space: nowrap; font-size: 13px; transition: background .16s, color .16s; }
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.tab-count { margin-inline-start: 6px; background: var(--lilac); color: var(--iris); border-radius: 10px; padding: 0 7px; font-size: 11.5px; }

/* ------------------------------------------------------------------ toolbar (filter capsule) */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; padding: 14px 16px; border-radius: var(--r-lg); background: rgba(255,255,255,.86); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); border: 1px solid rgba(255,255,255,.75); box-shadow: var(--sh-2); }
.toolbar.compact { box-shadow: none; padding: 6px 0; border: 0; background: none; backdrop-filter: none; }
.tb-item { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.tb-item .input { height: 34px; font-size: 13px; border-radius: 10px; }
.tb-item .combo { min-width: 150px; }
.tb-wide { min-width: 240px; }
.tb-label { font-size: 11.5px; font-weight: 700; color: var(--muted); padding-inline-start: 2px; }
.tb-checks { flex-direction: row; gap: 16px; align-items: center; min-height: 34px; flex-wrap: wrap; }
.tb-spacer { flex: 1; }
.tb-actions { display: flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ tables */
.table-wrap { display: flex; flex-direction: column; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 6px; position: relative; min-width: 230px; }
.search-box .icon { position: absolute; inset-inline-start: 11px; color: var(--muted); }
.search-box .input { padding-inline-start: 34px; height: 34px; }
.table-scroll { overflow: auto; max-width: 100%; border-radius: inherit; }
.table-scroll.tall { max-height: 62vh; }
.table-scroll.preview { max-height: 260px; border: 1px solid var(--line); border-radius: var(--r); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table th { position: sticky; top: 0; background: rgba(250,250,254,.96); backdrop-filter: blur(6px); z-index: 1; text-align: start; font-weight: 700; font-size: 12px; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num { text-align: end; }
.th-in { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.table td { padding: 10px 14px; border-bottom: 1px solid #efeef7; vertical-align: top; }
.table.dense td { padding: 7px 12px; } .table.dense th { padding: 9px 12px; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #faf9ff; }
.table tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: var(--paper-2); font-weight: 800; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; }
.table td.num, .num { text-align: end; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.table .desc { max-width: 380px; }
.table tr.muted td { color: var(--muted); }
.table tr.strike td { text-decoration: line-through; text-decoration-color: rgba(23,21,59,.25); }
.table tr.row-error td { background: #fff6f9; }
.table tr.row-warning td { background: #fffbf2; }
.table tr.row-sub td { color: var(--text-2); font-style: italic; background: var(--paper-2); }
.table tr.row-total td { font-weight: 800; }
.table.matrix td, .table.matrix th { text-align: center; } .table.matrix td:first-child, .table.matrix th:first-child { text-align: start; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 10px; border-top: 1px solid #efeef7; }
.amt { font-variant-numeric: tabular-nums lining-nums; direction: ltr; unicode-bidi: isolate; letter-spacing: -0.005em; }
.amt.neg { color: var(--rose); }
.link-amt { border: 0; background: none; padding: 1px 4px; margin: -1px -4px; cursor: pointer; color: inherit; font: inherit; border-radius: 6px; transition: background .15s, color .15s, box-shadow .15s; }
.link-amt:hover { background: var(--lilac); color: var(--iris); box-shadow: inset 0 -2px 0 rgba(108,92,231,.5); }
.fav { color: var(--success) !important; } .unfav { color: var(--rose) !important; }
.fav .amt, .unfav .amt { color: inherit; }
.expander { border: 0; background: none; cursor: pointer; padding: 0; width: 18px; height: 18px; display: inline-grid; place-items: center; color: var(--muted); vertical-align: -3px; border-radius: 5px; margin-inline-end: 4px; }
.expander:hover { background: var(--lilac); color: var(--iris); }
.expander-space { display: inline-block; width: 22px; }

/* ------------------------------------------------------------------ financial statement document */
.report-card { overflow: hidden; border-radius: var(--r-xl); box-shadow: var(--sh-2); }
.report-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--aurora); z-index: 2; }
.report-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding: 24px 28px 18px; flex-wrap: wrap; }
.report-title .h3 { font-size: 24px; }
.table.report { font-size: 14px; }
.table.report th { background: rgba(255,255,255,.96); color: var(--text-2); font-size: 12.5px; padding: 12px 18px; border-bottom: 1.5px solid var(--ink); }
.table.report td { padding: 9px 18px; border-bottom: 1px solid #f0eff7; }
.table.report .label-col { min-width: 300px; white-space: normal; }
.table.report td.num { font-size: 14px; }
.table.report tr.r-heading td { font: 600 16px var(--font-display); color: var(--ink); padding-top: 18px; border-bottom-color: transparent; }
html[dir=rtl] .table.report tr.r-heading td { font-weight: 700; font-size: 17px; }
.table.report tr.r-heading:hover td { background: transparent; }
.table.report tr.r-line td.label-col { color: var(--text); }
.table.report tr.r-total td { font-weight: 800; background: var(--paper-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.table.report tr.r-calc td { font-weight: 800; background: #f5f3ff; border-top: 1px solid rgba(108,92,231,.18); border-bottom: 1px solid rgba(108,92,231,.18); }
.table.report tr.r-calc td.label-col { position: relative; }
.table.report tr.r-calc td.label-col::before { content: ''; position: absolute; inset-inline-start: 0; inset-block: 6px; width: 3px; border-radius: 3px; background: var(--aurora); }
.table.report tr.r-calc td.num { font-size: 15px; }
.table.report tr.r-account td { color: var(--text-2); font-size: 13px; background: #fcfcff; }
.table.report tr.r-parent td { background: var(--paper-2); }
.table.report tr.r-detail td { font-size: 12.5px; background: #fdfcff; }
.table.report tr.hidden-row td { opacity: .5; }
.table.report tr.bold td { font-weight: 800; }
.table.report tbody tr.r-total:last-child td, .table.report tr.grand td { border-bottom: 3px double var(--ink); }
.table.tb th.grp { text-align: center; border-inline-start: 1px solid var(--line); color: var(--ink); }

/* comparison: inline variance bar + pill */
.vcell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.vbar { position: relative; width: 54px; height: 6px; border-radius: 6px; background: #efeef7; overflow: hidden; flex: none; }
.vbar i { position: absolute; inset-block: 0; inset-inline-start: 50%; border-radius: 6px; }
.vbar i.up { background: linear-gradient(90deg, #6fd1bf, var(--lagoon)); }
.vbar i.down { background: linear-gradient(90deg, #e98aa9, var(--rose)); inset-inline-start: auto; inset-inline-end: 50%; }
.vbar i.n-up { background: linear-gradient(90deg, #b9b0ff, var(--iris)); }
.vbar i.n-down { background: linear-gradient(90deg, #f4c27a, var(--saffron)); inset-inline-start: auto; inset-inline-end: 50%; }
.vbar::after { content: ''; position: absolute; inset-block: -2px; inset-inline-start: calc(50% - .5px); width: 1px; background: var(--line-2); }
.vpill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 800; background: #f1f0f8; color: var(--text-2); }
.vpill.fav { background: var(--success-50); } .vpill.unfav { background: var(--danger-50); }

.tb-warning { border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; color: #5b1530; background: linear-gradient(135deg, #fff6f9, #fff); box-shadow: inset 0 0 0 1.5px rgba(180,51,90,.45), var(--sh-2); }
.tb-warning-head { display: flex; gap: 14px; align-items: center; color: var(--danger); }
.tb-warning-head .h4 { font: 600 20px var(--font-display); }
.tb-diffs { display: flex; gap: 32px; flex-wrap: wrap; }
.tb-diffs > div { display: flex; flex-direction: column; gap: 2px; font-size: 19px; font-weight: 800; }
.tb-warning ul { margin: 4px 0 0; padding-inline-start: 20px; }

/* ------------------------------------------------------------------ overlays */
.overlay { position: fixed; inset: 0; background: rgba(17,14,48,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px; overflow-y: auto; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; background: var(--paper); border-radius: 24px; box-shadow: var(--sh-3); width: 100%; display: flex; flex-direction: column; max-height: 86vh; animation: modalIn .28s var(--ease) both; overflow: hidden; }
.modal::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--aurora); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-sm { max-width: 460px; } .modal-md { max-width: 660px; } .modal-lg { max-width: 880px; } .modal-xl { max-width: 1140px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 10px; }
.modal-head h3 { font: 600 21px var(--font-display); }
html[dir=rtl] .modal-head h3 { font-weight: 700; }
.modal-body { padding: 10px 22px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: var(--paper-2); border-top: 1px solid var(--line); }
.overlay-drawer { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { background: var(--mist); height: 100vh; display: flex; flex-direction: column; box-shadow: var(--sh-3); animation: slide .34s var(--ease) both; border-start-start-radius: 26px; border-end-start-radius: 26px; overflow: hidden; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
html[dir=rtl] .drawer { animation-name: slideRtl; }
@keyframes slideRtl { from { transform: translateX(-40px); opacity: 0; } }
.drawer-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 18px; background: var(--ink); color: #fff; overflow: hidden; }
.drawer-head::before { content: ''; position: absolute; inset: -60% -20% auto -20%; height: 220%; background: radial-gradient(40% 50% at 15% 30%, rgba(108,92,231,.7), transparent 70%), radial-gradient(35% 45% at 80% 40%, rgba(18,165,148,.45), transparent 70%); filter: blur(30px); }
.drawer-head > * { position: relative; }
.drawer-head h3 { font: 600 22px var(--font-display); }
.drawer-head .muted { color: rgba(236,234,255,.72); }
.drawer-head .icon-btn { color: #fff; } .drawer-head .icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.drawer-body { padding: 18px 24px 30px; overflow-y: auto; flex: 1; }
.drawer-body .table-scroll { background: var(--paper); border-radius: var(--r); box-shadow: var(--sh-1); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.crumbs .icon { color: var(--muted); }
.crumb { border: 0; background: var(--paper); border-radius: 30px; padding: 5px 12px; cursor: pointer; color: var(--text-2); font-weight: 700; box-shadow: var(--sh-1); transition: background .15s; }
.crumb:hover { background: var(--lilac); }
.crumb.cur { background: var(--ink); color: #fff; }
.drill-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--sh-1); }
.drill-head .h4 { font: 600 20px var(--font-display); }
.kpi-mini { display: flex; flex-direction: column; align-items: flex-end; font: 600 22px var(--font-display); }
.ledger-summary { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; background: var(--paper); border-radius: var(--r-lg); padding: 14px 18px; box-shadow: var(--sh-1); }
.ledger-summary > div { display: flex; flex-direction: column; gap: 2px; font-size: 16px; font-weight: 800; }
.ledger-summary > div.row { flex-direction: row; margin-inline-start: auto; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; margin: 0; }
.kv dt { font-size: 12px; color: var(--muted); font-weight: 600; } .kv dd { margin: 2px 0 0; font-weight: 700; }
.kv-inline { font-size: 13.5px; align-self: flex-start; background: var(--paper); padding: 8px 14px; border-radius: 30px; box-shadow: var(--sh-1); }
pre.json { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; overflow: auto; max-height: 60vh; font-size: 12px; direction: ltr; text-align: left; }

.toasts { position: fixed; bottom: 22px; inset-inline-end: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: min(440px, calc(100vw - 44px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: rgba(23,21,59,.92); backdrop-filter: blur(16px); color: #fff; padding: 12px 16px; border-radius: 16px; box-shadow: var(--sh-3); font-size: 13.5px; font-weight: 600; animation: toastIn .32s var(--ease) both; border: 1px solid rgba(255,255,255,.1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.toast-success .icon { color: #6fe0c8; } .toast-error .icon { color: #ff9cbc; } .toast-warning .icon { color: #ffd38a; }
.toast-error { box-shadow: inset 3px 0 0 var(--rose), var(--sh-3); }

/* ------------------------------------------------------------------ auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.1fr) minmax(380px, 1fr); background: var(--mist); }
.auth-art { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .aurora { inset: -20%; }
.auth-art > *:not(.aurora) { position: relative; }
.auth-equation { max-width: 460px; }
.eq-line { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font: 600 clamp(26px, 2.6vw, 38px)/1.15 var(--font-display); letter-spacing: -0.02em; }
html[dir=rtl] .eq-line { font-weight: 700; }
.eq-line b { font-weight: 400; color: rgba(255,255,255,.55); }
.eq-bar { display: flex; gap: 4px; height: 12px; margin: 24px 0 18px; }
.eq-bar i { border-radius: 8px; background: linear-gradient(90deg, #8b7cf6, #6c5ce7); }
.eq-bar i:nth-child(2) { background: linear-gradient(90deg, #3fb9a8, #12a594); }
.eq-bar i:nth-child(3) { background: linear-gradient(90deg, #f4c27a, #e9a23b); }
.auth-equation p { color: rgba(236,234,255,.8); font-size: 16px; max-width: 380px; }
.auth-foot { color: rgba(255,255,255,.5); font-size: 12px; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 48px clamp(28px, 6vw, 88px); max-width: 560px; width: 100%; justify-self: center; position: relative; }
.auth-panel.wide { max-width: 620px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-lang { position: absolute; top: 24px; inset-inline-end: 24px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.setup-steps li { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 30px; background: var(--paper); color: var(--muted); font-weight: 700; font-size: 13px; box-shadow: var(--sh-1); }
.setup-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #efeef8; font-size: 12px; }
.setup-steps li.active { color: var(--ink); } .setup-steps li.active span { background: var(--aurora); color: #fff; }
.setup-steps li.done { color: var(--success); } .setup-steps li.done span { background: var(--success-50); }

/* company picker */
.picker { position: relative; min-height: 100vh; padding: 0 24px 60px; }
.picker .band-bg { height: 360px; }
.picker-top { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 22px 0; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.picker-hero { position: relative; z-index: 2; max-width: 1180px; margin: 30px auto 34px; }
.on-dark { color: #fff; }
.on-dark-sub { color: rgba(236,234,255,.8); font-size: 16px; }
.picker-search { display: flex; align-items: center; gap: 8px; max-width: 360px; margin-top: 16px; padding: 0 14px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.picker-search input { flex: 1; border: 0; background: none; outline: none; color: #fff; }
.picker-search input::placeholder { color: rgba(255,255,255,.6); }
.company-grid { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.company-card { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: var(--r-lg); border: 1px solid rgba(214,211,238,.8); background: var(--paper); cursor: pointer; text-align: start; box-shadow: var(--sh-2); transition: transform .2s var(--ease), box-shadow .2s; }
.company-card:not(.add):hover { transform: translateY(-3px); box-shadow: 0 26px 50px -24px rgba(23,21,59,.45); }
.company-card.add { cursor: default; flex-direction: column; align-items: flex-start; background: rgba(255,255,255,.94); border-style: dashed; border-color: var(--line-2); box-shadow: none; }
.company-mono { width: 48px; height: 48px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff; font: 600 22px var(--font-display); background: var(--aurora); box-shadow: 0 12px 24px -12px rgba(108,92,231,.7); }
.company-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.company-name { font: 600 18px var(--font-display); }
html[dir=rtl] .company-name { font-weight: 700; }
.company-meta { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.company-flags { display: flex; gap: 6px; }
.company-go { color: var(--muted); transition: transform .2s var(--ease); }
.company-card:hover .company-go { transform: translateX(3px); color: var(--iris); }
html[dir=rtl] .company-card:hover .company-go { transform: translateX(-3px); }
.picker-top .lang-pill, .picker-top .avatar-btn { color: #fff; }

/* ------------------------------------------------------------------ dashboard */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.dash > * { min-width: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.hero-profit { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px 28px 20px; color: #fff; background: linear-gradient(145deg, #2a2470 0%, #1d1a52 55%, #15334f 100%); box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: 6px; min-height: 280px; }
.hero-profit::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; background: radial-gradient(closest-side, rgba(18,165,148,.45), transparent), radial-gradient(closest-side at 30% 70%, rgba(233,162,59,.25), transparent); filter: blur(10px); }
.hero-profit > * { position: relative; }
.hero-label { color: rgba(236,234,255,.75); font-weight: 700; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.hero-figure { font: 500 58px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; margin: 6px 0 2px; direction: ltr; unicode-bidi: isolate; text-align: start; }
html[dir=rtl] .hero-figure { text-align: end; align-self: flex-start; }
.hero-figure small { font: 600 16px var(--font); color: rgba(236,234,255,.6); margin-inline-start: 8px; letter-spacing: 0; }
.hero-sub { display: flex; gap: 18px; flex-wrap: wrap; color: rgba(236,234,255,.75); font-size: 13px; }
.hero-sub strong { color: #fff; }
.hero-spark { margin-top: auto; height: 96px; }
.delta { display: inline-flex; gap: 4px; align-items: center; font-weight: 800; font-size: 12.5px; padding: 3px 9px; border-radius: 20px; }
.delta.up { color: #0b7a61; background: #dcf5ee; } .delta.down { color: #9a2348; background: #fbe4ec; }
.hero-profit .delta.up { color: #7ff0d6; background: rgba(18,165,148,.22); } .hero-profit .delta.down { color: #ffb3c9; background: rgba(180,51,90,.28); }

.position-card { border-radius: var(--r-xl); padding: 22px 24px; background: var(--paper); box-shadow: var(--sh-2); border: 1px solid rgba(214,211,238,.7); display: flex; flex-direction: column; gap: 16px; min-height: 280px; }
.position-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.position-head h3 { font: 600 19px var(--font-display); }
.equation { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.eq-side { display: flex; flex-direction: column; gap: 8px; }
.eq-total { font: 600 26px var(--font-display); letter-spacing: -0.02em; direction: ltr; unicode-bidi: isolate; text-align: start; }
html[dir=rtl] .eq-total { text-align: end; }
.eq-sign { font: 400 30px var(--font-display); color: var(--muted); padding-bottom: 22px; }
.stackbar { display: flex; height: 16px; border-radius: 10px; overflow: hidden; gap: 3px; }
.stackbar i { display: block; height: 100%; border-radius: 6px; min-width: 4px; transition: flex .6s var(--ease); }
.seg-a { background: linear-gradient(90deg, #8b7cf6, #6c5ce7); }
.seg-l { background: linear-gradient(90deg, #f0b765, #e9a23b); }
.seg-e { background: linear-gradient(90deg, #3fc0ae, #12a594); }
.seg-c { background: linear-gradient(90deg, #a6c8f2, #3f8fd8); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.position-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.pf { display: flex; flex-direction: column; gap: 2px; cursor: pointer; border-radius: 10px; padding: 4px 6px; margin: -4px -6px; border: 0; background: none; text-align: start; }
.pf:hover { background: var(--lilac); }
.pf span { font-size: 12px; color: var(--muted); font-weight: 700; }
.pf b { font-size: 17px; font-weight: 800; }

.ribbon { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--sh-1); border: 1px solid rgba(214,211,238,.7); overflow: hidden; }
.rib { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 0; background: none; text-align: start; cursor: pointer; border-inline-start: 1px solid var(--line); transition: background .15s; min-width: 0; }
.rib:first-child { border-inline-start: 0; }
.rib:hover { background: #fbfaff; }
.rib-label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.rib-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.rib-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spark { display: block; }

.bullets { display: flex; flex-direction: column; gap: 18px; }
.bullet-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr auto; gap: 14px; align-items: center; }
.bullet-label { font-weight: 700; font-size: 13.5px; }
.bullet-track { position: relative; height: 22px; border-radius: 8px; background: repeating-linear-gradient(90deg, #f1f0f8 0 calc(25% - 1px), #e6e5f1 calc(25% - 1px) 25%); }
.bullet-actual { position: absolute; inset-block: 5px; inset-inline-start: 0; border-radius: 6px; background: linear-gradient(90deg, #8b7cf6, #6c5ce7 50%, #12a594); transition: width .6s var(--ease); }
.bullet-actual.over-cost { background: linear-gradient(90deg, #f0b765, #b4335a); }
.bullet-target { position: absolute; inset-block: 1px; width: 3px; border-radius: 2px; background: var(--ink); }
.bullet-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; grid-column: 2; }
.bullet-meta b { color: var(--text); font-weight: 800; }

/* ------------------------------------------------------------------ misc components */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-1); border: 1px solid rgba(214,211,238,.7); text-align: start; display: flex; flex-direction: column; gap: 4px; }
.kpi-btn { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; } .kpi-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.kpi-value.small { font-size: 14px; }
.kpi-delta { font-size: 12px; font-weight: 700; } .kpi-delta.up { color: var(--success); } .kpi-delta.down { color: var(--rose); }
.kpi-bad { box-shadow: inset 0 0 0 1.5px rgba(180,51,90,.4), var(--sh-1); background: #fffafb; }
.ratio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }

.wizard { display: flex; list-style: none; margin: 0; padding: 6px; gap: 4px; flex-wrap: wrap; background: rgba(255,255,255,.14); border-radius: 18px; backdrop-filter: blur(12px); align-self: flex-start; }
.wizard li { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 13px; color: rgba(236,234,255,.7); font-size: 13px; font-weight: 700; }
html[dir=rtl] .wizard li { padding: 7px 7px 7px 14px; }
.wizard li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); font-size: 12px; }
.wizard li.active { background: #fff; color: var(--ink); } .wizard li.active span { background: var(--aurora); color: #fff; }
.wizard li.done { color: #9ff0dc; } .wizard li.done span { background: rgba(18,165,148,.35); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 54px 20px; border-radius: var(--r-xl); cursor: pointer; text-align: center; color: var(--text-2); margin-bottom: 16px; background: linear-gradient(var(--paper-2), var(--paper-2)) padding-box, var(--aurora) border-box; border: 2px dashed transparent; transition: background .2s; }
.dropzone > .icon { width: 56px; height: 56px; padding: 14px; border-radius: 50%; color: #fff; background: var(--aurora); box-shadow: 0 14px 30px -12px rgba(108,92,231,.7); }
.dropzone:hover { background: linear-gradient(#f6f4ff, #f6f4ff) padding-box, var(--aurora) border-box; }
.dropzone .h4 { font: 600 19px var(--font-display); color: var(--ink); }
.map-grid { display: flex; flex-direction: column; gap: 4px; }
.map-row { display: grid; grid-template-columns: 240px 280px 1fr; gap: 14px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.map-row:hover { background: var(--paper-2); }
.map-label { font-weight: 700; font-size: 13px; } .map-sample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-wrap { display: flex; flex-direction: column; gap: 8px; }
.progress { height: 10px; background: #efeef8; border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--aurora); background-size: 200% 100%; animation: flow 2s linear infinite; transition: width .35s var(--ease); border-radius: 10px; }
@keyframes flow { to { background-position: -200% 0; } }
.done-box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 34px; text-align: center; }
.done-box > .icon { width: 64px; height: 64px; padding: 16px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #3fc0ae, #12a594); box-shadow: 0 18px 34px -14px rgba(18,165,148,.8); }
.done-box .h3 { font-size: 26px; color: var(--ink); }

.tree-card .card-body { padding: 8px; }
.tree { max-height: 68vh; overflow: auto; }
.tree-node { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; font-size: 13.5px; transition: background .12s; }
.tree-node:hover { background: var(--paper-2); }
.tree-node.sel { background: var(--lilac); border-color: rgba(108,92,231,.2); }
.tree-node.drop { border: 1.5px dashed var(--iris); background: var(--lilac); }
.tree-code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); min-width: 56px; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tree-count { font-size: 11.5px; color: var(--muted); min-width: 18px; text-align: end; font-weight: 700; }
.tree-actions { display: none; } .tree-node:hover .tree-actions, .tree-node.sel .tree-actions { display: inline-flex; }
.tree-actions .icon-btn { width: 26px; height: 26px; }
.grip { color: #c3c0dc; cursor: grab; display: inline-flex; }
.issues-bar { font-size: 13px; background: rgba(255,255,255,.9); padding: 8px 14px; border-radius: 30px; align-self: flex-start; box-shadow: var(--sh-1); }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; background: var(--paper-2); border-block: 1px solid var(--line); flex-wrap: wrap; }
.bulk-bar .combo { min-width: 240px; }

.designer { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.designer-side { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; }
.designer-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-block: 1px solid var(--line); background: var(--paper-2); margin: -2px -20px 12px; }
.designer-rows { display: flex; flex-direction: column; gap: 2px; }
.d-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; font-size: 13.5px; transition: background .12s; }
.d-row:hover { background: var(--paper-2); }
.d-row.sel { background: var(--lilac); border-color: rgba(108,92,231,.25); }
.d-row.drop { box-shadow: inset 0 2px 0 var(--iris); }
.d-row.is-hidden { opacity: .5; }
.d-calc { background: #f6f4ff; }
.d-type { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; min-width: 64px; text-align: center; }
.t-line { background: #efeef8; color: var(--text-2); } .t-group { background: #ece9ff; color: var(--iris); } .t-calc { background: #ddf4ef; color: #0b7a61; } .t-heading { background: #fdf0db; color: #8a5508; }
.d-label { flex: 1; min-width: 0; } .d-code { font-family: var(--mono); font-size: 11px; background: #efeef8; padding: 1px 7px; border-radius: 5px; }
.d-formula { color: #0b7a61; font-size: 12px; } .d-val { font-variant-numeric: tabular-nums; min-width: 110px; text-align: end; direction: ltr; font-weight: 700; }
.title-input { height: 34px; font-weight: 700; max-width: 280px; }
.src-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px; border-radius: 12px; background: var(--paper-2); }
.src-row .input, .src-row .combo { flex: 1; min-width: 140px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 18px; }
.logo-preview { max-height: 48px; max-width: 140px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: #fff; }
.je-form td { vertical-align: middle; } .je-form .combo { min-width: 240px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1560px) { .dock-search span, .dock-search kbd { display: none; } .dock-search { min-width: 0; width: 36px; justify-content: center; padding: 0; } .dock-tab { padding: 8px 10px; } }
@media (max-width: 1280px) {
  .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
}
@media (max-width: 1200px) { .designer { grid-template-columns: 1fr; } .designer-side { position: static; max-height: none; } .split { grid-template-columns: 1fr; } }
@media (max-width: 1040px) {
  .dock-sections { display: none; } .dock .dock-burger { display: inline-grid; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .map-row { grid-template-columns: 1fr 1fr; } .map-sample { grid-column: span 2; }
  .auth { grid-template-columns: 1fr; } .auth-art { min-height: 260px; padding: 26px; } .eq-line { font-size: 30px; }
}
@media (max-width: 720px) {
  :root { --band-h: 250px; }
  .dock-wrap { padding: 0 10px; top: 8px; margin-top: 8px; }
  .dock .brand-text, .company-chip .cc-name { display: none; } .company-chip { padding: 0 10px; }
  .content { padding: 16px 12px 60px; }
  h1, .display { font-size: 28px; }
  .tb-item, .tb-wide { min-width: calc(50% - 8px); flex: 1; }
  .table.report .label-col { min-width: 200px; } .report-title { padding: 20px 18px 14px; }
  .span-2 { grid-column: auto; }
  .hero-figure { font-size: 44px; }
  .equation { grid-template-columns: 1fr; } .eq-sign { display: none; }
  .bullet-row { grid-template-columns: 1fr; } .bullet-meta { grid-column: 1; }
  .drawer { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  .dock-wrap, .toolbar, .page-actions, .toasts, .band-bg { display: none !important; }
  .content { padding: 0; } .card { box-shadow: none; } .page-head, .page-head h1 { color: var(--text); }
}
