/* ═══════════════════════════════════════════════════════════════════════════
   ZENITJOB — Design System v4.0
   Tipografía DM Sans + Outfit · Paleta Indigo/Slate/Gold · Motion-first · PWA
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:        #5b5cf6;
  --brand-dark:   #4338ca;
  --brand-deeper: #3730a3;
  --brand-light:  #eef2ff;
  --brand-glow:   rgba(91,92,246,.16);
  --brand-mid:    #7c7df8;

  /* Gold accent — premium / highlight */
  --gold:         #d97706;
  --gold-light:   #fef3c7;
  --gold-bright:  #fbbf24;

  /* Surface */
  --bg:           #f4f5f9;
  --bg-2:         #eaecf4;
  --bg-warm:      #f9f8f5;
  --card:         #ffffff;
  --card-hover:   #fafaff;

  /* Sidebar */
  --sb:           #080e1f;
  --sb-2:         #0c1428;
  --sb-hover:     rgba(255,255,255,.055);
  --sb-active:    rgba(91,92,246,.26);
  --sb-border:    rgba(255,255,255,.065);
  --sb-text:      rgba(255,255,255,.55);
  --sb-text-act:  #ffffff;
  --sb-w:         240px;

  /* Text */
  --text:         #0c1222;
  --text-2:       #2d3a50;
  --text-muted:   #60708a;
  --text-faint:   #94a3b8;

  /* Border */
  --border:       #e0e4ef;
  --border-2:     #c8d0e4;

  /* Semantic */
  --success:      #059669;
  --success-bg:   #d1fae5;
  --success-text: #065f46;
  --warning:      #d97706;
  --warning-bg:   #fef3c7;
  --warning-text: #78350f;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --danger-text:  #991b1b;
  --info:         #2563eb;
  --info-bg:      #dbeafe;
  --info-text:    #1e40af;
  --purple:       #7c3aed;
  --purple-bg:    #ede9fe;
  --orange:       #ea580c;
  --orange-bg:    #ffedd5;

  /* Shadows — warm-tinted for depth */
  --shadow-xs:    0 1px 2px rgba(8,14,31,.05);
  --shadow-sm:    0 1px 3px rgba(8,14,31,.07), 0 4px 8px -2px rgba(8,14,31,.05);
  --shadow-md:    0 4px 8px -1px rgba(8,14,31,.09), 0 12px 20px -4px rgba(8,14,31,.06);
  --shadow-lg:    0 12px 30px -6px rgba(8,14,31,.12), 0 24px 48px -12px rgba(8,14,31,.08);
  --shadow-xl:    0 24px 64px rgba(8,14,31,.22);
  --shadow-brand: 0 4px 16px rgba(91,92,246,.3);

  /* Radii */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Motion */
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-out:    cubic-bezier(.22,1,.36,1);
  --ease-in-out: cubic-bezier(.4,0,.2,1);

  /* Topbar */
  --topbar-h: 54px;
  /* Safe area (iOS/Android) */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ── RESET & BASE ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page enter animation */
.main { animation: pageEnter .32s var(--ease-out) both; }
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sb-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--sb) 0%, var(--sb-2) 60%, #070c1a 100%);
  display: flex;
  flex-direction: column;
  z-index: 300;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}

/* Subtle dot-grid texture overlay */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

/* Logo / Brand */
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}

.sidebar-logo h2 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-logo h2 span.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  border-radius: 8px;
  font-size: 14px;
}

.sidebar-logo p {
  color: var(--sb-text);
  font-size: 11.5px;
  margin-top: 6px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav links */
.sidebar nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar nav::-webkit-scrollbar { display: none; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  letter-spacing: -.1px;
}

.sidebar nav a:hover {
  color: #fff;
  background: var(--sb-hover);
}

/* ── Iconos SVG sidebar ───────────────── */
.sb-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; opacity: 0.7;
  transition: opacity .15s;
}
.sb-icon svg {
  width: 18px; height: 18px;
  display: block;
}
.sidebar nav a:hover .sb-icon,
.sidebar nav a.active .sb-icon { opacity: 1; }

