/* Google Font 'Inter' loaded via link tag in index.html */

/* ==========================================================================
   CSS Variables & Design Tokens
   ========================================================================== */
:root {
  /* Primary Colors - Teal */
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-500: #0d7377;
  --primary-600: #0b6063;
  --primary-700: #0a4f52;
  
  /* Accent Colors - Amber/Gold */
  --accent-500: #d4860b;
  --accent-600: #b8750a;
  
  /* Warning/Status Colors */
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --danger: #dc3545;
  
  --warning-7d-bg: #fef3c7;
  --warning-7d-text: #92400e;
  --warning-7d-border: #f59e0b;
  
  --warning-3d-bg: #ffedd5;
  --warning-3d-text: #9a3412;
  --warning-3d-border: #f97316;
  
  --warning-1d-bg: #fee2e2;
  --warning-1d-text: #991b1b;
  --warning-1d-border: #ef4444;
  
  --success-today-bg: #d1fae5;
  --success-today-text: #065f46;
  --success-today-border: #10b981;
  
  /* Neutral Colors */
  --bg-color: #f8f6f3; /* Warm off-white */
  --surface-color: #ffffff;
  --text-main: #1e1e1e; /* Dark charcoal */
  --text-muted: #6b7280;
  --border-color: #e5e2dd; /* Soft warm gray */
  
  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-15: 60px;
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================================================
   2. Layout
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4);
}

.header {
  background-color: var(--surface-color);
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-500);
}

.header-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   3. Tabs
   ========================================================================== */
.tabs {
  display: flex;
  gap: var(--space-6);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.tab-btn {
  padding: var(--space-3) var(--space-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary-500);
}

.tab-btn.active {
  color: var(--primary-500);
  border-bottom-color: var(--primary-500);
}

.tab-count {
  background-color: var(--bg-color);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.tab-btn.active .tab-count {
  background-color: var(--primary-100);
  color: var(--primary-600);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ==========================================================================
   4. Toolbar & Search
   ========================================================================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.search-bar {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s ease;
}

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

.toolbar-actions {
  display: flex;
  gap: var(--space-3);
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  outline: none;
}

.btn-primary {
  background-color: var(--primary-500);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-600);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-100);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-color);
  border-color: var(--text-muted);
}

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

.btn-danger:hover:not(:disabled) {
  background-color: #c82333;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   6. Cards & Stat Cards
   ========================================================================== */
.card {
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #faf9f8;
}

.card-title {
  font-weight: 600;
  font-size: 1.0625rem;
}

.card-body {
  padding: var(--space-5);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-500);
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   7. Tables
   ========================================================================== */
.table-container {
  overflow-x: auto;
  width: 100%;
}

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

.data-table th {
  background-color: #f3f4f6;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.875rem;
}

.data-table tbody tr {
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background-color: #fafafa;
}

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

.agent-name {
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.agent-nik {
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   8. Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.badge-7h {
  background-color: var(--warning-7d-bg);
  color: var(--warning-7d-text);
}

.badge-3h {
  background-color: var(--warning-3d-bg);
  color: var(--warning-3d-text);
}

.badge-1h {
  background-color: var(--warning-1d-bg);
  color: var(--warning-1d-text);
  animation: pulse 2s infinite;
}

.badge-today {
  background-color: var(--success-today-bg);
  color: var(--success-today-text);
  box-shadow: 0 0 0 1px var(--success-today-border);
}

.badge-passed {
  background-color: #e5e7eb;
  color: #374151;
}

.badge-gender {
  background-color: #f3f4f6;
  color: #4b5563;
  padding: 2px 8px;
  font-weight: 600;
}

/* ==========================================================================
   9. Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.3s;
}

.modal {
  background-color: var(--surface-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 800px; }

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

.modal-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-main);
  background-color: var(--bg-color);
}

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

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  background-color: #faf9f8;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

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

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

.form-label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  transition: all 0.2s;
  background-color: var(--surface-color);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input:read-only, .form-input:disabled, .form-select:disabled {
  background-color: #f3f4f6;
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  display: block;
}

/* ==========================================================================
   11. Upload Zone & Progress Bar
   ========================================================================== */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f9fafb;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary-500);
  background-color: var(--primary-50);
}

.upload-zone-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  display: block;
}

.upload-zone-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.upload-zone-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.photo-preview {
  max-height: 200px;
  border-radius: var(--radius-md);
  margin: var(--space-4) auto 0;
  display: block;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Progress Bar */
.progress-container {
  background-color: #e5e7eb;
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin: var(--space-4) 0;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-500);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}

