/* =========================================================
   عيادتي — Lugal Soft
   نظام تصميم عربي RTL، لوحة طبية (تركوازي/أبيض)
   ========================================================= */

:root {
  --teal-50:  #eefbf9;
  --teal-100: #d3f4ef;
  --teal-200: #a8e9e1;
  --teal-300: #6fd8ce;
  --teal-400: #38bdb0;
  --teal-500: #14a08f;
  --teal-600: #0d8074;
  --teal-700: #0f665e;
  --teal-800: #10514c;
  --teal-900: #0f443f;

  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;

  --ok:      #16a34a;
  --ok-bg:   #dcfce7;
  --warn:    #d97706;
  --warn-bg: #fef3c7;
  --danger:  #dc2626;
  --danger-bg:#fee2e2;
  --info:    #2563eb;
  --info-bg: #dbeafe;
  --purple:  #7c3aed;
  --purple-bg:#ede9fe;

  --bg: #f4f7f8;
  --card: #ffffff;
  --border: var(--ink-200);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 2px 10px rgba(15, 23, 42, .07);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --header-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cairo', 'Segoe UI', 'Noto Naskh Arabic', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink-800);
  font-size: 15px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

[dir="rtl"] { text-align: right; }

a { color: var(--teal-600); text-decoration: none; }
a:hover { color: var(--teal-700); }

h1, h2, h3, h4 { margin: 0 0 .6rem; font-weight: 700; color: var(--ink-900); line-height: 1.4; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 .8rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }

/* ---------------- التخطيط ---------------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 620px; margin: 0 auto; padding: 0 16px; }

.page { padding: 18px 0 90px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-head h1 { margin: 0; }
.page-sub { color: var(--ink-500); font-size: .9rem; margin: 2px 0 0; }

/* ---------------- الترويسة ---------------- */
.topbar {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
.topbar a { color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; object-fit: cover;
  background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 1rem;
}
.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: .85rem; opacity: .95; }
.topbar-user .role-chip {
  background: rgba(255,255,255,.18); padding: 2px 9px; border-radius: 999px; font-size: .75rem;
}

/* ---------------- التنقل ---------------- */
.nav {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: var(--header-h); z-index: 40;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.nav-inner { display: flex; gap: 2px; min-width: max-content; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; color: var(--ink-600); font-size: .9rem; font-weight: 600;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--teal-600); background: var(--teal-50); }
.nav a.active { color: var(--teal-700); border-bottom-color: var(--teal-500); background: var(--teal-50); }
.nav .ico { font-size: 1.05rem; line-height: 1; }

/* شريط سفلي للجوال */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 60;
    background: #fff; border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(15,23,42,.08);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: .68rem; color: var(--ink-500); font-weight: 600; padding: 4px 2px;
  }
  .tabbar a .ico { font-size: 1.25rem; }
  .tabbar a.active { color: var(--teal-600); }
}

/* ---------------- البطاقات ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px; margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: -16px -16px 14px; padding: 13px 16px;
  border-bottom: 1px solid var(--border); background: var(--ink-50);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; }
.card-flush { padding: 0; }
.card-flush .card-head { margin: 0; border-radius: var(--radius) var(--radius) 0 0; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 960px) { .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } }

/* ---------------- بطاقات الإحصاء ---------------- */
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
}
.stat-ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.2rem; background: var(--teal-50); color: var(--teal-600); flex: none;
}
.stat-body { min-width: 0; }
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--ink-900); line-height: 1.2; }
.stat-label { font-size: .8rem; color: var(--ink-500); }
.stat.is-ok .stat-ico { background: var(--ok-bg); color: var(--ok); }
.stat.is-warn .stat-ico { background: var(--warn-bg); color: var(--warn); }
.stat.is-danger .stat-ico { background: var(--danger-bg); color: var(--danger); }
.stat.is-info .stat-ico { background: var(--info-bg); color: var(--info); }
.stat.is-purple .stat-ico { background: var(--purple-bg); color: var(--purple); }

