﻿/* =========================================================
   Queue System - Theme (أزرق جانبي + خلفية فاتحة + كروت بيضاء)
   ========================================================= */
:root {
    --bg: #eef3f9;
    --card: #ffffff;
    --text: #1f2a44;
    --muted: #6b7a90;
    --line: #e4eaf3;

    --side-1: #4a63f0;
    --side-2: #3346cc;

    --primary: #2f5bea;
    --primary-d: #2348c4;
    --green: #22b45a;
    --green-d: #188a43;
    --green-head: #1e8e3e;
    --teal: #14b8a6;
    --orange: #f59e0b;
    --orange-d: #dc8a06;
    --red: #ef4444;
    --red-d: #d12f2f;
    --slate: #475569;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(31, 42, 68, .06);
    --side-w: 250px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }

.sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
    width: var(--side-w);
    background: linear-gradient(180deg, var(--side-1), var(--side-2));
    color: #fff;
    display: flex; flex-direction: column;
    z-index: 50;
    transition: transform .25s;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: #fff; color: var(--side-2);
    display: grid; place-items: center; font-size: 20px; font-weight: 800;
    overflow: hidden; flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 800; font-size: 17px; line-height: 1.2; }
.brand-sub { font-size: 12px; opacity: .8; }

.nav { list-style: none; margin: 0; padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav li a {
    display: flex; align-items: center; gap: 12px;
    color: rgba(255,255,255,.88);
    padding: 10px 14px; border-radius: var(--radius-sm);
    margin-bottom: 4px; font-weight: 600;
}
.nav li a i { width: 20px; text-align: center; opacity: .9; }
.nav li a:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav li a.active { background: rgba(255,255,255,.20); color: #fff; }
.nav-sep { font-size: 12px; opacity: .6; padding: 12px 14px 4px; }
.side-foot { padding: 12px 10px 18px; border-top: 1px solid rgba(255,255,255,.12); }
.side-foot a { color: #fff; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.side-foot a:hover { background: rgba(255,255,255,.10); }

.main { margin-inline-start: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: #fff; height: 62px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.menu-btn { display: none; background: none; border: 0; font-size: 22px; color: var(--text); cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 800;
}

.lang-switch { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; }
.lang-switch a { padding: 3px 10px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.lang-switch a.on { background: #fff; color: var(--primary); box-shadow: var(--shadow); }

.content { padding: 24px; flex: 1; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.page-head h1 i { color: var(--primary); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-head {
    margin: -20px -20px 18px; padding: 14px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 700; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--line);
}
.card-head.green { background: var(--green-head); color: #fff; border: 0; }
.card-head.blue { background: var(--primary); color: #fff; border: 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.stat .num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 15px; font-weight: 700; line-height: 1.4; }
.ico {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center; color: #fff; font-size: 19px; flex-shrink: 0;
}
.ico.blue { background: var(--primary); }
.ico.indigo { background: #4f46e5; }
.ico.green { background: var(--green); }
.ico.teal { background: var(--teal); }
.ico.orange { background: var(--orange); }
.ico.red { background: var(--red); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    color: #fff; transition: background .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-d); color: #fff; }
.btn-success { background: var(--green); }
.btn-success:hover { background: var(--green-d); color: #fff; }
.btn-warning { background: var(--orange); }
.btn-warning:hover { background: var(--orange-d); color: #fff; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--red-d); color: #fff; }
.btn-dark { background: var(--slate); }
.btn-dark:hover { background: #334155; color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: #cfd8e6; }
.btn-outline:hover { background: var(--bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 7px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.green { background: var(--green); }
.badge.blue { background: var(--primary); }
.badge.orange { background: var(--orange); }
.badge.red { background: var(--red); }
.badge.gray { background: #94a3b8; }
.badge.light { background: var(--bg); color: var(--slate); }
.prefix-tag {
    display: inline-grid; place-items: center; min-width: 38px; height: 30px; padding: 0 8px;
    border-radius: 8px; background: #e8eeff; color: var(--primary); font-weight: 800;
}

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: start; font-size: 13px; color: var(--muted); font-weight: 700;
    padding: 10px 12px; background: #f6f8fc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafbfe; }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl .sub { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; background: #f7f9fd; border-radius: var(--radius-sm); }
.empty i { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--slate); }
.field .hint { font-size: 12px; color: var(--muted); }
.req { color: var(--red); }
.input, .field input[type=text], .field input[type=password], .field input[type=email], .field input[type=number],
.field input[type=date], .field input[type=time], .field input[type=tel], .field input[type=url], .field select, .field textarea {
    width: 100%; padding: 9px 12px; font-family: inherit; font-size: 14px; min-height: 42px;
    border: 1px solid #d4dce8; border-radius: var(--radius-sm); background: #fff; color: var(--text);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 234, .12); }
.field input[dir=ltr] { text-align: left; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { font-weight: 600; margin-inline-start: 4px; }
.checks input { width: 17px; height: 17px; accent-color: var(--primary); vertical-align: middle; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.lang-cols .field label .flag { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.alert.success { background: #e6f7ed; color: var(--green-d); }
.alert.error { background: #fdecec; color: var(--red-d); }
.alert.info { background: #e8eeff; color: var(--primary-d); }
.alert.warn { background: #fff5e0; color: #a86400; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { padding: 8px 12px; border: 1px solid #d4dce8; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; min-width: 200px; background: #fff; }

/* ---------- Grid helpers ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-side { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-weight: 600; }
.kv b { font-weight: 700; }

/* ---------- Steps (البداية) ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: #f6f8fc; font-weight: 600; }
.steps li .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #dfe6f3; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.steps li.done .dot { background: var(--green); color: #fff; }
.steps li a { margin-inline-start: auto; }

/* ---------- QR ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.qr-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-align: center; display: flex; flex-direction: column; }
.qr-top { background: linear-gradient(135deg, var(--side-1), var(--side-2)); color: #fff; padding: 14px 12px; }
.qr-top .place { font-weight: 800; font-size: 16px; }
.qr-top .what { font-size: 13px; opacity: .9; }
.qr-top img.logo { max-height: 38px; max-width: 120px; background: #fff; border-radius: 8px; padding: 3px; margin-bottom: 6px; }
.qr-body { padding: 16px; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-box { width: 180px; height: 180px; display: grid; place-items: center; }
.qr-box img, .qr-box canvas { width: 180px !important; height: 180px !important; }
.qr-dept { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.qr-scan { font-size: 12px; color: var(--muted); line-height: 1.5; }
.qr-url { font-size: 11px; color: var(--muted); word-break: break-all; direction: ltr; }
.qr-acts { display: flex; gap: 6px; justify-content: center; padding: 0 12px 14px; flex-wrap: wrap; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
    background: linear-gradient(160deg, var(--side-1), var(--side-2));
    color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.auth-side h2 { font-size: 30px; line-height: 1.4; }
.auth-side p { opacity: .9; font-size: 16px; margin: 0; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-feats li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.auth-feats li i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 440px; }
.auth-box.wide { max-width: 640px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.auth-box h1 { font-size: 24px; margin-bottom: 4px; }
.auth-box .lead { color: var(--muted); margin: 0 0 22px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); }
.section-title { font-weight: 800; font-size: 15px; color: var(--primary); margin: 6px 0 12px; display: flex; gap: 8px; align-items: center; grid-column: 1 / -1; }

/* ---------- Logo preview ---------- */
.logo-prev { width: 110px; height: 110px; border-radius: var(--radius); border: 2px dashed #cfd8e6; display: grid; place-items: center; overflow: hidden; background: #f7f9fd; color: var(--muted); font-size: 30px; }
.logo-prev img { max-width: 100%; max-height: 100%; }

/* ---------- Overlay (موبايل) ---------- */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .grid-2, .grid-side { grid-template-columns: 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(100%); }
    [dir=ltr] .sidebar { transform: translateX(-100%); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .overlay { display: block; }
    .main { margin-inline-start: 0; }
    .menu-btn { display: block; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .user-chip .nm { display: none; }
}

/* ---------- Print (QR) ---------- */
@media print {
    .sidebar, .topbar, .page-head, .toolbar, .qr-acts, .no-print, .alert { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0; }
    body { background: #fff; }
    .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .qr-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; }
    .qr-top { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =========================================================
   لوحة الموظف
   ========================================================= */
.staff-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.staff-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.staff-top select { padding: 8px 12px; border: 1px solid #d4dce8; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; font-weight: 700; background: #fff; min-width: 170px; }
.mini-stat { background: #fff; border-radius: 10px; padding: 6px 12px; box-shadow: var(--shadow); font-size: 13px; color: var(--muted); font-weight: 600; }
.mini-stat b { color: var(--text); font-size: 15px; margin-inline-start: 4px; }

.cur-card { text-align: center; padding: 0; overflow: hidden; }
.cur-head { background: linear-gradient(135deg, var(--side-1), var(--side-2)); color: #fff; padding: 22px 20px; position: relative; }
.cur-card.serving .cur-head { background: linear-gradient(135deg, #22b45a, #188a43); }
.cur-card.empty .cur-head { background: linear-gradient(135deg, #94a3b8, #64748b); }
.cur-label { font-size: 13px; opacity: .9; font-weight: 700; }
.cur-num { font-size: 68px; font-weight: 800; line-height: 1.1; direction: ltr; letter-spacing: 2px; }
.cur-name { font-size: 18px; font-weight: 700; }
.cur-phone { font-size: 14px; opacity: .9; direction: ltr; display: inline-block; }
.cur-tags { display: flex; gap: 6px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.cur-tags .badge { background: rgba(255,255,255,.22); }
.cur-timer { position: absolute; top: 12px; inset-inline-end: 14px; background: rgba(0,0,0,.18); padding: 2px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; direction: ltr; }
.cur-body { padding: 18px; }
.cur-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cur-actions .btn { padding: 12px 8px; flex-direction: column; gap: 4px; font-size: 13px; }
.cur-actions .btn i { font-size: 18px; }
.btn-next { width: 100%; padding: 18px; font-size: 20px; border-radius: 14px; margin-top: 12px; }
.btn-next kbd, .kbd { font-family: inherit; font-size: 11px; background: rgba(255,255,255,.25); padding: 1px 6px; border-radius: 5px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 30px;
    border: 1.5px solid #d4dce8; background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; user-select: none; color: var(--slate);
}
.chip .cnt { background: var(--bg); border-radius: 20px; padding: 0 8px; font-size: 12px; }
.chip.on { border-color: var(--primary); background: #e8eeff; color: var(--primary-d); }
.chip.on .cnt { background: var(--primary); color: #fff; }
.chip.closed { opacity: .6; }

.q-list { display: grid; gap: 8px; max-height: 62vh; overflow-y: auto; padding-inline-end: 2px; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #f7f9fd; border: 1px solid var(--line); }
.q-item.prio { background: #fff7e6; border-color: #fde3a7; }
.q-item.late { border-color: #f5b5b5; box-shadow: inset 3px 0 0 var(--red); }
.q-item.away { opacity: .75; }
.q-num { font-weight: 800; font-size: 18px; min-width: 64px; direction: ltr; text-align: center; color: var(--side-2); }
.q-info { flex: 1; min-width: 0; }
.q-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.q-acts { display: flex; gap: 6px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.modal-h { padding: 14px 18px; font-weight: 800; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-h button { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal-b { padding: 18px; display: grid; gap: 12px; }
.modal-f { padding: 0 18px 18px; display: flex; gap: 8px; }
.modal-f .btn { flex: 1; }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 700; }
.radio-list input { accent-color: var(--primary); width: 17px; height: 17px; }
.radio-list label:has(input:checked) { border-color: var(--primary); background: #e8eeff; }

/* تذكرة مطبوعة للزبون اليدوي */
.slip { text-align: center; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; }
.slip .sp { font-weight: 800; }
.slip .sn { font-size: 54px; font-weight: 800; direction: ltr; line-height: 1.1; color: var(--side-2); }
.slip .sd { font-weight: 700; color: var(--slate); }
.slip .sm { font-size: 12px; color: var(--muted); }
.slip #slipQr { display: flex; justify-content: center; margin-top: 8px; }
.slip #slipQr img, .slip #slipQr canvas { width: 120px !important; height: 120px !important; }

.toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 120;
    background: #1f2a44; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.2);
    opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
[dir=rtl] .toast { transform: translateX(50%); }
.toast.show { opacity: 1; }
.toast.error { background: var(--red-d); }
.toast.success { background: var(--green-d); }

@media (max-width: 992px) { .staff-grid { grid-template-columns: 1fr; } }

@media print {
    body.printing-slip * { visibility: hidden; }
    body.printing-slip .slip, body.printing-slip .slip * { visibility: visible; }
    body.printing-slip .slip { position: fixed; top: 0; left: 0; right: 0; border: 0; }
    body.printing-slip .modal-bg { background: none; }
}

/* ---------- الصلاحيات ---------- */
.perm-box { background: #f7f9fd; border-radius: var(--radius-sm); padding: 14px 16px; }
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.perm-list li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.perm-list input { width: 18px; height: 18px; accent-color: var(--primary); }
.perm-list input:disabled + label { opacity: .5; }

/* ---------- التقارير ---------- */
.rep-filters { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; gap: 12px 14px; align-items: end; }
.rep-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chart-box { position: relative; height: 260px; }
.comment { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .c-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.comment .c-stars { color: #f59e0b; font-size: 13px; }
.stat .num small { font-weight: 700; }
@media (max-width: 992px) { .rep-filters { grid-template-columns: 1fr 1fr; } .rep-btns { grid-column: 1 / -1; } }

/* ---------- الديمو ---------- */
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.demo-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.demo-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(47, 91, 234, .12); color: var(--text); }
.demo-card i { font-size: 26px; color: var(--primary); margin-bottom: 6px; }
.demo-card b { font-size: 16px; }
.demo-card span { font-size: 13px; color: var(--muted); }
.demo-bar { flex-wrap: wrap; }

/* ---------- التنبيهات ---------- */
.alerts-card { border-inline-start: 4px solid var(--red); }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { padding: 8px 10px; background: #fff7f7; border-radius: var(--radius-sm); }
.alert-list .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- خريطة الذروة ---------- */
.grid-side-rev { grid-template-columns: 1fr 300px; }
@media (max-width: 992px) { .grid-side-rev { grid-template-columns: 1fr; } }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12px; }
.heat th { color: var(--muted); font-weight: 700; padding: 2px 4px; white-space: nowrap; }
.heat td { text-align: center; border-radius: 6px; padding: 6px 2px; min-width: 30px; font-weight: 700; color: var(--text); }

/* ---------- الربط (API) ---------- */
.code { direction: ltr; text-align: left; background: #0f172a; color: #e2e8f0; border-radius: var(--radius-sm); padding: 12px 14px; font-family: Consolas, 'Courier New', monospace; font-size: 13px; overflow-x: auto; white-space: pre; margin: 6px 0 12px; }
.key-box { direction: ltr; font-family: Consolas, monospace; font-size: 15px; background: #fffbea; border: 1px dashed var(--orange); border-radius: var(--radius-sm); padding: 10px 12px; word-break: break-all; user-select: all; }
.ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.ev-list label { font-family: Consolas, monospace; font-size: 13px; }

/* ---------- رابط شاشة العرض ---------- */
.disp-link { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.disp-link input { flex: 1; min-width: 220px; direction: ltr; padding: 8px 12px; border: 1px solid #d4dce8; border-radius: var(--radius-sm); font-family: inherit; background: #f7f9fd; color: var(--slate); }

/* ---------- الباقات ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.plan-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; position: relative; display: block; transition: border-color .15s, box-shadow .15s; }
.plan-card input { position: absolute; top: 14px; inset-inline-end: 14px; width: 18px; height: 18px; accent-color: var(--primary); }
.plan-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 4px 16px rgba(47, 91, 234, .12); background: #f7f9ff; }
.pc-name { font-weight: 800; font-size: 16px; padding-inline-end: 26px; }
.pc-price { font-size: 26px; font-weight: 800; color: var(--primary); margin-top: 6px; }
.pc-price small { font-size: 13px; color: var(--muted); }
.pc-sub { font-size: 13px; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 13px; }
.plan-card ul i { color: var(--muted); width: 16px; }
