/*
  Audentia Mind Medcare — Admin Dashboard
  Design philosophy: dense, professional, minimal shadow, hover-driven actions.
  Inspirasi: Stripe, Linear, Notion, Plaid Dashboard.
*/

/* ──────────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ────────────────────────────────────────────────────────────────── */
:root {
  /* Brand - Audentia Mind Medcare */
  --teal-50:  #E6F7F5;
  --teal-100: #B3ECE7;
  --teal-200: #80DFDA;
  --teal-300: #4DD2CC;
  --teal-400: #26C6BE;
  --teal-500: #00B8A9;
  --teal-600: #0B6E6A;
  --teal-700: #075A57;
  --teal-800: #054543;

  /* Neutral — cooler blue-gray for premium feel */
  --gray-25:  #FAFBFC;
  --gray-50:  #F4F6F8;
  --gray-100: #EDF0F3;
  --gray-150: #E3E7EB;
  --gray-200: #D5DAE0;
  --gray-300: #B8C0CC;
  --gray-400: #8E99A8;
  --gray-500: #6B7688;
  --gray-600: #525E6E;
  --gray-700: #3D4756;
  --gray-800: #2A3240;
  --gray-900: #1A2030;
  --gray-950: #0F1420;

  /* Semantic — richer, more vibrant */
  --green-50:  #E8FBF2;
  --green-100: #C6F6DB;
  --green-600: #0DAF64;
  --green-700: #0A9054;

  --amber-50:  #FFF9E6;
  --amber-100: #FEF0C7;
  --amber-600: #E5850A;
  --amber-700: #C27006;

  --red-50:    #FFF0F0;
  --red-100:   #FEDEDE;
  --red-600:   #E5383B;
  --red-700:   #C51E21;

  --blue-50:   #EDF4FF;
  --blue-100:  #DBE8FE;
  --blue-600:  #3B82F6;
  --blue-700:  #2563EB;

  --violet-50: #F3EEFF;
  --violet-600:#8B5CF6;

  /* Roles */
  --bg:           #F0F2F5;
  --surface:      #FFFFFF;
  --surface-2:    var(--gray-50);
  --border:       var(--gray-150);
  --border-strong: var(--gray-300);
  --divider:      var(--gray-150);

  --text:         var(--gray-900);
  --text-2:       var(--gray-600);
  --text-3:       var(--gray-400);
  --text-4:       var(--gray-300);

  --primary:      #123A63;
  --primary-hover: #0B2745;
  --primary-soft: rgba(253, 183, 26, 0.14);
  --primary-tint: rgba(253, 183, 26, 0.22);

  /* Sidebar dark theme */
  --sidebar-bg:    linear-gradient(205deg, #0B2745 0%, #123A63 58%, #B87400 140%);
  --sidebar-text:  rgba(255, 255, 255, 0.65);
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover: rgba(255, 241, 199, 0.08);
  --sidebar-active-bg: linear-gradient(135deg, rgba(253,183,26,0.24), rgba(103,178,208,0.12));
  --sidebar-active-text: #FDB71A;
  --sidebar-divider: rgba(255, 255, 255, 0.06);
  --sidebar-section: rgba(255, 255, 255, 0.3);

  /* Type — slightly tighter scale for density */
  --ff-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ff-mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --fs-2xs:  10px;
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   16px;
  --fs-xl:   18px;
  --fs-2xl:  22px;
  --fs-3xl:  28px;
  --fs-4xl:  34px;

  /* Spacing 4px-grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* Radius — rounder for modern feel */
  --r-xs: 4px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Shadow — premium layered shadows */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --sh-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --sh-lg: 0 12px 24px -4px rgba(16, 24, 40, 0.12), 0 4px 8px -4px rgba(16, 24, 40, 0.04);
  --sh-xl: 0 20px 40px -8px rgba(16, 24, 40, 0.18), 0 8px 16px -8px rgba(16, 24, 40, 0.06);

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Backwards-compat aliases */
  --primary-dark: #0B2745;
  --primary-light: #E7F5FA;
  --primary-op: rgba(18, 58, 99, 0.1);
  --bg-color: var(--bg);
  --text-main: var(--text);
  --text-muted: var(--text-3);
  --success: var(--green-600);
  --success-bg: var(--green-50);
  --warning: var(--amber-600);
  --warning-bg: var(--amber-50);
  --danger: var(--red-600);
  --danger-bg: var(--red-50);
  --info: var(--blue-600);
  --info-bg: var(--blue-50);
  --warning-light: var(--amber-50);
  --success-light: var(--green-50);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-full: var(--r-pill);
  --bg-2: var(--gray-50);
  --amber-200: #FDE68A;
  --amber-800: #92400E;
  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-display);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { text-decoration: none; color: inherit; }

::selection { background: var(--primary-tint); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: var(--r-pill); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

.material-symbols-rounded {
  font-variation-settings: 'opsz' 24, 'wght' 400, 'FILL' 0, 'GRAD' 0;
  user-select: none;
}

kbd {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  color: var(--text-2);
  box-shadow: 0 1px 0 var(--gray-200);
}

/* ──────────────────────────────────────────────────────────────────
   LAYOUT
   ────────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition);
  box-shadow: 4px 0 24px -4px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
}

.sidebar-header {
  padding: var(--s-5) var(--s-5) var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  border-bottom: 1px solid var(--sidebar-divider);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: #FFFFFF;
  color: transparent;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(18, 58, 99, 0.25);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-icon .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'wght' 500;
}

.logo-text { line-height: 1.15; min-width: 0; }

.logo-text h2 {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-text span {
  font-size: var(--fs-2xs);
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.mobile-close {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  margin-left: auto;
  padding: var(--s-1);
  border-radius: var(--r-sm);
}

.mobile-close:hover { background: var(--sidebar-hover); color: white; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-2) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--sidebar-section);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: var(--s-4) var(--s-3) var(--s-2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-section-label:not(:first-child) {
  margin-top: var(--s-2);
  padding-top: var(--s-4);
  border-top: 1px solid var(--sidebar-divider);
}

.nav-section-icon {
  font-size: 13px !important;
  color: var(--sidebar-section);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--s-3);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--transition);
  height: 34px;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--sidebar-active-text);
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
}

.nav-item .material-symbols-rounded {
  font-size: 18px;
  font-variation-settings: 'wght' 320, 'opsz' 22;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .material-symbols-rounded {
  font-variation-settings: 'wght' 380, 'FILL' 1, 'opsz' 22;
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #E5383B, #FF6B6B);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(229, 56, 59, 0.4);
}

.nav-divider {
  height: 1px;
  background: var(--sidebar-divider);
  margin: var(--s-2) var(--s-2);
}

.sidebar-footer {
  padding: var(--s-3);
  border-top: 1px solid var(--sidebar-divider);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 8px var(--s-3);
  border-radius: var(--r-sm);
  transition: background var(--transition);
}

.user-profile:hover { background: var(--sidebar-hover); }

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #67B2D0 0%, #123A63 54%, #FDB71A 135%);
  color: white;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-xs);
  flex-shrink: 0;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(18, 58, 99, 0.28);
}

.user-info { flex: 1; min-width: 0; line-height: 1.25; }

.user-info h4 {
  font-size: var(--fs-sm);
  color: var(--sidebar-text-active);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: var(--fs-2xs);
  color: var(--sidebar-text);
  font-weight: 400;
}

.user-logout {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  color: var(--sidebar-text);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.user-logout:hover {
  color: #FF6B6B;
  background: rgba(229, 56, 59, 0.15);
}

.user-logout .material-symbols-rounded { font-size: 16px; }

/* ──────────────────────────────────────────────────────────────────
   MAIN + TOPBAR
   ────────────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s-6);
  gap: var(--s-3);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: var(--s-1);
  border-radius: var(--r-sm);
}

.menu-toggle:hover { background: var(--gray-100); color: var(--text); }
.menu-toggle .material-symbols-rounded { font-size: 22px; }

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--gray-50);
  border-radius: var(--r-sm);
  padding: 0 var(--s-3);
  flex: 1;
  max-width: 480px;
  height: 32px;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: text;
}

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

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  padding-left: var(--s-2);
  flex: 1;
  font-size: var(--fs-base);
  color: var(--text);
}

.topbar-search input::placeholder { color: var(--text-4); }

.topbar-search .icon {
  font-size: 16px;
  color: var(--text-3);
}

.topbar-search .kbd-hint {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--text-4);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
}

.topbar-actions {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  margin-left: auto;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--gray-50);
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn:active { transform: scale(0.95); }
.icon-btn .material-symbols-rounded { font-size: 18px; }

.icon-btn .indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: var(--red-600);
  border: 2px solid var(--surface);
  border-radius: var(--r-pill);
  display: none;
}

/* ──────────────────────────────────────────────────────────────────
   PAGE
   ────────────────────────────────────────────────────────────────── */
.page-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-8) var(--s-8);
  background: var(--bg);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--s-5);
  gap: var(--s-4);
  flex-wrap: wrap;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--divider);
}