.sidebar nav a.active {
  color: var(--sb-text-act);
  background: var(--sb-active);
  font-weight: 600;
}

.sidebar nav a.active .icon-nav {
  background: var(--brand);
  color: #fff;
}

.sidebar nav a .icon-nav {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--sb-hover);
  transition: background .15s;
}

.sidebar nav a:hover .icon-nav {
  background: rgba(255,255,255,.12);
}

/* ── SIDEBAR NUEVO: grupo label ──────────────────── */
.nav-label, .sb-group-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  padding: 16px 14px 5px;
  margin-top: 2px;
  pointer-events: none;
  user-select: none;
}

/* Logo nuevo */
.sb-brand-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.sb-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand) 0%, #818cf8 100%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(91,92,246,.55), 0 0 0 1px rgba(255,255,255,.1);
  transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.sb-brand-link:hover .sb-logo-icon {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 4px 18px rgba(91,92,246,.65), 0 0 0 1px rgba(255,255,255,.15);
}
.sb-logo-img {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(99,102,241,.4);
}
.sb-logo-text {
  font-size: 17px; font-weight: 400; color: #fff; letter-spacing: -.4px;
  font-family: 'Outfit', sans-serif;
}
.sb-logo-text strong { font-weight: 800; color: #fff; }
.sb-link-text { flex: 1; }

/* Sidebar footer / user area */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-footer-user { display: flex; align-items: center; gap: 9px; flex: 1; overflow: hidden; }

.sb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0;
}

.sb-footer-info { flex: 1; overflow: hidden; }
.sb-footer-name {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-footer-plan { font-size: 12px; color: rgba(255,255,255,.4); margin-top: 2px; }

.sb-logout {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.3); font-size: 15px; padding: 4px;
  border-radius: 6px; transition: background .15s, color .15s; flex-shrink: 0;
}
.sb-logout:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }

/* Compat: old sidebar-avatar / sidebar-footer-text */
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-footer-text { flex: 1; overflow: hidden; }
.sidebar-footer-text span { display: block; font-size: 10px; color: rgba(255,255,255,.28); letter-spacing: .3px; }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 299;
  animation: fadeIn .2s ease;
}

.sidebar-overlay.open { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.main,
.main-content {
  margin-left: var(--sb-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .2s ease;
}

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.topbar {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(224,228,239,.7);
  padding: 0 28px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Logo en topbar — solo visible en móvil (en desktop ya está en el sidebar) */
.tb-brand {
  display: none; align-items: center; gap: 8px;
  text-decoration: none; margin-right: 12px; flex-shrink: 0;
}
.tb-brand img { border-radius: 7px; display: block; }
.tb-brand span { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.tb-brand strong { font-weight: 900; }
@media (max-width: 900px) { .tb-brand { display: flex; } }

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text);
  margin-right: 8px;
  flex-shrink: 0;
  transition: background .15s;
}
.menu-toggle:hover { background: var(--bg); }
.menu-toggle svg { width: 20px; height: 20px; display: block; }

/* ── CONTENT ─────────────────────────────────────────────────────────────── */
.content {
  padding: 18px 24px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px 16px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease-spring), box-shadow .2s, border-color .2s;
  animation: cardReveal .4s var(--ease-out) both;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--stat-color, var(--brand)) 30%, var(--border));
}

/* Stagger cards */
.stat-card:nth-child(1) { animation-delay: .04s; }
.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .16s; }
.stat-card:nth-child(5) { animation-delay: .20s; }
.stat-card:nth-child(6) { animation-delay: .24s; }
.stat-card:nth-child(7) { animation-delay: .28s; }
.stat-card:nth-child(8) { animation-delay: .32s; }

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

