/* Medlab Policlinic Laboratory & Clinic Management System
   MetroCare Diagnostic & Medical Center — Philippines Demo */

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

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef3f9;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-soft: rgba(13, 148, 136, 0.12);
  --primary-glow: rgba(13, 148, 136, 0.25);
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.12);
  --sidebar-w: 272px;
  --sidebar-collapsed: 80px;
  --topbar-h: 68px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 6px rgba(15, 23, 42, 0.04), 0 20px 40px rgba(15, 23, 42, 0.1);
  --gradient-hero: linear-gradient(135deg, #0d9488 0%, #0284c7 55%, #1d4ed8 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
  --mesh: radial-gradient(ellipse 80% 50% at 20% -10%, rgba(13,148,136,0.18), transparent),
          radial-gradient(ellipse 60% 40% at 90% 10%, rgba(2,132,199,0.12), transparent);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elevated: #111827;
  --bg-subtle: #1a2332;
  --bg-glass: rgba(17, 24, 39, 0.78);
  --border: #1e293b;
  --border-strong: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --primary-soft: rgba(45, 212, 191, 0.14);
  --accent-soft: rgba(56, 189, 248, 0.14);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
  --gradient-card: linear-gradient(180deg, rgba(17,24,39,0.95) 0%, rgba(17,24,39,0.8) 100%);
  --mesh: radial-gradient(ellipse 80% 50% at 20% -10%, rgba(13,148,136,0.2), transparent),
          radial-gradient(ellipse 60% 40% at 90% 10%, rgba(2,132,199,0.15), transparent);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ========== App Shell ========== */
.app-shell { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex; flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-footer-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}

.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gradient-hero);
  display: grid; place-items: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 8px 20px var(--primary-glow);
}

.brand-text { display: flex; flex-direction: column; transition: opacity var(--transition); }
.brand-text strong { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-text span { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 10px 24px;
  scrollbar-width: thin;
}

.nav-section-title {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 14px 12px 8px; transition: opacity var(--transition);
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition); margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft); color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(13,148,136,0.15);
}

.nav-item i, .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
}

.sidebar.collapsed .nav-badge { display: none; }

.sidebar-footer {
  padding: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.main-wrap {
  flex: 1; margin-left: var(--sidebar-w);
  min-width: 0; transition: margin-left var(--transition);
  display: flex; flex-direction: column; min-height: 100vh;
}

.sidebar.collapsed ~ .main-wrap { margin-left: var(--sidebar-collapsed); }

.topbar {
  position: sticky; top: 0; z-index: 90;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-secondary); transition: all var(--transition);
  position: relative;
}

.icon-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-subtle); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--bg-elevated);
}

.search-box {
  flex: 1; max-width: 420px; position: relative;
}

.search-box input {
  width: 100%; height: 42px; padding: 0 16px 0 42px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-elevated); outline: none;
  transition: all var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-box i, .search-box svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted);
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.profile-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  cursor: pointer; transition: all var(--transition);
}

.profile-chip:hover { border-color: var(--border-strong); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient-hero); color: #fff;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700;
}
.profile-chip .meta { display: flex; flex-direction: column; line-height: 1.2; }
.profile-chip .meta strong { font-size: 0.8rem; }
.profile-chip .meta span { font-size: 0.68rem; color: var(--text-muted); }

.content { padding: 24px; flex: 1; background-image: var(--mesh); }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}

.breadcrumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap;
}

.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { opacity: 0.5; }

.page-title {
  font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subtitle { color: var(--text-secondary); margin-top: 4px; font-size: 0.925rem; }

.header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ========== Components ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  font-size: 0.875rem; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px var(--primary-glow); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-elevated); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 0.8rem; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 0.95rem; }
.btn-icon { width: 40px; padding: 0; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-subtle); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
  position: relative; padding: 20px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.45s ease both;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--primary-soft); opacity: 0.7;
}

.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-meta { margin-top: 10px; font-size: 0.78rem; display: flex; align-items: center; gap: 6px; }
.stat-meta.up { color: var(--success); }
.stat-meta.down { color: var(--danger); }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--primary-soft); color: var(--primary);
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 600;
  background: var(--bg-subtle); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-subtle); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 36px; height: 36px; font-size: 0.7rem; }
.user-cell .name { font-weight: 600; font-size: 0.875rem; }
.user-cell .sub { font-size: 0.75rem; color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 6px; color: var(--text-secondary);
}
.form-control {
  width: 100%; height: 42px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-elevated); outline: none;
  transition: all var(--transition);
}
textarea.form-control { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; }
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--bg-subtle);
  border-radius: 12px; width: fit-content; margin-bottom: 20px; flex-wrap: wrap;
}
.tab {
  padding: 8px 14px; border-radius: 10px; font-size: 0.825rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; border: none; background: transparent;
  transition: all var(--transition);
}
.tab.active, .tab:hover { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-elevated); border: 3px solid var(--primary);
  z-index: 1;
}
.timeline-item.done .timeline-dot { background: var(--primary); }
.timeline-item.pending .timeline-dot { border-color: var(--border-strong); }
.timeline-time { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 2px; }
.timeline-title { font-weight: 600; font-size: 0.9rem; }
.timeline-desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