.page-title h1 {
  font-size: var(--fs-3xl);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.page-title p {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: 4px;
  font-weight: 400;
}

.page-actions {
  display: flex;
  gap: var(--s-2);
  align-items: center;
}

/* ──────────────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: var(--fs-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn .material-symbols-rounded {
  font-size: 16px;
  font-variation-settings: 'wght' 500;
}

.btn-primary {
  background: linear-gradient(135deg, #123A63 0%, #1D527D 56%, #D89400 118%);
  color: white;
  box-shadow: 0 1px 2px rgba(18, 58, 99, 0.18), 0 6px 18px -12px rgba(216, 148, 0, 0.65), 0 1px 0 rgba(255,255,255,0.12) inset;
}
.btn-primary:hover { background: linear-gradient(135deg, #0B2745 0%, #123A63 52%, #B87400 120%); box-shadow: 0 3px 10px rgba(18, 58, 99, 0.28), 0 8px 22px -14px rgba(216, 148, 0, 0.7); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-soft); }

.btn-danger { background: var(--red-600); color: white; }
.btn-danger:hover { background: var(--red-700); }

.btn-sm { height: 28px; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.btn-xs { height: 24px; padding: 0 var(--s-2); font-size: var(--fs-xs); gap: 4px; }
.btn-lg { height: 38px; padding: 0 var(--s-4); font-size: var(--fs-base); }

/* Icon-only button */
.btn-icon {
  width: 28px;
  padding: 0;
}

.btn-icon .material-symbols-rounded { font-size: 16px; }

/* ──────────────────────────────────────────────────────────────────
   VIEW TOGGLE
   ────────────────────────────────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}

.view-toggle button {
  background: transparent;
  border: none;
  padding: 0 var(--s-3);
  height: 26px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-3);
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: var(--transition);
}

.view-toggle button .material-symbols-rounded { font-size: 16px; }

.view-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--sh-xs);
}

.view-toggle button:hover:not(.active) { color: var(--text); }

/* ──────────────────────────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────────────────────────── */
.card,
.dashboard-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition-slow);
  box-shadow: var(--sh-sm);
}

