/* ═══════════════════════════════════════════════════════════════════════
   Dawak (دواك) — Centro CDX design system, hand-rolled for an RTL Arabic SPA
   Tokens: teal #004a59 · ink #32373c · paper #fff · canvas #f9fafb
   Semantic: emerald=good · amber=borderline · rose=bad · sky=info
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --centro-primary: #004a59;
  --centro-primary-dark: #003943;
  --centro-ink: #32373c;
  --centro-paper: #ffffff;
  --canvas: #f9fafb;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --ink-70: rgba(50, 55, 60, 0.7);
  --ink-60: rgba(50, 55, 60, 0.6);
  --ink-40: rgba(50, 55, 60, 0.4);

  --emerald-bg: #d1fae5; --emerald-text: #065f46; --emerald: #059669;
  --amber-bg: #fef3c7;   --amber-text: #92400e;   --amber: #b45309;
  --rose-bg: #ffe4e6;    --rose-text: #9f1239;    --rose: #e11d48;
  --sky-bg: #e0f2fe;     --sky-text: #075985;     --sky: #0369a1;
  --purple-bg: #f3e8ff;  --purple-text: #6b21a8;
  --indigo-bg: #e0e7ff;  --indigo-text: #3730a3;
  --gray-bg: #f3f4f6;    --gray-text: #4b5563;

  --radius-card: 8px;
  --radius-btn: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --font: 'Tajawal', 'Roboto', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--centro-ink);
  min-height: 100%;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.tnum { font-variant-numeric: tabular-nums; }
a { color: var(--centro-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top navigation (AdminNav) ─────────────────────────────────────────── */

.topnav {
  background: var(--centro-primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: visible;          /* the dropdown must escape the bar */
  max-width: 100vw;
}
.topnav .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; color: #fff;
  margin-inline-end: 18px; white-space: nowrap;
}
.topnav .brand img { height: 30px; filter: brightness(0) invert(1); }
.topnav .brand .brand-sub { font-size: 11px; font-weight: 400; opacity: 0.75; display: block; line-height: 1; }
.topnav a.nav-link {
  color: rgba(255, 255, 255, 0.82);
  padding: 7px 9px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.topnav a.nav-link:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; color: #fff; }
.topnav a.nav-link.active { background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 700; }
.topnav .nav-links { display: flex; align-items: center; gap: 2px; min-width: 0; flex-shrink: 0; }
.topnav .spacer { flex: 1; min-width: 8px; }
.topnav .user-role { display: block; font-size: 10.5px; opacity: .7; line-height: 1; }

/* ── Overflow ("more") menu — shows what the bar can't fit ─────────────── */

.topnav .nav-more { position: relative; flex-shrink: 0; }
.topnav .more-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff; border-radius: var(--radius-btn);
  padding: 6px 11px; font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.topnav .more-btn:hover { background: rgba(255, 255, 255, 0.24); }
.topnav .more-btn .chev { font-size: 10px; transition: transform 0.18s; }
.topnav .nav-more.open .more-btn .chev { transform: rotate(180deg); }
.topnav .nav-more.open .more-btn { background: rgba(255, 255, 255, 0.26); }
.topnav .more-count {
  background: #fff; color: var(--centro-primary);
  border-radius: 999px; min-width: 17px; height: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; padding: 0 4px;
}
/* the "there is more here" pulse — fades once the user has opened it */
.topnav .nav-more.hint .more-btn { animation: more-pulse 2s ease-in-out 3; }
@keyframes more-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28); }
}
.topnav .more-menu {
  display: none; position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  background: var(--centro-paper); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  min-width: 210px; padding: 6px; z-index: 60; max-height: 70vh; overflow-y: auto;
}
.topnav .nav-more.open .more-menu { display: block; }
.topnav .more-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-btn);
  color: var(--centro-ink); font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.topnav .more-menu a:hover { background: var(--canvas); text-decoration: none; }
.topnav .more-menu a.active { background: var(--sky-bg); color: var(--sky-text); font-weight: 700; }
.topnav .more-menu .sec {
  font-size: 10.5px; color: var(--ink-40); padding: 8px 12px 4px; font-weight: 700;
  border-top: 1px solid var(--border-light); margin-top: 4px;
}
.topnav .more-menu .sec:first-child { border-top: none; margin-top: 0; }

