/**
 * AQUA 3.0 -- Custom Styles
 * ==========================
 * Tailwind handles 95% of styling. This covers the gaps.
 */

/* ─── CSS Variables ─────────────────────────────── */
:root {
  --bg-base: #0F172A;
  --bg-card: #1E293B;
  --bg-card-hover: #334155;
  --bg-input: #0F172A;
  --accent: #14B8A6;
  --accent-hover: #0D9488;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: #334155;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;
  --info: #3B82F6;
}

/* ─── Base Reset ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── Toast Notifications ───────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: #1E293B; }
.toast-info { background: var(--info); }

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

/* ─── Skeleton Loaders ──────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.375rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Status Badges ─────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.025em; }
.badge-pending { background: #94A3B820; color: #94A3B8; }
.badge-confirmed { background: #3B82F620; color: #3B82F6; }
.badge-scheduled { background: #8B5CF620; color: #8B5CF6; }
.badge-in-progress { background: #F59E0B20; color: #F59E0B; }
.badge-complete { background: #10B98120; color: #10B981; }
.badge-invoiced { background: #6366F120; color: #6366F1; }
.badge-paid { background: #05966920; color: #059669; }
.badge-cancelled { background: #EF444420; color: #EF4444; }
.badge-on-hold { background: #F9731620; color: #F97316; }

/* ─── Parse Status Badges ───────────────────────── */
.badge-job-created { background: #10B98120; color: #10B981; }
.badge-parsed { background: #3B82F620; color: #3B82F6; }
.badge-gate-failed { background: #F59E0B20; color: #F59E0B; }
.badge-skipped { background: #64748B20; color: #64748B; }
.badge-unprocessed { background: #94A3B820; color: #94A3B8; }

/* ─── Alert Level Badges ────────────────────────── */
.badge-ok { background: #10B98120; color: #10B981; }
.badge-info { background: #3B82F620; color: #3B82F6; }
.badge-warning { background: #F59E0B20; color: #F59E0B; }
.badge-critical { background: #EF444420; color: #EF4444; }
.badge-expired { background: #7C3AED20; color: #7C3AED; }

/* ─── Tabs ──────────────────────────────────────── */
.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Calendar Grid ─────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); }
.cal-header { padding: 0.5rem; text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-card); text-transform: uppercase; }
.cal-day { min-height: 5rem; padding: 0.25rem; background: var(--bg-base); position: relative; }
.cal-day.today { background: #14B8A610; }
.cal-day.other-month { opacity: 0.4; }
.cal-day-num { font-size: 0.75rem; color: var(--text-secondary); padding: 0.125rem 0.25rem; }
.cal-event { font-size: 0.625rem; padding: 0.125rem 0.25rem; border-radius: 0.125rem; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: white; }

/* ─── Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-content {
  background: var(--bg-card);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  max-width: 600px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  padding: 1.5rem;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── KPI Cards ─────────────────────────────────── */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: border-color 0.15s;
}
.kpi-card:hover { border-color: var(--accent); }
.kpi-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.kpi-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem; }

/* ─── Table ─────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.75rem 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--bg-card-hover); }
.data-table tr { cursor: pointer; }

/* ─── Transitions ───────────────────────────────── */
.fade-in { animation: fadeIn 0.2s ease; }