.dashboard-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}

.card-header {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
}

.card-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-action {
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: var(--r-xs);
  transition: var(--transition);
}

.card-action:hover { background: var(--primary-soft); }

.card-body { padding: var(--s-4); flex: 1; }

.chart-container {
  width: 100%;
  height: 220px;
  position: relative;
}

/* ──────────────────────────────────────────────────────────────────
   METRICS
   ────────────────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.metric-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s-4);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.metric-card:hover { border-color: var(--border-strong); }

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-2);
}

.metric-title {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon .material-symbols-rounded { font-size: 16px; }

.metric-icon.blue   { background: var(--blue-50); color: var(--blue-600); }
.metric-icon.green  { background: var(--green-50); color: var(--green-600); }
.metric-icon.amber  { background: var(--amber-50); color: var(--amber-700); }
.metric-icon.primary{ background: var(--primary-soft); color: var(--primary); }
.metric-icon.purple { background: var(--violet-50); color: var(--violet-600); }
.metric-icon.red    { background: var(--red-50); color: var(--red-600); }

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}

.metric-value {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.metric-trend {
  font-size: var(--fs-2xs);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--r-xs);
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-trend.up { color: var(--green-700); background: var(--green-50); }
.metric-trend.down { color: var(--red-700); background: var(--red-50); }
.metric-trend.neutral { color: var(--text-3); background: var(--gray-100); }

.metric-subtext {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: var(--s-1);
}

.metric-spark {
  margin-top: var(--s-2);
  height: 32px;
}

/* ──────────────────────────────────────────────────────────────────
   DASHBOARD GRID
   ────────────────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.dashboard-grid.equal { grid-template-columns: 1fr 1fr; }
.dashboard-grid.thirds { grid-template-columns: repeat(3, 1fr); }

/* ──────────────────────────────────────────────────────────────────
   TABLES — DENSE
   ────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--gray-50);
}

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  padding: var(--s-2) var(--s-4);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--gray-50);
  text-align: left;
  white-space: nowrap;
  height: 36px;
  user-select: none;
}

th.sortable {
  cursor: pointer;
}

th.sortable:hover {
  background: var(--gray-100);
  color: var(--text);
}

th.sortable .sort-arrow {
  display: inline-block;
  font-size: 12px;
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.4;
}

th.sortable.sort-asc .sort-arrow,
th.sortable.sort-desc .sort-arrow {
  opacity: 1;
  color: var(--primary);
}

th.checkbox-col,
td.checkbox-col {
  width: 36px;
  padding-left: var(--s-4);
  padding-right: 0;
}

td {
  padding: var(--s-2) var(--s-4);
  font-size: var(--fs-base);
  color: var(--text);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  height: 44px;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover { background: var(--gray-25); }

tbody tr.selected { background: var(--primary-soft); }

tbody tr:last-child td { border-bottom: 0; }

.td-primary {
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

.td-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 1px;
  font-weight: 400;
}

.td-mono {
  font-family: var(--ff-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.patient-cell {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fs-xs);
  flex-shrink: 0;
  letter-spacing: 0;
}

/* Hover-reveal action group di kanan row */
td.row-actions {
  text-align: right;
  padding-right: var(--s-4);
  white-space: nowrap;
}