/* ── Burger (mobile / very narrow) ─────────────────────────────────────── */

.topnav .burger {
  display: none; flex-direction: column; gap: 4px; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  padding: 8px 6px; margin-inline-end: 6px;
}
.topnav .burger span {
  display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.topnav .burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topnav .burger.open span:nth-child(2) { opacity: 0; }
.topnav .burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 780px) {
  .topnav { padding: 0 12px; }
  .topnav .burger { display: flex; }
  .topnav .nav-links {
    display: none; position: absolute; top: 56px; inset-inline-start: 0; inset-inline-end: 0;
    background: var(--centro-primary-dark); flex-direction: column; align-items: stretch;
    padding: 8px; gap: 2px; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3); z-index: 55;
    max-height: calc(100vh - 56px); overflow-y: auto;
  }
  .topnav .nav-links.open { display: flex; }
  .topnav .nav-links a.nav-link { padding: 11px 14px; font-size: 14px; }
  .topnav .nav-more { display: none !important; }
  .topnav .brand .brand-sub { display: none; }
  .topnav .user-box span { display: none; }
}
.topnav .clock-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.topnav .clock-chip .adv { cursor: pointer; opacity: 0.9; font-weight: 700; }
.topnav .clock-chip .adv:hover { opacity: 1; }
.topnav .user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-inline-start: 12px; white-space: nowrap; }
.topnav .user-box button {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff; border-radius: var(--radius-btn);
  padding: 4px 12px; cursor: pointer; font-family: var(--font); font-size: 12.5px;
}
.topnav .user-box button:hover { background: rgba(255, 255, 255, 0.1); }

/* ── Layout ────────────────────────────────────────────────────────────── */

.page { max-width: 1280px; margin: 0 auto; padding: 24px 20px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; color: var(--centro-primary); }
.page-head .sub { color: var(--ink-60); font-size: 13px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

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

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--centro-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}
.card h3 { font-size: 14.5px; font-weight: 700; color: var(--centro-ink); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h3 .hint { font-weight: 400; font-size: 12px; color: var(--ink-40); }

/* ── KPI tiles ─────────────────────────────────────────────────────────── */

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--centro-paper); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 13px 15px;
}
.kpi .label { font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink-60); font-weight: 500; margin-bottom: 3px; }
.kpi .value { font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; color: var(--centro-ink); }
.kpi .sub { font-size: 11.5px; color: var(--ink-40); margin-top: 2px; }
.kpi.tone-good .value { color: #047857; }
.kpi.tone-warn .value { color: var(--amber-text); }
.kpi.tone-bad .value { color: var(--rose-text); }
.kpi.tone-brand .value { color: var(--centro-primary); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--centro-primary); color: #fff;
  border: none; border-radius: var(--radius-btn);
  padding: 8px 16px; font-size: 13.5px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  transition: opacity 0.12s;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary {
  background: var(--centro-paper); color: var(--centro-primary);
  border: 1px solid var(--centro-primary);
}
.btn.ghost { background: transparent; color: var(--centro-primary); border: 1px solid var(--border); }
.btn.danger { background: var(--rose); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.success { background: #047857; }

/* ── Status badges (pill + dot + ring) ─────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 2px 10px 2px 11px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--emerald-bg); color: var(--emerald-text); }
.badge.warn { background: var(--amber-bg); color: var(--amber-text); }
.badge.bad { background: var(--rose-bg); color: var(--rose-text); }
.badge.info { background: var(--sky-bg); color: var(--sky-text); }
.badge.neutral { background: var(--gray-bg); color: var(--gray-text); }
.badge.special { background: var(--indigo-bg); color: var(--indigo-text); }
.badge.vip { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; }

/* ── Tables ────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: start; font-size: 11.5px; font-weight: 700; color: var(--ink-60);
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #f8fafb; }
.num { font-variant-numeric: tabular-nums; }

/* ── Filter bar ────────────────────────────────────────────────────────── */

.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input[type='text'], .filter-bar select, .form-field input, .form-field select, .form-field textarea {
  font-family: var(--font); font-size: 13.5px; color: var(--centro-ink);
  background: var(--centro-paper); border: 1px solid var(--border);
  border-radius: var(--radius-btn); padding: 7px 12px; outline: none;
}
.filter-bar input[type='text']:focus, .form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--centro-primary); box-shadow: 0 0 0 3px rgba(0, 74, 89, 0.1);
}
.filter-bar input[type='text'] { min-width: 240px; }
.chip {
  border: 1px solid var(--border); background: var(--centro-paper);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; color: var(--ink-70); font-family: var(--font);
}
.chip.active { background: var(--centro-primary); border-color: var(--centro-primary); color: #fff; }
.chip-x { border: 0; background: none; cursor: pointer; color: var(--ink-70); font-size: 12px; padding: 0 0 0 2px; }
.chip-x:hover { color: #e11d48; }

/* ── Forms ─────────────────────────────────────────────────────────────── */

.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-70); }
.form-field textarea { min-height: 90px; resize: vertical; line-height: 1.6; }

/* ── Drawer ────────────────────────────────────────────────────────────── */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35);
  z-index: 90; opacity: 0; transition: opacity 0.18s;
}
.drawer-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
  width: min(560px, 94vw); background: var(--centro-paper);
  z-index: 91; box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(-105%); transition: transform 0.2s ease;
  display: flex; flex-direction: column;
}
[dir='rtl'] .drawer { transform: translateX(105%); }
[dir='rtl'] .drawer.open, .drawer.open { transform: translateX(0); }
.drawer.open { transform: translateX(0); }
.drawer .drawer-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--canvas);
}
.drawer .drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer .close-x { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink-60); }

