/* ==========================================
   CSS Reset & Variables
   ========================================== */
:root {
  /* Dark Theme Palette (Default) */
  --bg-app: radial-gradient(circle at top left, #0b0f19, #0d1222, #07090e);
  --bg-sidebar: rgba(13, 18, 30, 0.7);
  --bg-card: rgba(20, 27, 45, 0.55);
  --bg-card-hover: rgba(25, 34, 56, 0.7);
  --border-color: rgba(255, 255, 255, 0.07);
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-inverse: #0b0f19;
  
  /* Accent Colors & Gradients */
  --primary-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --indigo-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --danger-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #f43f5e;
  --info: #06b6d4;
  
  /* Utilities */
  --font-display: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.5);
  --glass-blur: blur(12px);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
body.light-theme {
  --bg-app: radial-gradient(circle at top left, #f8fafc, #f1f5f9, #e2e8f0);
  --bg-sidebar: rgba(255, 255, 255, 0.8);
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-color: rgba(15, 23, 42, 0.08);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --indigo-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 15px 40px rgba(15, 23, 42, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body.light-theme * {
  scrollbar-color: rgba(15, 23, 42, 0.1) transparent;
}

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

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

body.light-theme *::-webkit-scrollbar-thumb {
  background-color: rgba(15, 23, 42, 0.1);
}

body {
  font-family: var(--font-body);
  background: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ==========================================
   Layout Structure
   ========================================== */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition-smooth);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.logo-area h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

body.light-theme .nav-item:hover {
  background: rgba(15, 23, 42, 0.03);
}

.nav-item.active {
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--primary-gradient);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  transition: var(--transition-smooth);
}

.nav-item.active .nav-icon {
  color: var(--primary);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Main Content Styling */
.main-content {
  margin-left: 280px;
  flex-grow: 1;
  padding: 2.5rem;
  max-width: 1600px;
  width: calc(100% - 280px);
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title p {
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-icon-only {
  padding: 0.65rem;
}

.btn-icon-only svg {
  width: 20px;
  height: 20px;
}

.btn-gradient {
  background: var(--primary-gradient);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35);
}

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

.btn-indigo {
  background: var(--indigo-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-indigo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

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

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================
   Tab Navigation & Panes
   ========================================== */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

/* ==========================================
   Dashboard Components
   ========================================== */
/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

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

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.stat-card.blue::after { background: var(--primary-gradient); }
.stat-card.green::after { background: var(--success-gradient); }
.stat-card.orange::after { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-card.red::after { background: var(--danger-gradient); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 0.25rem;
  line-height: 1;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.stat-card.blue .stat-icon { background: rgba(56, 189, 248, 0.1); color: var(--primary); }
.stat-card.green .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card.orange .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card.red .stat-icon { background: rgba(244, 63, 94, 0.1); color: var(--danger); }

.stat-icon svg {
  width: 24px;
  height: 24px;
}

/* Dashboard Layout Grid */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

.dashboard-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition-smooth);
}

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

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Pending WA alerts list */
.pending-wa-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.pending-wa-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition-smooth);
  position: relative;
}

body.light-theme .pending-wa-item {
  background: rgba(15, 23, 42, 0.01);
}

.pending-wa-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.wa-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.wa-item-meta h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.wa-item-meta p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.wa-item-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  display: inline-flex;
}

.wa-item-badge.alert-30 { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.wa-item-badge.alert-15 { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.wa-item-badge.alert-7 { background: rgba(244, 63, 94, 0.15); color: var(--danger); }
.wa-item-badge.alert-3 { background: rgba(244, 63, 94, 0.2); color: var(--danger); }
.wa-item-badge.alert-1 { background: rgba(244, 63, 94, 0.25); color: var(--danger); }

.wa-item-message {
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-style: italic;
  white-space: pre-wrap;
  max-height: 80px;
  overflow-y: auto;
  border-left: 2px solid var(--primary);
}

.wa-item-actions {
  display: flex;
  gap: 0.5rem;
}

.wa-item-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  flex: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
  margin-bottom: 1rem;
  opacity: 0.5;
}

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

/* ==========================================
   Tables
   ========================================== */
.section-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.search-filter-box {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-filter-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem 0.65rem 1rem;
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.search-filter-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.table-container {
  margin-top: 1.5rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

body.light-theme .data-table th {
  background: rgba(15, 23, 42, 0.01);
}

.data-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  transition: var(--transition-smooth);
}

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

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

body.light-theme .data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.01);
}

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

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

.badge-accent {
  background: var(--primary-gradient);
  color: var(--text-inverse);
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

.text-success { color: var(--success); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-buttons .btn {
  padding: 0.4rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.action-buttons svg {
  width: 16px;
  height: 16px;
}

/* ==========================================
   Settings Configurations
   ========================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.settings-card {
  height: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  width: 100%;
}

body.light-theme .form-group input,
body.light-theme .form-group select {
  background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.form-group.inline-group {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group.inline-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-group.inline-group label {
  cursor: pointer;
  user-select: none;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-8 { flex: 8; }
.col-6 { flex: 6; }
.col-4 { flex: 4; }

.inline-group-align {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.5rem;
}

.inline-group-align input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

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

.test-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 0.3s ease;
}

.test-panel h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.test-result {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  display: none;
}

.test-result.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-left: 3px solid var(--success);
}

.test-result.error {
  display: block;
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-left: 3px solid var(--danger);
}

/* ==========================================
   Modals
   ========================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.light-theme .modal-content {
  background: #ffffff;
}

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

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

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

.modal-content form {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 450px;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-left: 4px solid var(--primary);
  backdrop-filter: var(--glass-blur);
}

body.light-theme .toast {
  background: #ffffff;
}

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

.toast.fade-out {
  animation: slideOutRight 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

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

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

.toast-message {
  font-size: 0.85rem;
  font-weight: 500;
  flex-grow: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

/* ==========================================
   Loaders
   ========================================== */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loader-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

body.light-theme .loader {
  border-color: rgba(15, 23, 42, 0.1);
  border-left-color: var(--primary);
}

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

/* ==========================================
   Responsive adjustments
   ========================================== */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1.5rem;
  }
  
  .logo-area {
    margin-bottom: 1.5rem;
  }
  
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .section-header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-filter-box {
    max-width: 100%;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .col-8, .col-6, .col-4 {
    flex: none;
    width: 100%;
  }
  
  .inline-group-align {
    padding-top: 0.5rem;
    margin-bottom: 1.25rem;
  }
}