/* Colored accent bar on top */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--brand));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* Color variants for stat cards */
.stat-card:nth-child(1) { --stat-color: var(--brand); }
.stat-card:nth-child(2) { --stat-color: var(--success); }
.stat-card:nth-child(3) { --stat-color: var(--info); }
.stat-card:nth-child(4) { --stat-color: var(--purple); }
.stat-card:nth-child(5) { --stat-color: var(--orange); }
.stat-card:nth-child(6) { --stat-color: var(--success); }
.stat-card:nth-child(7) { --stat-color: var(--warning); }
.stat-card:nth-child(8) { --stat-color: #0ea5e9; }

.stat-card .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -1.5px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-card .sub {
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 500;
}

/* Stat icon (decorative) */
.stat-card .stat-icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: color-mix(in srgb, var(--stat-color, var(--brand)) 12%, transparent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: box-shadow .22s var(--ease-out), transform .22s var(--ease-out), border-color .22s;
  animation: cardReveal .4s var(--ease-out) both;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--border-2);
}

.card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -.25px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'DM Sans', inherit;
  transition: background .18s var(--ease-out), color .18s var(--ease-out), transform .18s var(--ease-out), box-shadow .18s var(--ease-out), opacity .18s var(--ease-out);
  text-decoration: none;
  letter-spacing: -.1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:active { transform: scale(.96) !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(91,92,246,.38);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-deeper) 100%);
  box-shadow: 0 4px 16px rgba(91,92,246,.48);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.btn-success:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { filter: brightness(1.08); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--border-2);
  color: var(--text);
}

.btn-subtle {
  background: var(--bg);
  color: var(--text-muted);
  border: none;
}
.btn-subtle:hover { background: var(--bg-2); color: var(--text); }

