/* ============================================================
   هوية كباتن — لوحة المنصة ولوحة المطعم وشاشة الدخول
   بيتحمّل بعد app.css، وبس برّا صفحات /pos (راجع App.razor) ⇒ شاشة الكاشير ما بتتأثر.
   الألوان هون لازم تطابق Theme/BrandPalette.cs
   الميلان (7°) من ساق الـK باللوجو: للصفحة المفتوحة وعلامة الحالة وشاشة الدخول بس.
   ============================================================ */
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url('fonts/Tajawal-400.ttf') format('truetype'); }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url('fonts/Tajawal-500.ttf') format('truetype'); }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url('fonts/Tajawal-700.ttf') format('truetype'); }
@font-face { font-family: 'Tajawal'; font-weight: 800; font-display: swap; src: url('fonts/Tajawal-800.ttf') format('truetype'); }

:root {
    --red: #E31F24; --ink: #141414; --lean: -7deg;

    --brand-300: #F4A79F; --brand-400: #E31F24; --brand-500: #E31F24;
    --brand-600: #C4161B; --brand-700: #9B1115;
    --gold-500: #E9B84A; --gold-600: #8A6100; --gold-700: #6E4D00; --gold-100: #FFF3D6; --gold-50: #FFF9EA;
    --success-400: #2E9C67; --success-500: #14804A; --success-600: #0F6A3D;
    --success-50: #E6F3EC; --success-150: #CFE8DB; --success-100: #E6F3EC;
    --danger-400: #C23B3B; --danger-500: #9B1C1C; --danger-600: #9B1C1C;
    --danger-50: #FBECEC; --danger-150: #EFC9C9; --danger-100: #FBECEC;

    --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F6F5F2;
    --border: #DCDCD8; --border-2: #E6E5E1;
    --text: #141414; --text-muted: #5A5A58; --text-soft: #6B6B68;
    --cocoa-800: #141414; --cocoa-900: #141414; --scrim: rgba(20, 20, 20, .5); --scroll: #C9C8C3;
    --bg-grad: none; --grid: #E6E5E1; --barbg: #E6E5E1;
    --icbg1: #FBDAD7; --icbg2: #FBDAD7; --brand-50: #FDEDEB;

    --radius: 6px; --radius-card: 6px; --radius-ctl: 5px;
    --shadow-sm: none; --shadow: none; --shadow-lg: none;
}

