/* ========================================
   FREELANCER BOT DASHBOARD - MODERN STYLES
   Ported from frontend_v2/src/styles/globals.css
   ======================================== */

/* Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ========================================
   DARK MODE (Default)
   ======================================== */
:root {
  /* Colors */
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --primary-light: #f87171;
  --primary-glow: rgba(220, 38, 38, 0.4);

  --secondary: #6366f1;
  --secondary-dark: #4f46e5;
  --secondary-light: #a5b4fc;

  --success: #22c55e;
  --success-light: #86efac;
  --warning: #f59e0b;
  --warning-light: #fcd34d;
  --danger: #dc2626;
  --info: #3b82f6;

  /* Backgrounds - Dark */
  --bg-dark: #0a0a0f;
  --bg-darker: #050507;
  --bg-card: #111118;
  --bg-card-hover: #1a1a24;
  --bg-elevated: #18181f;
  --bg-input: #0d0d12;
  --bg-tertiary: #1f1f28;

  /* Glass morphism */
  --glass-bg: rgba(17, 17, 24, 0.8);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-disabled: #52525b;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-focus: var(--primary);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

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

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--primary-glow);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Font */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Gradient backgrounds */
  --gradient-bg-1: rgba(220, 38, 38, 0.15);
  --gradient-bg-2: rgba(99, 102, 241, 0.1);
  --gradient-bg-3: rgba(17, 17, 24, 0.5);
}

/* ========================================
   LIGHT MODE
   ======================================== */
