/* =====================================================================
   SALESIA — design system  (by LINKIT Dev Team)
   ===================================================================== */
:root {
    --brand: #1D82F5; --brand-2: #6D5BFF; --brand-ink: #0B5FD0;
    --grad: linear-gradient(135deg, #1D82F5 0%, #6D5BFF 100%);
    --bg: #F4F6FB; --surface: #FFFFFF; --surface-2: #F8FAFD; --ink: #0F172A; --ink-2: #334155; --muted: #64748B; --line: #E6EAF2; --line-2: #EEF2F7;
    --ok: #12B76A; --warn: #F79009; --err: #F04438;
    --side: #0B1324; --side-2: #121C31; --side-ink: #C7D2E5; --side-mute: #6B7A96;
    --r: 16px; --r-sm: 10px;
    --sh: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --sh-lg: 0 18px 40px -18px rgba(16, 24, 40, .25);
    --font: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --side-w: 256px;
}
html[dir="rtl"] { --font: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.num, .money { font-variant-numeric: tabular-nums; }
small { font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------------- shell ---------------- */
.shell { display: flex; min-height: 100vh; }
.side { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--side-w); background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 40;
    background-image: radial-gradient(600px 300px at -10% -10%, rgba(109, 91, 255, .25), transparent 60%), radial-gradient(500px 300px at 110% 110%, rgba(29, 130, 245, .18), transparent 60%); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 22px 22px 18px; }
.side-brand .mark { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; box-shadow: 0 8px 20px -6px rgba(109, 91, 255, .7); }
.side-brand .mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 11px; background: #fff; }
.side-brand b { font-size: 17px; color: #fff; letter-spacing: .06em; }
.side-brand small { display: block; color: var(--side-mute); font-size: 11.5px; font-weight: 500; letter-spacing: 0; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side nav { flex: 1; overflow-y: auto; padding: 6px 14px 20px; }
.side .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--side-mute); padding: 16px 10px 6px; font-weight: 700; }
.side nav a { display: flex; align-items: center; gap: 12px; color: var(--side-ink); padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; position: relative; }
.side nav a i { font-size: 17px; opacity: .9; width: 20px; text-align: center; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.on { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(29, 130, 245, .8); }
.side nav a .cnt { margin-inline-start: auto; background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 20px; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 11.5px; color: var(--side-mute); text-align: center; }
.side-foot b { color: #fff; }

.main { flex: 1; margin-inline-start: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(244, 246, 251, .82); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(230, 234, 242, .7); }
.top .burger { display: none; }
.search-pill { flex: 1; max-width: 460px; position: relative; }
.search-pill i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-pill input { width: 100%; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding-inline: 40px 14px; font: inherit; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
.search-pill input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(29, 130, 245, .12); }
.top .sp { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; color: var(--ink-2); cursor: pointer; font: inherit; font-weight: 700; font-size: 13px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--err); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); position: relative; cursor: pointer; }
.me b { font-size: 13px; display: block; line-height: 1.2; }
.me small { color: var(--muted); font-size: 11.5px; }
.menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); min-width: 200px; padding: 6px; display: none; z-index: 50; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--brand); }
.page { padding: 24px 28px 60px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .sp { flex: 1; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }

/* ---------------- cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .sp { flex: 1; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, white); margin-bottom: 14px; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .val { font-size: 24px; font-weight: 800; margin-top: 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi .foot b { color: var(--c, var(--brand)); }
.kpi::after { content: ''; position: absolute; inset-inline-end: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--brand)) 14%, transparent), transparent 70%); }

/* ---------------- buttons / forms ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: transform .08s, box-shadow .15s, border-color .15s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 10px 22px -12px rgba(29, 130, 245, .9); }
.btn.primary:hover { color: #fff; box-shadow: 0 12px 26px -10px rgba(29, 130, 245, .95); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); background: #FEF3F2; color: var(--err); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.block { width: 100%; height: 46px; }
.btn i { font-size: 15px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }

.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.form label .req { color: var(--err); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input:not([type]), select, textarea {
    width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); outline: none; transition: border .15s, box-shadow .15s; }
textarea { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748B' d='M8 11 3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-inline-end: 32px; }
html[dir="rtl"] select { background-position: left 12px center; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(29, 130, 245, .12); }
input[type=file] { font: inherit; font-size: 13px; }
.form .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form .span2 { grid-column: span 2; }
.form .span3 { grid-column: 1 / -1; }
.form h3 { font-size: 14px; margin: 22px 0 12px; color: var(--ink); }
.hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; font-weight: 400; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }

.alert { padding: 12px 16px; border-radius: 12px; font-weight: 500; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert.ok { background: #ECFDF3; color: #067647; border: 1px solid #ABEFC6; }
.alert.err { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.alert.info { background: #EFF6FF; color: #1849A9; border: 1px solid #C7DEFE; }

/* ---------------- badges / chips ---------------- */
.badge { --c: #667085; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
    color: color-mix(in srgb, var(--c) 82%, black); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 22%, white); }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 9px; }
