/* ═══════════════════════════════════════════════════════
   ORAKARE — main.css
   Shared design system. All modules use these tokens.
═══════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --teal:       #3a7a7e;
  --teal-dark:  #2c5f62;
  --teal-lt:    #eaf4f4;
  --teal-glow:  #3a7a7e22;
  --ink:        #1e2e2f;
  --ink-mid:    #334a4c;
  --ink-soft:   #6b8a86;
  --surface:    #f4faf9;
  --white:      #fff;
  --border:     #cce0e0;
  --danger:     #c0392b;
  --warn:       #d4830a;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(58,122,126,0.10);
  --sidebar-w:  224px;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "DM Sans", sans-serif;
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
}

/* ── App shell ───────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.app-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { padding: 24px 28px; flex: 1; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #0d3d35;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-placeholder {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255,255,255,0.1);
  padding: 3px; flex-shrink: 0;
}

.sidebar-clinic-name {
  font-family: "DM Serif Display", serif;
  font-size: 13px; color: #fff; line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-doctor {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-group { padding: 10px 8px 2px; }

.nav-group-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,0.3);
  padding: 0 8px; margin-bottom: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 7px;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  font-size: 12px; font-weight: 400;
  transition: all .15s; margin-bottom: 1px;
  user-select: none;
}
.nav-item:hover  { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.nav-item.active { background: rgba(255,255,255,0.13); color: #fff; font-weight: 600; }
.nav-item-icon   { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  padding: 1px 7px; border-radius: 20px;
}
.nav-badge-alert { background: #c0392b !important; color: #fff !important; }

.sidebar-bottom {
  margin-top: auto; padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-family: "DM Serif Display", serif; font-size: 20px; color: var(--teal-dark); }
.topbar-date  { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg,var(--teal-lt),#fff);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-title { font-family: "DM Serif Display", serif; font-size: 19px; color: var(--teal-dark); }
.card-sub   { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.card-body  { padding: 22px; }

/* ── Stat cards ──────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 22px; }

.scard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative; overflow: hidden;
}
.scard::before {
  content: ""; position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--teal);
}
.slabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
.sval   { font-family: "DM Serif Display", serif; font-size: 28px; color: var(--ink); margin-top: 4px; }
.sicon  { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; opacity: .12; }

/* ── Sections ────────────────────────────────────────── */
.section { display: none; animation: fadeUp .25s ease; }
.section.active { display: block; }
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ── Forms ───────────────────────────────────────────── */
.fg  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ff  { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 11px; font-weight: 700;
  color: var(--ink-mid);
  text-transform: uppercase; letter-spacing: .06em;
}
.req { color: var(--danger); }

