/**
 * =============================================
 * VISA ADMIN PANEL - PREMIUM DESIGN 2026
 * Design System: Aligned with Customer Panel
 * =============================================
 */

:root {
  color-scheme: light;
  
  /* ============== COLOR PALETTE (Customer Panel Aligned) ============== */
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #fffbf7; /* WARM BACKGROUND - Same as customer panel */
  --card: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --accent-light: #3b82f6;
  --accent-soft: #eff6ff;
  
  /* Success */
  --success: #10b981;
  --success-soft: #d1fae5;
  --success-dark: #059669;
  
  /* Warning */
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --warning-dark: #d97706;
  
  /* Danger */
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --danger-dark: #dc2626;
  
  /* Gray Scale */
  --gray-25: #fafafa;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Borders & Lines */
  --line: #e2e8f0;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-strong: #cbd5e1;
  
  /* Shadows - Subtle & Clean */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-sm: 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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  
  /* Spacing */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  
  /* Transitions */
  --transition: 0.2s ease;
  --transition-fast: 0.15s ease;
  --transition-slow: 0.3s ease;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --font-mono: "SF Mono", Consolas, monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-tooltip: 1600;
}

/* =============================================
   RESET & BASE
   ============================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
}

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

a:hover {
  color: var(--accent);
}

/* ============== TYPOGRAPHY ============== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { 
  font-size: var(--text-3xl); 
  font-weight: var(--font-extrabold); 
  letter-spacing: -0.03em;
}

h2 { 
  font-size: var(--text-2xl); 
  font-weight: var(--font-bold); 
}

h3 { 
  font-size: var(--text-xl); 
  font-weight: var(--font-semibold); 
}

h4 { 
  font-size: var(--text-lg); 
  font-weight: var(--font-semibold); 
}

h5 { 
  font-size: var(--text-base); 
  font-weight: var(--font-medium); 
}

h6 { 
  font-size: var(--text-sm); 
  font-weight: var(--font-medium); 
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

p {
  color: var(--muted);
  line-height: 1.7;
}

strong, b {
  font-weight: var(--font-semibold);
  color: var(--ink);
}

small {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* =============================================
   LAYOUT - GRID SYSTEM
   ============================================= */

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   SIDEBAR - CLEAN & LIGHT
   ============================================= */

.sidebar {
  background: var(--card);
  color: var(--ink);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
  width: 260px;
  flex-shrink: 0;
  z-index: var(--z-fixed);
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
  transition: background var(--transition);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Sidebar Brand */
.sidebar-brand {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.brand-logo:hover {
  background: var(--gray-50);
}

.brand-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
  transition: all var(--transition);
}

.brand-logo:hover .brand-icon {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.brand-text h1 {
  font-size: var(--text-lg);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* Sidebar User Info */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-6);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  cursor: pointer;
}

.sidebar-user:hover {
  background: var(--gray-100);
  border-color: var(--border-strong);
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: white;
  background: var(--accent);
  border-radius: var(--radius);
  flex-shrink: 0;
  text-transform: uppercase;
}

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

.user-info strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Navigation */
.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  position: relative;
}

.sidebar nav a:hover {
  color: var(--ink);
  background: var(--gray-50);
}

.sidebar nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: var(--font-semibold);
}

.sidebar nav a img,
.sidebar nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: all var(--transition);
}

.sidebar nav a:hover img,
.sidebar nav a:hover svg,
.sidebar nav a.active img,
.sidebar nav a.active svg {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.sidebar-footer a:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =============================================
   HEADER & TOPBAR - CLEAN & SIMPLE
   ============================================= */

.header,
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  padding: var(--space-8);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  max-width: 100%;
}

/* Topbar Layout */
.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-6);
}

.topbar > div:first-child {
  flex: 1;
}

.topbar-actions,
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.topbar h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}

.topbar > div:first-child > p:last-child {
  font-size: var(--text-base);
  color: var(--muted);
  margin: 0;
}