.chip b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.chip small { display: block; color: var(--muted); font-size: 11.5px; }
.av { border-radius: 50%; object-fit: cover; flex: none; }
.av-i { display: inline-grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 12px; }

/* ---------------- tables ---------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar .search-pill { max-width: 320px; }
.toolbar .search-pill input { height: 38px; }
.toolbar select { width: auto; height: 38px; min-width: 150px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tabs a.on { background: var(--surface); color: var(--brand); box-shadow: var(--sh); }
.tabs a span { font-size: 11.5px; opacity: .75; margin-inline-start: 4px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #FAFBFF; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: end; }
.tbl .t-title { font-weight: 700; color: var(--ink); }
.tbl .t-sub { color: var(--muted); font-size: 12px; }
.tbl a.t-title:hover { color: var(--brand); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty i { font-size: 36px; color: #C5CEDD; display: block; margin-bottom: 8px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.pager .sp { flex: 1; }
.amt-due { color: var(--err); font-weight: 600; }
.amt-ok { color: var(--ok); font-weight: 600; }

/* ---------------- detail pages ---------------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.hero { display: flex; align-items: center; gap: 16px; padding: 22px; }
.hero .big-av { width: 58px; height: 58px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; flex: none; }
.hero h2 { font-size: 20px; font-weight: 800; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px; padding-inline-start: 22px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(29, 130, 245, .12); }
.timeline li::after { content: ''; position: absolute; inset-inline-start: 7.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); }
.stagebar { display: flex; gap: 4px; flex-wrap: wrap; }
.stagebar button { flex: 1; min-width: 90px; border: 0; padding: 9px 8px; font: inherit; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 10px; cursor: pointer; border: 1px solid var(--line); }
.stagebar button.on { background: var(--c); color: #fff; border-color: var(--c); }
.stagebar button.done { background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 80%, black); border-color: transparent; }

/* ---------------- items editor ---------------- */
.items { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.items th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: start; padding: 0 6px; }
.items td { padding: 0 6px; vertical-align: top; }
.items .it-row td:first-child { width: 48%; }
.items textarea { min-height: 42px; height: 42px; margin-top: 6px; font-size: 13px; }
.items .amt { font-weight: 700; padding-top: 10px; display: block; text-align: end; font-variant-numeric: tabular-nums; }
.totals { margin-inline-start: auto; max-width: 340px; width: 100%; }
.totals div { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 800; }

/* ---------------- board (deals) ---------------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.col { flex: 0 0 280px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 13px; }
.col-h i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.col-h span { margin-inline-start: auto; color: var(--muted); font-weight: 600; font-size: 12px; }
.col-b { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.dcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: var(--ink); box-shadow: var(--sh); border-top: 3px solid var(--c); }
.dcard:hover { box-shadow: var(--sh-lg); color: var(--ink); }
.dcard b { display: block; font-size: 13.5px; }
.dcard small { display: block; color: var(--muted); }
.dcard .v { font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }

/* ---------------- charts ---------------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .b span { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: var(--grad); min-height: 4px; box-shadow: 0 10px 18px -12px rgba(29, 130, 245, .8); }
.bars .b small { color: var(--muted); font-size: 11.5px; }
.bars .b em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.funnel div { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.funnel .lbl { width: 110px; color: var(--ink-2); font-weight: 600; }
.funnel .track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.funnel .fill { height: 100%; border-radius: 10px; background: var(--c); }
.funnel .n { width: 34px; text-align: end; font-weight: 700; }

/* ---------------- login ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.1fr; background: var(--surface); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 96px); }
.auth-form .logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.auth-form .logo-row img { height: 44px; max-width: 160px; object-fit: contain; }
.auth-form h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.auth-form p.lead { color: var(--muted); margin: 8px 0 28px; }
.auth-form .form { display: flex; flex-direction: column; gap: 14px; max-width: 400px; }
.auth-form .foot { margin-top: 36px; font-size: 12px; color: var(--muted); }
.auth-art { position: relative; overflow: hidden; background: #0B1324; color: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-art::before { content: ''; position: absolute; inset: -20%; background: radial-gradient(40% 40% at 25% 30%, rgba(109, 91, 255, .55), transparent 70%), radial-gradient(40% 40% at 75% 70%, rgba(29, 130, 245, .55), transparent 70%); filter: blur(10px); animation: drift 14s ease-in-out infinite alternate; }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 50%, black, transparent 75%); }
@keyframes drift { to { transform: translate(4%, -3%) scale(1.05); } }
.art-inner { position: relative; z-index: 1; max-width: 460px; width: 100%; }
.glass { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 18px 20px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); }
.art-inner h2 { font-size: 30px; line-height: 1.2; font-weight: 800; margin-bottom: 10px; letter-spacing: -.02em; }
.art-inner p { color: #B8C4DA; margin: 0 0 26px; }
.art-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.art-stats .glass b { display: block; font-size: 22px; }
.art-stats .glass small { color: #B8C4DA; }
.art-bars { display: flex; gap: 8px; align-items: flex-end; height: 70px; margin-top: 12px; }
.art-bars span { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #8FB8FF, #6D5BFF); opacity: .9; }
.brand-xl { font-size: 30px; font-weight: 800; letter-spacing: .08em; }
.brand-xl span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; background: radial-gradient(60% 50% at 20% 0%, rgba(109, 91, 255, .12), transparent), radial-gradient(60% 50% at 100% 100%, rgba(29, 130, 245, .12), transparent), var(--bg); }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-lg); padding: 34px; width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 760px; }
.auth-card .form { display: flex; flex-direction: column; gap: 14px; }
.lang-switch { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 5; }

/* ---------------- bottom nav (phones) ---------------- */
.bnav { display: none; }
.scrim { display: none; }

