/* ═══════════════════════════════════════════════════════════════════════════════
   شاشة الاستقبال — هوية "Clinical Luminance" (ملف Stitch المعتمد): كحلي #0A192F + سماوي #00F2FE على
   خلفية #F6F8FC، خط IBM Plex Sans Arabic، أزرار حبّة، كروت 24px، RTL حقيقي. هادئ وطبي - ألوان الحالة
   محدودة ومقصودة (مش زينة). كل شيء تحت .rc-shell أو .rc-* — صفر تعارض مع app.css.
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
    --rc-navy: #0A192F;
    --rc-navy-2: #112240;
    --rc-cyan: #00F2FE;
    --rc-accent: #0891b2;
    --rc-accent-ink: #0e7490;
    --rc-accent-tint: #e6fbfd;
    --rc-bg: #F6F8FC;
    --rc-surface: #ffffff;
    --rc-surface-2: #eef2f8;
    --rc-ink: #0A192F;
    --rc-muted: #5b6b82;
    --rc-border: #e3e8f0;
    --rc-ok: #0f9d6c;
    --rc-ok-tint: #e5f7ef;
    --rc-warn: #b7791f;
    --rc-warn-tint: #fdf4e3;
    --rc-danger: #c2410c;
    --rc-danger-tint: #fdeee7;
    --rc-info-tint: #eef3ff;
    --rc-radius: 22px;
    --rc-radius-sm: 14px;
    --rc-shadow: 0 1px 2px rgba(10, 25, 47, .05), 0 8px 24px rgba(10, 25, 47, .05);
}

.rc-shell {
    display: flex;
    min-height: 100vh;
    background: var(--rc-bg);
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    color: var(--rc-ink);
    direction: rtl;
    font-size: 15px;
}
.rc-shell * { box-sizing: border-box; }

/* ── السايدبار (كحلي) ── */
.rc-sidebar {
    width: 248px; flex-shrink: 0; background: var(--rc-navy); color: #c9d6ea;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.rc-brand { padding: 22px 20px 18px; display: flex; align-items: center; gap: 10px; }
.rc-brand .mark {
    width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--rc-cyan), #4facfe); color: var(--rc-navy); font-weight: 800;
}
.rc-brand .t { font-weight: 700; color: #fff; line-height: 1.2; }
.rc-brand .s { font-size: .75rem; color: #8aa0bf; }
.rc-nav { flex: 1; padding: 6px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.rc-nav-label { font-size: .7rem; color: #6f86a8; padding: 14px 12px 6px; letter-spacing: .4px; }
.rc-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
    color: #c9d6ea; text-decoration: none; font-weight: 500; transition: background .15s, color .15s;
}
.rc-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rc-link.active { background: rgba(0, 242, 254, .12); color: var(--rc-cyan); font-weight: 700; }
.rc-link .ic { width: 20px; text-align: center; }
.rc-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.rc-foot .who { font-size: .82rem; color: #8aa0bf; margin-bottom: 8px; }
.rc-logout {
    width: 100%; padding: 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
    background: transparent; color: #c9d6ea; cursor: pointer; font-family: inherit;
}
.rc-logout:hover { background: rgba(255, 255, 255, .06); }

/* ── المحتوى ── */
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-topbar {
    display: flex; align-items: center; gap: 12px; padding: 16px 28px;
    background: rgba(246, 248, 252, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5;
    border-bottom: 1px solid var(--rc-border);
}
.rc-topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 700; }
.rc-topbar .grow { flex: 1; }
.rc-body { padding: 24px 28px 48px; }
.rc-mode-pill {
    font-size: .74rem; padding: 4px 10px; border-radius: 999px; background: var(--rc-info-tint); color: #3046a8; font-weight: 600;
}
.rc-mode-pill.central { background: var(--rc-warn-tint); color: var(--rc-warn); }

/* ── عناصر عامة ── */
.rc-card { background: var(--rc-surface); border: 1px solid var(--rc-border); border-radius: var(--rc-radius); box-shadow: var(--rc-shadow); padding: 20px; }
.rc-card + .rc-card { margin-top: 16px; }
.rc-card h2 { font-size: 1rem; margin: 0 0 14px; font-weight: 700; }
/* قسم فرعي داخل كارت (مثلاً أنواع الحجز من التطبيق) */
.rc-subcard { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--rc-border); border-radius: var(--rc-radius); background: var(--rc-bg, transparent); }
.rc-subcard h3 { font-size: .92rem; margin: 0 0 10px; font-weight: 700; }
.rc-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rc-grow { flex: 1; }
.rc-muted { color: var(--rc-muted); }
.rc-small { font-size: .82rem; }
.rc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }

.rc-btn {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 999px;
    padding: 9px 18px; font-family: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none;
    transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap;
}
.rc-btn:active { transform: translateY(1px); }
.rc-btn:disabled { opacity: .5; cursor: not-allowed; }
.rc-btn.primary { background: var(--rc-navy); color: #fff; }
.rc-btn.primary:hover { box-shadow: 0 0 0 3px rgba(0, 242, 254, .25); }
.rc-btn.accent { background: var(--rc-cyan); color: var(--rc-navy); }
.rc-btn.ghost { background: var(--rc-surface); border-color: var(--rc-border); color: var(--rc-ink); }
.rc-btn.ghost:hover { background: var(--rc-surface-2); }
.rc-btn.danger { background: var(--rc-danger-tint); color: var(--rc-danger); }
.rc-btn.ok { background: var(--rc-ok-tint); color: var(--rc-ok); }
.rc-btn.sm { padding: 5px 12px; font-size: .8rem; }

.rc-input, .rc-select {
    border: 1px solid var(--rc-border); border-radius: 12px; padding: 9px 12px; font-family: inherit; font-size: .92rem;
    background: var(--rc-surface); color: var(--rc-ink); min-width: 0;
}
.rc-input:focus, .rc-select:focus { outline: none; border-color: var(--rc-accent); box-shadow: 0 0 0 3px rgba(8, 145, 178, .15); }
.rc-field { display: flex; flex-direction: column; gap: 5px; }
.rc-field label { font-size: .8rem; color: var(--rc-muted); font-weight: 600; }
.rc-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }

.rc-badge { display: inline-block; font-size: .74rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; background: var(--rc-surface-2); color: var(--rc-muted); }
.rc-badge.ok { background: var(--rc-ok-tint); color: var(--rc-ok); }
.rc-badge.warn { background: var(--rc-warn-tint); color: var(--rc-warn); }
.rc-badge.danger { background: var(--rc-danger-tint); color: var(--rc-danger); }
.rc-badge.info { background: var(--rc-accent-tint); color: var(--rc-accent-ink); }
.rc-badge.navy { background: var(--rc-navy); color: #fff; }

.rc-alert { border-radius: var(--rc-radius-sm); padding: 12px 16px; font-size: .9rem; }
.rc-alert.err { background: var(--rc-danger-tint); color: var(--rc-danger); }
.rc-alert.ok { background: var(--rc-ok-tint); color: var(--rc-ok); }
.rc-alert.warn { background: var(--rc-warn-tint); color: var(--rc-warn); }
.rc-alert.info { background: var(--rc-info-tint); color: #3046a8; }

.rc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rc-table th { text-align: start; font-size: .78rem; color: var(--rc-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--rc-border); }
.rc-table td { padding: 10px; border-bottom: 1px solid var(--rc-surface-2); vertical-align: middle; }
.rc-table tr:last-child td { border-bottom: none; }

/* ── لوحة اليوم: كارت طبيب ── */
.rc-doc { cursor: pointer; transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; gap: 12px; }
.rc-doc:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(10, 25, 47, .09); }
.rc-doc.off { opacity: .55; }
.rc-doc .name { font-weight: 700; font-size: 1.02rem; }
.rc-meter { height: 8px; background: var(--rc-surface-2); border-radius: 999px; overflow: hidden; }
.rc-meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--rc-accent), var(--rc-cyan)); border-radius: 999px; }
.rc-meter.full > span { background: var(--rc-warn); }
.rc-shift-line { display: flex; justify-content: space-between; font-size: .84rem; color: var(--rc-muted); }

