/* =====================================================================
   MediDesk247 — stylesheet
   ===================================================================== */

:root {
  /* Primary — red (matches www.krivalis.com) */
  --teal: #c8102e;
  --teal-dark: #a00d24;
  --teal-soft: #fce8ea;
  /* Neutrals — krivalis dark/grey */
  --blue: #2d2d2d;
  --ink: #222222;
  --muted: #555555;
  --line: #e5e5e5;
  --bg: #f5f5f5;
  --card: #ffffff;
  --danger: #c8102e;
  --danger-soft: #fce8ea;
  --green: #1a7f37;
  --green-soft: #d8f3e0;
  --amber: #b45309;
  --amber-soft: #fdeeca;
  --blue-soft: #ebebeb;
  --shadow: 0 8px 32px rgba(0, 0, 0, .08);
  --shadow-hover: 0 16px 48px rgba(0, 0, 0, .12);
  --radius: 8px;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
}

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

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(15,23,42,.04);
}
.navbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar-superadmin .navbar-inner { max-width: 1440px; }
.nav-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.nav-theme-toggle {
  background: var(--bg); border:1px solid var(--line); border-radius:10px;
  padding:8px 11px; cursor:pointer; font-size:16px; line-height:1;
  transition: background .2s, border-color .2s, transform .1s;
}
.nav-theme-toggle:hover { border-color:var(--teal); transform:translateY(-1px); }
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -.2px;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 51px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  transition: transform .2s;
}
.brand-logo:hover { transform: scale(1.05); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(200,16,46,.35);
}
.nav-links { display: flex; align-items: center; justify-content:flex-end; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav-more-trigger { background:transparent; color:#334155; padding:8px 12px; border:0; font:inherit; font-weight:600; font-size:14px; border-radius:9px; cursor:pointer; white-space:nowrap; }
.nav-more-trigger:hover, .nav-more-trigger.active { background:var(--teal-soft); color:var(--teal-dark); }
.nav-more-trigger span { font-size:12px; }
.nav-dropdown-menu .logout-link { color:var(--danger) !important; }
.nav-links a {
  padding: 8px 12px;
  border-radius: 9px;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--teal-soft); text-decoration: none; }
.nav-links a.active { background: var(--teal-soft); color: var(--teal-dark); }
.nav-links a.nav-cta {
  background: var(--teal);
  color: #fff;
  margin-left: 6px;
}
.nav-links a.nav-cta:hover { background: var(--teal-dark); }
.user-chip {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-soft);
  padding: 7px 11px;
  border-radius: 999px;
  margin: 0 2px 0 8px;
  white-space: nowrap;
}
.logout-link { color: var(--danger) !important; }
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-trigger { cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  padding: 8px;
  z-index: 100;
  animation: slideDown .18s ease-out;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--teal-soft); color: var(--teal-dark); text-decoration: none; }
.nav-dropdown-menu a.active { background: var(--teal-soft); color: var(--teal-dark); }