.progress-bar {
  height: 8px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden;
}
.progress-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--gradient-hero); transition: width 0.6s ease;
}

.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: 0.5; }

.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 280px; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px;
  animation: slideIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.info { border-left: 3px solid var(--info); }

.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 240px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 200;
  display: none; animation: fadeUp 0.2s ease;
}
.dropdown.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; font-size: 0.85rem;
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.dropdown-item:hover { background: var(--bg-subtle); color: var(--text); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 520px; background: var(--bg-elevated);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: fadeUp 0.25s ease; max-height: 90vh; overflow: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }

.flow-steps {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
}
.flow-step {
  flex: 1; min-width: 120px; text-align: center; padding: 14px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); font-size: 0.75rem; font-weight: 600;
  position: relative;
}
.flow-step.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.flow-step.done { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.flow-step .num {
  width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 8px;
  display: grid; place-items: center; font-size: 0.7rem;
  background: var(--bg-subtle); color: var(--text-muted);
}
.flow-step.active .num, .flow-step.done .num { background: currentColor; color: #fff; }

.queue-ticket {
  padding: 20px; border-radius: var(--radius); text-align: center;
  background: var(--gradient-hero); color: #fff;
  box-shadow: 0 12px 32px var(--primary-glow);
}
.queue-ticket .ticket-no { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; }
.queue-ticket .ticket-label { opacity: 0.85; font-size: 0.85rem; }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-day {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.8rem; cursor: pointer; transition: all var(--transition);
  background: var(--bg-elevated);
}
.cal-day:hover { border-color: var(--primary); }
.cal-day.today { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.cal-day.has-event::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--primary); margin-top: 4px;
}
.cal-head {
  text-align: center; font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted); padding: 8px 0;
}

.mobile-frame {
  max-width: 400px; margin: 0 auto;
  border: 8px solid #1e293b; border-radius: 36px;
  overflow: hidden; background: var(--bg);
  box-shadow: var(--shadow-lg); min-height: 720px;
  position: relative;
}
.mobile-notch {
  height: 28px; background: #1e293b;
  display: flex; align-items: center; justify-content: center;
}
.mobile-notch span {
  width: 80px; height: 6px; border-radius: 999px; background: #334155;
}
.mobile-content { padding: 20px 18px 32px; }
.mobile-bottom-nav {
  position: sticky; bottom: 0;
  display: flex; justify-content: space-around;
  padding: 12px 8px; background: var(--bg-glass);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
}
.mobile-bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 0.65rem; color: var(--text-muted); font-weight: 600;
}
.mobile-bottom-nav a.active { color: var(--primary); }
.mobile-bottom-nav svg { width: 20px; height: 20px; }

/* Auth pages */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.auth-visual {
  background: var(--gradient-hero);
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; position: relative; overflow: hidden;
}
.auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.15), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.12), transparent 35%);
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand .mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,0.2); display: grid; place-items: center;
  backdrop-filter: blur(8px);
}
.auth-visual h1 {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; max-width: 480px; margin-top: 48px;
}
.auth-visual p { margin-top: 16px; opacity: 0.9; max-width: 400px; font-size: 1.05rem; }
.auth-features { display: grid; gap: 12px; margin-top: 40px; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(8px);
  font-size: 0.9rem; font-weight: 500;
}
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px; background-image: var(--mesh);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-lg);
  animation: fadeUp 0.4s ease;
}
.auth-card h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-secondary); margin-bottom: 28px; font-size: 0.9rem; }
.auth-footer { margin-top: 24px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.otp-inputs input {
  width: 48px; height: 56px; text-align: center; font-size: 1.4rem; font-weight: 700;
  border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elevated);
  outline: none;
}
.otp-inputs input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.role-picker {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
.role-option {
  padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  text-align: center; cursor: pointer; font-size: 0.8rem; font-weight: 600;
  transition: all var(--transition); color: var(--text-secondary);
}
.role-option:hover, .role-option.active {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary);
}

.print-doc {
  max-width: 800px; margin: 0 auto; background: #fff; color: #0f172a;
  padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
[data-theme="dark"] .print-doc { background: var(--bg-elevated); color: var(--text); }
.doc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 24px; border-bottom: 2px solid var(--primary); margin-bottom: 24px;
}
.doc-header h1 { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.doc-meta .label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.doc-meta .value { font-weight: 600; margin-top: 2px; }

.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center;
}
.filter-bar .form-control { width: auto; min-width: 160px; height: 38px; }

.alert {
  padding: 14px 16px; border-radius: 12px; font-size: 0.875rem;
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

.fade-in { animation: fadeUp 0.4s ease both; }

/* Responsive */
@media (max-width: 1200px) {
  .grid-4, .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open { transform: translateX(0); width: var(--sidebar-w); }
  .main-wrap { margin-left: 0 !important; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 768px) {
  .content { padding: 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .kpi-row, .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .page-title { font-size: 1.35rem; }
  .profile-chip .meta { display: none; }
  .search-box { display: none; }
  .doc-meta { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .header-actions, .btn { display: none !important; }
  .main-wrap { margin: 0 !important; }
  .content { padding: 0; background: none; }
  .print-doc { box-shadow: none; border: none; }
}