/* ── دفتر الطبيب: مواعيد ── */
.rc-day-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.rc-day-head .doc { font-size: 1.2rem; font-weight: 700; }
.rc-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rc-slot {
    border: 1px solid var(--rc-border); border-radius: var(--rc-radius-sm); padding: 10px 12px; background: var(--rc-surface);
    display: flex; flex-direction: column; gap: 6px; min-height: 74px;
}
.rc-slot .tm { font-weight: 700; font-size: .92rem; display: flex; justify-content: space-between; align-items: center; }
.rc-slot.free { border-style: dashed; cursor: pointer; }
.rc-slot.free:hover { border-color: var(--rc-accent); background: var(--rc-accent-tint); }
.rc-slot.past { opacity: .5; }
.rc-slot.full { background: #fbfcfe; }
.rc-bk { border-radius: 10px; background: var(--rc-surface-2); padding: 6px 8px; font-size: .84rem; display: flex; flex-direction: column; gap: 3px; }
.rc-bk .n { font-weight: 600; }
.rc-bk .acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.rc-bk.app { background: var(--rc-accent-tint); }
.rc-bk.pending { background: var(--rc-warn-tint); }
.rc-bk.over { box-shadow: inset 3px 0 0 var(--rc-warn); }

/* ── دفتر الطبيب: دور ── */
.rc-queue { display: flex; flex-direction: column; gap: 8px; }
.rc-q {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px;
    border-radius: var(--rc-radius-sm); background: var(--rc-surface); border: 1px solid var(--rc-border);
}
.rc-q .num {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
    background: var(--rc-surface-2); color: var(--rc-navy);
}
.rc-q.present .num { background: var(--rc-ok-tint); color: var(--rc-ok); }
.rc-q.called .num { background: var(--rc-navy); color: var(--rc-cyan); }
.rc-q.in { border-color: var(--rc-accent); }
.rc-q.done, .rc-q.no_show { opacity: .5; }
.rc-q.skipped .num { background: var(--rc-warn-tint); color: var(--rc-warn); }
.rc-q .who .n { font-weight: 700; }
.rc-q .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rc-waves { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-wave { border: 1px solid var(--rc-border); border-radius: 12px; padding: 6px 10px; font-size: .8rem; background: var(--rc-surface); }
.rc-wave.full { background: var(--rc-warn-tint); border-color: transparent; }

/* ── لوحة جانبية (حجز) ── */
.rc-drawer-back { position: fixed; inset: 0; background: rgba(10, 25, 47, .35); z-index: 40; }
.rc-drawer {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(440px, 100vw); background: var(--rc-surface); z-index: 41;
    box-shadow: 0 0 40px rgba(10, 25, 47, .2); display: flex; flex-direction: column;
}
.rc-drawer header { padding: 18px 22px; border-bottom: 1px solid var(--rc-border); display: flex; align-items: center; }
.rc-drawer header h3 { margin: 0; font-size: 1.05rem; flex: 1; }
.rc-drawer .content { padding: 18px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.rc-drawer footer { padding: 14px 22px; border-top: 1px solid var(--rc-border); display: flex; gap: 8px; }
.rc-hits { border: 1px solid var(--rc-border); border-radius: 12px; max-height: 220px; overflow-y: auto; }
.rc-hit { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; font-size: .88rem; }
.rc-hit:hover, .rc-hit.sel, .rc-hit.hl { background: var(--rc-accent-tint); }
.rc-seg { display: inline-flex; background: var(--rc-surface-2); border-radius: 999px; padding: 3px; }
.rc-seg button { white-space: nowrap; border: none; background: transparent; padding: 6px 14px; border-radius: 999px; font-family: inherit; cursor: pointer; color: var(--rc-muted); font-weight: 600; }
.rc-seg button.on { background: var(--rc-surface); color: var(--rc-ink); box-shadow: var(--rc-shadow); }

/* ── إعداد الدوام ── */
.rc-week { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; align-items: start; }
.rc-week .day { font-weight: 700; padding-top: 8px; }
.rc-shift-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--rc-accent-tint);
    color: var(--rc-accent-ink); font-size: .84rem; margin: 3px; cursor: pointer; border: 1px solid transparent;
}
.rc-shift-chip:hover { border-color: var(--rc-accent); }
.rc-shift-chip.inactive { background: var(--rc-surface-2); color: var(--rc-muted); text-decoration: line-through; }

.rc-empty { text-align: center; padding: 40px 20px; color: var(--rc-muted); }
.rc-empty .big { font-size: 2rem; margin-bottom: 8px; }

.rc-print-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }
@media print {
    .rc-sidebar, .rc-topbar, .rc-print-hide { display: none !important; }
    .rc-shell, .rc-main, .rc-body { display: block !important; background: #fff !important; }
    .rc-print-title { display: block !important; }
    .rc-card { box-shadow: none !important; border: 1px solid #ccc !important; }
    body { background: #fff !important; }
}

@media (max-width: 900px) {
    .rc-sidebar { display: none; }
    .rc-body { padding: 16px; }
    .rc-topbar { padding: 12px 16px; }
    .rc-week { grid-template-columns: 1fr; }
}

/* ── البحث الموحّد Ctrl+K ── */
.rc-k-wrap { padding: 0 12px 6px; }
.rc-k-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #c9d6ea; font-family: inherit; font-size: .88rem; cursor: pointer; }
.rc-k-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
.rc-k-btn kbd, .rc-k-input kbd { font-family: inherit; font-size: .7rem; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.12); direction: ltr; }
.rc-k-back { position: fixed; inset: 0; background: rgba(10, 25, 47, .45); z-index: 60; }
.rc-k { position: fixed; z-index: 61; top: 10vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: 76vh; display: flex; flex-direction: column;
    background: var(--rc-surface); border-radius: 18px; box-shadow: 0 24px 60px rgba(10,25,47,.3); overflow: hidden; color: var(--rc-ink); font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
.rc-k-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--rc-border); }
.rc-k-input .ic { font-size: 1.2rem; color: var(--rc-muted); }
.rc-k-input input { flex: 1; border: none; outline: none; font-size: 1.05rem; font-family: inherit; background: transparent; color: var(--rc-ink); }
.rc-k-input kbd { background: var(--rc-surface-2); color: var(--rc-muted); }
.rc-k-list { overflow-y: auto; padding: 6px 0; }
.rc-k-group { font-size: .72rem; color: var(--rc-muted); font-weight: 700; padding: 10px 16px 4px; }
.rc-k-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; cursor: pointer; }
.rc-k-item.on { background: var(--rc-accent-tint); }
.rc-k-item .ic { width: 22px; text-align: center; }
.rc-k-item .tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rc-k-foot { padding: 8px 16px; font-size: .74rem; color: var(--rc-muted); border-top: 1px solid var(--rc-border); background: var(--rc-bg); }