td.row-actions .action-group {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

tbody tr:hover td.row-actions .action-group {
  opacity: 1;
}

td.row-actions .action-group.always-visible {
  opacity: 1;
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  transition: var(--transition);
}

input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::before {
  content: '';
  width: 10px;
  height: 10px;
  background: white;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:hover {
  border-color: var(--primary);
}

/* ──────────────────────────────────────────────────────────────────
   BADGES
   ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0;
  border: 1px solid transparent;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.8;
}

.badge.tag::before { display: none; }
.badge.tag {
  background: var(--gray-100);
  color: var(--text-2);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.badge.pending,
.badge.badge-pending {
  background: var(--amber-50);
  color: var(--amber-700);
}

.badge.confirmed,
.badge.badge-confirmed {
  background: var(--blue-50);
  color: var(--blue-700);
}

.badge.completed,
.badge.badge-completed {
  background: var(--green-50);
  color: var(--green-700);
}

.badge.cancelled,
.badge.badge-cancelled {
  background: var(--red-50);
  color: var(--red-700);
}

.badge.rescheduled,
.badge.badge-rescheduled {
  background: var(--violet-50);
  color: var(--violet-600);
}

.badge.badge-paid {
  background: var(--green-50);
  color: var(--green-700);
}

.badge.badge-unpaid {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ──────────────────────────────────────────────────────────────────
   TOOLBAR / FILTER BAR
   ────────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.toolbar-spacer { flex: 1; }

.toolbar input[type="text"],
.toolbar input[type="search"] {
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0 var(--s-3) 0 var(--s-8);
  font-size: var(--fs-sm);
  background: var(--surface);
  width: 280px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35'/></svg>");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.toolbar input[type="text"]:focus,
.toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.toolbar select {
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0 var(--s-2);
  font-size: var(--fs-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.toolbar select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-bar {
  display: flex;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
  align-items: center;
}

/* ──────────────────────────────────────────────────────────────────
   PAGINATION FOOTER
   ────────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--divider);
  background: var(--gray-25);
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.pagination-info {
  font-variant-numeric: tabular-nums;
}

.pagination-controls {
  display: flex;
  gap: 2px;
}

.pagination-controls .btn { height: 26px; padding: 0 var(--s-2); }

/* ──────────────────────────────────────────────────────────────────
   PROFILE CARDS (untuk view toggle = card)
   ────────────────────────────────────────────────────────────────── */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-3);
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: var(--transition);
}

.profile-card:hover {
  border-color: var(--border-strong);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: white;
  font-size: var(--fs-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}

.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: var(--r-pill);
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.profile-name {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.profile-role {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.45;
}

.profile-info-table {
  width: 100%;
  font-size: var(--fs-sm);
}

.profile-info-table td {
  padding: 4px 0;
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-sm);
  height: auto;
}

.profile-info-table tr:last-child td { border-bottom: 0; }

.profile-info-table td:first-child { color: var(--text-3); font-weight: 400; }

.profile-info-table td:last-child {
  text-align: right;
  font-weight: 500;
  color: var(--text);
}

.profile-schedule-box {
  background: var(--gray-50);
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-align: left;
  line-height: 1.6;
  border: 1px solid var(--border);
}

.profile-schedule-box strong {
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}

.profile-schedule-box strong .material-symbols-rounded {
  font-size: 14px;
  color: var(--primary);
}

/* ──────────────────────────────────────────────────────────────────
   FORMS
   ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--s-3); }
.form-group.full { grid-column: 1 / -1; }

.form-label,
.form-group label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-bottom: var(--s-1);
  font-weight: 500;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0 var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  background: var(--surface);
  color: var(--text);
  height: 34px;
  transition: var(--transition);
  font-weight: 400;
}

.form-textarea {
  height: auto;
  padding: var(--s-2) var(--s-3);
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-4); }

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 157, 138, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3) var(--s-4);
}

/* ──────────────────────────────────────────────────────────────────
   MODAL & DRAWER
   ────────────────────────────────────────────────────────────────── */
.modal-backdrop,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.5);
  backdrop-filter: blur(6px) saturate(150%);
  -webkit-backdrop-filter: blur(6px) saturate(150%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  animation: fadeIn 160ms ease;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 560px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlide 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}