.btn-brand-ghost {
  background: var(--brand-light);
  color: var(--brand-dark);
  border: none;
}
.btn-brand-ghost:hover { background: #dde4fd; }

.btn-sm { padding: 7px 12px; font-size: 12px; min-height: 32px; border-radius: var(--r-sm); gap: 4px; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-icon { padding: 7px; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: #f8f9ff; }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1px;
}

.badge-blue   { background: var(--info-bg);    color: var(--info-text); }
.badge-green  { background: var(--success-bg); color: var(--success-text); }
.badge-yellow { background: var(--warning-bg); color: var(--warning-text); }
.badge-red    { background: var(--danger-bg);  color: var(--danger-text); }
.badge-gray   { background: #f1f5f9;           color: #475569; }
.badge-purple { background: var(--purple-bg);  color: #5b21b6; }
.badge-orange { background: var(--orange-bg);  color: #9a3412; }
.badge-brand  { background: var(--brand-light); color: var(--brand-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,14,31,.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn .18s ease;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.04);
  animation: slideUp .28s var(--ease-spring);
  border: 1px solid rgba(255,255,255,.6);
}
.modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -.4px;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
}
.modal-wide  { max-width: 760px; }
.modal-full  { max-width: 96vw; max-height: 96vh; }

/* Close button (X) for modals */
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 30px; height: 30px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transition: background .15s;
}
.modal-close:hover { background: var(--bg-2); color: var(--text); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: .1px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.form-group input::placeholder { color: var(--text-faint); }
.form-group textarea { resize: vertical; min-height: 82px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── FILTER BAR ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.filter-bar input,
.filter-bar select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: var(--bg);
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, background .15s;
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCORE BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.score-bar { display: flex; align-items: center; gap: 8px; }
.score-bar .bar {
  flex: 1; height: 6px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.score-bar .bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--warning), var(--success));
  transition: width .4s ease;
}
.score-bar .num { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 32px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════════════════ */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-weekdays span {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }

.cal-day {
  min-height: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px;
  font-size: 12px;
  transition: border-color .15s;
}
.cal-day:hover { border-color: var(--brand); }
.cal-day.today {
  border-color: var(--brand);
  background: var(--brand-light);
}
.cal-day.other-month { opacity: .38; }
.cal-day-num { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--text); }
.cal-day.today .cal-day-num {
  background: var(--brand);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  margin-bottom: 4px;
}

.cal-event {
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-weight: 600;
  background: var(--brand);
}
.cal-event.Entrevista { background: var(--success); }
.cal-event.Llamada    { background: var(--info); }
.cal-event.Seguimiento { background: var(--warning); color: var(--warning-text); }
.cal-event.LinkedIn   { background: var(--purple); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 9px 16px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, background .15s, border-color .15s;
  font-family: inherit;
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-light);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  font-weight: 500;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: #a7f3d0; }
.alert-error   { background: var(--danger-bg);  color: var(--danger-text);  border-color: #fca5a5; }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-color: #93c5fd; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: #fcd34d; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING / EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.loading {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

.empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}
.empty .icon { font-size: 44px; margin-bottom: 14px; display: block; }
.empty h4 { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty p { font-size: 13.5px; }

/* ═══════════════════════════════════════════════════════════════════════════
   OFERTA CARD / CV CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.oferta-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: box-shadow .2s var(--ease-out), border-color .2s, transform .2s var(--ease-out);
  animation: cardReveal .35s var(--ease-out) both;
}
.oferta-card:hover {
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 25%, var(--border));
  transform: translateY(-2px);
}
.oferta-card h4 {
  font-size: 14.5px; font-weight: 700; margin-bottom: 5px;
  font-family: 'Outfit', sans-serif; letter-spacing: -.2px;
}
.oferta-card .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.oferta-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cv-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: box-shadow .15s;
}
.cv-card:hover { box-shadow: var(--shadow-md); }
.cv-card-info h4 { font-size: 14px; font-weight: 700; }
.cv-card-info p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.cv-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHART
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-wrap { position: relative; height: 220px; }

/* ═══════════════════════════════════════════════════════════════════════════
   GRID LAYOUTS
   ═══════════════════════════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ═══════════════════════════════════════════════════════════════════════════
   EVENT / ACTION ITEMS (dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }

.event-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--brand-light);
  flex-shrink: 0;
}

.event-item .info { flex: 1; }
.event-item .info strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.event-item .info span  { font-size: 12px; color: var(--text-muted); }

/* ── View more link ── */
.view-more {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  padding: 6px;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.view-more:hover { background: var(--brand-light); }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(15,23,42,.97);
  height: calc(64px + var(--safe-b));
  padding-bottom: var(--safe-b);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,.06);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,.42);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 12px;
  transition: color .15s;
  min-width: 52px;
  text-align: center;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.bottom-nav a.active { color: var(--brand); }
.bottom-nav a .icon { width: 22px; height: 22px; line-height: 1; display: block; }
.bottom-nav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Active dot indicator */
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 28px; height: 3px;
  background: var(--brand);
  border-radius: 0 0 3px 3px;
}
.bottom-nav a { position: relative; }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── ANIMATION UTILITIES ──────────────────────────────────────────────────── */

/* Stagger helpers for JS: add .stagger-1..8 to elements */
.stagger-1 { animation-delay: .05s !important; }
.stagger-2 { animation-delay: .10s !important; }
.stagger-3 { animation-delay: .15s !important; }
.stagger-4 { animation-delay: .20s !important; }
.stagger-5 { animation-delay: .25s !important; }
.stagger-6 { animation-delay: .30s !important; }
.stagger-7 { animation-delay: .35s !important; }
.stagger-8 { animation-delay: .40s !important; }

/* Generic reveal class (add from JS after render) */
.reveal {
  animation: cardReveal .38s var(--ease-out) both;
}

/* Slide-in from left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide-in from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Bounce in */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(.7); }
  70%  { opacity: 1; transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Toast slide-up */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(100%) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(20px) scale(.95); }
}

/* Number count shimmer pulse on stat cards */
@keyframes valuePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); color: var(--brand); }
  100% { transform: scale(1); }
}
.stat-card .value.pop { animation: valuePop .3s var(--ease-spring); }

/* Glow pulse for badges and alerts */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91,92,246,0); }
  50%       { box-shadow: 0 0 0 6px rgba(91,92,246,.18); }
}