/* Page Title */
.page-title {
  flex: 1;
  min-width: 0;
}

.page-title h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
  margin-bottom: var(--space-1);
  letter-spacing: -0.03em;
}

.page-title p {
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Search Bar */
.header-search {
  flex: 0 1 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--ink);
  transition: all var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search::before {
  content: '🔍';
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-base);
  opacity: 0.5;
}

/* Search Input in Topbar/Header */
.topbar .search,
.header .search {
  position: relative;
  flex: 0 1 300px;
}

.topbar .search input,
.header .search input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--ink);
  transition: all var(--transition);
}

.topbar .search input:focus,
.header .search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.topbar .search::before,
.header .search::before {
  content: '🔍';
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-base);
  opacity: 0.5;
  pointer-events: none;
}

.header-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.header-actions button:hover {
  background: var(--gray-50);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* =============================================
   CONTENT AREA
   ============================================= */

.content,
.main {
  flex: 1;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main > section {
  margin: 0 var(--space-8);
  margin-bottom: var(--space-8);
}

.main > section:first-of-type {
  margin-top: var(--space-8);
}

.main > .content {
  padding: var(--space-8);
}

.main .content > * {
  margin-bottom: var(--space-6);
}

.main .content > *:last-child {
  margin-bottom: 0;
}

/* Page Header (inside content) */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-6);
}

.page-header-title h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}

.page-header-title p {
  font-size: var(--text-base);
  color: var(--muted);
}

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

/* =============================================
   CARDS - CLEAN & MINIMAL
   ============================================= */

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

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

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--gray-25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2,
.card-header h3,
.card-header .card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin: 0;
  color: var(--ink);
}

.card-header-gradient {
  background: var(--gray-25);
  color: var(--ink);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.card-header-gradient h2,
.card-header-gradient h3,
.card-header-gradient .card-title {
  color: var(--ink);
  margin: 0;
  font-size: 16px;
  font-weight: var(--font-bold);
}

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

.card-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--gray-25);
  border-top: 1px solid var(--border);
}

/* Stat Cards & Stats Section */
.stat-cards,
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  padding: 0 var(--space-8);
}

.stat-card {
  background: var(--card);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

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

.stat-card h3 {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.stat-card strong {
  display: block;
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.stat-card .trend {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: var(--font-medium);
}

.stat-card.highlight {
  border-color: var(--accent-light);
  background: linear-gradient(135deg, var(--card) 0%, var(--accent-soft) 100%);
}

.stat-card .trend.up {
  color: var(--success);
}

.stat-card .trend.down {
  color: var(--danger);
}

.stat-card .trend.warn {
  color: var(--warning);
}

.stat-card .trend.danger {
  color: var(--danger);
}

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

.stat-card-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  font-size: var(--text-xl);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.stat-card-trend.up {
  color: var(--success);
}

.stat-card-trend.down {
  color: var(--danger);
}

/* =============================================
   BUTTONS - CLEAN & SIMPLE
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

/* Primary Button */
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

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

/* Secondary Button */
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--border-strong);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-50);
  color: var(--ink);
}

/* Destructive Button */
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* Icon Button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
}

/* =============================================
   FORMS - CLEAN & CONSISTENT
   ============================================= */

.form {
  display: grid;
  gap: var(--space-6);
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-grid label span {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--ink);
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
}

.form-label.required::after {
  content: '*';
  color: var(--danger);
  margin-left: var(--space-1);
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  width: 100%;
  font-family: var(--font-sans);
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:disabled,
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-control.error,
.form-input.error {
  border-color: var(--danger);
}

.form-control.error:focus,
.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  font-weight: var(--font-medium);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--muted);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
  appearance: none;
}

/* =============================================
   TABLES - CLEAN & COMPACT
   ============================================= */

.table-container,
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table,
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

/* Table Header */
.table thead,
.table-wrap table thead {
  background: var(--gray-50);
  color: var(--muted);
}