/* ── Toast ─────────────────────────────────────────────────────────────── */

#toast-root { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--centro-ink); color: #fff; border-radius: 8px;
  padding: 10px 18px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.2s ease;
  max-width: 90vw;
}
.toast.good { background: #047857; }
.toast.bad { background: var(--rose); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── Loading ───────────────────────────────────────────────────────────── */

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--centro-primary);
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Empty state ───────────────────────────────────────────────────────── */

.empty { text-align: center; padding: 36px 16px; color: var(--ink-40); }
.empty .emoji { font-size: 34px; margin-bottom: 8px; }

/* ── Kanban (deliveries) ───────────────────────────────────────────────── */

.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .kanban { grid-template-columns: 1fr 1fr; } }
.kanban .col { background: var(--gray-bg); border-radius: var(--radius-card); padding: 10px; min-height: 120px; }
.kanban .col > .col-title { font-size: 12.5px; font-weight: 700; color: var(--ink-70); padding: 2px 6px 10px; display: flex; justify-content: space-between; }
.kanban .kcard {
  background: var(--centro-paper); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 11px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); font-size: 13px;
}
.kanban .kcard .kname { font-weight: 700; margin-bottom: 2px; }
.kanban .kcard .kmeta { color: var(--ink-60); font-size: 12px; margin-bottom: 8px; }

/* ── WhatsApp simulator ────────────────────────────────────────────────── */

.sim-layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .sim-layout { grid-template-columns: 1fr; } }
.contact-list { max-height: 660px; overflow-y: auto; }
.contact {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-btn);
  cursor: pointer; align-items: center; border-bottom: 1px solid var(--border-light);
}
.contact:hover { background: var(--canvas); }
.contact.active { background: var(--sky-bg); }
.contact .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--centro-primary); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.contact .c-name { font-weight: 600; font-size: 13.5px; }
.contact .c-last { font-size: 11.5px; color: var(--ink-40); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }

.phone-frame {
  max-width: 420px; margin: 0 auto; border-radius: 30px;
  border: 10px solid #1f2937; background: #efe7dd;
  overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.phone-head {
  background: #075e54; color: #fff; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.phone-head .avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.phone-head .ph-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.phone-head .ph-sub { font-size: 11px; opacity: 0.8; }
.chat-scroll {
  height: 430px; overflow-y: auto; padding: 14px 10px;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0, transparent 40%);
  display: flex; flex-direction: column; gap: 6px;
}
.bubble {
  max-width: 82%; border-radius: 10px; padding: 8px 11px; font-size: 13px;
  line-height: 1.55; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  position: relative;
}
.bubble.from-pharmacy { background: #fff; align-self: flex-start; border-start-start-radius: 2px; }
.bubble.from-patient { background: #dcf8c6; align-self: flex-end; border-start-end-radius: 2px; }
.bubble .b-time { display: block; font-size: 10px; color: var(--ink-40); margin-top: 3px; text-align: end; }
.bubble .b-tag { font-size: 10px; color: var(--sky-text); font-weight: 600; }
.wa-buttons { display: flex; flex-direction: column; gap: 5px; align-self: flex-start; width: 82%; }
.wa-btn {
  background: #fff; color: #00a5f4; border: none; border-radius: 8px;
  padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font); box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}
.wa-btn:hover { background: #f0fdff; }
.chat-input { display: flex; gap: 8px; padding: 10px; background: #f0f2f5; }
.chat-input input {
  flex: 1; border: none; border-radius: 999px; padding: 10px 16px;
  font-family: var(--font); font-size: 13.5px; outline: none;
}
.chat-input button {
  background: #075e54; color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer; font-size: 16px;
}
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 10px; background: #f0f2f5; border-top: 1px solid var(--border-light); }
.quick-chips .chip { font-size: 11.5px; padding: 3px 10px; }

/* ── Charts ────────────────────────────────────────────────────────────── */

.chart-box { position: relative; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 30;
  background: var(--centro-ink); color: #fff; border-radius: 6px;
  padding: 6px 10px; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, -110%); opacity: 0; transition: opacity 0.08s;
  font-variant-numeric: tabular-nums;
}
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--ink-70); }
.chart-legend .li { display: flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ── Activity feed ─────────────────────────────────────────────────────── */

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border-light); font-size: 13px; align-items: flex-start; }
.feed-item:last-child { border-bottom: none; }
.feed-item .f-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; background: var(--gray-bg); }
.feed-item .f-time { color: var(--ink-40); font-size: 11px; }

/* ── Login page ────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--centro-primary) 0%, var(--centro-primary-dark) 100%);
  padding: 20px;
}
.login-card {
  background: var(--centro-paper); border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  width: 400px; max-width: 100%; padding: 36px 32px;
}
.login-card .logo-row { text-align: center; margin-bottom: 8px; }
.login-card .logo-row img { height: 44px; }
.login-card h1 { font-size: 24px; font-weight: 800; color: var(--centro-primary); text-align: center; }
.login-card .sub { text-align: center; color: var(--ink-60); font-size: 13px; margin-bottom: 24px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 6px; }
.login-error { background: var(--rose-bg); color: var(--rose-text); border-radius: var(--radius-btn); padding: 9px 12px; font-size: 13px; margin-bottom: 12px; display: none; }
.login-hint { margin-top: 18px; text-align: center; font-size: 12px; color: var(--ink-40); }
.powered { text-align: center; margin-top: 22px; color: rgba(255,255,255,0.7); font-size: 12px; }

/* Sign-in vendor mark — deliberately prominent: this is the first screen a
   client sees, and the sign-off should read as branding, not fine print. */
.login-powered {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border-light);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.login-powered .lead {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-40); font-weight: 500;
}
.login-powered .mark {
  font-size: 22px; font-weight: 800; letter-spacing: 0.01em;
  color: var(--centro-primary); line-height: 1.15;
}

/* Footer sign-off on every signed-in page */
.app-footer {
  margin-top: 28px; padding: 16px 24px 24px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}
.app-footer .powered-by { font-size: 12.5px; color: var(--ink-40); letter-spacing: 0.02em; }
.app-footer .powered-by strong { color: var(--centro-primary); font-weight: 700; }

