:root {
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --primary: 215 60% 22%;
  --primary-foreground: 210 40% 98%;
  --muted: 210 24% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 173 58% 39%;
  --destructive: 0 72% 51%;
  --border: 214 32% 91%;
  --radius: 0.5rem;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  height: 2.5rem;
  padding: 0 1rem;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-outline {
  border: 1px solid hsl(var(--border));
  background: white;
}
.btn-outline:hover { background: hsl(var(--muted)); }

.btn-destructive {
  background: hsl(var(--destructive));
  color: white;
}

.input {
  height: 2.5rem;
  width: 100%;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0 0.75rem;
  font-size: 0.875rem;
  background: white;
}
.input:focus {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 1px;
}

.badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #f1f5f9; color: #475569; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  color: #cbd5e1;
  font-size: 0.875rem;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgb(255 255 255 / 0.08);
  color: white;
}

.table-financial th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.table-financial td.num, .table-financial th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row-weekend { background: #ecfdf5; }
.row-variance { background: #fef2f2; }

#toast-root {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  min-width: 280px;
  max-width: 420px;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: white;
  box-shadow: 0 10px 30px rgb(15 23 42 / 0.12);
  animation: toast-in 0.2s ease;
}
.toast-success { border-left: 4px solid #16a34a; }
.toast-error { border-left: 4px solid #dc2626; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-sidebar {
  background: linear-gradient(180deg, hsl(215, 60%, 16%) 0%, hsl(200, 45%, 22%) 100%);
  color: #e2e8f0;
}

.topbar { box-shadow: 0 1px 3px rgb(15 23 42 / 0.06); }
.topbar-icon-btn {
  position: relative;
  width: 2.5rem; height: 2.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; border: 1px solid hsl(var(--border));
  background: white; color: #475569;
}
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 1rem; height: 1rem; padding: 0 4px;
  background: #dc2626; color: white; font-size: 10px; font-weight: 700;
  border-radius: 9999px; display: flex; align-items: center; justify-content: center;
}
.notif-dropdown, .profile-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 280px; background: white; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); box-shadow: 0 12px 40px rgb(15 23 42 / 0.12);
  z-index: 50;
}
.notif-item, .profile-link {
  display: block; padding: 0.65rem 1rem; font-size: 0.875rem; color: #334155;
}
.notif-item:hover, .profile-link:hover { background: #f8fafc; }
.avatar-circle {
  width: 2rem; height: 2rem; border-radius: 9999px;
  background: linear-gradient(135deg, #0d9488, #1e3a5f);
  color: white; font-size: 0.75rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.analytics-tab {
  padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.8125rem; font-weight: 500;
  background: white; border: 1px solid hsl(var(--border)); color: #475569;
}
.analytics-tab.active { background: #0f766e; color: white; border-color: #0f766e; }
.kpi-card { background: white; border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.25rem; }
.kpi-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; }
.kpi-value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.kpi-sub { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }
.chart-panel { border-top: 3px solid #0f766e; }
.chart-title { font-weight: 600; margin-bottom: 1rem; color: #0f172a; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(15 23 42 / 0.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.hidden { display: none; }
.modal-panel {
  width: 100%; max-width: 640px; background: white; border-radius: 12px;
  padding: 1.5rem; box-shadow: 0 25px 50px rgb(15 23 42 / 0.25);
  max-height: 90vh; overflow: hidden;
}