.field input,
.field select,
.field textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px; color: var(--ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.field textarea      { resize: vertical; min-height: 76px; }
.field input[readonly] { background: var(--teal-lt); color: var(--teal-dark); font-weight: 600; }

.fsec {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 0;
}
.fsec span {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--teal); white-space: nowrap;
}
.fsec::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  padding: 10px 20px; border-radius: 9px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .18s;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn-p { background: var(--teal); color: #fff; box-shadow: 0 2px 10px rgba(58,122,126,0.3); }
.btn-p:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn-g { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--border); }
.btn-g:hover { border-color: var(--teal); color: var(--teal); }
.btn-s { background: #d1f5ee; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.btn-s:hover { background: var(--teal); color: #fff; }
.btn-w { background: #fff3e0; color: var(--warn); border: 1.5px solid var(--warn); }
.btn-w:hover { background: var(--warn); color: #fff; }
.btn-danger { background: #fde8e6; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.wa-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 8px;
  background: #25D366; color: #fff;
  font-size: 12px; font-weight: 600;
  cursor: pointer; border: none;
  font-family: "DM Sans", sans-serif;
  text-decoration: none; transition: opacity .15s;
}
.wa-btn:hover { opacity: .85; }

/* ── Patient search dropdown ─────────────────────────── */
.pt-search-wrap { position: relative; }
.pt-search-wrap input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: "DM Sans", sans-serif; font-size: 14px;
  outline: none; transition: border-color .2s;
}
.pt-search-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }

.pt-drop {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--teal); border-radius: 8px;
  box-shadow: 0 8px 32px rgba(44,95,98,0.18);
  z-index: 1000; max-height: 220px; overflow-y: auto;
  margin-top: 4px; display: none;
}
.pt-drop.open { display: block; }
.pt-opt { padding: 10px 14px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.pt-opt:last-child { border-bottom: none; }
.pt-opt:hover { background: var(--teal-lt); }
.pt-opt-id { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.pt-sel {
  background: var(--teal-lt); border: 1.5px solid var(--teal);
  border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.pt-sel-name { font-weight: 600; color: var(--teal-dark); }
.pt-sel-info { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ── Treatment cards ─────────────────────────────────── */
.tx-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  margin-bottom: 10px; cursor: pointer;
  transition: all .2s; position: relative;
}
.tx-card:hover  { border-color: var(--teal); box-shadow: var(--shadow); }
.tx-card.selected { border-color: var(--teal); background: var(--teal-lt); }
.tx-id   { font-size: 11px; font-weight: 700; color: var(--teal-dark); }
.tx-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.tx-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.tx-badge { position: absolute; top: 12px; right: 12px; }

/* ── Pills / badges ──────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-ongoing  { background: #fff3cd; color: #856404; }
.pill-complete { background: #d1f5ee; color: var(--teal-dark); }
.pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Progress bar ────────────────────────────────────── */
.prog-wrap { background: #eaf4f4; border-radius: 20px; height: 7px; margin-top: 8px; overflow: hidden; }
.prog-bar  { height: 100%; border-radius: 20px; background: linear-gradient(90deg,var(--teal-dark),var(--teal)); transition: width .4s; }

/* ── Billing bar ─────────────────────────────────────── */
.billbar {
  background: linear-gradient(135deg,var(--teal-dark),var(--teal));
  border-radius: 10px; padding: 14px 18px; color: #fff;
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 14px;
}
.bi-label { font-size: 10px; opacity: .75; text-transform: uppercase; letter-spacing: .07em; }
.bi-val   { font-family: "DM Serif Display", serif; font-size: 18px; margin-top: 3px; }
.bi-val.grand   { color: #d4f5e9; }
.bi-val.balance { color: #ffd6d6; }

/* ── Consumables table ───────────────────────────────── */
.ctable { width: 100%; border-collapse: collapse; margin-top: 4px; }
.ctable th {
  background: var(--teal-lt); padding: 8px 10px; text-align: left;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--teal-dark);
}
.ctable td { padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ctable input, .ctable select {
  width: 100%; padding: 6px 8px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-family: "DM Sans", sans-serif; font-size: 13px; outline: none;
}
.ctable input:focus, .ctable select:focus { border-color: var(--teal); }
.ctable input[type=number] { text-align: right; }
.ctfoot td {
  background: var(--teal-lt); font-weight: 700; font-size: 13px;
  color: var(--teal-dark); padding: 9px 10px;
  border-top: 2px solid var(--teal);
}
.camt   { color: var(--teal-dark); font-weight: 600; font-size: 13px; padding: 6px 8px; display: block; }
.rmbtn  { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 16px; padding: 2px 5px; border-radius: 4px; }
.rmbtn:hover { background: #fde8e6; color: var(--danger); }

/* ── Modals / overlays ───────────────────────────────── */
.ov {
  position: fixed; inset: 0;
  background: rgba(14,28,26,0.55);
  display: none; place-items: center;
  z-index: 500; backdrop-filter: blur(3px);
}
.ov.open { display: grid; }

.modal {
  background: #fff; border-radius: 16px;
  width: 90%; max-width: 520px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(44,95,98,0.25);
  animation: mIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mIn { from{transform:scale(.92);opacity:0} to{transform:scale(1);opacity:1} }

.mhdr {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.mcls {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--ink-soft); padding: 2px 6px; border-radius: 6px;
}
.mcls:hover { background: var(--teal-lt); color: var(--teal); }
.mbdy { padding: 20px; }
.mact { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ── Toast ───────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 999; max-width: 360px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.ok { background: var(--teal); }
#toast.er { background: var(--danger); }
#toast.wn { background: var(--warn); }

/* ── Search bar ──────────────────────────────────────── */
.sbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; padding: 0 22px; }
.sbar input {
  flex: 1; padding: 9px 15px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-family: "DM Sans", sans-serif; font-size: 14px;
  outline: none; transition: all .2s;
}
.sbar input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
.sbar select {
  padding: 9px 13px; border: 1.5px solid var(--border);
  border-radius: 9px; font-family: "DM Sans", sans-serif; font-size: 13px; outline: none;
}

/* ── Records ─────────────────────────────────────────── */
.pt-rec { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.pt-rec-hdr {
  padding: 14px 20px;
  background: linear-gradient(135deg,var(--teal-lt),#fff);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.pt-rec-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.pt-rec-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pt-txs { padding: 0 20px 16px; }

.tx-sum { border: 1px solid var(--border); border-radius: 8px; margin-top: 12px; overflow: hidden; }
.tx-sum-hdr {
  padding: 10px 14px; background: var(--teal-lt);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.tx-sum-id   { font-size: 11px; font-weight: 700; color: var(--teal-dark); }
.tx-sum-name { font-size: 13px; font-weight: 600; color: var(--ink); }

.sit-row {
  display: flex; gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px; align-items: flex-start;
}
.sit-row:last-child { border-bottom: none; }
.sit-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sit-info  { flex: 1; }
.sit-date  { font-size: 11px; color: var(--ink-soft); }
.sit-done  { font-size: 13px; font-weight: 500; color: var(--ink); margin-top: 2px; }
.sit-rx    { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.sit-paid  { text-align: right; flex-shrink: 0; }

/* ── Appointment statuses ────────────────────────────── */
.astatus { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.ast-new       { background: #e8f4fd; color: #1a6fa8; }
.ast-confirmed { background: #d1f5ee; color: #0f766e; }
.ast-arrived   { background: #fff3cd; color: #856404; }
.ast-inchair   { background: #e8d5f5; color: #6b21a8; }
.ast-completed { background: #d1fae5; color: #065f46; }
.ast-cancelled { background: #fde8e6; color: #c0392b; }
.ast-noshow    { background: #f3f4f6; color: #6b7280; }

/* ── Day calendar ────────────────────────────────────── */
.cal-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 0; min-height: 600px; }
.cal-timeline { border-right: 1px solid var(--border); overflow-y: auto; position: relative; background: #fafcfc; }
.cal-hour { display: flex; align-items: flex-start; border-bottom: 1px solid var(--border); min-height: 52px; position: relative; }
.cal-hour-label { width: 52px; flex-shrink: 0; font-size: 11px; color: var(--ink-soft); font-weight: 500; padding: 4px 8px; text-align: right; line-height: 1; }
.cal-hour-line  { flex: 1; position: relative; }
.cal-half-line  { position: absolute; top: 50%; left: 0; right: 0; border-top: 1px dashed rgba(0,0,0,0.05); }
.cal-event {
  position: absolute; left: 4px; right: 4px;
  border-radius: 6px; padding: 3px 7px; font-size: 11px;
  cursor: pointer; overflow: hidden; z-index: 2;
  transition: opacity .15s; border-left: 3px solid;
}
.cal-event:hover { opacity: .85; }
.cal-now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.cal-now-dot  { position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-list-panel { overflow-y: auto; display: flex; flex-direction: column; }
.cal-empty-slot { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--ink-soft); }

/* ── Appointments list ───────────────────────────────── */
.appt-row {
  display: grid;
  grid-template-columns: 90px 1fr 140px 100px 120px 90px;
  align-items: center; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .15s; cursor: pointer;
}
.appt-row:hover { background: var(--teal-lt); }
.appt-row.header-row {
  background: #f8faf9;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-soft); cursor: default;
  border-bottom: 2px solid var(--border);
}
.appt-row.header-row:hover { background: #f8faf9; }
.atime    { font-weight: 700; color: var(--teal-dark); font-size: 14px; }
.aname    { font-weight: 600; font-size: 13px; color: var(--ink); }
.aphone   { font-size: 12px; color: var(--ink-soft); }
.aservice { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.appt-date-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.date-nav-btn {
  background: var(--teal-lt); border: 1px solid var(--border);
  color: var(--teal-dark); width: 34px; height: 34px;
  border-radius: 8px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.date-nav-btn:hover { background: var(--teal); color: #fff; }

.appt-detail-panel {
  background: var(--teal-lt); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin-top: 12px; display: none;
}
.appt-detail-panel.open { display: block; }

/* ── Finance ─────────────────────────────────────────── */
.fin-stat { background: #fff; border: 0.5px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.fin-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); font-weight: 700; margin-bottom: 6px; }
.fin-stat-val   { font-family: "DM Serif Display", serif; font-size: 26px; color: var(--ink); }
.fin-stat-sub   { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* ── Inventory ───────────────────────────────────────── */
.inv-stock-ok   { color: var(--teal-dark); font-weight: 700; }
.inv-stock-low  { color: #c0392b; font-weight: 700; }
.inv-stock-zero { color: #c0392b; font-weight: 700; font-size: 11px; text-transform: uppercase; }
.inv-expiry-warn { color: #b45309; font-size: 11px; font-weight: 600; }
.inv-expiry-ok   { color: var(--ink-soft); font-size: 12px; }

/* ── Notifications ───────────────────────────────────── */
.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background .15s; }
.notif-row:hover { background: var(--teal-lt); }
.notif-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--teal-lt); border: 1.5px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--teal-dark); flex-shrink: 0;
}
.notif-body   { flex: 1; min-width: 0; }
.notif-name   { font-weight: 600; font-size: 13px; color: var(--ink); }
.notif-detail { font-size: 12px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.notif-msg    {
  font-size: 12px; color: var(--ink); margin-top: 6px;
  padding: 8px 10px; background: #f8faf9;
  border-radius: 7px; border-left: 3px solid var(--teal);
  line-height: 1.5; white-space: pre-wrap;
}
.notif-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.notif-empty   { padding: 28px; text-align: center; color: var(--ink-soft); font-size: 13px; }

/* ── Login ───────────────────────────────────────────── */
#loginScreen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg,var(--teal-dark) 0%,var(--teal) 60%,#5a9a9e 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
#loginScreen.hidden { display: none; }

.login-card {
  background: #fff; border-radius: 20px;
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(14,42,44,0.35);
}
.login-logo-placeholder {
  width: 64px; height: 64px; border-radius: 14px;
  background: var(--teal-lt);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 16px;
}
.login-title { font-family: "DM Serif Display", serif; font-size: 24px; color: var(--teal-dark); text-align: center; }
.login-sub   { font-size: 13px; color: var(--ink-soft); text-align: center; margin-top: 4px; margin-bottom: 28px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mid); margin-bottom: 6px; }
.login-field input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-family: "DM Sans", sans-serif; font-size: 14px; color: var(--ink);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
.login-btn {
  width: 100%; padding: 12px;
  background: var(--teal); color: #fff; border: none; border-radius: 10px;
  font-family: "DM Sans", sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 8px; transition: background .18s;
}
.login-btn:hover    { background: var(--teal-dark); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-err    { color: var(--danger); font-size: 13px; text-align: center; margin-top: 10px; min-height: 18px; }
.login-footer { font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: 20px; }

/* ── Empty state ─────────────────────────────────────── */
.empty     { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty .ei { font-size: 44px; margin-bottom: 12px; }

/* ── Loader ──────────────────────────────────────────── */
.loading-bar {
  height: 3px; background: var(--teal);
  position: fixed; top: 0; left: 0; z-index: 9999;
  animation: loadbar 1.2s ease-in-out infinite;
}
@keyframes loadbar { 0%{width:0;opacity:1} 70%{width:85%;opacity:1} 100%{width:100%;opacity:0} }

/* ── Consultants ─────────────────────────────────────── */
.con-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 10px; display: flex; align-items: flex-start; gap: 14px;
}
.con-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--teal-lt); border: 2px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--teal-dark); flex-shrink: 0;
}
.con-info    { flex: 1; }
.con-name    { font-size: 15px; font-weight: 600; color: var(--ink); }
.con-spec    { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.con-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ── Tables (shared) ─────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f8faf9; padding: 9px 16px; text-align: left;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-soft);
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--ink); vertical-align: middle;
}
.data-table tr:hover td { background: var(--teal-lt); }

/* ── Dashboard grids ─────────────────────────────────── */
.dash-grid { display: grid; gap: 16px; grid-template-columns: repeat(4,1fr); margin-bottom: 20px; }
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.dash-3col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.dash-row  { display: flex; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px; transition: background .15s; }
.dash-row:hover { background: var(--teal-lt); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .app-content { margin-left: 0; }

  .mobile-nav-toggle {
    display: flex !important;
    position: fixed; bottom: 20px; right: 20px;
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--teal); color: #fff;
    align-items: center; justify-content: center;
    font-size: 22px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(58,122,126,0.4);
    z-index: 300; border: none;
  }

  .sidebar.mobile-open {
    display: flex !important;
    z-index: 400;
  }

  main { padding: 14px; }
  .fg  { grid-template-columns: 1fr; }
  .stats, .dash-grid { grid-template-columns: 1fr 1fr; }
  .billbar { grid-template-columns: 1fr 1fr; }
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-timeline { display: none; }
  .appt-row { grid-template-columns: 80px 1fr 100px; }
  .appt-row > *:nth-child(n+4) { display: none; }
  .dash-2col, .dash-3col { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats, .dash-grid { grid-template-columns: 1fr; }
}