/* ---------------- الأزرار ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--teal-600); color: #fff; font-family: inherit; font-size: .9rem;
  font-weight: 700; cursor: pointer; transition: .15s; white-space: nowrap;
  text-decoration: none; line-height: 1.6;
}
.btn:hover { background: var(--teal-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 5px 11px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--ink-700); border-color: var(--border); }
.btn-ghost:hover { background: var(--ink-50); color: var(--ink-900); border-color: var(--ink-300); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #15803d; }
.btn-warn { background: var(--warn); }
.btn-warn:hover { background: #b45309; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- النماذج ---------------- */
.field { margin-bottom: 14px; }
.field label, .label {
  display: block; font-size: .85rem; font-weight: 700;
  color: var(--ink-700); margin-bottom: 5px;
}
.field .hint { font-size: .78rem; color: var(--ink-500); margin-top: 4px; }
input[type="text"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], input[type="email"],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem;
  background: #fff; color: var(--ink-900); transition: .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teal-400);
  box-shadow: 0 0 0 3px var(--teal-100);
}
input:disabled, select:disabled, textarea:disabled { background: var(--ink-100); color: var(--ink-500); }
textarea { min-height: 90px; resize: vertical; line-height: 1.7; }
select { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--teal-600); vertical-align: middle; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.form-row-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.num { font-variant-numeric: tabular-nums; }
input[dir="ltr"], .ltr { direction: ltr; text-align: right; }

