/* لوحة BOTO: أسود، أبيض، وأحمر. */
:root {
    --paper: #f3f5f8;
    --card: #ffffff;
    --ink: #1b1d21;
    --muted: #8b919a;
    --line: #e7ebf0;
    --sidebar: #141414;
    --red: #e10613;
    --red-dark: #c10510;
    --green: #16a34a;
    --green-bar: #22c55e;
    --ok-bg: #e8f8ee;
    --warn: #e07a12;
    --warn-bg: #fff1e3;
    --danger: #e11d2e;
    --danger-bg: #fdecee;
    --shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
    --sans: "IBM Plex Sans Arabic", Tahoma, sans-serif;
    --latin: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: end; }

.shell {
    display: flex;
    direction: rtl;
    min-height: 100vh;
    background: var(--paper);
}
.sidebar {
    width: 232px;
    flex: none;
    background: var(--sidebar);
    color: #ececec;
    padding: 22px 14px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    margin-bottom: 22px;
}
.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.brand-car { width: 86px; height: 28px; }
.brand-name {
    font-family: Impact, "Arial Black", var(--latin);
    font-size: 2rem;
    font-style: italic;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.brand-sub {
    margin-top: 4px;
    font-family: var(--latin);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: #d7d7d7;
}
.brand-logo {
    width: 148px;
    height: 64px;
    object-fit: contain;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #c8c8c8;
}
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-link.is-active {
    background: var(--red);
    color: #fff;
}
.nav-link.is-active:hover { background: var(--red); }
.nav-link.is-soon { cursor: default; }
.nav-link.is-soon:hover { background: transparent; color: #c8c8c8; }
.side-foot {
    margin-top: auto;
    text-align: center;
    padding-top: 12px;
}
.side-car { width: 100%; height: 78px; }
.side-foot p {
    margin: 0;
    font-family: var(--latin);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: #9a9a9a;
}
.crest-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.crest {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--latin);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.crest-red { background: #9d1020; }
.crest-green { background: radial-gradient(circle at 50% 50%, #fff 0 28%, #0b7a32 29% 100%); }
.crest-gold { background: #c6a15a; }
.crest-silver { background: #8d8d8d; }

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 20;
}
.backdrop[hidden] { display: none; }

.main {
    flex: 1;
    min-width: 0;
}
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.icon-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
}
.icon-btn svg { width: 100%; height: 100%; }
.top-search {
    flex: 1;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f6f8;
    border-radius: 999px;
    padding: 0 14px;
    color: #6b7280;
}
.top-search svg { width: 18px; height: 18px; flex: none; color: #8b919a; }
.top-search input {
    border: 0;
    background: transparent;
    min-height: 42px;
    padding: 0;
    text-align: right;
    color: #1b1d21;
    font-weight: 500;
}
.top-search input::placeholder {
    color: #9aa1aa;
    font-weight: 400;
    opacity: 1;
}
.top-search input:focus { outline: none; color: #111; }
.top-tools {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.bell {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #3a3f45;
    text-decoration: none;
}
.bell svg { width: 22px; height: 22px; }
.bell span {
    position: absolute;
    top: 2px;
    inset-inline-end: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.68rem;
    display: grid;
    place-items: center;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1c1c1c;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.user-copy { display: flex; flex-direction: column; text-align: start; line-height: 1.25; }
.user-copy strong { font-size: 0.92rem; }
.user-copy small { color: var(--muted); font-size: 0.75rem; }
.content { padding: 22px 24px 48px; }
.content:not(:has(.dash)) { max-width: 1180px; }

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 22px;
}
.page-head h1, .hero-copy h1 { margin: 0; font-size: 1.7rem; font-weight: 700; }
.eyebrow { margin: 0 0 6px; color: var(--red); font-size: 0.86rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.lede { margin: 8px 0 0; color: var(--muted); max-width: 46rem; line-height: 1.7; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { border-color: var(--line); background: var(--card); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 0.86rem; }
.text-btn {
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    padding: 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto minmax(150px, 220px);
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding: 18px 20px;
    background:
        linear-gradient(135deg, #fff 0%, #fff 58%, #fff5f5 100%);
    border: 1px solid #f0d4d6;
    border-inline-start: 4px solid var(--red);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.hero-art svg { width: 100%; height: auto; }
.hero-copy { text-align: start; min-width: 0; }
.hero-copy p { margin: 6px 0 0; color: var(--muted); }
.date-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    padding: 12px 14px;
    min-width: 170px;
}
.date-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef2ff;
    display: grid;
    place-items: center;
    color: #4f46e5;
}
.date-icon svg { width: 18px; height: 18px; }
.date-card small, .date-card strong { display: block; }
.date-card small { color: var(--muted); }
.date-card strong { font-size: 0.95rem; }

.dash-kpis, .dash-mid, .dash-bot { display: grid; gap: 14px; margin-bottom: 14px; }
.dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-mid { grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr) 230px; }
.dash-bot { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.85fr); }

.kpi, .panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.kpi {
    padding: 16px 16px 14px;
    border-inline-start-width: 4px;
    border-inline-start-style: solid;
}
.kpi-total {
    background: linear-gradient(180deg, #fff7f7 0%, #fff 70%);
    border-color: #f3d0d3;
    border-inline-start-color: var(--red);
}
.kpi-available {
    background: linear-gradient(180deg, #f3fbf6 0%, #fff 70%);
    border-color: #cdead8;
    border-inline-start-color: var(--green);
}
.kpi-alert {
    background: linear-gradient(180deg, #fff8ef 0%, #fff 70%);
    border-color: #f3dfc2;
    border-inline-start-color: var(--warn);
}
.kpi-value {
    background: linear-gradient(180deg, #f5f7fb 0%, #fff 70%);
    border-color: #d7dde8;
    border-inline-start-color: #475569;
}
.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.red { background: #fde8ea; color: var(--red); }
.kpi-icon.green { background: #e7f8ee; color: var(--green); }
.kpi-icon.warn { background: #fff1e0; color: var(--warn); }
.kpi-icon.dark { background: #e8edf5; color: #334155; }
.kpi p, .kpi > span { margin: 0; color: var(--muted); font-size: 0.86rem; }
.kpi strong {
    display: block;
    margin: 4px 0 2px;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.panel {
    border-inline-start-width: 4px;
    border-inline-start-style: solid;
    border-inline-start-color: transparent;
    overflow: hidden;
}
.chart-card {
    background: linear-gradient(180deg, #f4fbf7 0%, #fff 42%);
    border-color: #cfe8da;
    border-inline-start-color: var(--green);
}
.low-card {
    background: linear-gradient(180deg, #fff6f6 0%, #fff 40%);
    border-color: #f0cfd2;
    border-inline-start-color: var(--red);
}
.qa-card {
    background: linear-gradient(180deg, #1a1a1a 0%, #242424 100%);
    border-color: #2e2e2e;
    border-inline-start-color: var(--red);
    color: #f3f3f3;
}
.qa-card .panel-head h2,
.qa-card .bolt { color: #fff; }
.qa-card .qa-btn:not(.qa-primary) {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #f0f0f0;
}
.qa-card .qa-btn small { color: #a8a8a8; }
.recent-card {
    background: #fff;
    border-color: #dbe3f0;
    border-inline-start-color: #3b82f6;
}
.feature-card {
    background: linear-gradient(180deg, #fff5f5 0%, #fff 48%);
    border-color: #efc8cb;
    border-inline-start-color: var(--red);
}

.panel-head, .panel-body { padding: 14px 16px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.panel-head a { color: var(--red); text-decoration: none; font-size: 0.86rem; }
.panel + .panel, .part-form .panel { margin-top: 14px; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 0.8rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--green-bar); }
.dot-low { background: #ef4444; }

.chart {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    height: 230px;
    direction: ltr;
    padding: 0 16px 16px;
}
.chart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.72rem;
    text-align: left;
    padding-bottom: 22px;
}
.chart-plot {
    display: flex;
    align-items: stretch;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}
.chart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.chart-pair {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
}
.bar {
    width: 16px;
    border-radius: 6px 6px 2px 2px;
    display: block;
}
.bar-ok { background: var(--green-bar); }
.bar-low { background: #ef4444; }
.chart-col small {
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.low-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.low-list a {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 10px 8px;
    border-radius: 12px;
}
.low-list a:hover { background: #f7f8fa; }
.low-ico {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f4f5f7;
    display: grid;
    place-items: center;
    flex: none;
    color: #4b5563;
}
.low-ico svg { width: 18px; height: 18px; }
.low-copy { min-width: 0; }
.low-copy strong, .low-copy small { display: block; }
.low-copy small { color: var(--muted); margin-top: 2px; }
.low-qty { text-align: center; }
.low-qty small { display: block; color: var(--muted); font-size: 0.68rem; white-space: nowrap; }
.low-qty b {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    margin-top: 4px;
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger);
}

.qa-card .panel-head { align-items: center; }
.bolt { color: var(--red); display: grid; }
.bolt svg { width: 18px; height: 18px; }
.qa-list { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.qa-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}
.qa-btn svg { width: 18px; height: 18px; flex: none; }
.qa-btn small { color: var(--muted); font-size: 0.75rem; margin-inline-start: 6px; }
.qa-primary {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.qa-primary:hover { background: var(--red-dark); }

.sheet-wrap { overflow: auto; }
.sheet { width: 100%; border-collapse: collapse; min-width: 640px; }
.sheet th, .sheet td {
    padding: 12px 14px;
    text-align: start;
    border-top: 1px solid var(--line);
    vertical-align: middle;
}
.sheet th { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.sheet a { font-weight: 600; text-decoration: none; }
.sheet small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.sheet .sku { color: var(--red); font-weight: 600; }

.feature-kicker { color: var(--red); }
.feature-body {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 8px;
    align-items: center;
    padding: 0 14px 16px;
}
.feature-visual {
    background: #fff;
    border: 1px solid #f0d0d3;
    border-radius: 14px;
    min-height: 140px;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.feature-visual img, .feature-visual svg { width: 100%; height: 150px; object-fit: contain; }
.feature-copy { text-align: start; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.feature-copy h3 { margin: 0; font-size: 1.05rem; }
.feature-copy p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.feature-price strong { font-size: 1.25rem; }
.feature-price small { color: var(--muted); margin-inline-start: 6px; }
.feature-copy .qa-primary { align-self: stretch; margin-top: 4px; }

.plain-list { list-style: none; margin: 0; padding: 6px; }
.plain-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
}
.plain-list a:hover { background: #f7f8fa; }
.plain-list strong, .part-name { display: block; }
.plain-list small, .part-cell small, .data small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}
.empty, .empty-block { color: var(--muted); padding: 18px; }
.empty-block {
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: 16px;
    text-align: center;
    padding: 42px 16px;
}
.empty-block h2 { margin: 0 0 8px; color: var(--ink); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}
.filters label, .part-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.filters .grow { flex: 1 1 220px; }
.filter-actions { display: flex; gap: 8px; }
input, select, textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(225, 6, 19, 0.16);
    border-color: var(--red);
}
.is-invalid { border-color: var(--danger); background: #fff8f8; }
.field-error { color: var(--danger); font-size: 0.8rem; }
.result-count { color: var(--muted); margin: 0 0 10px; }
.hint { margin: 0 0 12px; color: var(--muted); }

.table-wrap {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: auto;
    box-shadow: var(--shadow);
}
.data { width: 100%; border-collapse: collapse; min-width: 760px; }
.data th, .data td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.data th { font-size: 0.8rem; color: var(--muted); font-weight: 600; background: #fafbfc; }
.data tr:last-child td { border-bottom: 0; }
.part-cell { display: flex; gap: 10px; align-items: center; }
.part-cell img, .thumb {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    flex: none;
    background:
        linear-gradient(135deg, #f3f4f6 40%, #e10613 41% 48%, #f3f4f6 49%),
        #fff;
}
.part-name { font-weight: 600; text-decoration: none; }
.qty-pair { display: flex; align-items: center; gap: 8px; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #eef1f4;
    color: #4b5563;
}
.badge-ok { background: var(--ok-bg); color: var(--green); }
.badge-low { background: var(--warn-bg); color: var(--warn); }
.badge-out { background: var(--danger-bg); color: var(--danger); }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }

.compare-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
}
.compare-meta dt { color: var(--muted); font-size: 0.78rem; }
.compare-meta dd { margin: 4px 0 0; font-weight: 600; }
.compare-table tr.is-cheapest td {
    background: #f3faf5;
}
.compare-table .price-cell b { color: var(--green); font-size: 1.05rem; }
.part-card.is-cheapest {
    border-color: #86d3a0;
    box-shadow: 0 0 0 1px rgba(34, 140, 74, 0.12);
}
.compare-filters { margin-bottom: 18px; }
.cards { display: none; gap: 12px; }
.part-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.part-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 12px 0; }
.part-card dt { color: var(--muted); font-size: 0.78rem; }
.part-card dd { margin: 2px 0 0; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
.pager a { color: var(--red); text-decoration: none; }
.identity-body { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.identity-fields { flex: 1; min-width: 220px; }
.logo-preview, .logo-missing {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    flex: none;
    background: #111;
    border: 3px solid #111;
}
.logo-preview { object-fit: cover; }
.logo-missing {
    display: grid;
    place-items: center;
    color: #fff;
    font-family: var(--latin);
    font-size: 3rem;
}

.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.part-form label + label, .new-category, .image-row, .repeat-card { margin-top: 12px; }
.repeat-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: #fafbfc;
}
.is-hidden { display: none; }
.check { flex-direction: row !important; align-items: center; min-height: 42px; margin-top: 22px; }
.check input { width: auto; min-height: 0; }
.image-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.current-image, .preview {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.file-picker { position: relative; }
.file-control { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.file-button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
img[hidden] { display: none !important; }
.form-actions, .delete-form { display: flex; gap: 8px; margin-top: 16px; }
.banner {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.banner-success { background: var(--ok-bg); color: var(--green); }
.banner-error { background: var(--danger-bg); color: var(--danger); }
.solo { display: grid; place-items: center; padding: 32px 16px; }
.solo-card {
    width: min(100%, 460px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 28px;
}
.solo-card pre {
    background: var(--sidebar);
    color: #f4efe4;
    padding: 12px;
    border-radius: 10px;
    overflow: auto;
    direction: ltr;
    text-align: left;
}

@media (max-width: 1180px) {
    .dash-kpis { grid-template-columns: 1fr 1fr; }
    .dash-mid { grid-template-columns: 1fr 1fr; }
    .qa-card { grid-column: 1 / -1; }
    .dash-bot, .feature-body, .hero { grid-template-columns: 1fr; }
    .hero-art { display: none; }
}
@media (max-width: 860px) {
    .filters { display: grid; grid-template-columns: 1fr 1fr; }
    .filters .grow, .filter-actions { grid-column: 1 / -1; }
    .sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        bottom: 0;
        right: 0;
        left: auto;
        width: min(280px, 86vw);
        height: 100vh;
        height: 100dvh;
        overflow: auto;
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }
    html[dir="rtl"] .sidebar,
    html[dir="rtl"] .sidebar.is-open { right: 0; left: auto; }
    .sidebar.is-open,
    html[dir="rtl"] .sidebar.is-open { transform: translateX(0); }
    .side-foot, .side-note { display: none; }
    .nav-link span { min-width: 0; }
    .icon-btn { display: inline-flex; flex: none; }
    .content, .topbar { padding-inline: 12px; }
    .topbar { gap: 8px; min-height: 60px; padding-block: 10px; }
    .top-search { max-width: none; min-width: 0; padding-inline: 10px; }
    .top-search input { width: 100%; min-width: 0; }
    .top-tools { gap: 4px; flex: none; }
    .user-chip { gap: 6px; }
    .user-chip form { margin: 0; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-actions, .form-actions, .delete-form { flex-wrap: wrap; }
    .table-wrap { display: none; }
    .cards { display: grid; }
    .user-copy { display: none; }
    .hero, .dash, .panel, .kpi { max-width: 100%; }
}
@media (max-width: 640px) {
    .dash-kpis, .dash-mid, .grid-2, .grid-3, .grid-4, .part-card dl, .compare-meta { grid-template-columns: 1fr; }
    .qa-card { grid-column: auto; }
    .check { margin-top: 0; }
    .date-card { min-width: 0; }
}

.gate-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(225, 6, 19, 0.08), transparent 32%),
        var(--paper);
}
.gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.gate-card {
    width: min(440px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 32px 28px;
    text-align: center;
}
.gate-card .brand-name { color: #111; }
.gate-card .brand-sub { color: #6b7280; }
.gate-card h1 { margin: 18px 0 8px; font-size: 1.6rem; }
.gate-lead { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.gate-form { display: grid; gap: 14px; text-align: start; }
.gate-form label { display: grid; gap: 6px; font-weight: 600; }
.gate-form input {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}
.gate-form .btn { justify-content: center; }
.gate-back { display: inline-block; margin-top: 16px; color: var(--muted); text-decoration: none; }
.perm-set { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 16px; display: grid; gap: 10px; }
.perm-set legend { padding: 0 6px; font-weight: 700; }
.perm-set .badge { margin-inline-end: 6px; }