.table thead th,
.table-wrap table thead th {
  padding: var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
  color: var(--muted);
}

.table thead th:first-child {
  padding-left: var(--space-6);
}

.table thead th:last-child {
  padding-right: var(--space-6);
}

/* Table Body */
.table tbody tr,
.table-wrap table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
  cursor: pointer;
}

.table tbody tr:nth-child(even),
.table-wrap table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.01);
}

.table tbody tr:hover,
.table-wrap table tbody tr:hover {
  background: var(--gray-50);
}

.table tbody tr[data-row],
.table-wrap table tbody tr[data-row],
.table tbody tr[data-modal-url],
.table-wrap table tbody tr[data-modal-url] {
  cursor: pointer;
}

.table tbody td,
.table-wrap table tbody td {
  padding: var(--space-4);
  color: var(--muted);
  vertical-align: middle;
}

.table tbody td:first-child,
.table-wrap table tbody td:first-child {
  padding-left: var(--space-6);
  font-weight: var(--font-medium);
  color: var(--ink);
}

.table tbody td:last-child,
.table-wrap table tbody td:last-child {
  padding-right: var(--space-6);
}

/* Consultant Info (in table) */
.consultant-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.consultant-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: white;
  background: var(--accent);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.consultant-info strong {
  color: var(--ink);
  font-weight: var(--font-semibold);
}

/* Customer Cell (in table) */
.customer-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.customer-cell strong {
  color: var(--ink);
  font-weight: var(--font-semibold);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--success);
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--font-bold);
}

.consultant-name {
  font-size: 13px;
  font-weight: var(--font-medium);
  color: var(--ink);
}

/* Action Buttons in Table */
.action-buttons {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.action-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--muted);
}

.action-buttons button:hover {
  background: var(--gray-50);
  border-color: var(--border-strong);
  color: var(--ink);
}

/* Responsive Table */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
  }
  
  .table {
    min-width: 600px;
  }
}

/* =============================================
   BADGES & STATUS
   ============================================= */

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Status Colors */
.badge.ok,
.tag.ok,
.badge.success {
  background: var(--success-soft);
  color: var(--success-dark);
}

.badge.warn,
.tag.warn,
.badge.warning {
  background: var(--warning-soft);
  color: var(--warning-dark);
}

.badge.danger,
.tag.danger,
.badge.error {
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.badge.muted,
.tag.muted {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge.progress,
.tag.progress {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* =============================================
   PAGE TABS (Settings, etc.)
   ============================================= */

.page-tabs {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-8);
  margin-bottom: var(--space-6);
  border-bottom: 2px solid var(--border);
}

.page-tabs .tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -2px;
}

.page-tabs .tab-btn:hover {
  color: var(--ink);
  background: var(--gray-50);
}

.page-tabs .tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: var(--font-semibold);
}

.page-tab-panel {
  display: none;
  padding: 0 var(--space-8);
}

.page-tab-panel.active {
  display: block;
  animation: fadeSlideIn 0.3s ease-out;
}

/* =============================================
   MODALS - CLEAN & SIMPLE
   ============================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Backdrop */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: -1;
  animation: fadeIn 0.2s ease-out;
}

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

/* Modal Card */
.modal-card {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease-out;
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 1;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Large Modal (Customer Detail) */
.modal-lg .modal-card {
  max-width: 1400px;
  width: 90vw;
}

/* =============================================
   STACKED MODALS - Multiple Modal Support
   ============================================= */
.stacked-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.stacked-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.stacked-modal .modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.stacked-modal .modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 48px);
  background: var(--card, #fff);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  animation: stackedSlideIn 0.25s ease-out;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
}

.stacked-modal.modal-lg .modal-card {
  max-width: 1400px;
  width: 95vw;
  max-height: calc(100vh - 48px);
}

@keyframes stackedSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Stacked modal close button */
.stacked-modal .modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.2s ease;
}

.stacked-modal .modal-close:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: scale(1.1);
}