.modal-title,
.modal-header h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: var(--s-1);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--gray-100); color: var(--text); }
.modal-close .material-symbols-rounded { font-size: 18px; }

.modal-body {
  padding: var(--s-5);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  background: var(--gray-25);
}

/* Drawer (slide from right) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 22, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  animation: fadeIn 160ms ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  animation: drawerSlide 240ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--sh-xl);
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-body {
  padding: var(--s-5);
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  background: var(--gray-25);
}

/* ──────────────────────────────────────────────────────────────────
   TOAST
   ────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--s-5);
  right: var(--s-5);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--gray-900);
  color: white;
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 280px;
  max-width: 420px;
  font-size: var(--fs-sm);
  font-weight: 500;
  animation: toastSlide 180ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--sh-lg);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ──────────────────────────────────────────────────────────────────
   LOGIN PAGE
   ────────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F1923 0%, #1A2332 50%, #162230 100%);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -300px;
  right: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(11, 157, 138, 0.15), transparent 60%);
  pointer-events: none;
  animation: loginGlow 8s ease-in-out infinite alternate;
}

@keyframes loginGlow {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-40px, 40px) scale(1.1); }
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: var(--s-10) var(--s-8);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--s-6);
}

.login-logo .logo-circle {
  width: 52px;
  height: 52px;
  background: #FFFFFF;
  color: transparent;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto var(--s-3);
  letter-spacing: 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(18, 58, 99, 0.28);
}

.login-logo .logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-logo h1 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}

.login-logo p {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-form .form-group { margin-bottom: var(--s-3); }

.login-form .form-input { height: 38px; }

.login-btn {
  width: 100%;
  height: 38px;
  margin-top: var(--s-2);
}

.login-err {
  background: var(--red-50);
  color: var(--red-700);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-3);
  display: none;
  border: 1px solid var(--red-100);
  font-weight: 500;
}

.login-err.show { display: block; }

/* ──────────────────────────────────────────────────────────────────
   HELPERS
   ────────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-3); }
.text-primary { color: var(--primary); }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--ff-mono); font-size: var(--fs-xs); }

.empty-state {
  text-align: center;
  padding: var(--s-10) var(--s-4);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.empty-state .material-symbols-rounded {
  font-size: 36px;
  color: var(--gray-300);
  margin-bottom: var(--s-2);
  display: block;
}

.empty-state h3 {
  font-size: var(--fs-base);
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-state p {
  font-size: var(--fs-sm);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Skeleton loading */