/* ---------- Layout ---------- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------- Cards & grids ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 20px; }
.card h3 { margin: 0 0 14px; font-size: 17px; }
.card .muted { color: var(--muted); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: 0 0 auto;
}
.stat-icon.teal   { background: var(--teal-soft); }
.stat-icon.blue   { background: var(--blue-soft); }
.stat-icon.green  { background: var(--green-soft); }
.stat-icon.amber  { background: var(--amber-soft); }
.stat b { font-size: 24px; display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); text-decoration: none; }
.btn-outline { background: #fff; color: var(--teal-dark); border-color: var(--line); }
.btn-outline:hover { border-color: var(--teal); background: var(--teal-soft); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-teal  { background: var(--teal-soft);  color: var(--teal-dark); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue  { background: var(--blue-soft);  color: var(--blue); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red   { background: var(--danger-soft); color: var(--danger); }
.badge-gray  { background: #eef2f6; color: #64748b; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #334155; }
.input, select.input, textarea.input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.input:focus { outline: 2px solid #f3b8c2; border-color: var(--teal); }
textarea.input { resize: vertical; min-height: 72px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dob-age { display:block; min-height:20px; margin-top:5px; color:var(--teal-dark); font-size:13px; font-weight:700; }
.dob-age.invalid { color:var(--danger); }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-soft); color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-info    { background: var(--blue-soft); color: #075985; border-color: #bae6fd; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table .num { text-align: right; }

/* ---------- Landing / auth ---------- */
.hero {
  padding: 34px 0 10px;
  text-align: center;
}
.hero .pill {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -1px;
  margin: 0 auto 14px;
  max-width: 720px;
  line-height: 1.12;
}
.hero p.sub {
  color: var(--muted);
  font-size: 17px;
  max-width: 620px;
  margin: 0 auto 26px;
}
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 34px 0; }
@media (max-width: 720px) { .role-cards { grid-template-columns: 1fr; } }
.role-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.role-card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 14px;
}
.role-card h2 { margin: 0 0 8px; font-size: 21px; }
.role-card ul { margin: 12px 0 20px; padding-left: 18px; color: #475569; }
.role-card ul li { margin-bottom: 6px; }

.auth-wrap {
  max-width: 520px;
  margin: 26px auto 0;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #e7edf0;
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 20px;
}
.auth-tabs a {
  text-align: center;
  padding: 10px;
  border-radius: 9px;
  font-weight: 700;
  color: var(--muted);
}
.auth-tabs a.on { background: #fff; color: var(--teal-dark); box-shadow: var(--shadow); }
.auth-tabs a:hover { text-decoration: none; }

/* ---------- Feature list (landing) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.feature .f-icon { font-size: 24px; }
.feature h4 { margin: 10px 0 6px; font-size: 16px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- UID banner ---------- */
.uid-banner {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: 0 10px 24px rgba(200,16,46,.28);
  margin-bottom: 22px;
}
.uid-banner .uid-label { font-size: 13px; opacity: .85; text-transform: uppercase; letter-spacing: .6px; }
.uid-banner .uid-value { font-size: 28px; font-weight: 800; letter-spacing: 1px; }

/* ---------- Search ---------- */
.searchbar { display: flex; gap: 10px; }
.searchbar .input { flex: 1; }

/* ---------- Doctor / patient cards ---------- */
.doctor-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.doctor-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex: 0 0 auto;
}
.doctor-card h3 { margin: 0 0 4px; font-size: 18px; }
.doctor-card .spec { color: var(--teal-dark); font-weight: 700; font-size: 14px; }
.doctor-card p { margin: 6px 0; color: var(--muted); font-size: 14px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; margin-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal); border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--teal);
}
.tl-item .tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-item .tl-head b { font-size: 15px; }
.tl-item .tl-time { color: var(--muted); font-size: 13px; }
.tl-item .tl-body { color: #475569; font-size: 14px; margin-top: 4px; }

/* ---------- Prescription item rows ---------- */
.rx-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 900px) { .rx-row { grid-template-columns: 1fr 1fr; } }
.rx-row .input { padding: 8px 10px; }

/* ---------- Slot chips ---------- */
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.slot-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  text-align: center;
}
.slot-chip .day { font-weight: 800; color: var(--teal-dark); }
.slot-chip .time { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.slot-chip .left { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 30px;
}
.footer-inner {
  max-width: 1140px; margin: 0 auto; padding: 20px;
  color: var(--muted); font-size: 13px; text-align: center;
}

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.center { text-align: center; }
.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
}
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.kbd {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 7px; font-size: 12px; font-family: ui-monospace, monospace;
}

/* ---------- Print (prescription) ---------- */
@media print {
  .navbar, .site-footer, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #cbd5e1; }
  .page-break { page-break-before: always; }
  /* Centered letterhead for print */
  .card div[style*="border-bottom:2px solid"] { text-align: center !important; }
  .card div[style*="border-bottom:2px solid"] > div { justify-content: center !important; text-align: center !important; }
}

