:root {
  --brand-950: #092f31;
  --brand-900: #0b3d3f;
  --brand-800: #105759;
  --brand-700: #147174;
  --brand-600: #16888a;
  --brand-500: #22a4a3;
  --brand-100: #d9f3f0;
  --brand-50: #effaf8;
  --accent-700: #be581f;
  --accent-500: #ed7a32;
  --accent-100: #ffead9;
  --ink-950: #172128;
  --ink-800: #30404a;
  --ink-600: #5d6d76;
  --ink-400: #94a1a8;
  --line: #dfe7e7;
  --surface: #ffffff;
  --canvas: #f5f8f8;
  --success: #18865b;
  --danger: #c83f4d;
  --warning: #c9800e;
  --info: #2374a9;
  --shadow-sm: 0 2px 10px rgba(22, 56, 59, .07);
  --shadow: 0 16px 42px rgba(20, 58, 62, .11);
  --shadow-lg: 0 28px 80px rgba(8, 43, 46, .18);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --sidebar-width: 286px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink-950);
  background: var(--canvas);
  font-family: "Noto Sans Bengali", "Hind Siliguri", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-900); }
button, input, select, textarea { font: inherit; }
button, .btn { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.02em; }
small { color: var(--ink-600); }
code {
  padding: .16rem .38rem;
  border-radius: 6px;
  color: #9b3f18;
  background: #fff3e8;
  font: 500 .84em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 40px)); margin-inline: auto; }
.muted { color: var(--ink-400); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before { width: 24px; height: 2px; content: ""; background: currentColor; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wide { width: 100%; justify-content: center; }

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.3;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(34, 164, 163, .27);
  outline-offset: 2px;
}
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); box-shadow: 0 8px 20px rgba(18, 112, 115, .21); }
.btn.primary:hover { color: #fff; box-shadow: 0 12px 26px rgba(18, 112, 115, .28); }
.btn.light { color: var(--ink-800); border-color: var(--line); background: #fff; }
.btn.light:hover { color: var(--brand-800); border-color: #bdd5d4; background: var(--brand-50); }
.btn.danger { color: #fff; background: var(--danger); }
.btn.danger.ghost { color: var(--danger); border-color: #efbec3; background: #fff7f7; }
.btn.success { color: #fff; background: var(--success); }
.btn.small { min-height: 34px; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.btn.icon-btn { min-height: 34px; padding: 6px 11px; color: var(--brand-800); border-color: #c8dcdb; background: var(--brand-50); font-size: 12px; }

.brand-logo {
  display: inline-grid;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-900));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25), 0 10px 22px rgba(9, 70, 72, .2);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
}

.alert { margin: 0 0 18px; padding: 13px 16px; border: 1px solid; border-radius: 12px; }
.alert.success { color: #0e6241; border-color: #a8dfc8; background: #e9f9f1; }
.alert.danger { color: #982d39; border-color: #f0b8bd; background: #fff0f1; }
.alert.warning { color: #815008; border-color: #f0d29d; background: #fff8e8; }
.alert.info { color: #195c83; border-color: #b2d6e9; background: #eff9fe; }

.status-badge, .metric-pill, .verified-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink-600);
  background: #eef2f3;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: capitalize;
}
.status-badge.verified, .status-badge.active, .status-badge.confirmed, .status-badge.completed, .status-badge.success,
.verified-badge { color: #0d704b; background: #daf5e9; }
.status-badge.pending, .status-badge.pending_confirmation, .status-badge.draft { color: #96600a; background: #fff0ca; }
.status-badge.rejected, .status-badge.cancelled, .status-badge.cancelled_by_patient, .status-badge.cancelled_by_organization,
.status-badge.failure, .status-badge.denied, .status-badge.inactive, .status-badge.suspended { color: #aa3340; background: #ffe1e4; }
.status-badge.published, .status-badge.checked_in { color: #17688e; background: #dff2fb; }
.metric-pill { padding: 7px 12px; color: var(--brand-800); background: var(--brand-100); }

.content-card, .admin-card {
  border: 1px solid rgba(209, 222, 222, .9);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.empty-state { padding: 48px 22px !important; color: var(--ink-600); text-align: center; }
.empty-state b, .empty-state h2 { color: var(--ink-950); }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--ink-600); background: #f8fafa; font-size: 11px; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e9eeee; vertical-align: middle; }
td { color: var(--ink-800); }
td > b, td > small { display: block; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fbfdfd; }
tbody tr:last-child td { border-bottom: 0; }

.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 30px;
  place-items: center;
  background:
    radial-gradient(circle at 10% 15%, rgba(34, 164, 163, .18), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(237, 122, 50, .16), transparent 28%),
    linear-gradient(140deg, #eaf7f5, #f8fbfb 46%, #fff8f1);
}
.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-lg);
}
.setup-card { width: min(600px, 100%); }
.brand-lockup { display: flex; align-items: center; gap: 15px; margin-bottom: 28px; }
.brand-lockup h1 { margin: 0 0 2px; font-size: 27px; }
.brand-lockup p { margin: 0; color: var(--ink-600); }
.back-link { display: block; margin-top: 20px; color: var(--ink-600); text-align: center; }
.token-page { min-height: 100vh; padding: 30px; background: #eaf1f1; }
.token, .token-card { width: min(620px, 100%); margin: 0 auto 22px; padding: 28px; border: 1px solid #cddcdc; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.token-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.token-brand b,.token-brand small { display: block; }.token-brand small{font-size:11px}
.token-serial { padding: 24px 0; text-align: center; }
.token-serial > small,.token-serial > strong { display: block; }
.token-serial > strong { margin: 5px 0 12px; color: var(--brand-900); font-size: 58px; line-height: 1; }
.token dl { margin: 0; }.token dl > div { display: grid; grid-template-columns: 130px 1fr; gap: 15px; padding: 10px 0; border-bottom: 1px solid #edf1f1; }
.token dt { color: var(--ink-600); }.token dd { margin: 0; font-weight: 700; }
.token-note { margin: 20px 0; padding: 12px; border-radius: 10px; color: #84520c; background: #fff7e7; font-size: 12px; }
.token .no-print,.token-toolbar { display: flex; justify-content: center; gap: 9px; }
.token-toolbar { margin-bottom: 20px; }.token-sheet { display: grid; gap: 20px; }

@media (max-width: 900px) {
  .container { width: min(100% - 30px, 720px); }
  .actions { gap: 6px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .container, .narrow { width: calc(100% - 24px); }
  .btn { min-height: 44px; }
  .auth-page { padding: 14px; }
  .auth-card { padding: 24px 20px; border-radius: 20px; }
  .token-page { padding: 12px; }.token{padding:20px}.token dl>div{grid-template-columns:1fr;gap:2px}
  th, td { padding: 11px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