/* ── خيارات بسيطة (راديو بإطار) - زي حملة الإشعارات ── */
.rc-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-opt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--rc-border); background: var(--rc-surface); cursor: pointer; font-weight: 600; font-size: .9rem; }
.rc-opt.on { border-color: var(--rc-accent); background: var(--rc-accent-tint); color: var(--rc-accent-ink); }
.rc-opt input { width: 16px; height: 16px; margin: 0; }
.rc-step { font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.rc-step .n { width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--rc-navy); color: #fff; font-size: .8rem; }
.rc-open-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rc-open { text-align: start; border: 1.5px dashed var(--rc-border); border-radius: 14px; padding: 10px 12px; background: var(--rc-surface); cursor: pointer; font-family: inherit; color: var(--rc-ink); }
.rc-open:hover { border-color: var(--rc-accent); background: var(--rc-accent-tint); }
.rc-open.on { border-style: solid; border-color: var(--rc-accent); background: var(--rc-accent-tint); box-shadow: 0 0 0 3px rgba(8,145,178,.15); }
.rc-open .t { font-weight: 700; }

/* ── المساعد ── */
.rc-chat { display: flex; flex-direction: column; gap: 12px; }
.rc-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.7; }
.rc-msg.me { align-self: flex-start; background: var(--rc-navy); color: #fff; border-bottom-right-radius: 4px; }
.rc-msg.bot { align-self: flex-end; background: var(--rc-surface-2); border-bottom-left-radius: 4px; }
.rc-msg.sys { align-self: center; background: var(--rc-ok-tint); color: var(--rc-ok); font-size: .88rem; }
.rc-msg.sys.err { background: var(--rc-danger-tint); color: var(--rc-danger); }
.rc-action { align-self: flex-end; max-width: 82%; border: 1.5px solid var(--rc-accent); background: var(--rc-surface); border-radius: 14px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rc-action.done { opacity: .55; border-color: var(--rc-border); }
/* شارة وضع المساعد: AI (Gemini) أو داخلي (بحث مدمج) */
.rc-ai-tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--rc-surface-2); color: var(--rc-muted); letter-spacing: .3px; vertical-align: middle; }
.rc-ai-tag.ai { background: linear-gradient(135deg, #7c3aed, #0891b2); color: #fff; }
.rc-ai-tag.sm { font-size: .64rem; padding: 1px 7px; margin-inline-start: 8px; }
.rc-ai-tag.nav { font-size: .62rem; padding: 1px 7px; margin-inline-start: 4px; background: rgba(255,255,255,.1); color: #c9d6ea; }
.rc-ai-tag.nav.ai { background: linear-gradient(135deg, #7c3aed, #0891b2); color: #fff; }

/* 2026-11-02 الحجز السريع بقاعدة شاشة العلاجات: الإدخال يمين والأماكن الشاغرة جنبه بتمرير لوحدها */
.qb-entry { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; gap: 14px; align-items: start; }
.qb-form { display: flex; flex-direction: column; gap: 10px; }
.qb-form .rc-card, .qb-list { margin: 0; padding: 12px 14px; }
.qb-form .rc-step { margin-bottom: 8px; }
.qb-form .rc-opts { flex-wrap: wrap; gap: 6px; }
.qb-form .rc-opts .rc-select { min-width: 0 !important; flex: 1 1 180px; }
.qb-confirm { border-color: var(--rc-accent) !important; }
.qb-confirm .rc-row { flex-wrap: wrap; gap: 8px; }
.qb-list { max-height: calc(100vh - 170px); overflow-y: auto; position: sticky; top: 72px; }
@media (max-width: 900px) { .qb-entry { grid-template-columns: 1fr; } .qb-list { max-height: none; position: static; } }
.rc-doc-bks { margin-top: 8px; border-top: 1px dashed var(--rc-border); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.rc-doc-bks .bk { display: flex; gap: 8px; align-items: baseline; font-size: .8rem; min-width: 0; }
.rc-doc-bks .tm { color: var(--rc-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 58px; }
.rc-doc-bks .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-doc-bks .sx { font-size: .72rem; color: var(--rc-accent); flex-shrink: 0; }