/* Rotate slow (loading states) */
@keyframes rotateSlow {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sb-w: 220px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .content { padding: 20px 22px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar hidden by default, slides in */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.35);
  }

  /* Hamburger visible */
  .menu-toggle { display: flex; }

  /* Main full width */
  .main,
  .main-content { margin-left: 0; padding-bottom: calc(64px + var(--safe-b)); }
  .content { padding: 14px 14px; }
  .topbar { padding: 0 14px; height: 54px; }
  .topbar h1 { font-size: 16px; }

  /* Grids collapse */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }

  /* Modals full-height on mobile */
  .modal {
    padding: 20px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 95vh;
    margin-top: auto;
    margin-bottom: 0;
  }
  .modal-overlay { align-items: flex-end; padding: 0; }

  /* Smaller cards */
  .card { padding: 16px; }
  .stat-card { padding: 14px 14px 12px; }
  .stat-card .value { font-size: 26px; }

  /* Bottom nav visible */
  .bottom-nav { display: flex; }

  /* Calendar */
  .cal-day { min-height: 52px; padding: 4px; }
  .cal-day-num { font-size: 11px; }
  .cal-event { font-size: 9px; padding: 1px 3px; }

  /* Table */
  table { font-size: 12px; }
  thead th, tbody td { padding: 9px 10px; }

  /* Filter bar */
  .filter-bar { padding: 10px 12px; }
  .filter-bar input, .filter-bar select { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤480px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .cv-card { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .btn-sm { padding: 5px 9px; font-size: 11.5px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
  /* ── Ocultar toda la UI de la app ── */
  .sidebar,
  .topbar,
  .bottom-nav,
  .main-header,
  .page-controls,
  .tab-bar,
  .card-actions,
  .action-bar,
  .filters-bar,
  .search-bar,
  .fab,
  .sidebar-overlay,
  button,
  .btn,
  [class*="btn-"],
  nav,
  .perfil-nav,
  .guides-search,
  .guides-cats,
  #toast,
  .guide-modal-overlay { display: none !important; }

  /* ── Reset layout para que ocupe toda la hoja ── */
  html, body { background: #fff !important; margin: 0; padding: 0; }
  .main, .main-content, .content {
    margin: 0 !important; padding: 0 !important;
    width: 100% !important; max-width: 100% !important;
  }

  /* ── CV / Carta: sin bordes ni sombras, a sangre ── */
  .cv-doc,
  .carta-doc,
  .cv-wrap,
  .document-area {
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── Saltos de página ── */
  .cv-section { page-break-inside: avoid; }
  h2, h3 { page-break-after: avoid; }

  /* ── Colores: forzar negro sobre blanco para impresoras ── */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR v2 — COLLAPSIBLE, DROPDOWN, MOBILE OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar base overrides ───────────────────────────────── */
.sidebar {
  overflow: visible;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sb-w);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar nav flex layout ──────────────────────────────── */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sb-nav-spacer {
  flex: 1;
  min-height: 12px;
}

/* ── Group labels ─────────────────────────────────────────── */
.sb-group-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  padding: 16px 13px 5px;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s, padding 0.15s;
}

/* ── Nav links ────────────────────────────────────────────── */
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  margin-bottom: 1px;
  transition: background .16s, color .16s, padding .22s var(--ease-in-out);
  letter-spacing: -.1px;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.sidebar-nav a:hover {
  color: rgba(255,255,255,.9);
  background: var(--sb-hover);
}

/* Active state: pill indicator + strong background */
.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(91,92,246,.32) 0%, rgba(91,92,246,.12) 100%);
  font-weight: 600;
  border-left: 2.5px solid var(--brand-mid);
  padding-left: 9.5px;
  box-shadow: inset 0 0 12px rgba(91,92,246,.08);
}
.sidebar-nav a.active:hover {
  background: linear-gradient(90deg, rgba(91,92,246,.36) 0%, rgba(91,92,246,.15) 100%);
}
.sidebar-nav a.active .sb-icon { opacity: 1; }

/* ── Collapse toggle button ───────────────────────────────── */
.sb-collapse-btn {
  position: absolute;
  top: 20px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: #1e293b;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 310;
  color: rgba(255,255,255,0.5);
  transition: background 0.15s, transform 0.22s;
  padding: 0;
}
.sb-collapse-btn svg { width: 13px; height: 13px; display: block; }
.sb-collapse-btn:hover { background: #334155; color: #fff; }

/* When collapsed, rotate arrow to point right */
.sidebar--collapsed .sb-collapse-btn {
  transform: rotate(180deg);
}

/* ── Collapsed state ──────────────────────────────────────── */
.sidebar--collapsed {
  width: 64px !important;
  overflow: visible;
}

.sidebar--collapsed .sb-link-text,
.sidebar--collapsed .sb-group-label,
.sidebar--collapsed .sb-logo-text,
.sidebar--collapsed .sb-footer-info,
.sidebar--collapsed .sb-footer-chevron {
  opacity: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar--collapsed .sb-group-label {
  padding: 14px 0 5px;
}

.sidebar--collapsed .sb-icon {
  margin: 0 auto;
}

.sidebar--collapsed .sidebar-nav a {
  justify-content: center;
  padding: 10px 0;
  border-left: none;
  overflow: visible;
}
.sidebar--collapsed .sidebar-nav a.active {
  border-left: none;
  padding-left: 0;
}

.sidebar--collapsed .sidebar-logo {
  padding: 20px 0;
  display: flex;
  justify-content: center;
}

.sidebar--collapsed .sb-footer-user {
  justify-content: center;
}

/* ── Collapsed tooltips (via CSS + title attribute) ───────── */
.sidebar--collapsed .sidebar-nav a {
  position: relative;
}
.sidebar--collapsed .sidebar-nav a::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 400;
  box-shadow: 0 4px 12px rgba(8,14,31,0.28);
}
.sidebar--collapsed .sidebar-nav a:hover::after {
  opacity: 1;
}

/* ── Main layout adjustment when sidebar is collapsed ─────── */
.main--sidebar-collapsed,
.main-content.main--sidebar-collapsed {
  margin-left: 64px !important;
}

/* ── Profile dropdown ─────────────────────────────────────── */
.sb-dropdown {
  position: absolute;
  bottom: 72px;
  left: 10px;
  right: 10px;
  background: #1a2540;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 6px;
  z-index: 320;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(8,14,31,0.38);
}
.sb-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.sb-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 12px;
}

.sb-dropdown-avatar {
  width: 34px !important;
  height: 34px !important;
  font-size: 12px !important;
  flex-shrink: 0;
}

.sb-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.sb-dropdown-plan {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.sb-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.sb-dropdown-item .sb-icon {
  width: 16px; height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}
.sb-dropdown-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sb-dropdown-item.danger { color: #f87171; }
.sb-dropdown-item.danger:hover { background: rgba(248,113,113,0.1); color: #fca5a5; }
.sb-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 6px;
}

/* ── Footer user area ─────────────────────────────────────── */
.sidebar-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
  position: relative;
}

.sb-footer-user {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border-radius: 10px;
  padding: 7px 8px;
  transition: background 0.12s;
  overflow: hidden;
}
.sb-footer-user:hover { background: rgba(255,255,255,0.07); }

.sb-footer-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: rgba(255,255,255,0.3);
  transition: transform 0.18s;
}

.sidebar-footer:has(.sb-dropdown.open) .sb-footer-chevron {
  transform: rotate(180deg);
}

/* ── Mobile sidebar close button ─────────────────────────── */
.sb-close-mobile {
  display: none;
}

/* ── Mobile overlay ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 299;
}
.sidebar-overlay.active { display: block; animation: fadeIn 0.2s ease; }

/* ── Topbar notification bell ─────────────────────────────── */
.tb-bell {
  color: var(--text-muted);
  display: none;
}
.tb-bell svg { width: 18px; height: 18px; display: block; }

/* ── RESPONSIVE — MOBILE (≤900px) ───────────────────────────── */
@media (max-width: 900px) {
  /* Hide desktop collapse button on mobile */
  .sb-collapse-btn { display: none; }

  /* Sidebar slides in from left */
  .sidebar {
    width: var(--sb-w) !important;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }

  /* Undo desktop collapse classes on mobile */
  .sidebar--collapsed {
    width: var(--sb-w) !important;
  }
  .sidebar--collapsed .sb-link-text,
  .sidebar--collapsed .sb-group-label,
  .sidebar--collapsed .sb-logo-text,
  .sidebar--collapsed .sb-footer-info,
  .sidebar--collapsed .sb-footer-chevron {
    opacity: 1;
    width: auto;
    max-width: none;
    overflow: visible;
    pointer-events: auto;
  }
  .sidebar--collapsed .sb-group-label { padding: 14px 12px 5px; }
  .sidebar--collapsed .sb-icon { margin: 0; }
  .sidebar--collapsed .sidebar-nav a {
    justify-content: flex-start;
    padding: 9px 12px;
    overflow: hidden;
  }
  .sidebar--collapsed .sidebar-nav a.active {
    border-left: 3px solid #818cf8;
    padding-left: 9px;
  }
  .sidebar--collapsed .sidebar-logo {
    padding: 22px 20px 18px;
    display: block;
    justify-content: flex-start;
  }
  .sidebar--collapsed .sb-footer-user { justify-content: flex-start; }
  /* No tooltips on mobile */
  .sidebar--collapsed .sidebar-nav a::after { display: none; }

  /* Main has no margin on mobile */
  .main,
  .main-content { margin-left: 0 !important; }
  .main--sidebar-collapsed,
  .main-content.main--sidebar-collapsed { margin-left: 0 !important; }

  /* Show close button */
  .sb-close-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    border: none;
    font-family: inherit;
    z-index: 320;
    transition: background 0.15s;
  }
  .sb-close-mobile:hover { background: rgba(255,255,255,0.15); color: #fff; }

  /* Show bell in topbar on mobile */
  .tb-bell { display: flex; }

  /* Hamburger visible */
  .menu-toggle { display: flex; }

  /* Safe area bottom padding */
  .sidebar { padding-bottom: var(--safe-b); }
}

/* ── Dropdown position adjustment when sidebar is collapsed ─ */
@media (min-width: 901px) {
  .sidebar--collapsed .sb-dropdown {
    left: 4px;
    right: 4px;
    bottom: 64px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST GLOBAL — animated, premium
   ═══════════════════════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--sb);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  z-index: 9999;
  opacity: 0;
  transform: translateY(16px) scale(.95);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-spring);
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 8px 32px rgba(8,14,31,.32);
  max-width: 340px;
}
#toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADING — Outfit font globally
   ═══════════════════════════════════════════════════════════════════════════ */
h1, h2 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -.4px;
  text-wrap: balance;
}