.stacked-modal .modal-close svg {
  width: 20px;
  height: 20px;
  color: #64748b;
}

.stacked-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Large modal (Customer Detail) specific styles */
.stacked-modal.modal-lg {
  padding: 16px;
}

.stacked-modal.modal-lg .modal-card {
  height: calc(100vh - 32px);
  max-height: none;
  display: flex;
  flex-direction: column;
}

.stacked-modal.modal-lg .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  min-height: 0;
}

.stacked-modal.modal-lg .modal-body > .customer-detail-modal-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100% !important; /* Override the 85vh from customer_detail.php */
}

/* Override customer_detail.php fixed heights for stacked modal */
.stacked-modal.modal-lg .tab-content {
  max-height: none !important;
  flex: 1;
  min-height: 0;
}

.stacked-modal.modal-lg .content-area {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.stacked-modal.modal-lg .main-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Stacked modal stacking context - removed isolation to allow other modals on top */

/* Fix for modal inside modal - secondary modals */
.stacked-modal ~ .stacked-modal {
  /* Second+ modals get slightly different backdrop */
}

.stacked-modal ~ .stacked-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.4);
}

/* Modal Header */
.modal-header,
.modal-header-detail {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-5) var(--space-6);
  position: relative;
  flex-shrink: 0;
}

.modal-header h2,
.modal-header h3,
.modal-header-detail h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--ink);
  margin: 0;
}

.modal-header p,
.modal-header-detail p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-2);
}

.modal-header-detail .modal-title-section {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.modal-header-detail .modal-subtitle {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
}

/* Modal Close Button */
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--muted);
  transition: all var(--transition);
  z-index: 1001;
}

.modal-close:hover {
  background: var(--gray-100);
  border-color: var(--border-strong);
  color: var(--ink);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

/* Modal Body */
.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Wider accounting modals */
.accounting-modal-wrapper .modal-card {
  width: min(1200px, 92vw) !important;
  max-width: 1200px !important;
  height: 85vh !important;
  max-height: 85vh !important;
}

#customer-accounting-modal .modal-card {
  width: min(1200px, 92vw) !important;
  max-width: 1200px !important;
  height: 85vh !important;
  max-height: 85vh !important;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--gray-50);
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Customer Accounting Modal */
.customer-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
.summary-card {
  background: var(--gray-50, #f9fafb);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.summary-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}
.summary-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.summary-icon.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.summary-icon.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.summary-icon.orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.summary-value { font-size: 20px; font-weight: 700; }
.summary-label { font-size: 12px; color: var(--text-muted); }

.ca-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 15px;
}
.ca-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.ca-tab:hover { color: var(--text); }
.ca-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.ca-tab-content {
  display: none;
  max-height: 350px;
  overflow-y: auto;
}
.ca-tab-content.active { display: block; }
.ca-empty {
  display: none;
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

/* Premium Modals (Payment/Invoice/Create Account) */
.premium-modal-card {
  max-width: 780px !important;
  background: #f7f9fc !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.18) !important;
}
.premium-modal-card .premium-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.08));
}
.premium-modal-card .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.premium-modal-card .header-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}
.premium-modal-card .header-sub {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
}
.premium-modal-card .modal-body {
  padding: 20px 24px 10px;
}
.premium-modal-card label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}
.premium-modal-card .form-control {
  height: 44px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.premium-modal-card textarea.form-control {
  height: auto;
  min-height: 84px;
}
.premium-modal-card .premium-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}
.premium-modal-card .premium-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.premium-modal-card .premium-static {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  font-weight: 600;
}
.payment-modal-card .payment-alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
}
.payment-modal-card .payment-alert.success { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.payment-modal-card .payment-alert.warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.payment-modal-card .payment-alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; margin-top: 10px; }
.premium-modal-card .modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
/* Consultants modal */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-label input {
  width: 18px;
  height: 18px;
}
.assignment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assignment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}
.assignment-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.assignment-info strong {
  font-size: 15px;
}
.assignment-info span {
  font-size: 13px;
  color: var(--muted);
}
.assignment-info small {
  font-size: 12px;
  color: var(--muted);
}
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

