/* المواعيد التنفيذية – التصميم العام (RTL، فاتح/داكن) */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #0f1b2d;
  --muted: #5b6b80;
  --primary: #1e3a5f;
  --primary-2: #2c5282;
  --primary-soft: #e8eef6;
  --accent: #a8844d;
  --success: #047857;
  --success-soft: #e6f4ef;
  --warning: #b45309;
  --warning-soft: #fdf3e4;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --info: #0e7490;
  --info-soft: #e5f4f7;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 2px 8px rgba(15, 27, 45, .04);
  --radius: 12px;
  --sidebar-w: 248px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d1420;
  --surface: #141d2b;
  --surface-2: #192436;
  --border: #253247;
  --text: #e6ecf4;
  --muted: #93a2b8;
  --primary: #7aa7dc;
  --primary-2: #9cc0ea;
  --primary-soft: #1c2b42;
  --accent: #d1ad74;
  --success: #34d399;
  --success-soft: #11312a;
  --warning: #fbbf24;
  --warning-soft: #3a2c10;
  --danger: #f87171;
  --danger-soft: #3b1717;
  --info: #22d3ee;
  --info-soft: #0f2f37;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans Arabic', Tahoma, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.4; font-weight: 700; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .76rem; }
.nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- الهيكل ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--primary); color: #fff;
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40;
  display: flex; flex-direction: column; overflow-y: auto;
}
[data-theme="dark"] .sidebar { background: #0f1828; border-inline-end: 1px solid var(--border); }
.brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; }
.brand .logo-fallback { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; font-weight: 700; }
.brand b { display: block; font-size: .98rem; }
.brand span { font-size: .75rem; opacity: .75; }
.nav { padding: 10px 8px; flex: 1; }
.nav .group { font-size: .72rem; opacity: .55; padding: 12px 12px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.86);
  padding: 8px 12px; border-radius: 8px; font-size: .92rem; margin-bottom: 1px;
}
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.nav a .badge { margin-inline-start: auto; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.side-foot .who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }

.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 10px 22px; min-height: 58px;
}
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .today { font-size: .82rem; color: var(--muted); }
.content { padding: 22px; max-width: 1400px; margin: 0 auto; }
.menu-btn { display: none; }
.backdrop { display: none; }

/* شريط سفلي لواجهة المدير التنفيذي على الجوال */
.bottom-nav { display: none; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(100%); transition: transform .2s; }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px; }
  .topbar { padding: 8px 12px; }
  .topbar .today { display: none; }
  body.role-ceo .bottom-nav {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  body.role-ceo .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--muted); padding: 6px 0; }
  body.role-ceo .bottom-nav a.active { color: var(--primary); font-weight: 700; }
  body.role-ceo .bottom-nav a:hover { text-decoration: none; }
  body.role-ceo .content { padding-bottom: 90px; }
}

