/* ============================================
   RAZIA APP — Design System v2.0
   Production-grade mobile-first UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --primary-50: #eef4ff;
  --primary-100: #d9e6ff;
  --primary-200: #bcd4fe;
  --primary-300: #8fb9fd;
  --primary-400: #5a93fa;
  --primary-500: #3470f6;
  --primary-600: #1e51eb;
  --primary-700: #163dd8;
  --primary-800: #1833af;
  --primary-900: #1a308a;
  --primary-950: #141f54;

  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --white: #ffffff;
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --text-2xs: 0.625rem;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 50%;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-colored: 0 4px 14px -2px;

  --transition-1: 120ms ease;
  --transition-2: 200ms ease;
  --transition-3: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  --bottom-nav-height: 60px;
  --header-height: 56px;
  --content-max-width: 430px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--slate-800);
  background: var(--bg-app);
  overflow-x: hidden;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-1);
}

a:hover {
  color: var(--primary-700);
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- App Shell ---------- */
.app-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg-app);
}

.page-content {
  padding: var(--space-4);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-8));
}

/* ---------- Header ---------- */
.app-header {
  background: var(--slate-900);
  color: var(--white);
  padding: var(--space-4);
  padding-top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header .header-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.app-header .header-subtitle {
  font-size: var(--text-xs);
  color: var(--slate-400);
  font-weight: 400;
  margin-top: 1px;
}

.header-action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--slate-300);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-1);
}

.header-action:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max-width);
  height: var(--bottom-nav-height);
  background: var(--white);
  border-top: 1px solid var(--slate-100);
  display: flex;
  align-items: stretch;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--slate-400);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.2px;
  gap: 3px;
  flex: 1;
  transition: color var(--transition-1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  line-height: 1;
  transition: all var(--transition-2);
}

.nav-item.active {
  color: var(--primary-600);
}

.nav-item.active .nav-icon {
  color: var(--primary-600);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--primary-600);
  border-radius: 0 0 2px 2px;
}

.nav-item .nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  min-width: 15px;
  height: 15px;
  background: var(--danger-500);
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}

/* ---------- Dashboard Hero ---------- */
.dashboard-hero {
  background: var(--slate-900);
  margin: -16px -16px 20px -16px;
  padding: 20px 16px 24px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 160px;
  height: 160px;
  border-radius: var(--radius-full);
  background: rgba(52, 112, 246, 0.08);
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -40px;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: rgba(52, 112, 246, 0.05);
}

.greeting-section {
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
}

.greeting-text {
  font-size: var(--text-base);
  color: var(--slate-400);
  font-weight: 500;
}

.greeting-name {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-top: 2px;
}

.greeting-sub {
  font-size: var(--text-xs);
  color: var(--slate-500);
  margin-top: 4px;
}

/* ---------- Stat Cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.stat-card .stat-header {
  margin-bottom: var(--space-2);
}

.stat-card .stat-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.stat-card.stat-primary .stat-icon {
  background: rgba(52, 112, 246, 0.15);
  color: var(--primary-400);
}

.stat-card.stat-success .stat-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success-500);
}

.stat-card.stat-warning .stat-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-500);
}

.stat-card .stat-value {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: var(--text-2xs);
  color: var(--slate-400);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Quick Actions ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--slate-700);
  -webkit-tap-highlight-color: transparent;
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-2);
}

.qa-primary {
  background: var(--primary-50);
  color: var(--primary-600);
}

.qa-success {
  background: var(--success-50);
  color: var(--success-600);
}

.qa-warning {
  background: var(--warning-50);
  color: var(--warning-600);
}

.qa-info {
  background: var(--primary-50);
  color: var(--primary-500);
}

.quick-action-item:active .quick-action-icon {
  transform: scale(0.92);
}

.quick-action-label {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-align: center;
  color: var(--slate-600);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-100);
  padding: var(--space-4);
  transition: border-color var(--transition-1);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--slate-800);
}

/* List Cards */
.list-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-100);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-1);
  text-decoration: none;
  color: inherit;
}

.list-card:active {
  transform: scale(0.99);
}

.list-card .card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.list-card .card-body {
  flex: 1;
  min-width: 0;
}