/* ---------------- print ---------------- */
@media print { .no-print { display: none !important; } }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}
@media (max-width: 860px) {
    .side { transform: translateX(-100%); transition: transform .25s ease; width: 280px; }
    html[dir="rtl"] .side { transform: translateX(100%); }
    body.nav-open .side { transform: none; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 19, 36, .45); z-index: 35; }
    .main { margin-inline-start: 0; }
    .top { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 8px; }
    .top .burger { display: inline-grid; }
    .me > span:not(.av) { display: none; }
    .me { padding: 3px; }
    .kpi .val { font-size: 19px; }
    .kpi { padding: 14px 16px; }
    .search-pill input { font-size: 13px; }
    .page { padding: 16px 14px 96px; }
    .page-head h1 { font-size: 19px; }
    .g2, .g3, .form .grid2, .form .grid3 { grid-template-columns: 1fr; }
    .form .span2 { grid-column: auto; }
    .kv { grid-template-columns: 110px 1fr; }
    /* tables → cards */
    table.tbl.cards thead { display: none; }
    table.tbl.cards, table.tbl.cards tbody, table.tbl.cards tr, table.tbl.cards td { display: block; width: 100%; }
    table.tbl.cards tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); position: relative; }
    table.tbl.cards td { padding: 4px 0; border: 0; display: block; text-align: end; overflow: hidden; }
    table.tbl.cards td::before { content: attr(data-l); color: var(--muted); font-size: 12px; float: left; margin-inline-end: 12px; padding-top: 1px; }
    html[dir="rtl"] table.tbl.cards td::before { float: right; }
    table.tbl.cards td .chip { justify-content: flex-end; }
    table.tbl.cards td.lead-cell { display: block; text-align: start; padding-bottom: 8px; padding-inline-end: 50px; }
    table.tbl.cards td.lead-cell::before { display: none; }
    table.tbl.cards td.act { position: absolute; top: 12px; inset-inline-end: 12px; width: auto; padding: 0; }
    table.tbl.cards td.act::before { display: none; }
    table.tbl.cards td:empty { display: none; }
    .bnav { display: flex; position: fixed; bottom: 12px; inset-inline: 12px; z-index: 45; background: rgba(11, 19, 36, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 20px; padding: 6px; box-shadow: 0 20px 40px -16px rgba(11, 19, 36, .7); padding-bottom: calc(6px + env(safe-area-inset-bottom) * .5); }
    .bnav a, .bnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #93A2BF; font: inherit; font-size: 10.5px; font-weight: 600; padding: 7px 0; border-radius: 14px; background: none; border: 0; }
    .bnav i { font-size: 19px; }
    .bnav .on { color: #fff; background: var(--grad); }
    .form-foot { position: sticky; bottom: 84px; z-index: 5; }
    .items .it-row td:first-child { width: auto; }
    .items, .items tbody, .items tr, .items td { display: block; }
    .items thead { display: none; }
    .items .it-row { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; }
    .items .it-row td:first-child { grid-column: 1 / -1; }
}
