/*
 * ═══════════════════════════════════════════════════════════════
 *  WORKSTATION — Design System v2.0
 *  Professional SaaS Light Theme
 *
 *  Palette:
 *    White  → base, surfaces, cards
 *    Navy   → navigation, headers, primary actions
 *    Orange → CTAs, highlights, alerts
 *    Black  → text, high-contrast elements
 *    Green  → dollar metrics, positive indicators
 *
 *  Structure:
 *    1. Design Tokens (CSS variables)
 *    2. Typography
 *    3. Spacing & Layout primitives
 *    4. Base reset overrides
 *    5. Component library
 *       5a. Buttons
 *       5b. Badges & Status
 *       5c. Cards & Metric Cards
 *       5d. Sidebar & Navigation
 *       5e. Header
 *       5f. Tables
 *       5g. Forms
 *       5h. Alerts & Feedback
 *       5i. Dollar / FX indicators
 *       5j. Empty states
 *       5k. Modal
 *    6. Utilities
 *    7. Animations
 * ═══════════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────
   1. DESIGN TOKENS
   ───────────────────────────────────────── */
:root {
  /* ── Core Palette ── */
  --white: #ffffff;
  --navy-900: #4C1D95;
  --navy-800: #5B21B6;
  --navy-700: #6D28D9;
  --navy-600: #7C3AED;
  --navy-500: #8B5CF6;
  --navy-100: #EDE9FE;
  --navy-50: #F5F3FF;

  --orange-600: #ea6c00;
  --orange-500: #f97316;
  --orange-400: #fb923c;
  --orange-100: #fff0e5;
  --orange-50: #fff8f0;

  --black: #0a0a0a;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;

  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-100: #d1fae5;
  --green-50: #ecfdf5;

  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --red-50: #fff5f5;

  --yellow-500: #f59e0b;
  --yellow-100: #fef3c7;

  /* ── Semantic Colors (mapped from palette) ── */
  --primary: var(--navy-800);
  --primary-dark: var(--navy-900);
  --primary-light: var(--navy-500);
  --primary-hover: var(--navy-700);
  --primary-subtle: var(--navy-50);

  --accent: var(--orange-500);
  --accent-dark: var(--orange-600);
  --accent-light: var(--orange-400);
  --accent-subtle: var(--orange-50);

  --success: var(--green-500);
  --success-dark: var(--green-600);
  --success-subtle: var(--green-50);
  --success-text: var(--green-700);

  --danger: var(--red-500);
  --danger-dark: var(--red-600);
  --danger-subtle: var(--red-50);

  --warning: var(--yellow-500);
  --warning-subtle: var(--yellow-100);

  /* ── Surface & Background ── */
  --bg-base: var(--gray-50);
  --bg-surface: var(--white);
  --bg-elevated: var(--white);
  --bg-overlay: rgba(11, 27, 53, 0.6);

  /* ── Text ── */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);
  --text-inverse: var(--white);
  --text-link: var(--navy-500);

  /* ── Border ── */
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --border-focus: var(--navy-500);
  --border-accent: var(--orange-500);

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-navy: 0 4px 14px rgba(27, 43, 75, 0.18);
  --shadow-orange: 0 4px 14px rgba(249, 115, 22, 0.3);

  /* ── Sidebar ── */
  --sidebar-bg: #F8F7FF;
  --sidebar-hover: rgba(124, 58, 237, 0.06);
  --sidebar-active: rgba(124, 58, 237, 0.10);
  --sidebar-active-border: #7C3AED;
  --sidebar-text: #6B7280;
  --sidebar-text-active: #7C3AED;
  --sidebar-label: #9CA3AF;
  --sidebar-width: 260px;

  /* ── Typography ── */
  --font-main:
    "Inter", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-display: "Inter", "Segoe UI", sans-serif;

  /* ── Font sizes ── */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 30px;

  /* ── Spacing scale ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* ── Radius ── */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.25s ease;
  --transition-slow: all 0.35s ease;

  /* ── Z-index ── */
  --z-base: 0;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;
  --z-toast: 2000;

  /* ── Semantic Web App Tokens ── */
  --bg-primary: var(--gray-50);
  --surface-primary: var(--white);
  --card-bg: var(--white);
  --border-primary: var(--gray-200);

  /* ── Mapped Fallbacks (Safe Drop-in Replacement) ── */
  --dark-bg: var(--bg-primary);
  --dark-surface: var(--surface-primary);
  --dark-card: var(--card-bg);
  --dark-border: var(--border-primary);
  --dark-sidebar: var(--sidebar-bg);
}

