/* Medicare Diagnostics — Patient Portal.
   Phase 2: auth screens (.pp-*). Phase 3: dashboard shell (.pd-*).
   Lightweight, mobile-first, standalone stylesheet — reuses the brand's
   color tokens (same values as public/assets/staff/staff.css's :root) for
   visual consistency, not the admin sidebar/table component library. */

:root {
  --brand: #076969;
  --brand-dark: #054f4f;
  --brand-light: #e3f3f2;
  --accent: #ff9f1c;
  --ink: #0f172a;
  --ink-muted: #475569;
  --border: #e8edf5;
  --bg: #f7f9fc;
  --danger: #ff3d5a;
  --success: #22b573;
  --warning: #ff9f1c;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body.pp-body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, var(--brand-light) 0%, var(--bg) 220px, var(--bg) 100%);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.pp-wrap { width: 100%; max-width: 420px; min-width: 0; }

.pp-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(7, 105, 105, 0.08);
  padding: 32px 28px 26px;
  animation: ppFadeUp .35s ease both;
}

@keyframes ppFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .pp-card { animation: none; } }

.pp-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.pp-logo-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.pp-logo-text .name { font-size: 16px; font-weight: 800; color: var(--brand-dark); line-height: 1.15; }
.pp-logo-text .tagline { font-size: 11px; color: var(--ink-muted); }

.pp-title { font-size: 19px; font-weight: 800; margin: 0 0 6px; color: var(--ink); }
.pp-subtitle { font-size: 13px; color: var(--ink-muted); line-height: 1.5; margin: 0 0 22px; }

.pp-form-group { margin-bottom: 18px; }
.pp-form-group label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }

.pp-mobile-input { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.pp-mobile-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.pp-mobile-prefix { display: flex; align-items: center; padding: 0 12px; background: var(--bg); color: var(--ink-muted); font-weight: 700; font-size: 14px; border-right: 1px solid var(--border); }
.pp-mobile-input input { border: none; outline: none; padding: 12px 14px; font-size: 16px; letter-spacing: .02em; width: 100%; min-width: 0; flex: 1; background: transparent; color: var(--ink); }

.pp-otp-input { width: 100%; text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 700; padding: 14px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.pp-otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }

.pp-btn { display: block; width: 100%; text-align: center; border: none; border-radius: var(--radius-sm); padding: 13px 16px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s ease, opacity .15s ease; text-decoration: none; }
.pp-btn-primary { background: var(--brand); color: #fff; }
.pp-btn-primary:hover { background: var(--brand-dark); }
.pp-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.pp-btn-link { background: none; color: var(--brand); font-weight: 700; padding: 10px 0; }
.pp-btn-link:hover { color: var(--brand-dark); text-decoration: underline; }

.pp-resend-row { text-align: center; font-size: 13px; color: var(--ink-muted); margin: 16px 0 4px; }
.pp-resend-row .timer { font-weight: 700; color: var(--ink); }

.pp-alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; line-height: 1.45; }
.pp-alert-danger { background: #fff1f2; color: #b91c3c; border-color: #ffd7dd; }
.pp-alert-warning { background: #fff8ec; color: #92620a; border-color: #ffe3b0; }
.pp-alert-success { background: #ecfbf3; color: #0f7a4c; border-color: #bdeed4; }
.pp-alert-info { background: var(--brand-light); color: var(--brand-dark); border-color: #b7e4e0; }

.pp-footnote { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-muted); }
.pp-footnote i { color: var(--brand); font-size: 15px; }

.pp-mobile-display { text-align: center; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 22px; }
.pp-mobile-display .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-muted); margin-top: 2px; }

.pp-center-link { text-align: center; margin-top: 6px; }

/* ================================================================
   Phase 3 — Dashboard shell (.pd-*). Replaces the Phase 2 index.php
   placeholder (.pp-home-* removed — dashboard.php is now the real home).
   ================================================================ */
html, body.pd-body { height: 100%; }
body.pd-body { margin: 0; font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--ink); display: block; padding: 0; }

.pd-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.pd-sidebar {
  width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.pd-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.pd-sidebar-brand-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.pd-sidebar-brand .name { font-size: 14.5px; font-weight: 800; color: var(--brand-dark); line-height: 1.2; }
.pd-sidebar-brand .tagline { font-size: 10.5px; color: var(--ink-muted); }

.pd-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.pd-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--ink-muted); text-decoration: none; font-size: 13.5px; font-weight: 600; margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}
.pd-nav-item i { width: 18px; text-align: center; font-size: 15px; }
.pd-nav-item:hover { background: var(--bg); color: var(--ink); }
.pd-nav-item.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; }