.list-card .card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-card .card-meta {
  font-size: var(--text-xs);
  color: var(--slate-400);
  margin-top: 2px;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--slate-300);
  flex-shrink: 0;
}

.list-card .card-end {
  text-align: right;
  flex-shrink: 0;
}

.list-card .card-amount {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--slate-700);
  font-variant-numeric: tabular-nums;
}

/* Link "more" */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
  color: var(--primary-600);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  gap: 3px;
  letter-spacing: 0.1px;
}

.badge-success {
  background: var(--success-50);
  color: var(--success-700);
}

.badge-warning {
  background: var(--warning-50);
  color: var(--warning-700);
}

.badge-danger {
  background: var(--danger-50);
  color: var(--danger-700);
}

.badge-info {
  background: var(--primary-50);
  color: var(--primary-700);
}

.badge-neutral {
  background: var(--slate-100);
  color: var(--slate-600);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-2);
  line-height: 1.4;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary-600);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-success {
  background: var(--success-600);
  color: var(--white);
}

.btn-success:hover {
  background: var(--success-700);
}

.btn-danger {
  background: var(--danger-600);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--danger-700);
}

.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  color: var(--slate-700);
}

.btn-outline:hover {
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-600);
}

.btn-ghost:hover {
  background: var(--primary-50);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  min-height: 34px;
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-md);
  min-height: 48px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  right: calc(50% - var(--content-max-width) / 2 + var(--space-4));
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-600);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-colored) rgba(52, 112, 246, 0.28);
  cursor: pointer;
  z-index: 150;
  transition: all var(--transition-2);
  -webkit-tap-highlight-color: transparent;
}

.fab:active {
  transform: scale(0.92);
}

.fab:hover {
  background: var(--primary-700);
}

@media (max-width: 430px) {
  .fab {
    right: var(--space-4);
  }
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--slate-800);
  background: var(--white);
  transition: all var(--transition-2);
  min-height: 44px;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(52, 112, 246, 0.08);
}

.form-input::placeholder {
  color: var(--slate-400);
}

textarea.form-input {
  min-height: 80px;
  resize: vertical;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--slate-400);
  margin-top: var(--space-1);
}

/* Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.chip {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-600);
  cursor: pointer;
  transition: all var(--transition-1);
  -webkit-tap-highlight-color: transparent;
}

.chip:hover,
.chip.active {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* ---------- Search ---------- */
.search-bar {
  position: relative;
  margin-bottom: var(--space-4);
}

.search-bar .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
  display: flex;
}

.search-bar .form-input {
  padding-left: 40px;
}

/* ---------- Tabs ---------- */
.tab-bar {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  padding: 1px 0;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid var(--slate-200);
  cursor: pointer;
  transition: all var(--transition-1);
  background: var(--white);
  color: var(--slate-500);
  -webkit-tap-highlight-color: transparent;
}

.tab-item:hover {
  color: var(--slate-700);
  border-color: var(--slate-300);
}

.tab-item.active {
  background: var(--slate-900);
  color: var(--white);
  border-color: var(--slate-900);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-3);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6);
  width: 100%;
  max-width: var(--content-max-width);
  max-height: 85dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition-3);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 32px;
  height: 4px;
  background: var(--slate-200);
  border-radius: var(--radius-pill);
  margin: 0 auto var(--space-5);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: var(--space-4);
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  width: calc(100% - var(--space-8));
  max-width: var(--content-max-width);
  pointer-events: none;
}

.toast {
  background: var(--slate-900);
  color: var(--white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-xl);
  margin-bottom: var(--space-2);
  transform: translateY(-20px);
  opacity: 0;
  transition: all var(--transition-3);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  background: var(--success-700);
}

.toast.toast-danger {
  background: var(--danger-700);
}

.toast.toast-warning {
  background: var(--warning-700);
}

/* ---------- Section Headers ---------- */
.section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--space-3);
  margin-top: var(--space-5);
}

.section-title:first-child {
  margin-top: 0;
}

.divider {
  height: 1px;
  background: var(--slate-100);
  margin: var(--space-4) 0;
}

/* ---------- Info Rows ---------- */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--slate-50);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: var(--text-sm);
  color: var(--slate-500);
}

.info-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate-800);
  text-align: right;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  opacity: 0.3;
  color: var(--slate-500);
}