/* ---------- عناصر عامة ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 9px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .btn.primary { color: #0d1420; }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 10px; font-size: .82rem; }
.btn.icon { padding: 7px; }
.topbar .btn.icon { border-color: transparent; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.nav .badge { background: var(--accent); color: #fff; border: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- النماذج ---------- */
.form { display: grid; gap: 14px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.field .req::after { content: ' *'; color: var(--danger); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 88px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
input[type="color"] { padding: 2px; height: 38px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .9rem; }
.time-pick { display: flex; gap: 6px; }
.time-pick select { padding-inline: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); border-radius: 99px; padding: 3px 12px; font-size: .84rem; cursor: pointer; background: var(--surface); user-select: none; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .chip.on { color: #0d1420; }
.search { position: relative; }
.search input { padding-inline-start: 34px; }
.search svg { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.range { display: flex; align-items: center; gap: 10px; }
.range input[type=range] { flex: 1; padding: 0; }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { background: var(--surface-2); color: var(--muted); font-weight: 600; text-align: start; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: .82rem; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty svg { width: 34px; height: 34px; opacity: .5; display: block; margin: 0 auto 6px; }

/* ---------- لوحة التحكم ---------- */
.stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.stat .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.stat .ic.success { background: var(--success-soft); color: var(--success); }
.stat .ic.warning { background: var(--warning-soft); color: var(--warning); }
.stat .ic.danger { background: var(--danger-soft); color: var(--danger); }
.stat .ic.info { background: var(--info-soft); color: var(--info); }
.stat .v { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: .8rem; color: var(--muted); }
a.stat:hover { text-decoration: none; border-color: var(--primary-2); }
.next-up { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: 0; }
[data-theme="dark"] .next-up { background: linear-gradient(135deg, #1c2b42, #23395a); }
.next-up .muted { color: rgba(255,255,255,.75); }
.countdown { display: flex; gap: 10px; margin-top: 10px; direction: rtl; }
.countdown div { background: rgba(255,255,255,.12); border-radius: 10px; padding: 6px 12px; text-align: center; min-width: 62px; }
.countdown b { display: block; font-size: 1.35rem; }
.countdown span { font-size: .72rem; opacity: .8; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }

.mlist { list-style: none; margin: 0; padding: 0; }
.mlist li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.mlist li:last-child { border-bottom: 0; }
.mlist .time { min-width: 76px; font-weight: 700; color: var(--primary); font-size: .9rem; }
.mlist .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.mlist .t1 { font-weight: 600; }
.mlist a { color: inherit; }

/* ---------- التقويم ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-toolbar .label { font-weight: 700; font-size: 1.1rem; }
.cal-toolbar .label small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 14px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--text); }
.seg button + button { border-inline-start: 1px solid var(--border); }
.seg button.on { background: var(--primary); color: #fff; }
[data-theme="dark"] .seg button.on { color: #0d1420; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.month .dow { background: var(--surface-2); text-align: center; font-size: .8rem; color: var(--muted); padding: 6px 0; font-weight: 600; border-bottom: 1px solid var(--border); }
.month .cell { min-height: 112px; border-inline-start: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 5px; cursor: pointer; overflow: hidden; }
.month .cell:nth-child(7n+1) { border-inline-start: 0; }
.month .cell.out { background: var(--surface-2); opacity: .6; }
.month .cell.today { background: var(--primary-soft); }
.month .num { display: flex; justify-content: space-between; font-size: .8rem; }
.month .num b { font-size: .9rem; }
.month .num span { color: var(--muted); font-size: .7rem; }
.ev { display: block; font-size: .74rem; border-radius: 5px; padding: 1px 5px; margin-top: 3px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ev.cancelled { opacity: .5; text-decoration: line-through; }
.ev.conflict { outline: 2px solid var(--danger); outline-offset: -1px; }
.more { font-size: .72rem; color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) {
  .month .cell { min-height: 64px; padding: 2px; }
  .month .ev { font-size: 0; height: 6px; padding: 0; margin-top: 2px; }
  .month .num span { display: none; }
}
.week { display: grid; border: 1px solid var(--border); border-radius: 10px; overflow: auto; background: var(--surface); max-height: 72vh; }
.week .hdr { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: center; font-size: .8rem; padding: 6px 2px; }
.week .hdr.today { color: var(--primary); font-weight: 700; }
.week .hcol { font-size: .72rem; color: var(--muted); text-align: center; border-inline-end: 1px solid var(--border); }
.week .hcol div { height: 56px; border-bottom: 1px solid var(--border); padding-top: 2px; }
.week .dcol { position: relative; border-inline-end: 1px solid var(--border); }
.week .dcol .slot { height: 56px; border-bottom: 1px solid var(--border); }
.week .dcol .slot:hover { background: var(--surface-2); cursor: pointer; }
.week .wev { position: absolute; inset-inline: 2px; border-radius: 6px; color: #fff; font-size: .74rem; padding: 2px 5px; overflow: hidden; cursor: pointer; line-height: 1.35; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.week .wev.conflict { outline: 2px solid var(--danger); }
.week .nowline { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- تفاصيل ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; padding: 8px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); min-width: 70px; }
.progress > div { height: 100%; background: var(--success); }
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 16px 14px; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.att { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; font-size: .88rem; }
.att .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop { border: 2px dashed var(--border); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; font-size: .88rem; }
.drop:hover { border-color: var(--primary-2); }
.alert { padding: 10px 14px; border-radius: 10px; font-size: .9rem; display: flex; gap: 8px; align-items: flex-start; }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.success { background: var(--success-soft); color: var(--success); }

/* ---------- نافذة منبثقة وتنبيهات ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 18, 30, .5); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal .mh { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal .mh h3 { flex: 1; margin: 0; }
.modal .mb { padding: 18px; overflow-y: auto; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f1b2d; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 380px; animation: fade .15s; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--success); }
.loader { display: grid; place-items: center; padding: 50px; color: var(--muted); }
.spin { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الدخول ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--primary-soft), var(--bg) 60%); }
.auth-card { width: min(420px, 100%); }
.auth-card .brand-big { text-align: center; margin-bottom: 18px; }
.auth-card .brand-big .logo-fallback, .auth-card .brand-big img { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 8px; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 1.5rem; font-weight: 700; object-fit: contain; }

/* ---------- الإشعارات ---------- */
.notif { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.notif.unread { background: var(--primary-soft); }
.notif .ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.bell-dot { position: absolute; top: 4px; inset-inline-end: 4px; min-width: 16px; height: 16px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .65rem; display: grid; place-items: center; padding: 0 4px; }

/* ---------- الطباعة (المحاضر والتقارير) ---------- */
.doc { background: #fff; color: #111; padding: 36px 42px; max-width: 900px; margin: 0 auto; border: 1px solid var(--border); font-size: 14.5px; line-height: 1.9; }
.doc .doc-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px double #1e3a5f; padding-bottom: 12px; margin-bottom: 18px; }
.doc .doc-head img { width: 76px; height: 76px; object-fit: contain; }
.doc .doc-head .o { flex: 1; }
.doc .doc-head .o b { font-size: 1.2rem; color: #1e3a5f; display: block; }
.doc .doc-head .meta { text-align: left; font-size: .85rem; color: #333; }
.doc h2.doc-title { text-align: center; color: #1e3a5f; margin: 6px 0 18px; font-size: 1.3rem; }
.doc h3 { color: #1e3a5f; border-bottom: 1px solid #cbd5e1; padding-bottom: 3px; margin: 18px 0 8px; font-size: 1.02rem; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.doc th, .doc td { border: 1px solid #94a3b8; padding: 6px 8px; text-align: right; vertical-align: top; }
.doc th { background: #eef2f7; width: 150px; }
.doc .sig { display: flex; justify-content: space-between; margin-top: 46px; text-align: center; }
.doc .sig div { min-width: 200px; }
.doc .foot { margin-top: 26px; font-size: .8rem; color: #555; text-align: center; border-top: 1px solid #cbd5e1; padding-top: 6px; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts, .backdrop { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .doc { border: 0; padding: 0; max-width: none; }
  .print-only { display: block !important; }
  .chart-box canvas { max-width: 100% !important; }
  a { color: inherit; }
  [data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #111; --border: #ccc; --muted: #444; --surface-2: #f3f4f6; }
}
.print-only { display: none; }
.chart-box { position: relative; height: 280px; }
@media (max-width: 700px) { .grid > [style*="grid-column:span"] { grid-column: auto !important; } }

/* لوحة المؤشرات */
.ins-h { margin: 22px 0 10px; font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.ibars { display: grid; gap: 8px; }
.ib { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: .85rem; }
.ib-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-t { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.ib-f { display: block; height: 100%; border-radius: 4px; }
.ib-v { font-weight: 600; min-width: 38px; text-align: left; }
@media print { .ins-h { break-after: avoid; } .grid { break-inside: avoid; } .ib-f, .stat .ic { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* غياب المدير في التقويم */
.ev.absent { background: repeating-linear-gradient(135deg, var(--warning-soft, #fef3c7) 0 6px, transparent 6px 12px) !important; color: var(--warning, #b45309) !important; border: 1px dashed currentColor; font-weight: 600; }

/* شاشة الاستقبال */
.rc-h { margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; font-size: 1.05rem; }
.rc-m { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.rc-m.past { opacity: .65; }
.rc-m.now { border-inline-start: 4px solid var(--warning); }
.rc-time { min-width: 74px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.rc-time b { font-size: 1.15rem; color: var(--primary); }
.rc-time span { font-size: .8rem; color: var(--muted); }
.rc-guests { margin-top: 8px; display: grid; gap: 6px; }
.rc-guest { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rc-guest.in { background: var(--success-soft); border-color: transparent; }
.rc-guest .btn.success { min-width: 92px; font-size: 1rem; }

/* حقوق التصميم والتطوير */
.credit { text-align: center; font-size: .72rem; color: var(--muted); padding: 14px 8px 18px; letter-spacing: .2px; }
.auth-card .credit { padding: 14px 0 0; border-top: 1px solid var(--border); margin-top: 14px; }
.credit.side { color: rgba(255,255,255,.55); padding: 10px 0 0; font-size: .68rem; }
@media print { .credit { display: none !important; } }