/* ---------- Prescription letterhead centered ---------- */
.letterhead-centered {
  text-align: center;
  border-bottom: 2px solid var(--teal);
  padding-bottom: 14px;
  margin-bottom: 12px;
}
.letterhead-centered .lh-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.letterhead-centered .lh-clinic {
  font-size: 20px;
  font-weight: 800;
  color: #7a0a1c;
  line-height: 1.2;
}
.letterhead-centered .lh-doc {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e5e5e5;
}

/* ---------- Prescription attachments (handwritten) ---------- */
.att-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att-thumb {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
}
.att-thumb img { width: 100%; height: 120px; object-fit: cover; display: block; cursor: zoom-in; }
.att-thumb .cap { padding: 6px 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.checkbox-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.checkbox-line input { width: 17px; height: 17px; accent-color: var(--teal); }


/* =====================================================================
   Calendar widget
   ===================================================================== */
.cal { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:16px; }
.cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cal-title { font-weight:800; font-size:16px; color:var(--ink); }
.cal-nav { background:var(--teal-soft); color:var(--teal-dark); border:none; border-radius:8px; width:34px; height:34px; font-size:18px; cursor:pointer; font-weight:700; }
.cal-nav:hover { background:#f6cdd5; }
.cal-week { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cal-cell { position:relative; min-height:44px; border:1px solid var(--line); border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:14px; color:var(--ink); background:#fff; }
.cal-cell.empty { border:none; background:transparent; }
.cal-cell.has { cursor:pointer; font-weight:700; border-color:#e9aab6; background:#fdf3f4; }
.cal-cell.has:hover { background:var(--teal-soft); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--teal); }
.cal-cell.sel { background:var(--teal); color:#fff; border-color:var(--teal); }
.cal-cell .dot { position:absolute; top:5px; right:6px; width:6px; height:6px; border-radius:50%; background:var(--teal); }
.cal-cell.sel .dot { background:#fff; }
.cal-times { margin-top:14px; }
.cal-loading, .cal-err { color:var(--muted); font-size:14px; padding:8px 2px; }
.cal-daylabel { font-weight:800; font-size:14px; margin-bottom:10px; color:var(--teal-dark); }
.times-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:10px; }
.time-chip { border:1px solid var(--line); border-radius:11px; padding:10px 12px; background:#fff; }
.time-chip .t { font-weight:800; color:var(--ink); }
.time-chip .s { font-size:12px; color:var(--muted); margin:3px 0 8px; }
.time-chip .row { display:flex; gap:6px; flex-wrap:wrap; }
.time-chip button { flex:1; }
.time-chip-select { border:1px solid var(--line); border-radius:11px; padding:11px 12px; background:#fff; cursor:pointer; width:100%; text-align:center; font-family:inherit; }
.time-chip-select .t { font-weight:800; }
.time-chip-select .s { font-size:12px; color:var(--muted); margin-top:3px; }
.time-chip-select:hover { border-color:var(--teal); }
.time-chip-select.on { border-color:var(--teal); background:var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.time-chip-select:disabled { opacity:.5; cursor:not-allowed; }

/* bulk slot selection toolbar (doctor/admin calendar) */
.cal-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 12px;
  background: var(--teal-soft); border: 1px solid #e9aab6; border-radius: 10px;
  font-size: 13px;
}
.cal-selall-wrap { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--teal-dark); cursor: pointer; }
.cal-selall-wrap input, .cal-sel { accent-color: var(--teal); cursor: pointer; }
.cal-count { margin-right: auto; }

/* booking summary strip */
.book-summary { background:var(--teal-soft); border:1px solid #e9aab6; border-radius:11px; padding:12px 14px; margin-top:14px; font-size:14px; display:none; }
.book-summary.show { display:block; }
.book-summary b { color:var(--teal-dark); }

/* location (address) option cards — booking page & allot widget */
.loc-options { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:10px; }
.loc-card {
  display:flex; align-items:flex-start; gap:10px;
  border:1px solid var(--line); border-radius:11px; padding:12px 14px;
  cursor:pointer; background:#fff; transition:border-color .15s, box-shadow .15s;
}
.loc-card:hover { border-color:var(--teal); }
.loc-card:has(input:checked) { border-color:var(--teal); box-shadow:0 0 0 2px var(--teal-soft); }
.loc-card input { margin-top:3px; accent-color:var(--teal); }
.loc-body { flex:1; line-height:1.45; }
.loc-body b { color:var(--teal-dark); }
.loc-body .muted { margin-top:2px; }
@media (max-width: 640px) { .loc-options { grid-template-columns: 1fr; } }

/* =====================================================================
   Mobile / responsive navigation & layout
   ===================================================================== */
.nav-toggle {
  display: none;
  background: var(--teal-soft);
  color: var(--teal-dark);
  border: none;
  border-radius: 9px;
  font-size: 20px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  line-height: 1;
}
@media (max-width: 860px) {
  .navbar-inner { min-height:62px; padding:8px 12px; flex-wrap:wrap; gap:10px; }
  .brand { min-width:0; flex:1 1 auto; }
  .brand-logo { height:42px; max-width:145px; }
  .brand > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .nav-actions { order:2; }
  .nav-toggle { display: block; }
  .nav-links {
    order:3;
    display: none;
    width: 100%;
    margin-left:0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 2px;
    border-top:1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-more-trigger { padding: 11px 12px; text-align: left; width:100%; }
  .nav-links a.nav-cta { margin-left: 0; text-align: center; }
  .user-chip { margin: 4px 0; text-align: center; }
  .logout-link { text-align: center; }
  .nav-dropdown { width:100%; }
  .nav-dropdown-menu { position:static; min-width:0; margin:2px 0 4px; box-shadow:none; border-radius:8px; padding:4px; animation:none; }
  .nav-dropdown-menu a { padding:9px 12px; }
  .nav-more-trigger { justify-content:space-between; }
}

/* Mobile table & form helpers */
@media (max-width: 640px) {
  .container { padding: 18px 12px 50px; }
  .spread { align-items: flex-start; }
  .searchbar { flex-direction: column; }
  .searchbar .input { max-width: none !important; }
  .auth-tabs { grid-template-columns: 1fr 1fr !important; }
  .auth-tabs a { padding: 8px 6px; font-size: 13px; }
  .doctor-card { flex-direction: column; }
  .rx-row { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 27px; }
}

/* ---------- Confirmation modal (Proceed / Don't proceed) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20, 20, 20, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 12px; max-width: 420px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.25); overflow: hidden;
  animation: modalPop .18s ease-out;
}
@keyframes modalPop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { padding: 16px 20px; font-weight: 700; font-size: 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; color: var(--ink); font-size: 14.5px; line-height: 1.55; }
.modal-actions { padding: 14px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--bg); }
.modal-actions .btn { margin: 0; }

/* ---------- Show/hide password toggle ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 46px; width: 100%; }
.pw-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--line); background: #f8fafc; border-radius: 8px;
  padding: 3px 8px; cursor: pointer; font-size: 15px; line-height: 1.4;
}
.pw-toggle:hover { background: #eef2f7; }

/* ---------- Specialization / superspecialization picker ---------- */
.subspec-box {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-wrap: wrap; gap: 8px 16px; background: #f8fafc;
  max-height: 160px; overflow-y: auto;
}
.subspec-box label {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 13px; margin: 0; cursor: pointer;
}
.subspec-box input[type="checkbox"] { width: auto; margin: 0; }

/* ---------- Shared-slot early-arrival note ---------- */
.slot-note {
  border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: #713f12;
}
.slot-note b { color: #92400e; }

/* ---------- Inline calendar flash (AJAX slot actions) ---------- */
.cal-flash {
  border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; font-size: 13.5px;
  border: 1px solid var(--line); background: #f8fafc;
}
.cal-flash.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.cal-flash.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

/* ---------- Spinner ---------- */
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--teal);
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cal-loading { display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--muted); }

/* ---------- Dark Mode (manual toggle via html.dark-mode) ---------- */
html.dark-mode {
  --bg: #0f172a; --card: #1e293b; --ink: #e2e8f0; --muted: #94a3b8; --line: #334155;
  --teal-soft: #2a1a1d; --blue-soft: #1e293b; --green-soft: #132a1f; --amber-soft: #2a2210; --danger-soft: #2a1a1d;
}
html.dark-mode body { background: var(--bg); color: var(--ink); }
html.dark-mode .navbar { background: #1e293b; border-color: var(--line); }
html.dark-mode .card, html.dark-mode .stat, html.dark-mode .role-card, html.dark-mode .feature, html.dark-mode .cal, html.dark-mode .time-chip, html.dark-mode .time-chip-select, html.dark-mode .loc-card, html.dark-mode .slot-chip, html.dark-mode .modal-card { background: var(--card); border-color: var(--line); color: var(--ink); }
html.dark-mode .input, html.dark-mode select.input, html.dark-mode textarea.input { background: #0f172a; color: var(--ink); border-color: var(--line); }
html.dark-mode .table th { color: var(--muted); border-color: var(--line); }
html.dark-mode .table td { border-color: var(--line); }
html.dark-mode .table tbody tr:hover { background: #1e293b; }
html.dark-mode .btn-outline { background: var(--card); color: var(--ink); border-color: var(--line); }
html.dark-mode .site-footer { background: #1e293b; border-color: var(--line); }
html.dark-mode .modal-actions { background: #0f172a; }

/* ---------- Waiting List ---------- */
.waiting-badge { background: #fef3c7; color: #92400e; border:1px solid #fde68a; padding:4px 8px; border-radius:999px; font-size:12px; }

/* ---------- Video ---------- */
.video-container { position:relative; width:100%; height:600px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#000; }
.video-container iframe { width:100%; height:100%; border:0; }

/* ---------- Timeline grouped ---------- */
.timeline-group { margin-bottom:24px; }
.timeline-group h4 { margin:0 0 12px; font-size:14px; color:var(--teal-dark); border-bottom:1px solid var(--line); padding-bottom:6px; }

/* ---------- Reviews ---------- */
.stars { color:#f59e0b; letter-spacing:2px; }
.star-input { display:flex; gap:4px; }
.star-input button { background:none; border:none; font-size:24px; cursor:pointer; color:#cbd5e1; }
.star-input button.on { color:#f59e0b; }

/* ---------- Autocomplete ---------- */
.autocomplete-list { position:absolute; background:#fff; border:1px solid var(--line); border-radius:8px; max-height:180px; overflow-y:auto; z-index:10; width:100%; box-shadow:var(--shadow); }
.autocomplete-item { padding:8px 12px; cursor:pointer; font-size:14px; }
.autocomplete-item:hover { background:var(--teal-soft); }

/* ---------- Voice notes ---------- */
.voice-player { display:flex; align-items:center; gap:10px; padding:10px; background:var(--bg); border-radius:10px; }

/* ---------- Collapsible sections for prescription ---------- */
.collapsible-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: all .2s;
  box-shadow: var(--shadow);
}
.collapsible-trigger:hover { border-color: var(--teal); background: var(--teal-soft); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.collapsible-trigger .arrow { transition: transform .2s; }
.collapsible-trigger.open .arrow { transform: rotate(180deg); }
.collapsible-content {
  display: none;
  margin-top: 12px;
  animation: slideDown .25s ease-out;
}
.collapsible-content.open { display: block; }
@keyframes slideDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }

/* ---------- Tabs for dashboard ---------- */
.tabs { display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
.tab-btn {
  padding:10px 18px;
  border-radius:10px;
  border:1px solid var(--line);
  background: var(--card);
  cursor:pointer;
  font-weight:700;
  font-size:14px;
  transition: all .2s;
}
.tab-btn:hover { border-color: var(--teal); background: var(--teal-soft); }
.tab-btn.active { background: var(--teal); color:#fff; border-color: var(--teal); }
.tab-content { display:none; }
.tab-content.active { display:block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ---------- Advanced options grid ---------- */
.advanced-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap:14px; }
.advanced-card {
  background: var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:18px;
  text-align:center;
  transition: all .2s;
  box-shadow: var(--shadow);
}
.advanced-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--teal); }
.advanced-card .icon { font-size:32px; margin-bottom:8px; }
.advanced-card h4 { margin:0 0 6px; font-size:15px; }
.advanced-card p { font-size:12px; color:var(--muted); margin:0 0 10px; }

/* ---------- Improved UI/UX ---------- */
.card { transition: box-shadow .2s, transform .15s; }
.card:hover { box-shadow: var(--shadow-hover); }
.stat { transition: all .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn { transition: all .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.table tbody tr { transition: background .15s; }
.badge { transition: all .15s; }

/* ---------- Enhanced dark mode ---------- */
html.dark-mode .autocomplete-list { background: #1e293b; border-color: #334155; }
html.dark-mode .autocomplete-item { color: #e2e8f0; }
html.dark-mode .autocomplete-item:hover { background: #2a1a1d; }
html.dark-mode .uid-banner { background: linear-gradient(135deg, #7a0a1c, #c8102e); }
html.dark-mode .collapsible-trigger { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html.dark-mode .collapsible-trigger:hover { background: #2a1a1d; border-color: #c8102e; }
html.dark-mode .tab-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }
html.dark-mode .tab-btn.active { background: #c8102e; color:#fff; }
html.dark-mode .advanced-card { background: #1e293b; border-color: #334155; }
html.dark-mode .badge-teal { background: #2a1a1d; color: #fca5a5; }
html.dark-mode .badge-green { background: #132a1f; color: #86efac; }
html.dark-mode .badge-blue { background: #1e293b; color: #94a3b8; }
html.dark-mode .badge-amber { background: #2a2210; color: #fcd34d; }
html.dark-mode .badge-red { background: #2a1a1d; color: #fca5a5; }
html.dark-mode .badge-gray { background: #334155; color: #94a3b8; }
html.dark-mode .alert-success { background: #132a1f; color: #86efac; border-color: #166534; }
html.dark-mode .alert-error { background: #2a1a1d; color: #fca5a5; border-color: #991b1b; }
html.dark-mode .alert-info { background: #1e293b; color: #7dd3fc; border-color: #075985; }
html.dark-mode .brand { color: #e2e8f0; }
html.dark-mode .nav-links a { color: #94a3b8; }
html.dark-mode .nav-more-trigger { color: #cbd5e1; }
html.dark-mode .nav-more-trigger:hover, html.dark-mode .nav-more-trigger.active { background: #2a1a1d; color: #fca5a5; }
html.dark-mode .nav-links a:hover { background: #2a1a1d; color: #fca5a5; }
html.dark-mode .nav-links a.active { background: #2a1a1d; color: #fca5a5; }
html.dark-mode .doctor-card, html.dark-mode .slot-chip { background: #1e293b; border-color: #334155; }
html.dark-mode .kbd { background: #0f172a; border-color: #334155; color: #94a3b8; }
html.dark-mode #dark-mode-toggle { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0; }

/* ---------- Loading shimmer ---------- */
.shimmer { background: linear-gradient(90deg, var(--bg) 25%, #e2e8f0 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