/* Topbar h1 override */
.topbar h1 {
  font-family: 'Outfit', sans-serif;
}

/* ── Score / ATS number display ── */
.score-big, .ats-score-num, .dash-dias-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

/* ── Pill badges upgrade ── */
.badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1px;
}

/* ── Form inputs upgrade ── */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(91,92,246,.14), 0 1px 3px rgba(8,14,31,.06);
  border-color: var(--brand);
}

/* ── Sidebar avatar upgrade ── */
.sb-avatar, .sidebar-avatar {
  background: linear-gradient(135deg, var(--brand) 0%, #a78bfa 100%);
  box-shadow: 0 2px 8px rgba(91,92,246,.35);
}

/* ── Tab active line transition ── */
.tab-btn {
  transition: color .18s, background .18s, border-color .18s;
  font-family: 'DM Sans', sans-serif;
}
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ── Global number typography ── */
/* All Outfit-font numeric displays get tabular nums automatically */
[class*="value"], [class*="-num"], [class*="score"], [class*="count"],
[class*="-val"], [class*="kpi-"] {
  font-variant-numeric: tabular-nums;
}

/* Better heading balance on all h3 and below */
h3, h4, h5 {
  text-wrap: balance;
}

/* Smooth focus rings globally */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── Content padding — keep original ── */