/* ── Misc ──────────────────────────────────────────────────────────────── */

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--ink-60); font-size: 12.5px; }
.small { font-size: 12px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
hr.sep { border: none; border-top: 1px solid var(--border-light); margin: 14px 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.info-grid .ig { background: var(--canvas); border-radius: var(--radius-btn); padding: 8px 12px; }
.info-grid .ig .k { font-size: 11px; color: var(--ink-60); }
.info-grid .ig .v { font-weight: 700; font-size: 13.5px; }
.timeline { border-inline-start: 2px solid var(--border); padding-inline-start: 14px; display: flex; flex-direction: column; gap: 10px; }
.timeline .t-item { position: relative; font-size: 12.5px; }
.timeline .t-item::before {
  content: ''; position: absolute; inset-inline-start: -19.5px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--centro-primary);
  border: 2px solid var(--centro-paper);
}

/* current page lives inside the overflow menu — make that obvious */
.topnav .nav-more.has-active .more-btn {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

/* ── Staff assistant ─────────────────────────────────────────────────────
   Floating helper, present on every screen. Sits bottom-right as a fixed
   overlay so it never disturbs the page beneath it. */

.assistant-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--centro-primary); color: #fff;
  border: none; cursor: pointer; font-size: 24px; line-height: 1;
  box-shadow: 0 6px 22px rgba(0, 74, 89, 0.38);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.assistant-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 74, 89, 0.45); }
.assistant-fab:active { transform: translateY(0); }

.assistant-panel {
  position: fixed; bottom: 88px; right: 22px; z-index: 61;
  width: 400px; max-width: calc(100vw - 44px);
  max-height: min(620px, calc(100vh - 130px));
  background: var(--centro-paper); border: 1px solid var(--border-light);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.assistant-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }

.assistant-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--centro-primary); color: #fff;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.assistant-close {
  background: transparent; border: none; color: #fff; cursor: pointer;
  font-size: 15px; opacity: 0.85; padding: 2px 6px;
}
.assistant-close:hover { opacity: 1; }

.assistant-body { padding: 12px; overflow-y: auto; }
.assistant-input {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-light); border-radius: var(--radius-btn);
  margin-bottom: 10px;
}
.assistant-input:focus { outline: 2px solid var(--centro-primary); outline-offset: -1px; }

.assistant-hint { font-size: 11.5px; color: var(--ink-40); margin: 10px 0 6px; font-weight: 600; }
.assistant-empty { font-size: 13px; color: var(--ink-60); padding: 10px 2px; }
.assistant-answer {
  font-size: 13.5px; line-height: 1.7; background: var(--canvas);
  border-radius: var(--radius-btn); padding: 10px 12px; white-space: pre-wrap;
}

.assistant-example, .assistant-row {
  display: block; width: 100%; text-align: start; cursor: pointer;
  background: var(--canvas); border: 1px solid transparent;
  border-radius: var(--radius-btn); padding: 8px 11px; margin-bottom: 5px;
  font-family: inherit; font-size: 13px; color: var(--centro-ink);
}
.assistant-example:hover, .assistant-row:hover {
  border-color: var(--centro-primary); background: #fff;
}
.assistant-example b, .assistant-row b { display: block; font-weight: 700; }
.assistant-example span, .assistant-row span {
  display: block; font-size: 11.5px; color: var(--ink-40); margin-top: 1px;
}

.assistant-card { padding: 2px; }
.assistant-name { font-size: 17px; font-weight: 800; color: var(--centro-primary); }
.assistant-sub { font-size: 12px; color: var(--ink-60); margin-bottom: 10px; }
.assistant-alerts { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

.assistant-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
  background: var(--canvas); border-radius: var(--radius-btn); padding: 10px;
}
.assistant-fact { display: flex; flex-direction: column; }
.assistant-fact .k { font-size: 10.5px; color: var(--ink-40); }
.assistant-fact .v { font-size: 13px; font-weight: 700; }
.assistant-fact .v.bad { color: #be123c; }

.assistant-meds { font-size: 12.5px; color: var(--ink-60); line-height: 1.6; }
.assistant-actions { display: flex; gap: 6px; margin-top: 12px; }

@media (max-width: 560px) {
  .assistant-panel { right: 12px; left: 12px; width: auto; bottom: 82px; }
  .assistant-fab { bottom: 16px; right: 16px; }
  .assistant-facts { grid-template-columns: 1fr; }
}