.empty-state .empty-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--slate-500);
  margin-bottom: var(--space-2);
}

.empty-state .empty-text {
  font-size: var(--text-sm);
  color: var(--slate-400);
  max-width: 220px;
  margin: 0 auto;
}

/* ---------- Loading ---------- */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  margin: var(--space-6) auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Sync Indicator ---------- */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-2xs);
  color: var(--slate-500);
  padding: var(--space-1) var(--space-2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xs);
}

.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--success-500);
  animation: pulse 2.5s ease infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--slate-900);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(52, 112, 246, 0.1) 0%, transparent 70%);
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(52, 112, 246, 0.06) 0%, transparent 70%);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-6);
}

.login-logo .logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--slate-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto var(--space-3);
}

.login-logo .logo-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.5px;
}

.login-logo .logo-subtitle {
  font-size: var(--text-sm);
  color: var(--slate-500);
  margin-top: 2px;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-5);
  font-size: var(--text-2xs);
  color: var(--slate-600);
  position: relative;
  z-index: 1;
}

/* ---------- Profile Card ---------- */
.profile-card {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--slate-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 auto var(--space-3);
  letter-spacing: -0.5px;
}

.profile-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--slate-900);
}

.profile-role {
  font-size: var(--text-sm);
  color: var(--slate-500);
  margin-top: 4px;
}

/* ---------- Menu List ---------- */
.menu-list {
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--slate-50);
  text-decoration: none;
  color: var(--slate-700);
  transition: background var(--transition-1);
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active {
  background: var(--slate-50);
}

.menu-item .menu-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: var(--slate-50);
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-item .menu-text {
  flex: 1;
  font-weight: 500;
  font-size: var(--text-base);
}

.menu-item .menu-arrow {
  color: var(--slate-300);
}

.menu-item.menu-danger .menu-icon {
  background: var(--danger-50);
  color: var(--danger-600);
}

.menu-item.menu-danger .menu-text {
  color: var(--danger-600);
}

/* ---------- Data Table ---------- */
.table-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  background: var(--slate-50);
  font-weight: 600;
  color: var(--slate-500);
  padding: var(--space-3);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--slate-200);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--slate-50);
  white-space: nowrap;
}

/* ---------- Confirm Dialog ---------- */
.confirm-dialog {
  text-align: center;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon.confirm-warning {
  background: var(--warning-100);
  color: var(--warning-600);
}

.confirm-icon.confirm-success {
  background: var(--success-100);
  color: var(--success-600);
}

.confirm-icon.confirm-danger {
  background: var(--danger-100);
  color: var(--danger-600);
}

.confirm-text {
  font-size: var(--text-base);
  color: var(--slate-600);
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: var(--space-2);
}

.confirm-actions .btn {
  flex: 1;
}

/* ---------- Multi-step ---------- */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.step-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--slate-300);
  transition: all var(--transition-3);
}

.step-dot.active {
  width: 20px;
  border-radius: var(--radius-pill);
  background: var(--primary-600);
}

.step-dot.done {
  background: var(--success-500);
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
  animation: fadeUp 0.25s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Class Grid ---------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.class-btn {
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  transition: all var(--transition-1);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.class-btn:hover,
.class-btn.selected {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* ---------- Checkbox List ---------- */
.check-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-1);
  -webkit-tap-highlight-color: transparent;
}

.check-list-item:hover {
  background: var(--slate-50);
}

.check-list-item.checked {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--slate-300);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-1);
  font-size: 0.7rem;
  color: transparent;
}

.check-list-item.checked .custom-checkbox {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: var(--white);
}

/* ---------- Detail Page ---------- */
.detail-status-banner {
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid;
}

.detail-status-banner.status-lunas {
  background: var(--success-50);
  border-color: var(--success-100);
}

.detail-status-banner.status-belum {
  background: var(--danger-50);
  border-color: var(--danger-100);
}

.detail-status-banner.status-kurang {
  background: var(--warning-50);
  border-color: var(--warning-100);
}

.detail-status-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-lunas .detail-status-icon {
  background: var(--success-500);
  color: var(--white);
}

.status-belum .detail-status-icon {
  background: var(--danger-500);
  color: var(--white);
}