html, body { font-family: 'Tajawal', 'Segoe UI', sans-serif; font-size: 16px; background: #fff; }
body { background: #fff; line-height: 1.55; }
button, input, select, textarea { font-family: inherit; }
.mud-typography, .mud-button-root, .mud-input-slot { font-family: inherit !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ===== الأرقام والعناوين: نفس الخط بكل مكان، وبلا ضغط مسافات ===== */
.stat-value, .hero-value, .kpi-value, .quick-num, .pay-value, .cell-num, .cell-money, .money-val.big,
.pf-card .pf-val, .live-stat-n, .live-count, .live-id, .live-age, .live-age-word, .od-id, .od-qty, .od-line,
.fee-base, .kabaten-modal-title, .brand-btn, .lang-toggle span { font-family: inherit; letter-spacing: 0; }

/* ===== الهيكل ===== */
.side-rail.wide {
    width: 240px; padding: 0 0 32px; gap: 0; align-items: stretch;
    background: var(--surface-2); box-shadow: none; border: 0; overflow: hidden;
}
html[dir="ltr"] .side-rail { box-shadow: none; }
.rail-mark { height: 112px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--red); }
.rail-mark img { width: 164px; height: auto; display: block; }
.rail-toggle, .rail-toggle-btn { display: none; }
.rail-links { display: flex; flex-direction: column; padding-top: 26px; }
.side-rail.wide .rail-item {
    width: auto; min-height: 44px; padding: 0 28px; border-radius: 0; z-index: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    color: var(--ink); background: none; box-shadow: none; font-size: 1rem; font-weight: 500;
}
.side-rail.wide .rail-item span { white-space: normal; }
.side-rail.wide .rail-item:hover { background: none; color: var(--red); }
.side-rail.wide .rail-item.active { color: #fff; font-weight: 700; background: none; box-shadow: none; }
.side-rail.wide .rail-item.active::before {
    content: ""; position: absolute; z-index: -1; inset-block: 0;
    inset-inline-start: -14px; inset-inline-end: 16px;
    background: var(--red); transform: skewX(var(--lean));
}
.side-rail.wide .rail-item.active::after { display: none; }
.rail-count { color: var(--red); font-weight: 700; font-size: .9rem; }
.rail-item.active .rail-count { color: #fff; }
.rail-groups { margin: 22px 0 0; position: relative; }
.rail-groups::before { content: ""; position: absolute; top: 0; inset-inline: 28px; border-top: 1px solid #DDDBD5; }
.rail-groups { padding-top: 14px; }
.rail-groups summary {
    min-height: 44px; padding: 0 28px; display: flex; align-items: center; gap: 8px;
    cursor: pointer; list-style: none; color: var(--text-muted); font-weight: 500;
}
.rail-groups summary::-webkit-details-marker { display: none; }
.rail-groups summary::after {
    content: ""; width: 7px; height: 7px; margin-inline-start: auto; margin-bottom: 4px;
    border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg);
}
.rail-groups details[open] > summary::after { transform: rotate(225deg); margin-bottom: -4px; }
.rail-groups summary:hover { color: var(--ink); }
/* لوحة المطعم: لوجو المطعم تحت لوجو كباتن */
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 22px 28px 0; }
.side-rail.wide .rail-brand { margin: 0; padding-inline-start: 28px; }
.side-rail.wide .rail-brand-txt { color: var(--ink); font-weight: 700; display: inline; }
.rail-logo, .brand-title-mark { background: var(--ink); box-shadow: none; border-radius: 5px; font-weight: 700; }
.side-rail.wide .rail-logo, .side-rail.wide .rail-logo.rail-logo-img, .brand-title-mark.brand-title-logo { border-radius: 5px; }
.brand-title-logo, .rail-logo-img { background: #fff; }

.top-bar { height: 72px; padding: 0 64px; background: #fff; box-shadow: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.top-title { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.page-body { padding: 14px 64px 56px; }
.icon-btn { background: none; color: var(--ink); border-radius: 5px; }
.icon-btn:hover { background: var(--surface-2); transform: none; }
.top-bar .icon-btn { width: 42px; height: 42px; border-radius: 5px; background: none; color: var(--ink); box-shadow: none; }
.top-bar .icon-btn:hover { background: var(--surface-2); }
.bell-badge { background: var(--red); border-color: #fff; }
.bell-panel { border-radius: 6px; border: 1px solid var(--ink); box-shadow: none; }
.bell-item { border-radius: 4px; }
.lang-toggle { height: 42px; border: 0; background: none; border-radius: 5px; padding: 0; }
.lang-toggle span { height: 42px; border-radius: 5px; font-size: .95rem; font-weight: 500; color: var(--text-muted); }
.lang-toggle span.on { background: none; color: var(--ink); font-weight: 800; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.alarm-pill, .platform-link, .mock-chip { border-radius: 5px; }

/* ===== العناوين ===== */
.page-head { margin-bottom: 30px; }
.page-h1 { font-size: 2rem; font-weight: 800; letter-spacing: 0; line-height: 1.25; background: none; color: var(--ink); -webkit-text-fill-color: currentColor; }
.page-h1:focus, .page-h1:focus-visible { outline: none; }
.page-hint { font-size: .95rem; margin-top: 4px; }
.section-title { font-size: 1.15rem; font-weight: 700; }

/* ===== المحتوى: بلا كروت ===== */
.glass { border: 1px solid var(--border); border-radius: 6px; box-shadow: none; overflow: visible; }
.glass::before { display: none; }
.glass:hover, .stat-card:hover, .setting-btn:hover, .quick-link:hover, .brand-btn:hover, .od-clickable:hover { transform: none; box-shadow: none; }
.glass > * { z-index: auto; }
.filter-bar, .table-wrap, .live-bar, .bento-cell, .hero, .kpi, .stat-card, .pay-card, .pf-card { border: 0; border-radius: 0; background: none; }
.filter-bar, .live-bar { padding: 0 0 22px; margin-bottom: 8px; align-items: flex-end; }
.bento-cell, .hero, .stat-card, .pay-card, .kpi { padding: 0 0 24px !important; border-bottom: 1px solid var(--border); }
.stat-card, .kpi, .hero, .pf-card, .bento-cell, .pay-card, .form-card, .setting-btn, .quick-link, .login-card { animation: none; }
.hero { min-height: 0; gap: 18px; }
.hero-value { color: var(--ink); text-shadow: none; }
.kpi-dot { width: 7px; height: 17px; border-radius: 0; transform: skewX(var(--lean)); }
.kpi-value, .pf-card .pf-val { font-weight: 700; }
.bg-caramel, .bg-success, .bg-danger, .quick-link { background-image: none; }
.bg-caramel { background-color: var(--gold-500); } .bg-success { background-color: var(--success-500); } .bg-danger { background-color: var(--danger-500); }
.quick-link { background-color: var(--ink); } .quick-link::after { display: none; } .quick-num { text-shadow: none; }
.stat-icon, .setting-ic { background: var(--icbg1); border-radius: 5px; color: var(--ink); }
.setting-ic .mud-icon-root { color: var(--ink) !important; }
.ai-card.on, .ai-card.off { border-width: 1px; border-radius: 6px; }
.ai-card .ai-icon, .ai-card .ai-pill { border-radius: 5px; }
.apexcharts-canvas text, .apexcharts-canvas .apexcharts-legend-text, .apexcharts-tooltip, .apexcharts-tooltip * { font-family: 'Tajawal', sans-serif !important; }
.share-bar, .share-fill { border-radius: 0; }
.delta, .delta.up, .delta.down { background: none; padding: 0; }
.pf-grid { gap: 34px 48px; margin-bottom: 44px; }
.pf-card { padding: 0 0 20px !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; }
.pf-card .pf-label { margin-bottom: 8px; font-size: 1rem; font-weight: 500; }
.pf-card .pf-label .mud-icon-root { display: none; }
.pf-card .pf-val, .money-val.big { font-size: 2.1rem; }
.money-val { font-weight: 700; } .money-cur { font-weight: 500; font-size: .82em; } .money-val.big .money-cur { font-size: .55em; }
.setting-btn { border-radius: 6px; }

/* ===== الأزرار والخانات ===== */
.brand-btn, .brand-btn.caramel { background: var(--ink); color: #fff; border-radius: 5px; box-shadow: none; font-weight: 700; }
.brand-btn:hover { background: #333; filter: none; }
.brand-btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.brand-btn.ghost:hover { background: var(--surface-2); }
.live-actions .reject, .od-reject { background: #fff; color: var(--danger-600); border: 1px solid var(--danger-600); }
.mini-btn, .scope-btn { background: #fff; border: 1px solid var(--border); border-radius: 5px; color: var(--ink); font-weight: 500; min-height: 36px; font-size: .9rem; }
.mini-btn:hover, .scope-btn:hover { border-color: var(--ink); background: #fff; }
.scope-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-field, .form-input, .form-textarea { border: 1px solid #A9A9A4; border-radius: 5px; box-shadow: none; }
.filter-field:focus, .form-input:focus, .form-textarea:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.date-label, .form-row > label { font-size: .9rem; font-weight: 500; }
.file-input::file-selector-button { background: var(--ink); border-radius: 4px; }
.seg { background: none; border: 0; padding: 0; gap: 4px 30px; border-radius: 0; flex-wrap: wrap; }
.seg button { padding: 8px 0; border-radius: 0; font-size: 1rem; font-weight: 500; border-bottom: 3px solid transparent; }
.seg button.on { color: var(--ink); background: none; box-shadow: none; font-weight: 700; border-bottom-color: var(--red); }
.switch-row, .pf-note, .notif-shop, .save-toast, .email-status, .payout-preview, .payout-confirm, .od-note, .od-empty,
.od-item, .od-sum, .live-note, .shop-row, .pos-secret, .stmt-paid { border-radius: 5px; }
.notif-shop.on { border-color: var(--ink); background: var(--surface-2); }
.notif-shop input { accent-color: var(--ink); }
.switch .track { background: #A9A9A4; }

/* ===== الجداول ===== */
table.data-table { font-size: 1rem; }
table.data-table thead th {
    background: #fff; padding: 12px 0; border-bottom: 1px solid var(--border);
    font-size: .9rem; font-weight: 500; letter-spacing: 0; text-transform: none;
}
table.data-table tbody td { padding: 14px 0; border-bottom: 1px solid var(--border); }
/* المسافة بين الأعمدة حسب اتجاه الصفحة مش الخلية — في خلايا dir="ltr" (أرقام وتلفونات) جوّا صفحة عربية */
html[dir="rtl"] table.data-table :is(th, td):not([colspan]) { padding-left: 22px; padding-right: 0; }
html[dir="ltr"] table.data-table :is(th, td):not([colspan]) { padding-right: 22px; padding-left: 0; }
html[dir="rtl"] table.data-table td[dir="ltr"] { text-align: right; }
table.data-table tbody tr:nth-child(even) { background: none; }
table.data-table tbody tr:hover, .row-click:hover td, tr.row-click:hover { background: var(--surface-2) !important; }
.cell-num { color: var(--ink); }
.cell-sub { display: block; color: var(--text-muted); font-size: .85rem; font-weight: 400; line-height: 1.4; }
.stage-row td { padding: 0 14px !important; }
.rest-id, .rest-id.brand-no { border-radius: 3px; background: none; border-color: var(--border); color: var(--text-muted); }

/* علامة الحالة: خط مايل + كلام، بدل الحبة الملوّنة */
.badge, .badge.b-pending, .badge.b-accepted, .badge.b-rejected, .badge.b-neutral, .badge.b-delivery, .badge.b-pickup {
    background: none; color: var(--ink); padding: 0; border-radius: 0; gap: 9px; font-size: .95rem; font-weight: 500;
}
.badge::before { content: ""; flex: none; width: 7px; height: 16px; background: #A9A9A4; transform: skewX(var(--lean)); }
.badge.b-pending::before { background: var(--gold-500); }
.badge.b-accepted::before { background: var(--success-500); }
.badge.b-rejected::before { background: var(--danger-500); }
.badge.b-delivery::before { background: #6FBF9D; }
.badge.is-late { color: var(--red); font-weight: 700; }
.badge.is-late::before { background: var(--red); }

/* ===== النوافذ ===== */
.kabaten-modal, .kabaten-confirm-scrim { backdrop-filter: none; animation: none; }
.kabaten-modal-card, .kabaten-confirm { border: 0; border-radius: 6px; box-shadow: none; }
.kabaten-modal-title { text-align: start; font-weight: 800; background: none; color: var(--ink); -webkit-text-fill-color: currentColor; }
.kabaten-confirm-icon { border-radius: 5px; color: var(--ink); }

/* ===== الطلبات الحيّة ===== */
.live-col { border: 0; border-top: 2px solid var(--ink); border-radius: 0; }
.live-col-head { background: none; padding: 14px 0; }
.live-col-title { font-size: 1.05rem; font-weight: 700; }
.live-count { border: 0; background: none; padding: 0; font-size: 1.1rem; color: var(--ink); }
.live-list { padding: 14px 0; }
.live-card, .live-age, .live-offline { border-radius: 5px; }
.live-stat-n, .live-id, .od-id, .od-qty, .od-sum-row.total { color: var(--ink); }

/* ===== نظرة عامة ===== */
.ov-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; padding-bottom: 26px; margin: 6px 0 64px; border-bottom: 1px solid var(--border); }
.ov-flow a { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; }
.ov-flow strong { font-size: 3.1rem; font-weight: 700; line-height: 1.15; }
.ov-flow span { font-weight: 500; font-size: 1.05rem; }
.ov-flow small { color: var(--text-muted); font-size: .9rem; }
.ov-flow a:hover span { text-decoration: underline; text-underline-offset: 5px; }
.ov-flow .late strong, .ov-flow .late small { color: var(--red); }
.ov-flow .late small { font-weight: 700; }
.ov-two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 96px; }
.ov-two h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; }
.ov-todo > div { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 4px; min-height: 78px; border-bottom: 1px solid var(--border); }
.ov-todo strong { font-size: 1.7rem; font-weight: 700; }
.ov-todo p { margin: 0; font-weight: 500; }
.ov-todo .cell-sub { margin: 0; }
.ov-todo a { color: var(--ink); font-weight: 500; text-underline-offset: 5px; padding: 10px 0; }
.ov-todo a:hover { color: var(--red); }
.ov-none { color: var(--text-muted); padding: 22px 0; }
.ov-sum { margin: 0; }
.ov-sum > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.ov-sum dt { color: var(--text-muted); }
.ov-sum dd { margin: 0; font-weight: 700; }

/* ===== فلاتر الطلبات والمطاعم (نفس الشكل) ===== */
.line-search { flex: 1 1 100%; display: flex; flex-direction: column; }
.line-search input, .rx-toolbar .rx-search input { width: 100%; box-sizing: border-box; }
.line-search input { border: 0; border-bottom: 1px solid var(--ink); background: none; height: 46px; padding: 0; font-size: 1.05rem; outline: none; color: var(--ink); border-radius: 0; }
.line-search input:focus { box-shadow: inset 0 -1px 0 var(--ink); }
.line-search input::placeholder, .rx-search input::placeholder { color: #6B6B68; }
.count-tabs { display: flex; flex-wrap: wrap; gap: 6px 38px; margin: 6px 0 20px; }
.count-tabs button, .admin-shell .rx-seg button {
    border: 0; border-bottom: 3px solid transparent; background: none; padding: 8px 0; border-radius: 0; cursor: pointer;
    color: var(--text-muted); font: inherit; font-size: 1rem; font-weight: 500; box-shadow: none; flex: none;
}
.count-tabs b, .rx-seg b { color: var(--ink); font-weight: 700; margin-inline-end: 5px; }
.count-tabs button.on, .admin-shell .rx-seg button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--red); background: none; box-shadow: none; }

/* ===== صفحة المطاعم (الستايل الأصلي جوّا الصفحة، فمنحتاج أولوية أعلى) ===== */
.admin-shell .rx-toolbar { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; gap: 14px 24px; margin-bottom: 22px; }
.admin-shell .rx-search { flex: 1 1 100%; background: none; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 0; height: 48px; }
.admin-shell .rx-search:focus-within { box-shadow: inset 0 -1px 0 var(--ink); }
.admin-shell .rx-search input { font-size: 1.05rem; }
.admin-shell .rx-seg { flex: 1 1 auto; width: auto; background: none; border: 0; border-radius: 0; padding: 0; gap: 4px 38px; }
.admin-shell .rx-sort { border: 0; background: none; border-radius: 0; font-size: 1rem; font-weight: 500; }
.admin-shell .rx-icon-btn, .admin-shell .rx-toolbar > .rx-icon-btn { border-radius: 5px; }
.admin-shell .rx-icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
.admin-shell table.rx-table { font-size: 1rem; }
.admin-shell table.rx-table thead th { font-size: .9rem; letter-spacing: 0; }
.admin-shell table.rx-table tbody tr.rx-row td { padding-block: 12px; border-bottom-color: var(--border); }
.admin-shell table.rx-table tbody tr.rx-row.row-open td { background: var(--surface-2); }
html[dir] .admin-shell table.rx-table tbody tr.rx-row.row-open td:first-child { box-shadow: none; }
html[dir="rtl"] .admin-shell table.rx-table tbody tr.rx-row td { padding-left: 22px; padding-right: 0; }
html[dir="ltr"] .admin-shell table.rx-table tbody tr.rx-row td { padding-right: 22px; padding-left: 0; }
.admin-shell .rx-logo { width: 44px; height: 44px; border-radius: 5px; box-shadow: 0 0 0 1px var(--border-2); }
.admin-shell .rx-logo-ph { background: var(--ink); font-weight: 700; }
.admin-shell .rx-name { font-size: 1rem; } .admin-shell .rx-sub, .admin-shell .rx-notes, .admin-shell .rx-b-notes { font-size: .85rem; }
.admin-shell .rx-count { background: none; border: 0; padding: 0; min-width: 0; font-size: 1rem; font-weight: 500; }
.admin-shell .rx-badges { gap: 4px 16px; }
.admin-shell .rx-panel-head { text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 500; }
.admin-shell .rx-panel-head b { background: none; color: var(--ink); }
.admin-shell .rx-detail td::before { background: var(--border); }
.admin-shell .rx-detail .rx-branches, .admin-shell .rx-empty { border-radius: 6px; box-shadow: none; }
.admin-shell .rx-dot { width: 6px; height: 15px; border-radius: 0; box-shadow: none; transform: skewX(var(--lean)); }
.admin-shell .rx-b-name, .admin-shell .rx-b-cell { font-size: .95rem; }
.admin-shell .rx-warn { border-radius: 3px; font-size: .82rem; }
.admin-shell .sk { animation: none; background: var(--border-2); border-radius: 3px; }

/* ===== الدخول ===== */
.login-split { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 100vh; overflow: hidden; }
.login-form { display: flex; flex-direction: column; justify-content: center; width: min(450px, 100%); box-sizing: border-box; margin: 0 auto; padding: 96px 24px 40px; position: relative; }
.login-form .lang-toggle { position: absolute; top: 28px; inset-inline-start: 16px; }
.login-form h1 { font-size: 2.25rem; font-weight: 800; margin: 0 0 36px; outline: none; }
.login-form .field { margin-bottom: 30px; }
.login-form .field label { font-size: 1rem; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.login-form .input-wrap { border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 0; }
.login-form .input-wrap:focus-within { box-shadow: inset 0 -1px 0 var(--ink); border-color: var(--ink); }
.login-form .input-wrap input { font-size: 1.1rem; outline: none; }
.login-form .login-btn { margin-top: 8px; min-height: 56px; font-size: 1.05rem; }
.login-error { border-radius: 5px; }
.login-mark { position: relative; z-index: 0; display: grid; place-items: center; }
.login-mark::before { content: ""; position: absolute; z-index: -1; inset-block: 0; inset-inline-start: 0; inset-inline-end: -140px; background: var(--red); transform: skewX(var(--lean)); }
.login-mark img { height: min(560px, 62vh); width: auto; }
/* شاشة «فتح لوحة المطعم» */
.login-logo { width: 100px; height: 100px; border-radius: 5px; background: var(--red); box-shadow: none; }
.login-logo img { height: 74px; }

/* ===== الشاشات الأصغر ===== */
@media (max-width: 1200px) {
    .top-bar, .page-body { padding-inline: 32px; }
    .ov-two { gap: 48px; }
}
@media (max-width: 900px) {
    .admin-shell { flex-direction: column; }
    .side-rail.wide { width: 100%; padding: 0; flex-direction: row; flex-wrap: wrap; align-items: center; background: var(--red); overflow: visible; }
    .rail-mark { height: 68px; padding-inline-start: 16px; justify-content: flex-start; flex: 1; }
    .rail-mark img { width: 112px; }
    .rail-toggle { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; }
    .rail-toggle-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; color: #fff; font-weight: 700; cursor: pointer; }
    .rail-toggle:focus-visible + .rail-toggle-btn { outline: 2px solid #fff; outline-offset: -6px; }
    .rail-body { display: none; width: 100%; background: var(--surface-2); padding-bottom: 18px; }
    .rail-toggle:checked ~ .rail-body { display: block; }
    .side-rail.wide .rail-item span { display: inline; }
    .side-rail.wide .rail-item { justify-content: space-between; padding: 0 16px; }
    .side-rail.wide .rail-item.active::before { inset-inline-end: -14px; }
    .rail-groups summary, .side-rail.wide .rail-brand { padding-inline: 16px; }
    .rail-groups::before { inset-inline: 16px; }
    .login-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .login-mark { order: -1; padding: 24px 0; }
    .login-mark::before { inset: 0; transform: none; }
    .login-mark img { height: 150px; }
    .login-form { justify-content: flex-start; padding-top: 84px; }
    .ov-two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .top-bar { height: auto; padding: 8px 16px; min-height: 56px; }
    .page-body { padding: 10px 16px 40px; }
    .page-h1 { font-size: 1.7rem; }
    .ov-flow { grid-template-columns: 1fr 1fr; margin-bottom: 40px; }
    .ov-flow strong { font-size: 2.5rem; }
    .lang-toggle span.on { display: none; }
    .platform-shell .top-bar-start:has(.top-title) { display: none; }
    .filter-bar > *, .filter-bar > * > * { min-width: 0; max-width: 100%; }
    .filter-bar .date-label, .filter-bar > .filter-field { flex: 1 1 140px; min-width: 0; box-sizing: border-box; }
    .filter-bar .date-label .filter-field { width: 100%; min-width: 0; box-sizing: border-box; }
    .form-card table.data-table td { white-space: normal; }
    .line-search { flex: 1 1 100%; }
    .count-tabs, .admin-shell .rx-seg { gap: 4px 24px; }
    .admin-shell .rx-seg button { flex: none; padding: 8px 0; }
}