/* Modal Footer */
.modal-footer {
  padding: var(--space-4) var(--space-6);
  background: var(--gray-25);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Modal Tabs Container */
.modal-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);
}

.modal-tabs .tab-btn,
.modal-tabs button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: var(--font-medium);
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.modal-tabs .tab-btn:hover,
.modal-tabs button:hover {
  background: var(--gray-100);
  color: var(--ink);
}

.modal-tabs .tab-btn.active,
.modal-tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--font-semibold);
}

/* Tab Panel show/hide */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

[data-tab-panel] {
  display: none;
}

[data-tab-panel].active {
  display: block;
}

/* Modal Tabs - Clean Blue Style */
.tab-nav {
  display: flex;
  gap: 0;
  background: var(--accent);
  margin: 0;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.tab-nav::-webkit-scrollbar {
  height: 4px;
}

.tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.tab-btn.active {
  background: white;
  color: var(--accent);
  border-bottom-color: white;
  font-weight: var(--font-semibold);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeSlideIn 0.3s ease-out;
}

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

/* Modal Content Grid - 2 Columns (Like Customer Panel) */
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 32px;
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

/* Section Titles in Modal */
.modal-body h3,
.modal-body h4 {
  grid-column: 1 / -1;
  font-size: 18px;
  font-weight: var(--font-bold);
  color: var(--ink);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.modal-body h3:first-child,
.modal-body h4:first-child {
  margin-top: 0;
}

/* Icon Before Section Titles */
.modal-body h3::before,
.modal-body h4::before {
  font-size: 20px;
  line-height: 1;
}

/* Field Display - Customer Panel Style (Boxed & Clean) */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  border: none;
  transition: none;
  margin-bottom: var(--space-4);
}

.field:hover {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.field-label {
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: var(--space-1);
}

.field-value {
  font-size: 15px;
  font-weight: var(--font-normal);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-height: 42px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.field-value:empty::before {
  content: '—';
  color: var(--muted);
}

/* Field Value Hover Effect */
.field:hover .field-value {
  border-color: var(--border-strong);
}

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

/* Field in Modal - Like Customer Panel */
.modal-body .field {
  margin-bottom: var(--space-4);
}

.modal-body .field-label {
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.modal-body .field-value {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-height: 42px;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
}

/* Empty Field Value */
.modal-body .field-value:empty::before,
.field-value.empty::before {
  content: '—';
  color: var(--muted);
}

/* Info Item (in customer_detail modal) - Same as Field */
.info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: 0;
}

.info-item label {
  font-size: 14px;
  font-weight: var(--font-semibold);
  color: var(--ink);
  margin-bottom: var(--space-1);
}

.info-item .view-mode {
  font-size: 15px;
  font-weight: var(--font-normal);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-height: 42px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.info-item:hover .view-mode {
  border-color: var(--border-strong);
}

/* Empty Info Item */
.info-item .view-mode:empty::before {
  content: '—';
  color: var(--muted);
}

/* Info Grid - 2 Column Layout */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 32px;
  margin-bottom: var(--space-6);
}

.info-item.full-width {
  grid-column: 1 / -1;
}

/* Info Section */
.info-section {
  margin-bottom: var(--space-8);
}

.info-section h4 {
  font-size: 18px;
  font-weight: var(--font-bold);
  color: var(--ink);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   FILTERS & SEARCH
   ============================================= */

.filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
  .filters {
    margin-bottom: var(--space-3);
  }
}

.filters-card {
  background: var(--card);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow);
}

/* Filter Bar */
.filter-bar {
  background: var(--card);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  margin: 0 var(--space-8);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: flex-end;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 200px;
}

.filter-form label span {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--ink);
}

.filter-form input[type="date"] {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.filter-form input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 1200px) {
  .filter-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .filter-form {
    grid-template-columns: 1fr;
  }
}

.filter-form select {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  font-family: var(--font-sans);
  cursor: pointer;
}

.filter-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Filter Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--muted);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover {
  color: var(--ink);
  background: var(--gray-100);
  border-color: var(--border-strong);
}