/* ---------------- الجداول ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); }
table.tbl th {
  background: var(--ink-50); font-weight: 700; color: var(--ink-600);
  font-size: .8rem; white-space: nowrap; position: sticky; top: 0;
}
table.tbl tbody tr:hover { background: var(--teal-50); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.actions { white-space: nowrap; }

/* ---------------- الشارات ---------------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; background: var(--ink-100); color: var(--ink-600);
  white-space: nowrap;
}
.badge-booked   { background: var(--info-bg);   color: #1d4ed8; }
.badge-present  { background: var(--warn-bg);   color: #a16207; }
.badge-in_room  { background: var(--purple-bg); color: #6d28d9; }
.badge-done     { background: var(--ok-bg);     color: #15803d; }
.badge-no_show  { background: var(--danger-bg); color: #b91c1c; }
.badge-cancelled{ background: var(--ink-200);   color: var(--ink-600); }
.badge-active   { background: var(--ok-bg);     color: #15803d; }
.badge-suspended{ background: var(--danger-bg); color: #b91c1c; }
.badge-teal     { background: var(--teal-100);  color: var(--teal-700); }

/* ---------------- التنبيهات ---------------- */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
  font-size: .9rem; border: 1px solid transparent; font-weight: 600;
}
.alert-ok      { background: var(--ok-bg);     color: #14532d; border-color: #bbf7d0; }
.alert-error   { background: var(--danger-bg); color: #7f1d1d; border-color: #fecaca; }
.alert-warn    { background: var(--warn-bg);   color: #78350f; border-color: #fde68a; }
.alert-info    { background: var(--info-bg);   color: #1e3a8a; border-color: #bfdbfe; }

/* ---------------- فارغ ---------------- */
.empty {
  text-align: center; padding: 40px 20px; color: var(--ink-500);
}
.empty .ico { font-size: 2.6rem; display: block; margin-bottom: 10px; opacity: .55; }
.empty p { margin: 0 0 4px; font-weight: 600; }
.empty small { font-size: .82rem; }

/* ---------------- الطابور ---------------- */
.queue-list { display: flex; flex-direction: column; gap: 10px; }
.q-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-sm); transition: .15s;
}
.q-item.dragging { opacity: .45; }
.q-item.drop-target { border-color: var(--teal-400); box-shadow: 0 0 0 3px var(--teal-100); }
.q-item[data-status="in_room"] { border-inline-start: 5px solid var(--purple); background: #faf8ff; }
.q-item[data-status="present"] { border-inline-start: 5px solid var(--warn); }
.q-item[data-status="done"]    { opacity: .62; }
.q-item[data-status="no_show"], .q-item[data-status="cancelled"] { opacity: .5; }
.q-num {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: var(--teal-600); color: #fff; display: grid; place-items: center;
  font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.q-num.pending { background: var(--ink-200); color: var(--ink-500); }
.q-body { flex: 1; min-width: 0; }
.q-name { font-weight: 700; color: var(--ink-900); }
.q-meta { font-size: .8rem; color: var(--ink-500); display: flex; gap: 10px; flex-wrap: wrap; }
.q-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.q-handle { cursor: grab; color: var(--ink-400); font-size: 1.2rem; padding: 0 2px; user-select: none; }
.q-handle:active { cursor: grabbing; }
@media (max-width: 620px) {
  .q-item { flex-wrap: wrap; }
  .q-actions { width: 100%; justify-content: stretch; }
  .q-actions .btn { flex: 1; }
}

/* ---------------- الحجز ---------------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step {
  flex: 1; text-align: center; font-size: .76rem; font-weight: 700;
  color: var(--ink-400); padding-top: 22px; position: relative;
}
.step::before {
  content: ''; position: absolute; top: 0; inset-inline-start: 50%;
  transform: translateX(50%); width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink-200);
}
.step.done::before { background: var(--teal-400); }
.step.active::before { background: var(--teal-600); box-shadow: 0 0 0 4px var(--teal-100); }
.step.active { color: var(--teal-700); }
.step.done { color: var(--teal-600); }

.day-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.day-btn {
  flex: none; width: 68px; padding: 9px 4px; border-radius: 12px; text-align: center;
  border: 1px solid var(--border); background: #fff; cursor: pointer; font-family: inherit;
  transition: .15s;
}
.day-btn .wd { font-size: .74rem; color: var(--ink-500); font-weight: 700; }
.day-btn .dn { font-size: 1.25rem; font-weight: 800; color: var(--ink-900); }
.day-btn .mn { font-size: .68rem; color: var(--ink-400); }
.day-btn:hover:not(:disabled) { border-color: var(--teal-300); }
.day-btn.selected { background: var(--teal-600); border-color: var(--teal-600); }
.day-btn.selected .wd, .day-btn.selected .dn, .day-btn.selected .mn { color: #fff; }
.day-btn:disabled { opacity: .38; cursor: not-allowed; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.slot {
  padding: 10px 4px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; text-align: center; font-weight: 700; font-size: .9rem;
  cursor: pointer; font-family: inherit; color: var(--ink-800); transition: .15s;
}
.slot:hover:not(:disabled) { border-color: var(--teal-400); background: var(--teal-50); }
.slot.selected { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.slot:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.otp-input {
  letter-spacing: .55em; text-align: center; font-size: 1.7rem;
  font-weight: 800; padding: 12px; direction: ltr; font-variant-numeric: tabular-nums;
}

/* ---------------- ملف المريض ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a {
  padding: 9px 15px; font-size: .88rem; font-weight: 700; color: var(--ink-500);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a.active { color: var(--teal-700); border-bottom-color: var(--teal-500); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--ink-500); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink-900); font-weight: 600; }

.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before {
  content: ''; position: absolute; inset-block: 6px; inset-inline-start: 6px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; inset-inline-start: -20px; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-100);
}
.tl-date { font-size: .8rem; color: var(--ink-500); font-weight: 700; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; background: var(--ink-100); font-size: .8rem;
  font-weight: 600; color: var(--ink-700);
}
.chip-danger { background: var(--danger-bg); color: #b91c1c; }
.chip-warn { background: var(--warn-bg); color: #92400e; }
.chip-info { background: var(--info-bg); color: #1e40af; }

.rx-row {
  display: grid; grid-template-columns: 2.2fr 1fr 1.2fr 1fr auto; gap: 8px;
  align-items: start; margin-bottom: 8px;
}
@media (max-width: 760px) { .rx-row { grid-template-columns: 1fr 1fr; } .rx-row .rx-del { grid-column: 2; justify-self: end; } }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.file-card {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: #fff; box-shadow: var(--shadow-sm);
}
.file-card img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--ink-100); }
.file-card .fc-body { padding: 8px 10px; font-size: .78rem; }
.file-card .fc-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pdf { height: 120px; display: grid; place-items: center; font-size: 2.4rem; background: var(--ink-100); }

/* ---------------- المرافق ---------------- */
.muted { color: var(--ink-500); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:6px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.hide { display: none !important; }
.money::after { content: ' د.ع'; font-size: .8em; opacity: .7; }
.text-ok { color: var(--ok); } .text-danger { color: var(--danger); } .text-warn { color: var(--warn); }

.toast {
  position: fixed; bottom: 84px; inset-inline: 16px; z-index: 200;
  background: var(--ink-900); color: #fff; padding: 12px 16px;
  border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .9rem;
  text-align: center; opacity: 0; transform: translateY(12px); transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--danger); }
@media (min-width: 721px) { .toast { inset-inline: auto 24px; bottom: 24px; max-width: 380px; } }

/* شاشة الدخول */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
}
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px;
  padding: 28px 24px; box-shadow: var(--shadow-lg);
}
.auth-logo {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px;
  background: var(--teal-50); color: var(--teal-600);
  display: grid; place-items: center; font-size: 1.9rem;
}

@media print {
  .topbar, .nav, .tabbar, .btn, .no-print { display: none !important; }
  body { background: #fff; }
}

/* =========================================================
   المرحلة 2: بوابة المريض + التحاليل
   ========================================================= */

/* --- ترويسة البوابة --- */
.pt-head {
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
  color: #fff; padding: 12px 0;
}
.pt-head-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-brand img { width: 42px; height: 42px; border-radius: 11px; object-fit: contain; background: #fff; padding: 3px; }
.pt-ph {
  width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 1.2rem; flex: none;
}
.pt-brand-txt { min-width: 0; line-height: 1.35; }
.pt-brand-txt b { display: block; font-size: 1rem; }
.pt-brand-txt span { font-size: .78rem; opacity: .9; }
.pt-head .btn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.pt-head .btn-ghost:hover { background: rgba(255,255,255,.25); color: #fff; }
.pt-nav { top: 0; }

/* --- بطاقة موعد --- */
.pt-appt { display: flex; align-items: center; gap: 12px; }
.pt-appt-date {
  width: 56px; height: 56px; flex: none; border-radius: 14px;
  background: var(--teal-50); color: var(--teal-700);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.pt-appt-date b { font-size: 1.35rem; font-weight: 800; }
.pt-appt-date span { font-size: .66rem; }

/* --- مربعات الاختصار --- */
.pt-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; padding: 16px 10px; margin-bottom: 0; color: var(--ink-800);
}
.pt-tile:hover { border-color: var(--teal-300); color: var(--ink-900); }
.pt-tile .ico { font-size: 1.6rem; }
.pt-tile b { font-size: 1.3rem; color: var(--ink-900); }
.pt-tile span { font-size: .78rem; color: var(--ink-500); }

/* --- ملاحظة للمريض --- */
.pt-note {
  background: var(--teal-50); border-inline-start: 3px solid var(--teal-400);
  padding: 8px 10px; border-radius: 8px; margin-top: 6px;
  font-size: .9rem; white-space: pre-line;
}

/* --- بطاقة تحليل --- */
.lab-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px; background: #fff;
}
.lab-value { font-size: 1.5rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lab-trend { margin-top: 8px; }
.lab-trend svg { display: block; width: 100%; height: auto; }
.lab-history { margin-top: 8px; }
.lab-history summary { cursor: pointer; color: var(--teal-700); font-weight: 700; }
.lab-history[open] summary { margin-bottom: 4px; }

.flag-low    { color: #2563eb; }
.flag-normal { color: #16a34a; }
.flag-high   { color: #dc2626; }

td.flag-low, td.flag-high { font-weight: 800; }

/* --- مفاتيح المشاركة --- */
.share-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--ink-600); font-weight: 600;
}
.share-toggle input { width: 15px; height: 15px; }
.shared-badge { background: var(--teal-100); color: var(--teal-700); }

/* --- QR في الطباعة --- */
.rx-qr { text-align: center; }
.rx-qr svg { width: 22mm; height: 22mm; display: block; margin: 0 auto; }
.rx-qr .cap { font-size: 7pt; color: #6b7280; margin-top: 1mm; }
