:root {
    --bg: #eef1f6;
    --card: #ffffff;
    --ink: #1d2433;
    --muted: #6b7385;
    --line: #d9dee8;
    --primary: #1f3a68;
    --primary-ink: #ffffff;
    --accent: #c9a24a;
    --danger: #a32121;
    --ok: #1d6b3a;
    --green: #0f6b2e;
    --blue: #11308a;
    --red: #8f1111;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
}
a { color: var(--primary); }
h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h1:focus { outline: none; }

/* ---------- shell ---------- */
.shell {
    display: grid;
    grid-template-columns: 210px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "top top" "side content";
    min-height: 100vh;
}
.topbar {
    grid-area: top;
    display: flex; align-items: center; gap: 1rem;
    background: var(--primary); color: var(--primary-ink);
    padding: .4rem 1rem;
    position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; }
.brand img { height: 36px; width: 36px; object-fit: cover; border-radius: 50%; background: #fff; }
.menu { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: .5rem; }
.menu-btn {
    background: transparent; color: #fff; border: 1px solid transparent;
    padding: .35rem .7rem; border-radius: 6px; cursor: pointer; text-decoration: none; font: inherit;
}
.menu-btn:hover { border-color: rgba(255,255,255,.5); }

.dropdown { position: relative; }
.dropdown-body, .sub-body {
    display: none; position: absolute; top: 100%; right: 0;
    background: #fff; color: var(--ink); min-width: 290px;
    border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: .3rem 0; z-index: 30;
}
.dropdown:hover > .dropdown-body, .dropdown:focus-within > .dropdown-body { display: flex; }
/* The reports menu is long: two columns, and it scrolls if the window is still too short */
.dropdown-body {
    width: min(640px, calc(100vw - 2rem));
    max-height: calc(100vh - 70px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
}
.dropdown-body .col { flex: 1 1 0; min-width: 0; }
.dropdown-body .col + .col { border-inline-start: 1px solid #eef0f5; }
.dropdown-body a { display: block; padding: .42rem .9rem; color: var(--ink); text-decoration: none; cursor: pointer; break-inside: avoid; }
.dropdown-body a:hover { background: #eef2fa; }
.dropdown-body .grp { break-inside: avoid; padding: .3rem .9rem; border-top: 1px solid #eef0f5; border-bottom: 1px solid #eef0f5; }
.dropdown-body .grp > span { display: block; font-size: .85rem; color: var(--muted); font-weight: 700; padding: .1rem 0; }
.dropdown-body .grp > div { display: flex; gap: .3rem; }
.dropdown-body .grp > div a { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: .3rem .4rem; }
@media (max-width: 700px) {
    .dropdown:hover > .dropdown-body, .dropdown:focus-within > .dropdown-body { display: block; }
    .dropdown-body .col + .col { border: 0; }
}

.side {
    grid-area: side; background: #fff; border-inline-start: 1px solid var(--line);
    padding: .75rem .5rem; display: flex; flex-direction: column; gap: .35rem;
}
.side-btn {
    display: flex; align-items: center; gap: .55rem; padding: .6rem .7rem; border-radius: 8px;
    text-decoration: none; color: var(--ink); font-weight: 600; border: 1px solid var(--line); background: #fafbfd;
}
.side-btn:hover { background: #eef2fa; }
.side-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.side-btn.disabled { opacity: .45; cursor: not-allowed; }
.side-btn .ico { width: 1.4rem; text-align: center; }
.content { grid-area: content; padding: 1rem; min-width: 0; }

/* ---------- common ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

.btn {
    font: inherit; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #f0f3f9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover:not(:disabled) { background: #284b85; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.gold { background: var(--accent); color: #1d2433; border-color: var(--accent); }
.btn.small { padding: .2rem .5rem; font-size: .85rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }

.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem 1rem; }
.form label, label.f { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .9rem; }
.form .wide { grid-column: 1 / -1; }
input, select, textarea {
    font: inherit; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
    min-width: 0;
}
input:disabled, input[readonly] { background: #f3f5f9; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db4e0; border-color: #9db4e0; }
label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; }
.money { direction: ltr; text-align: right; }

.grid-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--line); border-radius: 8px; }
table.grid { border-collapse: collapse; width: 100%; background: #fff; font-size: .9rem; }
table.grid th, table.grid td { padding: .4rem .55rem; border-bottom: 1px solid #eceff5; text-align: right; white-space: nowrap; }
table.grid th { background: #f3f5fa; position: sticky; top: 0; z-index: 1; }
table.grid tr.sel td { background: #dfe8fb; }
table.grid tbody tr:hover td { background: #f5f8ff; cursor: pointer; }
table.grid tfoot td { font-weight: 700; background: #f3f5fa; }

/* ---------- contract: printed sheet (ContractView) and design screen ---------- */
.ct-sheet { background: #fff; color: #111; max-width: 794px; margin: 0 auto; padding: 28px 34px; line-height: 1.75;
            font-family: "Traditional Arabic", "Segoe UI", Tahoma, Arial, sans-serif; }
.ct-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px double #333; padding-bottom: 8px; margin-bottom: 12px; }
.ct-head img { height: 78px; width: 78px; object-fit: contain; }
.ct-head .ct-hall { font-size: 1.25em; font-weight: 700; }
.ct-head h1 { margin: 0; font-size: 1.15em; }
.ct-sheet h2 { font-size: 1.05em; margin: 12px 0 4px; text-decoration: underline; }
.ct-p { margin: 6px 0; text-align: justify; }
.ct-services { margin: 4px 0; padding-inline-start: 22px; }
.ct-clauses { margin: 4px 0; padding-inline-start: 26px; }
.ct-clauses li, .ct-services li { margin: 3px 0; text-align: justify; }
.ct-clauses.plain { list-style: none; padding-inline-start: 0; }
.ct-signs { display: flex; justify-content: space-between; gap: 18px; margin-top: 40px; }
.ct-signs div { flex: 1; text-align: center; font-weight: 700; }
.ct-signs i { display: block; border-bottom: 1px dotted #333; height: 46px; }
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; }
    .ct-sheet { max-width: none; padding: 0; }
    @page { size: A4; margin: 14mm; }
}
.ctd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .ctd { grid-template-columns: 1fr; } }
.ctd-preview { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.ctd-paper { background: #e9ecf1; padding: 12px; border-radius: 8px; }
.ctd-paper .ct-sheet { box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.ctd-item { display: flex; gap: .4rem; align-items: flex-start; margin: .3rem 0; }
.ctd-item input, .ctd-item textarea { flex: 1; }
.ctd-n { min-width: 1.6rem; text-align: center; font-weight: 700; padding-top: .45rem; color: var(--muted); }
.ctd-btns { display: flex; gap: .2rem; }
.ctd-tags { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; margin-bottom: .6rem; background: #fafbfe; }
.ctd-tags summary { cursor: pointer; font-weight: 700; }
.ctd-tags div { margin-top: .4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }

/* ---------- platform: subscription banner and admin screen ---------- */
.sub-banner { border-radius: 10px; padding: .6rem .9rem; margin-bottom: .8rem; font-weight: 600; border: 1px solid; }
.sub-banner.trial { background: #eef4ff; border-color: #c8d8f5; color: #1f3a68; }
.sub-banner.soon { background: #fff8e1; border-color: #f0d488; color: #7a5a00; }
.sub-banner.expired { background: #fdeeee; border-color: #f0c4c4; color: var(--danger); }
.pf-top { display: flex; align-items: center; gap: 1rem; background: var(--primary); color: #fff; padding: .6rem 1rem; }
.pf-top a { color: #fff; }
.pf-wrap { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.st { display: inline-block; font-size: .8rem; padding: .1rem .55rem; border-radius: 99px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.st.trial { background: #eef4ff; color: #1f3a68; border-color: #c8d8f5; }
.st.active { background: #eaf6ee; color: var(--ok); border-color: #bfe3cb; }
.st.soon { background: #fff8e1; color: #7a5a00; border-color: #f0d488; }
.st.expired { background: #fdeeee; color: var(--danger); border-color: #f0c4c4; }
.st.suspended { background: #333; color: #fff; border-color: #333; }

/* ---------- booking permissions (users screen) ---------- */
.bk-perms { margin-top: 1rem; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; background: #fafbfe; }
.bk-perms.off { opacity: .6; }
.bk-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bk-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; margin-top: .5rem; }
.bk-groups fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .3rem .6rem .5rem; margin: 0; background: #fff; }
.bk-groups legend { font-weight: 700; color: var(--primary); padding: 0 .3rem; }
.bk-groups label.check { display: flex; align-items: flex-start; gap: .4rem; padding: .2rem 0; font-weight: 600; }
.bk-groups label.check small { font-weight: 400; }

/* ---------- searchable dropdown (Shared/Combo.razor + app.js) ---------- */
.combo { position: relative; display: block; min-width: 0; }
.combo .combo-input { width: 100%; padding-inline-end: 2rem; }
.combo-btn {
    position: absolute; inset-inline-end: 1px; top: 1px; bottom: 1px; width: 1.9rem;
    border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .9rem; border-radius: 0 7px 7px 0;
}
[dir="rtl"] .combo-btn { border-radius: 7px 0 0 7px; }
.combo-btn:hover:not(:disabled) { background: #eef2fa; color: var(--ink); }
.combo-list {
    display: none; position: fixed; z-index: 200; margin: 0; padding: .25rem 0; list-style: none; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18);
    font-weight: 400; font-size: .95rem; text-align: right;
}
.combo.open .combo-list { display: block; }
.combo-list li { padding: .42rem .75rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-list li:hover, .combo-list li.active { background: #e3ebfa; }
.combo-list li.sel { font-weight: 700; color: var(--primary); }
.combo-list li.sel::before { content: "✓ "; }
.combo-list .combo-none, .combo-list .combo-wait { color: var(--muted); cursor: default; font-size: .85rem; }
.combo-list .combo-none:hover, .combo-list .combo-wait:hover { background: none; }

/* ---------- loading and reconnect (App.razor) ---------- */
#app-loading { display: flex; gap: .6rem; align-items: center; justify-content: center; min-height: 60vh; color: var(--muted); font-size: 1.1rem; }
#app-root:not(:empty) + #app-loading { display: none; }
.spinner { width: 1.2rem; height: 1.2rem; border: 3px solid #c9d3e6; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#components-reconnect-modal { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block; position: fixed; top: 0; inset-inline: 0; z-index: 2000; padding: .6rem;
}
#components-reconnect-modal .rc-box {
    max-width: 640px; margin: 0 auto; display: flex; gap: .7rem; align-items: center; justify-content: center;
    background: #fff8e1; border: 1px solid #f0d488; border-radius: 10px; padding: .7rem 1rem; box-shadow: 0 6px 20px rgba(0,0,0,.18); font-weight: 600;
}
#components-reconnect-modal .rc-show, #components-reconnect-modal .rc-failed, #components-reconnect-modal .rc-rejected { display: none; }
#components-reconnect-modal.components-reconnect-show .rc-show,
#components-reconnect-modal.components-reconnect-failed .rc-failed,
#components-reconnect-modal.components-reconnect-rejected .rc-rejected { display: block; }
#components-reconnect-modal.components-reconnect-failed .spinner,
#components-reconnect-modal.components-reconnect-rejected .spinner { display: none; }

/* full position of customers' events (/today) */
.pos-cust { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; border-top: 4px solid var(--primary); }
.pos-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.pos-head h2 { margin: 0 0 .2rem; }
.pos-final { border-radius: 8px; padding: .4rem .8rem; text-align: center; border: 1px solid; }
.pos-final span { display: block; font-size: .8rem; }
.pos-final b { font-size: 1.3rem; direction: ltr; display: block; }
.pos-final.due { background: #fdeeee; color: var(--danger); border-color: #f0c4c4; }
.pos-final.clear { background: #eaf6ee; color: var(--ok); border-color: #bfe3cb; }
.pos-event { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .7rem; background: #fbfcfe; page-break-inside: avoid; }
.pos-ev-head { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin-bottom: .5rem; }
.tag { font-size: .78rem; padding: .1rem .5rem; border-radius: 99px; background: #eef1f6; border: 1px solid var(--line); }
.tag.today { background: var(--accent); border-color: var(--accent); color: #1d2433; font-weight: 700; }
.tag.paid { background: #eaf6ee; color: var(--ok); border-color: #bfe3cb; }
.tag.due { background: #fdeeee; color: var(--danger); border-color: #f0c4c4; }
.pos-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .4rem; }
.pos-nums div { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: .3rem .5rem; font-size: .82rem; color: var(--muted); }
.pos-nums b { display: block; color: var(--ink); font-size: 1rem; direction: ltr; text-align: right; }
.pos-nums .rem b { color: var(--danger); }
.pos-tables { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .6rem; }
.pos-tables > div { flex: 1 1 300px; min-width: 0; overflow-x: auto; }
.pos-tables h3 { font-size: .95rem; margin: 0 0 .3rem; }
.pos-tables table.grid tbody tr:hover td { background: inherit; cursor: default; }
.pos-acc td:last-child { text-align: left; direction: ltr; }
.pos-acc tfoot td { color: var(--danger); font-size: 1rem; }
@media print {
    .pos-cust { break-inside: auto; border: 1px solid #999; }
    table.grid th { position: static; }
}

/* receipts review (admin) */
.rr-sum { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: .6rem 0; padding: .5rem .8rem; background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; }
.rr-sum .bad { color: var(--danger); font-weight: 600; }
.rr-check { width: 1.2rem; height: 1.2rem; cursor: pointer; accent-color: var(--ok); }
table.grid tr.rr-yes td { background: #eaf6ee; }

.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.row > .card { flex: 1 1 380px; }
.totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }
.totals div { background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; }
.totals b { display: block; font-size: 1.05rem; direction: ltr; text-align: right; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
    background: linear-gradient(135deg, #1f3a68, #3b5f99); }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: .75rem; text-align: center; }
.login label { text-align: right; display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.login-logo { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin: 0 auto; border: 3px solid var(--accent); }

/* ---------- calendar (Form2) ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.cal-nav { display: flex; gap: .4rem; align-items: center; }
.cal-nav .month { width: 110px; text-align: center; font-weight: 700; }
.legend { display: flex; gap: 1rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 2px; vertical-align: middle; }
.sw.green, .stripe.green { background: var(--green); }
.sw.blue, .stripe.blue { background: var(--blue); }
.sw.red, .stripe.red { background: var(--red); }
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .55rem; }
.day {
    position: relative; height: 64px; border: 1px solid #bfc6d4; background: #fff; border-radius: 6px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font: inherit;
    font-weight: 700; overflow: hidden;
}
.day:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.day .dname { font-size: .82rem; }
.day .dnum { font-size: 1rem; }
.stripe { position: absolute; left: 0; right: 0; height: 6px; }
.stripe.top { top: 0; }
.stripe.bottom { bottom: 0; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10,20,40,.45); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: #fff; border-radius: 12px; padding: 1.2rem; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(1000px, 100%); }
.details { white-space: pre-wrap; font-family: inherit; line-height: 1.7; background: #f7f9fc; padding: .8rem; border-radius: 8px; }

.org-banner { display: flex; align-items: center; gap: 1rem; }
.org-banner img { width: 84px; height: 84px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.login-logo { object-fit: contain !important; background: #fff; }
.brand img { object-fit: contain !important; }
.logo-edit { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 150px; height: 150px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; }
.logo-preview img { max-width: 140px; max-height: 140px; object-fit: contain; }

/* ---------- smart reports ---------- */
.smart { --s1: #2a78d6; --s2: #eb6834; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.kpi b { font-size: 1.45rem; direction: ltr; text-align: right; color: var(--ink); }
.kpi small { color: var(--muted); font-size: .78rem; }
.kpi.good { border-inline-start: 4px solid var(--ok); }
.kpi.bad { border-inline-start: 4px solid var(--danger); }
.neg { color: var(--danger); font-weight: 700; }
.insight { background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; margin: .7rem 0 0; font-size: .92rem; }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 99px; background: #eef1f6; font-size: .8rem; }
.tag.hot { background: #fde7e7; color: var(--danger); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 300px; overflow: auto; }
.chip { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: .25rem .35rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .85rem; font-weight: 700; background: #fff; }
.chip small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.chip.wk { border-color: var(--s1); background: #eaf2fc; }
.chip:hover { box-shadow: 0 2px 6px rgba(0,0,0,.12); }

.vchart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .4rem; height: 240px; align-items: end; border-bottom: 1px solid #c9ced8; padding-top: .5rem; }
.vcol { display: flex; flex-direction: column; height: 100%; justify-content: flex-end; align-items: stretch; }
.vbars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.vbar { width: 42%; max-width: 22px; border-radius: 4px 4px 0 0; position: relative; min-height: 0; }
.vbar.s1 { background: var(--s1); } .vbar.s2 { background: var(--s2); }
.vlabels { display: grid; grid-template-columns: repeat(12, 1fr); gap: .4rem; padding-top: .3rem; }
.vlabels span { text-align: center; font-size: .72rem; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.hbars { display: flex; flex-direction: column; gap: .35rem; }
.hrow { display: grid; grid-template-columns: minmax(80px, 28%) 1fr 11.5rem; align-items: center; gap: .5rem; font-size: .88rem; position: relative; }
.hlab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htrack { background: #f1f3f7; border-radius: 4px; height: 14px; overflow: hidden; }
.htrack i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.hval { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .hrow { grid-template-columns: minmax(70px, 30%) 1fr 7.5rem; } }

[data-tip] { cursor: default; }
[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); right: 50%; transform: translateX(50%);
    background: #1d2433; color: #fff; padding: .3rem .55rem; border-radius: 6px; font-size: .78rem; white-space: nowrap; z-index: 5; pointer-events: none;
}
.vbar[data-tip]:hover, .hrow:hover .htrack i { filter: brightness(1.12); }
@media print { .smart .card, .kpi { break-inside: avoid; } .chips { max-height: none; } }

.viewer-back { padding: .6rem; }
.viewer { background: #fff; border-radius: 10px; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; border-bottom: 1px solid var(--line); background: #f3f5fa; }
.viewer iframe { flex: 1; border: 0; width: 100%; background: #525659; }

#blazor-error-ui { background: #ffe9a8; bottom: 0; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .reload { margin-inline-start: 1rem; }

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; grid-template-areas: "top" "side" "content"; }
    .side { flex-direction: row; overflow-x: auto; border: 0; border-bottom: 1px solid var(--line); }
    .side-btn { flex: 0 0 auto; }
    .topbar { flex-wrap: wrap; }
}

@media print {
    .topbar, .side, .toolbar, .no-print { display: none !important; }
    .shell { display: block; }
    .card { border: 0; }
}