.pd-sidebar-footer { padding: 10px; border-top: 1px solid var(--border); }
.pd-nav-logout { color: var(--danger); }
.pd-nav-logout:hover { background: #fff1f2; color: var(--danger); }

.pd-overlay { display: none; }

/* ---- Topbar ---- */
.pd-topbar {
  position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pd-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pd-hamburger { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 38px; height: 38px; align-items: center; justify-content: center; font-size: 16px; color: var(--ink); cursor: pointer; flex-shrink: 0; }
.pd-topbar-title { font-size: 16px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-topbar-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pd-topbar-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.pd-topbar-user-meta { text-align: right; line-height: 1.25; display: none; }
.pd-topbar-user-meta .name { font-size: 13px; font-weight: 700; color: var(--ink); }
.pd-topbar-user-meta .code { font-size: 11px; color: var(--ink-muted); }
.pd-topbar-logout { color: var(--ink-muted); font-size: 17px; text-decoration: none; padding: 8px; border-radius: var(--radius-sm); }
.pd-topbar-logout:hover { background: #fff1f2; color: var(--danger); }

/* ---- Main content ---- */
.pd-main { flex: 1; min-width: 0; padding: 22px 24px 60px; max-width: 1100px; margin: 0 auto; width: 100%; }
.pd-page-header { margin-bottom: 18px; }
.pd-page-header h1 { font-size: 20px; font-weight: 800; margin: 0 0 4px; color: var(--ink); }
.pd-page-header p { font-size: 13px; color: var(--ink-muted); margin: 0; }

/* ---- Cards ---- */
.pd-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(7,105,105,0.04); padding: 20px 22px; margin-bottom: 18px; }
.pd-card-title { font-size: 14px; font-weight: 800; color: var(--ink); margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pd-card-title .link { font-size: 12px; font-weight: 700; color: var(--brand); text-decoration: none; }
.pd-card-title .link:hover { text-decoration: underline; }

/* ---- Welcome / stats ---- */
.pd-welcome { font-size: 19px; font-weight: 800; color: var(--ink); margin: 0 0 2px; }
.pd-welcome-sub { font-size: 13px; color: var(--ink-muted); margin: 0 0 20px; }

.pd-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.pd-stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.pd-stat-card .icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 10px; }
.pd-stat-card .value { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1; }
.pd-stat-card .label { font-size: 12px; color: var(--ink-muted); margin-top: 5px; }

.pd-quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.pd-quick-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 10px; text-align: center; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.pd-quick-card:hover { box-shadow: 0 8px 20px rgba(7,105,105,.1); transform: translateY(-1px); }
.pd-quick-card .icon { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 17px; margin: 0 auto 10px; }
.pd-quick-card .label { font-size: 12px; font-weight: 700; color: var(--ink); }

/* ---- Upcoming appointment (prominent) ---- */
.pd-upcoming-card { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 10px 28px rgba(5,79,79,.22); }
.pd-upcoming-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .85; margin-bottom: 10px; }
.pd-upcoming-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pd-upcoming-doctor { font-size: 18px; font-weight: 800; }
.pd-upcoming-dept { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.pd-upcoming-details { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.pd-upcoming-details div span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; margin-bottom: 2px; }
.pd-upcoming-details div strong { font-size: 14.5px; font-weight: 800; }
.pd-upcoming-token { background: rgba(255,255,255,.16); border-radius: var(--radius-sm); padding: 10px 16px; text-align: center; }
.pd-upcoming-token span { display: block; font-size: 10px; text-transform: uppercase; opacity: .8; }
.pd-upcoming-token strong { font-size: 20px; font-weight: 800; }
.pd-upcoming-action { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--brand-dark); font-weight: 700; font-size: 13px; padding: 9px 18px; border-radius: var(--radius-sm); text-decoration: none; }
.pd-upcoming-action:hover { background: #f0fdfa; }

/* ---- Empty state ---- */
.pd-empty { text-align: center; padding: 34px 16px; color: var(--ink-muted); }
.pd-empty .icon { width: 52px; height: 52px; border-radius: 50%; background: var(--bg); color: var(--ink-muted); display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 12px; }
.pd-empty .title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.pd-empty .sub { font-size: 12.5px; }

/* ---- Table (mobile-collapsing, same technique as staff.css's .responsive-cards) ---- */
table.pd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.pd-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); border-bottom: 2px solid var(--border); }
table.pd-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.pd-table tr:last-child td { border-bottom: none; }

@media (max-width: 760px) {
  table.pd-table thead { display: none; }
  table.pd-table, table.pd-table tbody, table.pd-table tr, table.pd-table td { display: block; width: 100%; }
  table.pd-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
  table.pd-table td { padding: 5px 0; border-bottom: none; display: flex; justify-content: space-between; gap: 10px; text-align: right; }
  table.pd-table td::before { content: attr(data-label); font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: var(--ink-muted); text-align: left; }
  table.pd-table td[data-label=""]::before, table.pd-table td:not([data-label])::before { content: none; }
}

/* ---- Status badges ---- */
.pd-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.pd-badge-blue { background: #e8f1fd; color: #1d4ed8; }
.pd-badge-green { background: #ecfbf3; color: #0f7a4c; }
.pd-badge-orange { background: #fff8ec; color: #92620a; }
.pd-badge-red { background: #fff1f2; color: #b91c3c; }
.pd-badge-grey { background: var(--bg); color: var(--ink-muted); }

/* ---- Filter tabs ---- */
.pd-filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pd-filter-tab { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 7px 16px; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); cursor: pointer; text-decoration: none; }
.pd-filter-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---- Test Reports (Phase 8): per-order test chips + pending-report note ---- */
.pd-test-chips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; }
.pd-test-chip { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pd-report-pending-sub { font-size: 11px; color: var(--ink-muted); margin-top: 4px; max-width: 200px; }

/* ---- Visit / timeline rows ---- */
.pd-visit-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pd-visit-row:last-child { border-bottom: none; }
.pd-visit-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.pd-visit-main { flex: 1; min-width: 0; }
.pd-visit-date { font-size: 11px; color: var(--ink-muted); font-weight: 700; text-transform: uppercase; }
.pd-visit-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.pd-visit-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }
.pd-visit-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---- Profile ---- */
.pd-profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.pd-profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.pd-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pd-profile-name { font-size: 18px; font-weight: 800; color: var(--ink); }
.pd-profile-code { font-size: 12.5px; color: var(--ink-muted); }
.pd-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.pd-field { }
.pd-field label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); margin-bottom: 5px; }
.pd-field .val { font-size: 14px; color: var(--ink); font-weight: 600; }
.pd-field input, .pd-field select, .pd-field textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; color: var(--ink); background: #fff; }
.pd-field input:focus, .pd-field select:focus, .pd-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.pd-field input:disabled { background: var(--bg); color: var(--ink-muted); }

.pd-btn { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: var(--radius-sm); padding: 10px 20px; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none; }
.pd-btn-primary { background: var(--brand); color: #fff; }
.pd-btn-primary:hover { background: var(--brand-dark); }
.pd-btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.pd-btn-secondary:hover { background: var(--bg); }

/* ---- Responsive: mobile drawer sidebar ---- */
@media (max-width: 880px) {
  .pd-sidebar {
    position: fixed; left: -260px; top: 0; bottom: 0; z-index: 40; width: 250px;
    transition: left .2s ease; box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  .pd-sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .pd-hamburger { display: flex; }
  .pd-overlay.open { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 30; }
  .pd-main { padding: 16px 14px 50px; }
  .pd-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pd-quick-grid { grid-template-columns: repeat(3, 1fr); }
  .pd-field-grid { grid-template-columns: 1fr; }
  .pd-upcoming-details { gap: 14px; }
}
@media (min-width: 640px) {
  .pd-topbar-user-meta { display: block; }
}

/* ================================================================
   Phase 4A — Family Members (.pd-family-*, .pd-modal-*)
   ================================================================ */
.pd-family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pd-family-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.pd-family-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pd-family-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; flex-shrink: 0; }
.pd-family-relationship { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.pd-family-name { font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 1px; }
.pd-family-meta { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 4px; }
.pd-family-meta + .pd-family-meta { margin-top: 2px; }
.pd-family-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pd-family-actions .pd-btn { padding: 8px 14px; font-size: 12.5px; flex: 1; justify-content: center; }
.pd-family-remove { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--ink-muted); cursor: pointer; font-size: 14px; padding: 4px; }
.pd-family-remove:hover { color: var(--danger); }
.pd-family-card { position: relative; }
.pd-add-family-card { border: 2px dashed var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 24px; cursor: pointer; color: var(--brand); font-weight: 700; font-size: 13px; background: none; min-height: 150px; }
.pd-add-family-card:hover { background: var(--brand-light); border-color: var(--brand); }
.pd-add-family-card i { font-size: 22px; }

/* ---- Modal (mirrors staff.css's qa-modal fade/scale, self-contained here) ---- */
.pd-modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.pd-modal-backdrop.open { display: flex; animation: pdBackdropFade .18s ease; }
.pd-modal-box { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.2); }
.pd-modal-backdrop.open .pd-modal-box { animation: pdBoxIn .2s cubic-bezier(.16,1,.3,1); }
@keyframes pdBackdropFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pdBoxIn { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@media (prefers-reduced-motion: reduce) { .pd-modal-backdrop.open, .pd-modal-backdrop.open .pd-modal-box { animation: none; } }
.pd-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.pd-modal-header h3 { margin: 0; font-size: 15.5px; font-weight: 800; color: var(--ink); }
.pd-modal-close { background: none; border: none; font-size: 20px; color: var(--ink-muted); cursor: pointer; line-height: 1; padding: 4px; }
.pd-modal-body { padding: 20px; }
.pd-modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.pd-tab-toggle { display: flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 18px; }
.pd-tab-btn { flex: 1; text-align: center; padding: 8px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); cursor: pointer; border: none; background: none; }
.pd-tab-btn.active { background: var(--brand); color: #fff; }

.pd-search-result-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pd-search-result-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.pd-search-result-meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

/* ---- Who are you booking for? ---- */
.pd-who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pd-who-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; background: #fff; }
.pd-who-card:hover { border-color: var(--brand); }
.pd-who-card.selected { border-color: var(--brand); background: var(--brand-light); }
.pd-who-card .pd-family-avatar { margin: 0 auto 8px; }
.pd-booking-for-banner { background: var(--brand-light); border: 1px solid #b7e4e0; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--brand-dark); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.pd-booking-for-banner strong { font-weight: 800; }

.pd-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; }
.pd-summary-grid div span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); }