/* ─────────────────────────────────────────
   2. TYPOGRAPHY
   ───────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

.ds-h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.ds-h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}
.ds-h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.ds-h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
}
.ds-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}
.ds-caption {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.ds-body {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.6;
}
.ds-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────
   3. BASE RESET OVERRIDES (light mode)
   ───────────────────────────────────────── */
body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--navy-500);
}

/* ─────────────────────────────────────────
   5a. BUTTONS
   ───────────────────────────────────────── */

/* Primary — Navy */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 18px;
  font-family: var(--font-main);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--navy-800);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--navy-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-navy);
}
.btn-primary:active {
  transform: translateY(0);
}

/* CTA — Orange */
.btn-cta,
.btn-accent {
  background: var(--orange-500);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-cta:hover,
.btn-accent:hover {
  background: var(--orange-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-orange);
}

/* Outlined Navy */
.btn-outline {
  background: transparent;
  color: var(--navy-800);
  border: 1.5px solid var(--navy-800);
}
.btn-outline:hover {
  background: var(--navy-50);
}

/* Outlined Orange */
.btn-outline-accent {
  background: transparent;
  color: var(--orange-500);
  border: 1.5px solid var(--orange-500);
}
.btn-outline-accent:hover {
  background: var(--orange-50);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--gray-100);
  border-color: var(--border-strong);
}

/* Danger */
.btn-danger {
  background: var(--red-500);
  color: var(--white);
}
.btn-danger:hover {
  background: var(--red-600);
}

/* Success */
.btn-success {
  background: var(--green-500);
  color: var(--white);
}
.btn-success:hover {
  background: var(--green-600);
}

/* Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 13px 24px;
  font-size: var(--text-lg);
  border-radius: var(--radius-md);
}
.btn-xl {
  padding: 15px 32px;
  font-size: var(--text-xl);
  border-radius: var(--radius-lg);
}
.btn-full {
  width: 100%;
}
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
}

/* Login button override */
.login-btn {
  background: var(--navy-800) !important;
  background-image: none !important;
  box-shadow: var(--shadow-navy) !important;
}
.login-btn:hover {
  background: var(--navy-700) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 43, 75, 0.3) !important;
}

/* ─────────────────────────────────────────
   5b. BADGES & STATUS
   ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-primary {
  background: var(--navy-100);
  color: var(--navy-800);
}
.badge-accent {
  background: var(--orange-100);
  color: var(--orange-600);
}
.badge-success {
  background: var(--green-100);
  color: var(--green-700);
}
.badge-danger {
  background: var(--red-100);
  color: var(--red-600);
}
.badge-warning {
  background: var(--yellow-100);
  color: #92400e;
}
.badge-neutral {
  background: var(--gray-100);
  color: var(--gray-700);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.active {
  background: var(--green-500);
  box-shadow: 0 0 0 2px var(--green-100);
}
.status-dot.inactive {
  background: var(--gray-400);
}
.status-dot.warning {
  background: var(--yellow-500);
}
.status-dot.danger {
  background: var(--red-500);
}

/* ─────────────────────────────────────────
   5c. CARDS & METRIC CARDS
   ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Metric card */
.metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}
.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--navy-800);
}
.metric-card.accent::before {
  background: var(--orange-500);
}
.metric-card.success::before {
  background: var(--green-500);
}
.metric-card.warning::before {
  background: var(--yellow-500);
}
.metric-card.danger::before {
  background: var(--red-500);
}
.metric-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.metric-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}
.metric-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.metric-trend {
  font-size: var(--text-sm);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-trend.up {
  color: var(--green-600);
}
.metric-trend.down {
  color: var(--red-500);
}

/* ─────────────────────────────────────────
   5d. SIDEBAR & NAVIGATION (Navy dark)
   ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width) !important;
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.04);
}

.menu-section {
  color: var(--sidebar-label) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px !important;
  padding: 20px 20px 8px !important;
}

.menu-item {
  color: var(--sidebar-text) !important;
  font-size: var(--text-sm) !important;
  padding: 11px 18px !important;
  border-left: 3px solid transparent !important;
  border-radius: 0 !important;
  transition: var(--transition-fast) !important;
}
.menu-item:hover {
  background: var(--sidebar-hover) !important;
  color: var(--primary) !important;
}
.menu-item.active {
  background: var(--sidebar-active) !important;
  color: var(--primary) !important;
  border-left-color: var(--primary) !important;
  font-weight: 600 !important;
}
.menu-item span:first-child {
  font-size: 16px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   5e. HEADER
   ───────────────────────────────────────── */
.header {
  background: var(--white) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: var(--shadow-xs) !important;
  height: 62px !important;
}
.header-title {
  font-size: var(--text-lg) !important;
  font-weight: 700 !important;
  color: var(--navy-800) !important;
}
.user-name {
  color: var(--navy-800) !important;
  font-weight: 600 !important;
}
.cotizaciones-header {
  border-right-color: var(--border) !important;
  padding-right: 20px !important;
}
.cotizacion-label {
  color: var(--text-tertiary) !important;
}
.cotizacion-valor {
  color: var(--green-600) !important;
  font-weight: 800 !important;
}

.selector-sucursal {
  background: var(--gray-50) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-size: var(--text-sm) !important;
}

.logout-btn {
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
  background: var(--gray-50) !important;
  border-radius: var(--radius-sm) !important;
  font-size: var(--text-sm) !important;
  transition: var(--transition-fast) !important;
}
.logout-btn:hover {
  background: var(--red-50) !important;
  border-color: var(--red-500) !important;
  color: var(--red-600) !important;
}

/* ─────────────────────────────────────────
   5f. TABLES
   ───────────────────────────────────────── */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.ds-table th {
  background: var(--gray-50);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.ds-table td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.ds-table tbody tr {
  transition: var(--transition-fast);
}
.ds-table tbody tr:hover {
  background: var(--navy-50);
}
.ds-table tbody tr:last-child td {
  border-bottom: none;
}

/* Any existing table overrides */
table {
  border-collapse: collapse !important;
}
thead th {
  background: var(--gray-50) !important;
  color: var(--text-secondary) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  border-bottom: 2px solid var(--border) !important;
}
tbody tr:hover {
  background: var(--navy-50) !important;
}

/* ─────────────────────────────────────────
   5g. FORMS
   ───────────────────────────────────────── */
.form-group input,
.form-group select,
.form-group textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
select,
textarea {
  background: var(--white) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  font-size: var(--text-base) !important;
  transition: var(--transition-fast) !important;
}
input:focus,
select:focus,
textarea:focus,
.form-group input:focus,
.form-group select:focus {
  border-color: var(--navy-800) !important;
  box-shadow: 0 0 0 3px rgba(27, 43, 75, 0.1) !important;
  outline: none !important;
}
.form-group label {
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

/* ─────────────────────────────────────────
   5h. ALERTS & FEEDBACK
   ───────────────────────────────────────── */
.ds-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--text-sm);
}
.ds-alert-success {
  background: var(--green-50);
  border-color: var(--green-100);
  color: var(--green-700);
}
.ds-alert-danger {
  background: var(--red-50);
  border-color: var(--red-100);
  color: var(--red-600);
}
.ds-alert-warning {
  background: var(--yellow-100);
  border-color: #fde68a;
  color: #92400e;
}
.ds-alert-info {
  background: var(--navy-50);
  border-color: var(--navy-100);
  color: var(--navy-800);
}
.ds-alert-accent {
  background: var(--orange-50);
  border-color: var(--orange-100);
  color: var(--orange-600);
}

.error-msg {
  background: var(--red-50) !important;
  border-color: var(--red-500) !important;
  color: var(--red-600) !important;
  border-radius: var(--radius-md) !important;
  font-size: var(--text-sm) !important;
}

/* ─────────────────────────────────────────
   5i. DOLLAR / FX INDICATORS (green)
   ───────────────────────────────────────── */
.fx-indicator {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}
.fx-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
}
.fx-value {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--green-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.fx-value.up {
  color: var(--green-600);
}
.fx-value.down {
  color: var(--red-500);
}
.fx-pill {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  color: var(--green-700);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
}
/* Ensure existing cotizacion-valor is green */
.cotizacion-valor,
[class*="dolar"],
[class*="usd"],
[class*="cotiz"] .valor,
.cotizacion-valor,
.price-usd,
.usd-value {
  color: var(--green-600) !important;
  font-weight: 700 !important;
}

/* ─────────────────────────────────────────
   5j. EMPTY STATES
   ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-5);
  background: var(--gray-100);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}
.empty-state-body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 320px;
  margin-bottom: var(--sp-6);
  line-height: 1.6;
}

/* ─────────────────────────────────────────
   5k. MODAL
   ───────────────────────────────────────── */
.modal-overlay {
  background: var(--bg-overlay) !important;
}
.modal,
.modal-content {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
  color: var(--text-primary) !important;
}
.modal-header,
.modal h2,
.modal-title {
  color: var(--navy-800) !important;
  font-weight: 700 !important;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: var(--sp-4) !important;
  margin-bottom: var(--sp-5) !important;
}

/* ─────────────────────────────────────────
   6. UTILITIES
   ───────────────────────────────────────── */
.text-navy {
  color: var(--navy-800) !important;
}
.text-orange {
  color: var(--orange-500) !important;
}
.text-green {
  color: var(--green-600) !important;
}
.text-muted {
  color: var(--text-secondary) !important;
}
.text-danger {
  color: var(--red-500) !important;
}

.bg-navy {
  background: var(--navy-800) !important;
}
.bg-orange {
  background: var(--orange-500) !important;
}
.bg-green-subtle {
  background: var(--green-50) !important;
}
.bg-navy-subtle {
  background: var(--navy-50) !important;
}
.bg-accent-subtle {
  background: var(--orange-50) !important;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-5) 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shadow-card {
  box-shadow: var(--shadow-sm);
}
.rounded {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}
.rounded-xl {
  border-radius: var(--radius-xl);
}

/* ─────────────────────────────────────────
   7. ANIMATIONS
   ───────────────────────────────────────── */
@keyframes ds-fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ds-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ds-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@keyframes ds-slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes ds-scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fadeIn {
  animation: ds-fadeIn 0.25s ease both;
}
.animate-fadeInUp {
  animation: ds-fadeInUp 0.3s ease both;
}
.animate-pulse {
  animation: ds-pulse 1.8s ease infinite;
}
.animate-scaleIn {
  animation: ds-scaleIn 0.2s ease both;
}

/* Stagger children */
.stagger > *:nth-child(1) {
  animation-delay: 0ms;
}
.stagger > *:nth-child(2) {
  animation-delay: 60ms;
}
.stagger > *:nth-child(3) {
  animation-delay: 120ms;
}
.stagger > *:nth-child(4) {
  animation-delay: 180ms;
}

/* ─────────────────────────────────────────
   LOGIN — Light remake
   ───────────────────────────────────────── */
.login-screen {
  background: linear-gradient(
    135deg,
    var(--navy-900) 0%,
    var(--navy-800) 60%,
    var(--navy-700) 100%
  ) !important;
}
/* subtle pattern overlay */
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(
      circle at 20% 80%,
      rgba(249, 115, 22, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 50%
    );
  pointer-events: none;
}
.login-card {
  background: var(--white) !important;
  border: none !important;
  box-shadow: var(--shadow-xl) !important;
}
.login-card h1 {
  color: var(--navy-900) !important;
}
.login-card p {
  color: var(--text-secondary) !important;
}
.login-logo {
  border-color: var(--navy-100) !important;
  background: var(--gray-50) !important;
}

/* ─────────────────────────────────────────
   CONTENT AREA
   ───────────────────────────────────────── */
.content,
.main-content,
#content,
.content-area {
  background: var(--bg-base) !important;
  color: var(--text-primary) !important;
}

/* Section titles */
.section-title,
.module-title,
.panel-title,
h2,
h3 {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}

/* Panel / module surfaces */
.panel,
.module,
.content-panel,
.tab-content {
  background: var(--white) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
}

/* Generic dark backgrounds → white */
[style*="background: #1e1e1e"],
[style*="background:#1e1e1e"],
[style*="background: #121212"],
[style*="background:#121212"],
.dark-surface,
.dark-panel {
  background: var(--white) !important;
  color: var(--text-primary) !important;
}

/* Summary row / totals */
.total-row,
.summary-row,
tfoot tr {
  background: var(--navy-50) !important;
  font-weight: 700 !important;
  color: var(--navy-800) !important;
}

/* KPI / stat number */
.stat-value,
.kpi-value,
.metric-number {
  color: var(--navy-800) !important;
  font-weight: 800 !important;
}
.stat-positive,
.positive,
.value-up {
  color: var(--green-600) !important;
}
.stat-negative,
.negative,
.value-down {
  color: var(--red-500) !important;
}

/* Primary color override removed — tokens managed by theme-final.css */