.status-kurang .detail-status-icon {
  background: var(--warning-500);
  color: var(--white);
}

.detail-status-text .status-title {
  font-weight: 700;
  font-size: var(--text-base);
}

.status-lunas .status-title {
  color: var(--success-700);
}

.status-belum .status-title {
  color: var(--danger-700);
}

.status-kurang .status-title {
  color: var(--warning-700);
}

.detail-status-text .status-desc {
  font-size: var(--text-xs);
  color: var(--slate-500);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 1.5px;
  background: var(--slate-200);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-4);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--primary-600);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--primary-100);
}

.timeline-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate-800);
}

.timeline-desc {
  font-size: var(--text-xs);
  color: var(--slate-400);
  margin-top: 1px;
}

/* ---------- Action Bar ---------- */
.action-bar {
  position: fixed;
  bottom: var(--bottom-nav-height);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max-width);
  background: var(--white);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--slate-100);
  z-index: 150;
  display: flex;
  gap: var(--space-2);
}

/* ---------- Date Filter ---------- */
.date-filter {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
}

.date-filter .form-input {
  flex: 1;
  min-height: 38px;
  font-size: var(--text-sm);
}

/* ---------- Utilities ---------- */
.text-success {
  color: var(--success-600) !important;
}

.text-danger {
  color: var(--danger-600) !important;
}

.text-warning {
  color: var(--warning-600) !important;
}

.text-muted {
  color: var(--slate-500) !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-bold {
  font-weight: 700;
}

.text-sm {
  font-size: var(--text-sm);
}

.text-xs {
  font-size: var(--text-xs);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.mt-sm {
  margin-top: var(--space-2);
}

.mt-md {
  margin-top: var(--space-3);
}

.mt-lg {
  margin-top: var(--space-4);
}

.mt-xl {
  margin-top: var(--space-5);
}

.mb-sm {
  margin-bottom: var(--space-2);
}

.mb-md {
  margin-bottom: var(--space-3);
}

.mb-lg {
  margin-bottom: var(--space-4);
}

.mb-xl {
  margin-bottom: var(--space-5);
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-sm {
  gap: var(--space-2);
}

.gap-md {
  gap: var(--space-3);
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--slate-200);
  border-radius: var(--radius-pill);
}

/* =========================================
   ACCORDION (Phase 6)
   ========================================= */
.accordion-wrapper {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-100);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: all var(--transition-1);
}

.accordion-wrapper .list-card {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border: none;
  cursor: pointer;
}

.accordion-wrapper.expanded .list-card {
  border-bottom: 1px solid var(--slate-100);
  background: var(--slate-50);
}

.accordion-body {
  padding: var(--space-4);
  background: var(--surface);
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
body.light-mode {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --surface: #ffffff;
}

body.light-mode .dashboard-hero {
  background: linear-gradient(135deg, #3470f6 0%, #6366f1 100%) !important;
}

body.light-mode .bottom-nav {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

body.light-mode .bottom-nav .nav-item {
  color: #64748b;
}

body.light-mode .bottom-nav .nav-item.active {
  color: #3470f6;
}

body.light-mode .app-header {
  background: linear-gradient(135deg, #3470f6 0%, #6366f1 100%);
}

body.light-mode .stat-card {
  background: rgba(255, 255, 255, 0.15);
}

body.light-mode .card,
body.light-mode .list-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

body.light-mode .section-title {
  color: #334155;
}

body.light-mode .text-muted,
body.light-mode .card-meta {
  color: #64748b;
}

body.light-mode .page-content {
  background: #f1f5f9;
}

body.light-mode .search-bar .form-input {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

body.light-mode .tab-bar .tab-item {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
}

body.light-mode .tab-bar .tab-item.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

body.light-mode .modal .modal {
  background: #ffffff;
}

body.light-mode .quick-action-label {
  color: #334155;
}

body.light-mode .card-name {
  color: #1e293b;
}

body.light-mode .profile-card {
  color: #1e293b;
}

body.light-mode .menu-item {
  color: #334155;
}

body.light-mode .menu-item:hover {
  background: #f1f5f9;
}

body.light-mode .accordion-body {
  background: #f8fafc;
}

body.light-mode .form-select,
body.light-mode select {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}