/* ================================================================
   Phase 5 — Notification Center (.pd-bell-*, .pd-notif-*)
   ================================================================ */
.pd-bell-wrap { position: relative; }
.pd-bell-btn { position: relative; background: none; border: 1px solid var(--border); border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--ink-muted); cursor: pointer; }
.pd-bell-btn:hover { background: var(--bg); color: var(--ink); }
.pd-bell-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 20px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.pd-bell-dropdown { display: none; position: absolute; top: 46px; right: 0; width: 320px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.14); z-index: 60; overflow: hidden; animation: pdBoxIn .18s cubic-bezier(.16,1,.3,1) both; }
.pd-bell-dropdown.open { display: block; }
.pd-bell-dropdown-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 800; color: var(--ink); }
.pd-bell-markall { background: none; border: none; color: var(--brand); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.pd-bell-dropdown-list { max-height: 340px; overflow-y: auto; }
.pd-bell-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.pd-bell-item:last-child { border-bottom: none; }
.pd-bell-item.unread { background: var(--brand-light); }
.pd-bell-item-icon { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 1px solid var(--border); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.pd-bell-item-title { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.pd-bell-item-msg { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; line-height: 1.4; }
.pd-bell-dropdown-footer { display: block; text-align: center; padding: 10px; font-size: 12px; font-weight: 700; color: var(--brand); text-decoration: none; border-top: 1px solid var(--border); background: var(--bg); }
.pd-bell-dropdown-footer:hover { background: var(--brand-light); }

.pd-notif-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; position: relative; transition: background .15s ease; }
.pd-notif-card.unread { background: var(--brand-light); border-color: #b7e4e0; }
.pd-notif-card:not(.unread) { opacity: .82; }
.pd-notif-icon { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--border); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.pd-notif-body { flex: 1; min-width: 0; }
.pd-notif-for { font-size: 11px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.pd-notif-title { font-size: 14px; font-weight: 800; color: var(--ink); }
.pd-notif-message { font-size: 13px; color: var(--ink-muted); margin-top: 3px; line-height: 1.5; }
.pd-notif-meta { font-size: 11px; color: var(--ink-muted); margin-top: 8px; }
.pd-notif-action { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--brand); text-decoration: none; }
.pd-notif-action:hover { text-decoration: underline; }
.pd-notif-dot { position: absolute; top: 16px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

@media (prefers-reduced-motion: reduce) { .pd-bell-dropdown { animation: none; } }
@media (max-width: 480px) {
  .pd-bell-dropdown { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
  .pd-notif-card { padding: 13px; gap: 10px; }
}
.pd-summary-grid div strong { font-size: 14px; color: var(--ink); }

/* ================================================================
   Phase 4B — Live Queue (.pd-queue-*)
   ================================================================ */
.pd-queue-section { margin-bottom: 18px; }
.pd-queue-section-title { font-size: 13px; font-weight: 800; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }

.pd-queue-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; position: relative; overflow: hidden; }
.pd-queue-card.is-next { border-color: var(--brand); box-shadow: 0 6px 24px rgba(7,105,105,.14); }

.pd-queue-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.pd-queue-doctor { font-size: 15px; font-weight: 800; color: var(--ink); }
.pd-queue-meta { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.pd-queue-who { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }

.pd-queue-live-badge { display: inline-flex; align-items: center; gap: 5px; background: #fff1f2; color: #b91c3c; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 4px 9px; border-radius: 20px; flex-shrink: 0; }
.pd-queue-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #dc2626; animation: pdLivePulse 1.6s ease-in-out infinite; }
@keyframes pdLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.pd-queue-status-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pd-queue-token-block span, .pd-queue-serving-block span, .pd-queue-ahead-block span { display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); margin-bottom: 3px; }
.pd-queue-token-block strong { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1; }
.pd-queue-serving-block strong { font-size: 18px; font-weight: 700; color: var(--ink); }
.pd-queue-ahead-block strong { font-size: 18px; font-weight: 700; color: var(--ink); }

.pd-queue-status-label { margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.pd-queue-status-label i { color: var(--brand); }
.pd-queue-sub-status { font-size: 11.5px; color: var(--accent); font-weight: 700; margin-top: 3px; }

.pd-queue-updating { position: absolute; top: 14px; right: 16px; font-size: 10.5px; color: var(--ink-muted); opacity: 0; transition: opacity .2s ease; }
.pd-queue-updating.show { opacity: 1; }

/* "You're Next" takeover state — subtle, professional, not flashy */
.pd-queue-next-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff;
  border-radius: var(--radius); padding: 26px 22px; text-align: center;
  animation: pdNextIn .35s cubic-bezier(.16,1,.3,1) both;
}
.pd-queue-next-hero .bell { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 12px; animation: pdBellRing 1.8s ease-in-out infinite; }
.pd-queue-next-hero .title { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.pd-queue-next-hero .sub { font-size: 13px; opacity: .9; margin-top: 4px; }
.pd-queue-next-hero .token { font-size: 30px; font-weight: 800; margin-top: 14px; }
.pd-queue-next-hero .doctor { font-size: 13px; opacity: .9; margin-top: 2px; }

@keyframes pdNextIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes pdBellRing { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-12deg); } 20% { transform: rotate(10deg); } 30% { transform: rotate(-8deg); } 40% { transform: rotate(6deg); } 50% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) {
  .pd-queue-live-dot, .pd-queue-next-hero, .pd-queue-next-hero .bell { animation: none; }
}

@media (max-width: 480px) {
  .pd-queue-status-row { gap: 10px; }
  .pd-queue-token-block strong { font-size: 22px; }
}
