/* ── هيكل لوحة التحكم ── */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--plum); color: #f4e3eb; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 40px; height: 40px; }
.brand b { display: block; font-size: 17px; color: #fff; }
.brand small { color: #d9b6c8; font-size: 12px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #ead2de; text-decoration: none; font-weight: 700; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: #fff; color: var(--plum); }
.nav a .ico { width: 22px; text-align: center; font-size: 17px; }
.nav a .badge { margin-inline-start: auto; background: var(--rose); color: #fff; font-size: 11px; padding: 0 7px; border-radius: 999px; }
.side .me { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.side .me button { background: none; border: 0; color: #d9b6c8; cursor: pointer; padding: 0; text-decoration: underline; }

.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 26px 6px; flex-wrap: wrap; }
.top h1 { font-size: 22px; font-weight: 800; color: var(--plum); margin-inline-end: auto; }
.page { padding: 12px 26px 40px; }

.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 14px 16px 4px; }
  .top h1 { font-size: 19px; }
  .page { padding: 10px 16px 100px; }
  .tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; background: #fff; border-top: 1px solid var(--line); z-index: 40; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; position: relative; }
  .tabbar .ico { font-size: 20px; }
  .tabbar .on { color: var(--rose); }
  .tabbar .badge { position: absolute; top: 2px; left: 50%; margin-left: 6px; background: var(--rose); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 999px; }
}

/* ── تسجيل الدخول ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #f6dfe9 0, transparent 50%), radial-gradient(circle at 90% 90%, #ecd9e3 0, transparent 45%), var(--bg); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .logo { text-align: center; margin-bottom: 18px; }
.login .logo img { width: 68px; }
.login .logo h1 { font-size: 22px; color: var(--plum); margin-top: 6px; }
.err-box { background: var(--bad-soft); color: var(--bad); padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }

/* ── قائمة المواعيد ── */
.appt-list { display: flex; flex-direction: column; gap: 8px; }
.appt { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; border-inline-start: 4px solid var(--c, var(--rose)); }
.appt:hover { background: var(--blush); }
.appt .tm { min-width: 66px; font-weight: 800; color: var(--plum); font-size: 15px; }
.appt .tm small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.appt .who { flex: 1; min-width: 0; }
.appt .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .who span { font-size: 13px; color: var(--muted); }
.appt.cancelled, .appt.noshow { opacity: .55; }

/* ── جدول اليوم (حسب الموظفة) ── */
.daybar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.daybar .date-title { font-weight: 800; font-size: 17px; color: var(--plum); min-width: 150px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--plum); color: #fff; }

.sched-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.sched { display: grid; position: relative; min-width: 100%; }
.sched .hd { position: sticky; top: 0; background: #fff; z-index: 3; padding: 10px 6px; text-align: center; font-weight: 800; border-bottom: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.sched .hd i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 5px; }
.sched .tcol { font-size: 12px; color: var(--muted); text-align: center; border-inline-end: 1px solid var(--line); position: relative; }
.sched .tcol div { position: absolute; inset-inline: 0; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.sched .col { position: relative; border-inline-end: 1px solid var(--line); }
.sched .col:last-child { border-inline-end: 0; }
.sched .cell { position: absolute; inset-inline: 0; border-top: 1px dashed #f1e7ec; cursor: pointer; }
.sched .cell.hour { border-top: 1px solid var(--line); }
.sched .cell:hover { background: var(--blush); }
.sched .blk { position: absolute; inset-inline: 4px; border-radius: 9px; padding: 5px 8px; font-size: 12px; overflow: hidden; cursor: pointer; z-index: 2; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); line-height: 1.35; }
.sched .blk b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched .blk.pending { outline: 2px dashed rgba(255,255,255,.85); outline-offset: -4px; }
.sched .blk.done { opacity: .8; }
.sched .blk.done::after { content: '✓'; position: absolute; top: 4px; left: 7px; font-weight: 800; }
.sched .blk.cancelled, .sched .blk.noshow { background: repeating-linear-gradient(-45deg, #ccc, #ccc 6px, #ddd 6px, #ddd 12px) !important; color: #555; }
.sched .now { position: absolute; inset-inline: 0; height: 2px; background: var(--bad); z-index: 4; pointer-events: none; }

/* ── تفاصيل الموعد ── */
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; }
.dl dt { color: var(--muted); font-weight: 700; font-size: 13px; }
.dl dd { margin: 0; }

.sugg { border: 1px solid var(--line); border-radius: 10px; margin-top: -6px; margin-bottom: 12px; max-height: 200px; overflow-y: auto; }
.sugg div { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.sugg div:last-child { border-bottom: 0; }
.sugg div:hover { background: var(--blush); }
.picked { display: flex; align-items: center; justify-content: space-between; background: var(--blush); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }

/* ── الرسائل ── */
.inbox { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 110px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.conv-list { border-inline-end: 1px solid var(--line); overflow-y: auto; }
.conv { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.conv:hover, .conv.on { background: var(--blush); }
.conv .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; font-size: 14px; }
.conv .bd { flex: 1; min-width: 0; }
.conv .bd b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .bd span { font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .tm { font-size: 11px; color: var(--muted); white-space: nowrap; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.thread-b { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #fcf8fa; }
.bub { max-width: 78%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.bub.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-top-right-radius: 4px; }
.bub.out { background: var(--rose-soft); align-self: flex-end; border-top-left-radius: 4px; }
.bub .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bub .meta.fail { color: var(--bad); font-weight: 700; }
.thread-f { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.thread-f textarea { min-height: 44px; max-height: 140px; }
.warn-line { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 6px 12px; font-weight: 700; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 160px); }
  .inbox.open .conv-list { display: none; }
  .inbox:not(.open) .thread { display: none; }
}

/* ── الحملات ── */
.bar { height: 8px; background: #f1e7ec; border-radius: 99px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.camp { display: flex; flex-direction: column; gap: 8px; }

/* ── تبويبات ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--plum); border-bottom-color: var(--rose); }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; overflow-x: auto; }
.chart .d { flex: 1; min-width: 22px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bars i { width: 45%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .d span { font-size: 10px; color: var(--muted); }

.copy { display: flex; gap: 6px; }
.copy input { direction: ltr; }
.status-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-line:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.dot.on { background: var(--ok); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }
.swatch { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.svc-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }

/* ── الإضافات ── */
.allergy { color: var(--bad); font-weight: 800; }
.allergy-box { background: var(--bad-soft); color: var(--bad); font-weight: 800; padding: 9px 14px; border-radius: 10px; margin-bottom: 12px; }
.perk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff; border: 1px dashed #e3c4d3; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.perk.check { align-items: flex-start; }
.stamps { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.stamps i { width: 24px; height: 24px; border-radius: 50%; border: 2px dashed #e3c4d3; display: grid; place-items: center; font-style: normal; font-size: 13px; }
.stamps i.on { border: 2px solid var(--rose); background: var(--rose-soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.gallery figcaption { padding: 6px 8px; font-size: 12px; position: relative; }
.gallery figcaption .icon-btn { position: absolute; top: 2px; left: 2px; font-size: 14px; }
.pkg { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.pkg.used { opacity: .55; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ev-card { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; box-shadow: var(--shadow); }
.ev-card:hover { border-color: #e3c4d3; }
.ev-card.cancelled { opacity: .5; }
.ev-date { min-width: 58px; text-align: center; background: linear-gradient(160deg, var(--plum), var(--rose)); color: #fff; border-radius: 12px; padding: 8px 4px; }
.ev-date b { display: block; font-size: 24px; line-height: 1.1; }
.ev-date span { font-size: 11px; }
.stars-s { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.review-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; }
.pill-link { display: inline-flex; gap: 4px; align-items: center; background: var(--blush); border: 1px solid #ecd2df; color: var(--plum); border-radius: 999px; padding: 6px 14px; text-decoration: none; cursor: pointer; font-size: 14px; }
.pill-link:hover { background: var(--rose-soft); }
.upcoming h3 { margin-bottom: 8px; }
@media (max-width: 640px) { .ev-grid { grid-template-columns: 1fr; } .review-row { flex-direction: column; } }

/* ── المركز: الدور، الجم، الملف الطبي ── */
.display-link { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; background: linear-gradient(120deg, #fff, var(--blush)); }
.q-row { display: flex; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.q-row:last-child { border-bottom: 0; }
.q-row.called { background: var(--info-soft); border-radius: 12px; }
.q-row.mine .q-num { background: var(--rose); color: #fff; }
.q-row.done, .q-row.skipped { opacity: .6; }
.q-num { min-width: 54px; height: 54px; border-radius: 14px; background: var(--rose-soft); color: var(--plum); font-weight: 900; font-size: 24px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.med-rec { border: 1px solid var(--line); border-inline-start: 4px solid var(--rose); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; background: #fff; line-height: 1.8; }
.med-rec .lbl { color: var(--muted); font-weight: 700; font-size: 13px; }
.chart-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
@media (max-width: 640px) { .q-row > .row { width: 100%; } }