[data-theme="light"] {
  --bg-dark: #f5f5f7;
  --bg-darker: #e8e8ec;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f9fb;
  --bg-elevated: #fafafa;
  --bg-input: #f0f0f3;
  --bg-tertiary: #f3f4f6;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #6b7280;
  --text-disabled: #9ca3af;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.12);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(220, 38, 38, 0.2);

  --primary-glow: rgba(220, 38, 38, 0.25);

  --gradient-bg-1: rgba(220, 38, 38, 0.08);
  --gradient-bg-2: rgba(99, 102, 241, 0.05);
  --gradient-bg-3: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-danger,
[data-theme="light"] .btn-success {
  color: white;
}
[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #b91c1c 100%);
}
[data-theme="light"] .btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}
[data-theme="light"] .btn-success:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}
[data-theme="light"] .btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
[data-theme="light"] .btn-secondary:hover {
  background: var(--bg-darker);
  border-color: var(--border-light);
}
[data-theme="light"] .btn-ghost {
  color: var(--text-secondary);
}
[data-theme="light"] .btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -20%, var(--gradient-bg-1), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, var(--gradient-bg-2), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, var(--gradient-bg-3), transparent);
  pointer-events: none;
  z-index: -1;
  animation: gradientShift 20s ease-in-out infinite alternate;
  transition: background var(--transition-slow);
}
@keyframes gradientShift {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.8; transform: scale(1.1); }
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; height: auto; }

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }
p { color: var(--text-secondary); }

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}
.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
  color: white;
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
  color: white;
}
.btn-success:hover {
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}
.btn-sm { padding: var(--space-xs) var(--space-sm); font-size: 0.75rem; }
.btn-lg { padding: var(--space-md) var(--space-lg); font-size: 1rem; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon.sm { width: 32px; height: 32px; }

/* ========================================
   INPUTS
   ======================================== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.input::placeholder { color: var(--text-muted); }
.input:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}
.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 44px; }
.input-with-icon .icon,
.input-with-icon i[data-lucide] {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 18px;
  height: 18px;
}
textarea.input { min-height: 100px; resize: vertical; }
select.input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  min-height: 38px;
}
select.input:hover { border-color: var(--primary); }

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}
.checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
}
.checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ========================================
   TABLE
   ======================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.table th {
  background: var(--bg-elevated);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.table tbody tr {
  transition: background var(--transition-fast);
}
.table tbody tr:hover { background: var(--bg-card-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.badge-primary { background: rgba(220, 38, 38, 0.15); color: var(--primary-light); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success-light); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning-light); }
.badge-info    { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.badge-secondary { background: rgba(99, 102, 241, 0.15); color: var(--secondary-light); }

/* Bot-specific badges (status names from bidder/scanner pipeline) */
.badge-sent { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.badge-awarded, .badge-bid { background: rgba(34, 197, 94, 0.15); color: var(--success-light); }
.badge-rejected { background: rgba(220, 38, 38, 0.15); color: var(--primary-light); }
.badge-no_response, .badge-skipped { background: var(--bg-elevated); color: var(--text-muted); }
.badge-dry_run { background: rgba(245, 158, 11, 0.15); color: var(--warning-light); }
.badge-new, .badge-evaluated { background: rgba(99, 102, 241, 0.15); color: var(--secondary-light); }

/* ========================================
   STAT CARD (large with icon + number)
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity var(--transition-base);
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}
.stat-icon.red    { background: rgba(220, 38, 38, 0.15);  color: var(--primary); }
.stat-icon.blue   { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon.green  { background: rgba(34, 197, 94, 0.15);  color: var(--success); }
.stat-icon.purple { background: rgba(99, 102, 241, 0.15); color: var(--secondary); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================
   SHARED STAT BLOCKS (compact gradient cards)
   ======================================== */
.stat-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
}
.stat-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.stat-block-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.stat-block-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.stat-block.purple { background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.04) 100%); border-color: rgba(99,102,241,0.15); }
.stat-block.blue   { background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(6,182,212,0.04) 100%); border-color: rgba(59,130,246,0.15); }
.stat-block.orange { background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, rgba(249,115,22,0.04) 100%); border-color: rgba(245,158,11,0.15); }
.stat-block.green  { background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(20,184,166,0.04) 100%); border-color: rgba(16,185,129,0.15); }
.stat-block.pink   { background: linear-gradient(135deg, rgba(236,72,153,0.08) 0%, rgba(244,63,94,0.04) 100%); border-color: rgba(236,72,153,0.15); }
.stat-block.red    { background: linear-gradient(135deg, rgba(220,38,38,0.08) 0%, rgba(197,33,33,0.04) 100%); border-color: rgba(220,38,38,0.15); }
.stat-block.cyan   { background: linear-gradient(135deg, rgba(6,182,212,0.08) 0%, rgba(20,184,166,0.04) 100%); border-color: rgba(6,182,212,0.15); }
.stat-block:hover { transform: translateY(-1px); }
.stat-block.purple:hover { border-color: rgba(99,102,241,0.3); }
.stat-block.blue:hover   { border-color: rgba(59,130,246,0.3); }
.stat-block.orange:hover { border-color: rgba(245,158,11,0.3); }
.stat-block.green:hover  { border-color: rgba(16,185,129,0.3); }
.stat-block.pink:hover   { border-color: rgba(236,72,153,0.3); }
.stat-block.red:hover    { border-color: rgba(220,38,38,0.3); }
.stat-block.cyan:hover   { border-color: rgba(6,182,212,0.3); }
.stat-block.purple .stat-block-icon { background: rgba(99,102,241,0.15);  color: #6366f1; }
.stat-block.blue   .stat-block-icon { background: rgba(59,130,246,0.15);  color: #3b82f6; }
.stat-block.orange .stat-block-icon { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.stat-block.green  .stat-block-icon { background: rgba(16,185,129,0.15);  color: #10b981; }
.stat-block.pink   .stat-block-icon { background: rgba(236,72,153,0.15);  color: #ec4899; }
.stat-block.red    .stat-block-icon { background: rgba(220,38,38,0.15);   color: #dc2626; }
.stat-block.cyan   .stat-block-icon { background: rgba(6,182,212,0.15);   color: #06b6d4; }
.stat-block-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-block-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
[data-theme="light"] .stat-block.purple { background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.02) 100%); border-color: rgba(99,102,241,0.12); }
[data-theme="light"] .stat-block.blue   { background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(6,182,212,0.02) 100%); border-color: rgba(59,130,246,0.12); }
[data-theme="light"] .stat-block.orange { background: linear-gradient(135deg, rgba(245,158,11,0.06) 0%, rgba(249,115,22,0.02) 100%); border-color: rgba(245,158,11,0.12); }
[data-theme="light"] .stat-block.green  { background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(20,184,166,0.02) 100%); border-color: rgba(16,185,129,0.12); }
[data-theme="light"] .stat-block.pink   { background: linear-gradient(135deg, rgba(236,72,153,0.06) 0%, rgba(244,63,94,0.02) 100%); border-color: rgba(236,72,153,0.12); }
[data-theme="light"] .stat-block.red    { background: linear-gradient(135deg, rgba(220,38,38,0.06) 0%, rgba(197,33,33,0.02) 100%); border-color: rgba(220,38,38,0.12); }
[data-theme="light"] .stat-block.cyan   { background: linear-gradient(135deg, rgba(6,182,212,0.06) 0%, rgba(20,184,166,0.02) 100%); border-color: rgba(6,182,212,0.12); }

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fade-in   { animation: fadeIn var(--transition-base) ease-out; }
.animate-slide-up  { animation: slideUp var(--transition-base) ease-out; }
.animate-slide-down{ animation: slideDown var(--transition-base) ease-out; }
.animate-scale-in  { animation: scaleIn var(--transition-spring) ease-out; }
.animate-pulse     { animation: pulse 2s infinite; }
.animate-spin      { animation: spin 1s linear infinite; }

.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }

/* ========================================
   LOADING
   ======================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   TOAST
   ======================================== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 2000;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideLeft var(--transition-base) ease-out;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info    { border-left: 4px solid var(--info); }

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}
.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.empty-state-description {
  color: var(--text-muted);
  max-width: 400px;
}

/* ========================================
   MODAL (kept for inbox draft regeneration etc.)
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: 1000;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.modal-body { padding: var(--space-lg); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* ========================================
   UTILITIES
   ======================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Lucide icon sizing default */
i[data-lucide], svg.lucide {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}