.ocr-status {
  text-align: center;
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   12. Milad Summary Cards
   ========================================================================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.summary-card {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  border-left: 4px solid;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  background-color: var(--surface-color);
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.summary-count {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-1);
  color: var(--text-main);
}

.summary-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.summary-card.warning-7h {
  border-left-color: var(--warning-7d-border);
  background-color: #fffbeb;
}

.summary-card.warning-3h {
  border-left-color: var(--warning-3d-border);
  background-color: #fff7ed;
}

.summary-card.warning-1h {
  border-left-color: var(--warning-1d-border);
  background-color: #fef2f2;
}

.summary-card.warning-today {
  border-left-color: var(--success-today-border);
  background-color: #f0fdf4;
}

/* ==========================================================================
   13. Birthday Table / Milad Row
   ========================================================================== */
.milad-row.row-warning-7h {
  background-color: #fffbeb;
}
.milad-row.row-warning-3h {
  background-color: #fff7ed;
}
.milad-row.row-warning-1h {
  background-color: #fef2f2;
}
.milad-row.row-success-today {
  background-color: #f0fdf4;
}

.countdown {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.countdown.urgent {
  color: var(--danger-text);
  animation: pulse 2s infinite;
}

/* ==========================================================================
   14. Group Cards
   ========================================================================== */
.grup-card {
  background-color: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary-500);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.grup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background-color: #faf9f8;
  border-bottom: 1px solid var(--border-color);
}

.grup-date-range {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.grup-count {
  background-color: var(--primary-100);
  color: var(--primary-700);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.grup-members {
  padding: 0 var(--space-4);
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-color);
}

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

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--primary-100);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.member-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.member-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.member-badge {
  margin-left: auto;
}

/* ==========================================================================
   15. Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background-color: var(--surface-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 320px;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-left: 4px solid var(--text-muted);
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

.toast-success { border-left-color: #10b981; }
.toast-warning { border-left-color: #f59e0b; }
.toast-error { border-left-color: #ef4444; }
.toast-info { border-left-color: #3b82f6; }

.toast-icon {
  font-size: 1.25rem;
  margin-top: 2px;
}

.toast-success .toast-icon { color: #10b981; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-error .toast-icon { color: #ef4444; }
.toast-info .toast-icon { color: #3b82f6; }

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  margin-left: auto;
  padding: 0 4px;
}

.toast-close:hover {
  color: var(--text-main);
}

/* ==========================================================================
   16. Empty State
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: var(--space-15) var(--space-4);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  color: #cbd5e1;
}

.empty-state-title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--space-2);
  color: var(--text-main);
}

.empty-state-text {
  font-size: 0.875rem;
  max-width: 400px;
  margin: 0 auto var(--space-6);
}

/* ==========================================================================
   17. Notification Bell
   ========================================================================== */
.notification-bell {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  transition: background-color 0.2s;
  color: var(--text-muted);
}

.notification-bell:hover {
  background-color: var(--bg-color);
  color: var(--text-main);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--danger);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 4px;
  border: 2px solid var(--surface-color);
}

/* ==========================================================================
   18. Detail View & Confirm Dialog
   ========================================================================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  background-color: #f9fafb;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border: 1px solid var(--border-color);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.detail-value {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-main);
}

.detail-photo {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.confirm-text {
  padding: var(--space-4) 0 var(--space-6);
  text-align: center;
  font-size: 1rem;
  color: var(--text-main);
}

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

/* ==========================================================================
   19. Utilities & Animations
   ========================================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

.hidden { display: none !important; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

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

.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.3s ease forwards; }

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

::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   21. Responsive Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .stat-cards, .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    padding: var(--space-3) var(--space-4);
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-bar {
    max-width: none;
  }
  
  .form-row, .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .tabs {
    padding-bottom: 2px;
  }
}

@media (max-width: 480px) {
  .stat-cards, .summary-cards {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: var(--space-3);
  }
  
  .modal {
    width: 95%;
  }
  
  .btn {
    padding: 8px 16px;
  }
  
  .header-subtitle {
    display: none;
  }
  
  .toast {
    min-width: calc(100vw - 32px);
    right: 16px;
    bottom: 16px;
  }
}
/* LOGIN OVERLAY */
#login-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-color);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 350px;
  text-align: center;
}
.login-box h2 {
  margin-top: 0;
  color: var(--primary-500);
  margin-bottom: 20px;
}
.login-box .form-group {
  text-align: left;
  margin-bottom: 15px;
}
