/* ============================================
   Banjar ZERO TB — Design System
   Ocean Blue Palette | Balinese Aesthetics
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Ocean Blue Palette */
  --primary: #0077B6;
  --primary-dark: #023E8A;
  --primary-light: #90E0EF;
  --primary-glow: rgba(0, 119, 182, 0.15);

  /* Semantic Colors */
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-dark: #0A1628;
  --text: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --danger: #B00020;
  --danger-light: #FDECEA;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --warning: #E65100;
  --warning-light: #FFF3E0;
  --info: #0288D1;
  --info-light: #E1F5FE;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(0, 119, 182, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

/* ---------- Offline Banner ---------- */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, var(--danger), #D32F2F);
  color: #fff;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(176, 0, 32, 0.4);
  animation: slideDown 0.3s ease;
}

.offline-banner.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

body.is-offline {
  padding-top: 40px;
}

body.is-offline .btn,
body.is-offline button,
body.is-offline input,
body.is-offline select,
body.is-offline textarea {
  pointer-events: none !important;
  opacity: 0.5 !important;
}

/* ---------- App Container ---------- */
#app {
  min-height: 100vh;
}

/* ---------- Header ---------- */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.app-header .logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.app-header .logo-area h1 {
  font-size: 1.2rem;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-header .logo-area .logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-header {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 50%, #00B4D8 100%);
  color: #fff;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(144, 224, 239, 0.15) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(5%, 3%);
  }
}

/* Hero with Gunung Agung background */
.hero-bg {
  background: linear-gradient(160deg, rgba(2, 62, 138, 0.75) 0%, rgba(0, 119, 182, 0.65) 50%, rgba(0, 180, 216, 0.6) 100%),
    url('/assets/background.webp') center/cover no-repeat;
  min-height: 280px;
}

.hero-bg::before {
  background: radial-gradient(circle at 30% 50%, rgba(144, 224, 239, 0.1) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.hero-image {
  width: 100%;
  max-width: 400px;
  margin: var(--space-lg) auto 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

/* Balinese ornament divider */
.ornament-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
  margin: var(--space-md) auto;
  border-radius: var(--radius-full);
}

/* ---------- Navigation Cards ---------- */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-lg);
  max-width: 600px;
  margin: 0 auto;
}

.nav-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.nav-card:hover::before {
  transform: scaleX(1);
}

.nav-card:active {
  transform: translateY(-2px);
}

.nav-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto var(--space-sm);
}

.nav-card .card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-dark);
  margin-bottom: var(--space-xs);
}

.nav-card .card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- Page Container ---------- */
.page {
  padding: var(--space-lg);
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title {
  font-size: 1.4rem;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-title .back-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
}

.page-title .back-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary-light);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  outline: none;
}

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

.filter-select {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 119, 182, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0, 119, 182, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #C62828;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #1B5E20;
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.78rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-fab {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
}

.data-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--primary-glow);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: var(--space-xs);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-curiga {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-sampel {
  background: var(--info-light);
  color: var(--info);
}

.badge-negatif {
  background: var(--success-light);
  color: var(--success);
}

.badge-positif {
  background: var(--danger-light);
  color: var(--danger);
}

/* PMO Status Badges */
.badge-pengobatan {
  background: var(--info-light);
  color: var(--info);
}

.badge-tuntas {
  background: var(--success-light);
  color: var(--success);
}

.badge-dropout {
  background: var(--danger-light);
  color: var(--danger);
}

/* Investigasi Status Badges */
.badge-belum {
  background: var(--border-light);
  color: var(--text-muted);
}

.badge-sudah {
  background: var(--success-light);
  color: var(--success);
}

.badge-tpt {
  background: var(--warning-light);
  color: var(--warning);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.form-control {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg-card);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Checkbox group (Screening) */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checkbox-item:hover {
  background: var(--primary-glow);
  border-color: var(--primary-light);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-item label {
  font-size: 0.85rem;
  cursor: pointer;
  margin: 0;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-xl);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0.8;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 250px;
  max-width: 380px;
}

.toast-success {
  background: var(--success);
  color: #fff;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-info {
  background: var(--primary);
  color: #fff;
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ---------- Confirm Dialog ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.5);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.2s ease;
}

.confirm-dialog p {
  margin-bottom: var(--space-lg);
  color: var(--text);
  font-size: 0.95rem;
}

.confirm-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* ---------- PMO Grid ---------- */
.pmo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-sm);
}

.pmo-day {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  position: relative;
}

.pmo-day:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.pmo-day.minum {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.pmo-day.tidak {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.pmo-day .day-num {
  font-weight: 600;
}

.pmo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-fast);
}

.pmo-card:hover {
  box-shadow: var(--shadow-md);
}

.pmo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.pmo-patient-name {
  font-weight: 700;
  color: var(--primary-dark);
}

/* ---------- Chart ---------- */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.chart-container canvas {
  width: 100% !important;
  height: 250px !important;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: var(--space-md);
}

/* ---------- Ranking Table ---------- */
.ranking-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.ranking-badge.gold {
  background: linear-gradient(135deg, #FFD700, #FFA000);
}

.ranking-badge.silver {
  background: linear-gradient(135deg, #C0C0C0, #9E9E9E);
}

.ranking-badge.bronze {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
}

/* ---------- Searchable Combobox ---------- */
.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 90;
  animation: fadeIn 0.15s ease;
}

.combobox-item {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.combobox-item:last-child {
  border-bottom: none;
}

.combobox-item:hover {
  background: var(--primary-glow);
  color: var(--primary-dark);
}

.combobox-item.combobox-all {
  font-weight: 600;
  color: var(--primary);
}

.combobox-item.combobox-empty {
  color: var(--text-muted);
  cursor: default;
  font-style: italic;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--primary-glow);
  border: 1px solid var(--primary-light);
  color: var(--primary-dark);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  animation: fadeIn 0.2s ease;
}

.filter-clear-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.filter-clear-btn:hover {
  background: var(--danger);
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 50%, #00B4D8 100%);
  padding: var(--space-lg);
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}

.login-card h2 {
  margin-bottom: var(--space-xs);
}

.login-card .login-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-xl);
}

.login-card .form-control {
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  padding: var(--space-md);
}

.login-card .btn {
  width: 100%;
  padding: var(--space-md);
  font-size: 1rem;
  margin-top: var(--space-md);
}

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: var(--space-sm);
  min-height: 1.2em;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---------- Loading Spinner ---------- */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  flex-direction: column;
  gap: var(--space-md);
  color: var(--text-muted);
}

/* ---------- Status Select (inline in table) ---------- */
.status-select {
  padding: 4px 28px 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  background: var(--bg-card);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all var(--transition-fast);
}

.status-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .nav-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .nav-card {
    padding: var(--space-md);
  }

  .nav-card .card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .page {
    padding: var(--space-md);
  }

  .toolbar {
    flex-direction: column;
  }

  .search-input,
  .filter-select {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 0.78rem;
  }

  .data-table th,
  .data-table td {
    padding: var(--space-xs) var(--space-sm);
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2.8rem;
  }

  .hero .tagline {
    font-size: 1.15rem;
  }

  .nav-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 800px;
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--border-light);
}

::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.gap-sm {
  gap: var(--space-sm);
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}