.chip.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: var(--font-semibold);
}

.filters-grid {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.filters-grid .search-input {
  flex: 2 1 300px;
  min-width: 200px;
}

.filters-grid select {
  flex: 1 1 150px;
  min-width: 120px;
}

.filters-grid button {
  flex: 0 0 auto;
}

/* Tablet - Still single row but tighter */
@media (max-width: 1024px) {
  .filters-grid {
    gap: var(--space-2);
  }
  
  .filters-grid .search-input {
    flex: 1 1 200px;
  }
  
  .filters-grid select {
    flex: 1 1 120px;
  }
}

/* Mobile - Horizontal scroll, single row */
@media (max-width: 768px) {
  .filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--space-6) * -1);
    padding: 0 var(--space-6);
  }
  
  .filters-grid {
    flex-wrap: nowrap;
    gap: var(--space-2);
    min-width: max-content;
  }
  
  .filters-grid .search-input {
    flex: 0 0 180px;
  }
  
  .filters-grid .search-input input {
    font-size: 14px;
    padding: 8px 12px 8px 36px;
  }
  
  .filters-grid select {
    flex: 0 0 140px;
    font-size: 14px;
    padding: 8px 10px;
  }
  
  .filters-grid button {
    flex: 0 0 auto;
    font-size: 14px;
    padding: 8px 16px;
    white-space: nowrap;
  }
}

/* Filters inside card-header */
.card-header .filters {
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  margin: 0;
}

/* Search Input with Icon */
.search-input {
  position: relative;
}

.search-input input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  transition: all var(--transition);
}

.search-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::before {
  content: '🔍';
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-base);
  opacity: 0.5;
}

/* =============================================
   LOADING STATES
   ============================================= */

.loading {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

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

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

/* =============================================
   ALERTS & NOTIFICATIONS
   ============================================= */

.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  display: flex;
  align-items: start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.alert-success {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success-dark);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: var(--warning-dark);
}

.alert-danger {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-dark);
}

.alert-info {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* =============================================
   LOGIN PAGE
   ============================================= */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.logo-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.logo-text h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
  margin: 0;
  line-height: 1;
}

.logo-text span {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-2);
}

.login-subtitle {
  font-size: var(--text-base);
  color: var(--muted);
  margin: 0;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  color: var(--danger-dark);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.login-alert svg {
  flex-shrink: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.login-form label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
}

.login-form input {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: white;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: all var(--transition);
}

.login-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

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

.login-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  text-align: center;
}

.login-footer p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}

.login-footer a {
  color: var(--accent);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: color var(--transition);
}

.login-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* =============================================
   CHARTS & GRAPHS
   ============================================= */

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  margin: 0 var(--space-8);
  margin-bottom: var(--space-8);
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

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

.chart-container {
  padding: var(--space-6);
  position: relative;
  height: 300px;
}

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

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  margin: 0 var(--space-8);
  margin-bottom: var(--space-8);
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-col-wide {
  grid-column: 1 / -1;
}
  max-height: 100%;
}

/* =============================================
   DASHBOARD WIDGETS
   ============================================= */

/* Todo List */
.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}

.todo-item:hover {
  background: var(--gray-50);
}

.todo-item label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  cursor: pointer;
}

.todo-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  accent-color: var(--accent);
  cursor: pointer;
}

.todo-item span {
  font-size: var(--text-sm);
  color: var(--ink);
}

/* Activity Feed */
.activity {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.activity > div {
  padding: var(--space-3);
  border-left: 3px solid var(--border);
  padding-left: var(--space-4);
  transition: all var(--transition);
}

.activity > div:hover {
  border-left-color: var(--accent);
  background: var(--gray-25);
}

.activity strong {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
  display: block;
  margin-bottom: var(--space-1);
}

.activity p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
  margin-bottom: var(--space-1);
}