.skel {
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-150) 50%, var(--gray-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin { to { transform: rotate(360deg) } }
.spin { animation: spin 1.4s linear infinite; }

/* Bulk action bar (muncul saat row di-checklist) */
.bulk-bar {
  display: none;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  background: var(--gray-900);
  color: white;
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
  font-size: var(--fs-sm);
  animation: toastSlide 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bulk-bar.show { display: flex; }

.bulk-bar .count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bulk-bar button {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 0;
  padding: 4px var(--s-2);
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bulk-bar button:hover { background: rgba(255,255,255,0.18); }

.bulk-bar .material-symbols-rounded { font-size: 14px; }

.bulk-bar-spacer { flex: 1; }

/* ──────────────────────────────────────────────────────────────────
   CHARTS
   ────────────────────────────────────────────────────────────────── */
.line-chart path.line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 1.4s ease-out forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.line-chart path.area {
  opacity: 0;
  animation: fadeInArea 800ms ease-out 200ms forwards;
}

@keyframes fadeInArea {
  to { opacity: 1; }
}

.line-chart circle {
  opacity: 0;
  animation: fadePoint 280ms ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.06s + 0.5s);
}

@keyframes fadePoint {
  to { opacity: 1; }
}

.donut-chart circle.segment {
  transform-origin: center;
  animation: drawCircle 700ms ease-out forwards;
}

@keyframes drawCircle {
  from { stroke-dasharray: 0 100; }
}

.sparkline {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ──────────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: 1.6fr 1fr; }
}

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid,
  .dashboard-grid.equal { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-close, .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .topbar-search { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .page-container { padding: var(--s-4); }
  .drawer { max-width: 100%; }
}

/* ──────────────────────────────────────────────────────────────────
   COMMAND PALETTE
   ────────────────────────────────────────────────────────────────── */
.cmd-item {
  position: relative;
  transition: background 80ms ease;
}

.cmd-item::after {
  content: '↵';
  position: absolute;
  right: var(--s-4);
  font-size: 12px;
  color: var(--text-4);
  opacity: 0;
}

.cmd-item:hover::after { opacity: 1; }

#cmdPaletteOverlay .modal {
  box-shadow: var(--sh-xl);
}

/* ──────────────────────────────────────────────────────────────────
   POLISH — row action buttons, focus ring, transitions
   ────────────────────────────────────────────────────────────────── */
td.row-actions .action-group .btn-icon {
  border: 1px solid transparent;
  color: var(--text-3);
}

td.row-actions .action-group .btn-icon:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--sh-xs);
}

/* Danger hover untuk delete icon */
td.row-actions .action-group .btn-icon:hover .material-symbols-rounded[data-danger],
td.row-actions .action-group .btn-icon[title="Hapus"]:hover,
td.row-actions .action-group .btn-icon[title="Arsipkan"]:hover,
td.row-actions .action-group .btn-icon[title="Nonaktifkan"]:hover {
  color: var(--red-600);
  border-color: var(--red-100);
  background: var(--red-50);
}

/* Smooth focus rings everywhere */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-radius: var(--r-xs);
}

/* mark / highlight for search */
mark {
  background: var(--amber-100);
  color: var(--text);
  border-radius: 2px;
  padding: 0 1px;
}

/* Sortable header active state polish */
th.sortable.sort-asc,
th.sortable.sort-desc {
  color: var(--text);
}

/* Toolbar select with chevron */
.toolbar select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* Drawer detail rows zebra-free, clean */
.drawer-body table thead { background: var(--gray-50); }

/* Metric card subtle lift on hover */
.metric-card { cursor: default; }

/* Profile card lift */
.profile-card { transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.profile-card:hover { box-shadow: var(--sh-sm); }

/* Nav badge for pending — pulse */
.nav-badge {
  animation: badgePulse 2.4s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11,110,106,0.0); }
  50% { box-shadow: 0 0 0 3px rgba(11,110,106,0.12); }
}

/* Login refinement — premium feel */
.login-page::after {
  content: '';
  position: absolute;
  bottom: -240px;
  left: -160px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(124,58,237,0.06), transparent 70%);
  pointer-events: none;
}

.login-card {
  box-shadow: var(--sh-lg);
}

.login-logo .logo-circle {
  box-shadow: 0 8px 20px -6px rgba(18,58,99,0.45);
}

/* View toggle subtle */
.view-toggle { border: 1px solid var(--border); }

/* Table row primary clickable cue */
.td-primary[onclick] { transition: color var(--transition); }
.td-primary[onclick]:hover { color: var(--primary); }

/* Bulk bar sticky bottom alternative spacing */
.bulk-bar { position: sticky; top: var(--s-2); z-index: 5; }

/* Empty state icon container nicer */
.empty-state .material-symbols-rounded {
  background: var(--gray-50);
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: var(--r-pill);
  margin: 0 auto var(--s-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

/* Card header icon inline */
.card-title .material-symbols-rounded {
  font-size: 16px;
  vertical-align: -3px;
  margin-right: 2px;
  color: var(--text-3);
}

/* ── Image upload widget ── */
.img-upload {
  display: flex;
  gap: var(--s-3);
  align-items: center;
}
.img-upload-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border-strong);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.img-upload-preview.round { border-radius: var(--r-pill); }
.img-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-upload-preview .material-symbols-rounded { font-size: 28px; color: var(--gray-400); }
.img-upload-side { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.img-upload-actions { display: flex; gap: var(--s-2); }
.img-upload-status { font-size: var(--fs-xs); color: var(--text-3); }
