/* ===== CSS DESIGN SYSTEM - ERP Datacenter ===== */

:root {
  /* Colors - Dark Theme */
  --bg-primary: #06060f;
  --bg-secondary: #0c0c1d;
  --bg-tertiary: #12122b;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.05);
  --border-focus: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
  --accent-gradient-2: linear-gradient(135deg, #6366f1, #a78bfa);
  --accent-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-xs: 0.6875rem;
  --font-sm: 0.8125rem;
  --font-base: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;

  /* Spacing */
  --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-12: 48px;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent-tertiary); text-decoration: none; }
a:hover { color: var(--accent-primary); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== LOGIN PAGE ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.15), transparent 70%);
  top: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.login-container::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.1), transparent 70%);
  bottom: -50px;
  left: -50px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-card h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: var(--space-2);
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  margin-bottom: var(--space-8);
}

.login-card .error-message {
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--danger);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  margin-bottom: var(--space-4);
  display: none;
}

.login-card .error-message.show { display: block; }

/* ===== APP LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition-base);
  overflow: hidden;
}

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

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand .brand-icon svg { width: 22px; height: 22px; color: white; }

.sidebar-brand .brand-text h2 {
  font-size: var(--font-base);
  font-weight: 700;
  white-space: nowrap;
}

.sidebar-brand .brand-text p {
  font-size: var(--font-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-section-title {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-tertiary);
}

.nav-item.active svg { color: var(--accent-primary); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-sm);
  flex-shrink: 0;
}

.user-details { overflow: hidden; }
.user-details .name { font-size: var(--font-sm); font-weight: 600; }
.user-details .role { font-size: var(--font-xs); color: var(--text-muted); text-transform: capitalize; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-header {
  height: var(--header-height);
  background: rgba(6, 6, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-header .page-title {
  font-size: var(--font-lg);
  font-weight: 700;
}

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

.page-content {
  flex: 1;
  padding: var(--space-8);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: var(--font-md);
  font-weight: 600;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.stat-card .stat-icon svg { width: 22px; height: 22px; }
.stat-card .stat-icon.purple { background: rgba(99,102,241,0.15); color: var(--accent-primary); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card .stat-icon.blue { background: var(--info-bg); color: var(--info); }

.stat-card .stat-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.stat-card .stat-value {
  font-size: var(--font-2xl);
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-change {
  font-size: var(--font-xs);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-input-focus); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-input); }

.btn-sm { padding: var(--space-2) var(--space-3); font-size: var(--font-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--font-base); }
.btn-icon { padding: var(--space-2); width: 36px; height: 36px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; appearance: auto; }

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

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

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

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

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

.table-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  flex: 1;
  max-width: 320px;
}

.table-search svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

.table-search input {
  border: none;
  background: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  outline: none;
  width: 100%;
}

.table-search input::placeholder { color: var(--text-muted); }

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

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}

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

.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
  color: var(--text-primary);
}

.data-table td:last-child { text-align: right; }
.data-table th:last-child { text-align: right; }

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: flex-end;
}

.table-empty {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--text-muted);
}

.table-empty svg { width: 48px; height: 48px; margin-bottom: var(--space-4); opacity: 0.3; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-draft { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-sent { background: var(--info-bg); color: var(--info); }
.badge-paid { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.badge-overdue { background: var(--danger-bg); color: var(--danger); }
.badge-cancelled { background: rgba(107,114,128,0.15); color: #6b7280; }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-suspended { background: var(--warning-bg); color: var(--warning); }
.badge-planning { background: var(--info-bg); color: var(--info); }
.badge-in_progress, .badge-in-progress { background: rgba(99,102,241,0.15); color: var(--accent-primary); }
.badge-completed { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-approved { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59,130,246,0.25); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }

/* Quick Login Bar */
.demo-accounts {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px dashed var(--border-color);
}
.demo-accounts-title {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.demo-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.demo-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-xs);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all var(--transition-fast);
  text-align: left;
}
.demo-btn:hover {
  background: var(--bg-input-focus);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}
.demo-btn strong { color: var(--text-primary); font-size: var(--font-xs); }
.demo-btn span { font-size: 0.65rem; color: var(--text-muted); }

/* Receipt Upload & Preview */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.upload-dropzone:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.04);
}
.receipt-thumbnail-container {
  position: relative;
  display: inline-block;
  margin-top: var(--space-3);
}
.receipt-thumbnail {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  object-fit: contain;
  background: #000;
  display: block;
}
.receipt-view-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--accent-tertiary);
  font-size: var(--font-xs);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-top: var(--space-1);
}
.receipt-view-btn:hover { text-decoration: underline; }

/* Status timeline / approval banner */
.status-banner {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.status-banner.pending { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.25); color: var(--warning); }
.status-banner.approved { background: var(--info-bg); border: 1px solid rgba(59,130,246,0.25); color: var(--info); }
.status-banner.paid { background: var(--success-bg); border: 1px solid rgba(16,185,129,0.25); color: var(--success); }
.status-banner.rejected { background: var(--danger-bg); border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }


/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 1000px; }

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

.modal-header h2 {
  font-size: var(--font-lg);
  font-weight: 700;
}

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

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
}

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

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

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-3);
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-sm);
  min-width: 300px;
  max-width: 440px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--info); }

.toast.removing { animation: toastOut 0.3s ease forwards; }

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

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ===== CHARTS ===== */
.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
}

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

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.section-header h2 {
  font-size: var(--font-xl);
  font-weight: 700;
}

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

/* ===== DETAIL VIEW ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.detail-item .detail-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item .detail-value {
  font-size: var(--font-base);
  color: var(--text-primary);
  font-weight: 500;
}

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

.tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-family);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.filter-bar .form-select,
.filter-bar .form-input {
  width: auto;
  min-width: 150px;
}

/* ===== INVOICE PREVIEW ===== */
.invoice-items-table {
  margin-bottom: var(--space-4);
}

.invoice-items-table .add-item-row {
  padding: var(--space-3);
}

.invoice-totals {
  margin-left: auto;
  width: 320px;
}

.invoice-totals .total-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.invoice-totals .total-row.grand-total {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-3);
  margin-top: var(--space-2);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-6);
  opacity: 0.2;
}

.empty-state h3 {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--font-sm);
  margin-bottom: var(--space-6);
}

/* ===== TAX CARDS ===== */
.tax-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.tax-card h3 {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tax-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--font-sm);
}

.tax-row .tax-label { color: var(--text-secondary); }
.tax-row .tax-value { font-weight: 600; }
.tax-row.total { border-top: 1px solid var(--border-color); padding-top: var(--space-3); margin-top: var(--space-2); font-weight: 700; }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row, .form-row-3, .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: var(--space-4); }
}

/* ===== UTILITY CLASSES ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent-primary); }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mr-2 { margin-right: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