.activity span {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Activity List (Reports Page) */
.activity-list {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 500px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--gray-25);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.activity-item:hover {
  background: var(--gray-50);
}

.activity-action {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
}

.activity-entity {
  font-size: var(--text-xs);
  color: var(--muted);
  padding: var(--space-1) var(--space-2);
  background: var(--gray-100);
  border-radius: var(--radius-sm);
}

.activity-user {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-left: auto;
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Flow Chart */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.flow > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--gray-25);
  transition: all var(--transition);
}

.flow > div:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.flow p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.flow strong {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--ink);
}

@media (max-width: 768px) {
  .flow {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================
   STATUS PIPELINE & KANBAN
   ============================================= */

.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  padding: 0 var(--space-8);
  margin-bottom: var(--space-8);
}

.pipeline-stage {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

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

.pipeline-header h3 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--ink);
  margin: 0;
}

.pipeline-count {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--muted);
  background: var(--gray-100);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.pipeline-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
}

.pipeline-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition);
}

.pipeline-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.pipeline-item-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.pipeline-item-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* Status Labels & Indicators */
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-right: var(--space-2);
}

.status-indicator.success {
  background: var(--success);
}

.status-indicator.warning {
  background: var(--warning);
}

.status-indicator.danger {
  background: var(--danger);
}

.status-indicator.muted {
  background: var(--gray-400);
}

/* Worker Status Badge */
.worker-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.worker-status.running {
  background: var(--success-soft);
  color: var(--success-dark);
}

.worker-status.stopped {
  background: var(--danger-soft);
  color: var(--danger-dark);
}

/* Worker Status Bar (Automation Page) */
.worker-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  margin: 0 var(--space-8);
  margin-bottom: var(--space-6);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.worker-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.worker-indicator {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.worker-indicator.running {
  background: var(--success);
}

.worker-indicator.stopped {
  background: var(--danger);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.worker-info strong {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--ink);
}

.status-text {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.status-text.running {
  color: var(--success-dark);
}

.status-text.stopped {
  color: var(--danger-dark);
}

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

/* Filter Tabs (in card-header) */
.filter-tabs {
  display: flex;
  gap: var(--space-2);
}

.filter-tabs .tab-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--muted);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tabs .tab-btn:hover {
  color: var(--ink);
  background: var(--gray-100);
}

.filter-tabs .tab-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: var(--font-semibold);
}

/* Log Modal */
.log-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: var(--space-6);
}

.log-modal-content {
  width: 100%;
  max-width: 1000px;
  max-height: 80vh;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.log-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--gray-25);
}

.log-modal-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--ink);
  margin: 0;
}

.log-modal-header button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  transition: all var(--transition);
}

.log-modal-header button:hover {
  background: var(--gray-200);
  color: var(--ink);
}

.log-output {
  flex: 1;
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--gray-900);
  color: var(--gray-100);
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.log-output::-webkit-scrollbar {
  width: 8px;
}

.log-output::-webkit-scrollbar-track {
  background: var(--gray-800);
}

.log-output::-webkit-scrollbar-thumb {
  background: var(--gray-600);
  border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

/* Spacing */
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: var(--font-bold); }
.font-semibold { font-weight: var(--font-semibold); }

/* Colors */
.text-primary { color: var(--ink); }
.text-secondary { color: var(--muted); }
.text-muted { color: var(--muted); }

/* Visibility */
.hidden { display: none; }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  
  .content {
    padding: var(--space-6);
  }
  
  .header {
    padding: var(--space-4) var(--space-6);
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .stat-cards {
    grid-template-columns: 1fr;
  }
  
  .modal-card {
    max-height: 95vh;
    margin: var(--space-4);
  }
  
  .modal-grid {
    grid-template-columns: 1fr;
  }
  
  .content {
    padding: var(--space-4);
  }
}
