/*
 * SGS-Recluta — Design System Premium
 * Dark-first. Transiciones, profundidad, micro-interacciones.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ══════════════════════════════════════════════════════════════
   TOKENS — Dark
   ══════════════════════════════════════════════════════════════ */
:root, [data-theme="dark"], [data-bs-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242836;
  --bg-card: #1e2230;
  --bg-card-hover: #262b3a;
  --border-color: #2d3348;
  --border-subtle: rgba(255,255,255,.04);
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b8;
  --text-muted: #6b7394;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-muted: rgba(99,102,241,.12);
  --accent-glow: rgba(99,102,241,.25);
  --success: #22c55e; --success-muted: rgba(34,197,94,.12);
  --warning: #f59e0b; --warning-muted: rgba(245,158,11,.12);
  --danger: #ef4444;  --danger-muted: rgba(239,68,68,.12);
  --info: #3b82f6;    --info-muted: rgba(59,130,246,.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  /* Lía compat */
  --bg: var(--bg-primary); --bg2: var(--bg-secondary); --surface: var(--bg-tertiary);
  --text: var(--text-primary); --dim: var(--text-secondary); --border: var(--border-color);
  --err: var(--danger); --ok: var(--success); --warn: var(--warning);
}

/* ══════════════════════════════════════════════════════════════
   TOKENS — Light
   ══════════════════════════════════════════════════════════════ */
[data-theme="light"], [data-bs-theme="light"], body.lia-theme-light {
  --bg-primary: #f4f6f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #edf0f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fc;
  --border-color: #dfe3eb;
  --border-subtle: rgba(0,0,0,.04);
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #8492a6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-muted: rgba(79,70,229,.08);
  --accent-glow: rgba(79,70,229,.18);
  --success: #16a34a; --success-muted: rgba(22,163,74,.08);
  --warning: #d97706; --warning-muted: rgba(217,119,6,.08);
  --danger: #dc2626;  --danger-muted: rgba(220,38,38,.08);
  --info: #2563eb;    --info-muted: rgba(37,99,235,.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
}

/* ══════════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
::selection { background: var(--accent-muted); color: var(--accent); }

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

/* ── Transitions global ───────────────────────────────────── */
a, button, input, select, textarea, .card, .badge, .btn, .nav-link, .table td {
  transition: all .15s ease;
}

/* ══════════════════════════════════════════════════════════════
   CARDS — Profundidad y hover
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover {
  border-color: rgba(99,102,241,.2);
  box-shadow: var(--shadow-md);
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.card-body { padding: 1.25rem; }
.card-footer, .card-header {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
}

/* ══════════════════════════════════════════════════════════════
   TABLES — Legible, compacta, hover claro
   ══════════════════════════════════════════════════════════════ */
.table { color: var(--text-primary); --bs-table-bg: transparent; border-collapse: separate; border-spacing: 0; }
.table thead th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--border-color);
  padding: .6rem .75rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.table td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: .8rem;
  vertical-align: middle;
}
.table-hover > tbody > tr:hover > * {
  background: var(--accent-muted);
}
.table tbody tr { cursor: default; }
.table tbody tr[style*="cursor:pointer"]:hover,
.table tbody tr.clickable:hover { cursor: pointer; }

/* Row actions — show on hover */
.table .row-actions { opacity: 0; transition: opacity .15s; }
.table tr:hover .row-actions { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   FORMS — Input glow, padding cómodo
   ══════════════════════════════════════════════════════════════ */
.form-control, .form-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .85rem;
  padding: .5rem .75rem;
}
.form-control:focus, .form-select:focus {
  background: var(--bg-tertiary);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { color: var(--text-secondary); font-size: .78rem; font-weight: 600; }
.input-group-text { background: var(--bg-secondary); border-color: var(--border-color); color: var(--text-muted); }
.form-check-input { background-color: var(--bg-tertiary); border-color: var(--border-color); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-control-sm, .form-select-sm { font-size: .78rem; padding: .35rem .6rem; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS — Depth + feedback
   ══════════════════════════════════════════════════════════════ */
.btn { font-weight: 600; border-radius: var(--radius-sm); font-size: .82rem; letter-spacing: .01em; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-outline-primary { color: var(--accent); border-color: var(--accent); }
.btn-outline-primary:hover { background: var(--accent); color: #fff; }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-color); }
.btn-outline-secondary:hover { background: var(--bg-tertiary); border-color: var(--accent); color: var(--accent); }
.btn-sm { font-size: .75rem; padding: .3rem .6rem; }
.btn-ghost { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }

/* ══════════════════════════════════════════════════════════════
   BADGES — Pill style con muted backgrounds
   ══════════════════════════════════════════════════════════════ */
.badge {
  font-weight: 600; font-size: .68rem; letter-spacing: .02em;
  border-radius: 20px; padding: .25em .65em;
}
.badge-estado { font-size: .65rem; }
.bg-primary-subtle { background: var(--accent-muted) !important; color: var(--accent) !important; }
.bg-success-subtle { background: var(--success-muted) !important; color: var(--success) !important; }
.bg-danger-subtle { background: var(--danger-muted) !important; color: var(--danger) !important; }
.bg-warning-subtle { background: var(--warning-muted) !important; color: var(--warning) !important; }
.bg-info-subtle { background: var(--info-muted) !important; color: var(--info) !important; }

/* Score badges */
.badge-score {
  font-size: .7rem; font-weight: 800; min-width: 32px; text-align: center;
  border-radius: 6px; padding: .2em .5em;
}

/* ══════════════════════════════════════════════════════════════
   MODALS — Suave, con profundidad
   ══════════════════════════════════════════════════════════════ */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}
.modal-header { border-color: var(--border-subtle); padding: 1rem 1.25rem; }
.modal-header .modal-title { font-size: .95rem; font-weight: 700; }
.modal-footer { border-color: var(--border-subtle); padding: .75rem 1.25rem; }
.modal-body { padding: 1.25rem; }
.modal-backdrop { backdrop-filter: blur(4px); }

/* ══════════════════════════════════════════════════════════════
   DROPDOWNS
   ══════════════════════════════════════════════════════════════ */
.dropdown-menu {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: .4rem;
}
.dropdown-item {
  color: var(--text-primary); border-radius: var(--radius-sm);
  font-size: .82rem; padding: .4rem .75rem;
}
.dropdown-item:hover { background: var(--accent-muted); color: var(--accent); }
.dropdown-divider { border-color: var(--border-subtle); }

/* ══════════════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════════════ */
.kpi-card .card-body { padding: 1rem; }
.kpi-card .kpi-value {
  font-size: 1.8rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kpi-card .kpi-label {
  font-size: .6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.kpi-card .kpi-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

/* ══════════════════════════════════════════════════════════════
   KANBAN
   ══════════════════════════════════════════════════════════════ */
.kanban-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: .75rem;
  min-height: 300px;
}
.kanban-col-header {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding-bottom: .5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: .5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: .6rem;
  margin-bottom: .4rem;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.kanban-card .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; color: var(--accent);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════ */
.timeline-item {
  display: flex; gap: .75rem; padding-bottom: .75rem;
  position: relative;
}
.timeline-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1;
  border: 2px solid var(--border-color);
  transition: border-color .15s, background .15s;
}
.timeline-dot.active { border-color: var(--accent); background: var(--accent-muted); }
.timeline-line {
  position: absolute; left: 15px; top: 32px; bottom: 0;
  width: 2px; background: var(--border-color);
}
.timeline-content {
  flex: 1; padding-top: 4px; min-width: 0;
}
.timeline-time {
  font-size: .6rem; color: var(--text-muted); white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   CALENDAR
   ══════════════════════════════════════════════════════════════ */
.cal-event {
  padding: 3px 6px; border-radius: 4px; margin-bottom: 2px;
  font-size: .6rem; font-weight: 600; cursor: pointer;
  border-left: 3px solid;
  transition: transform .1s;
}
.cal-event:hover { transform: scale(1.02); }

/* ══════════════════════════════════════════════════════════════
   AVATAR / INITIALS
   ══════════════════════════════════════════════════════════════ */
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 800; flex-shrink: 0;
}
.avatar-md {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; flex-shrink: 0;
}
.avatar-lg {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem; margin-bottom: .75rem; display: block;
  opacity: .3;
}
.empty-state h6 { color: var(--text-secondary); font-weight: 700; }
.empty-state p { font-size: .82rem; max-width: 320px; margin: .5rem auto 0; }

/* ══════════════════════════════════════════════════════════════
   LOADING SKELETON
   ══════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══════════════════════════════════════════════════════════════
   TOAST (override Bootstrap)
   ══════════════════════════════════════════════════════════════ */
.toast { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); border: none; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination .page-link {
  background: var(--bg-tertiary); border-color: var(--border-color);
  color: var(--text-secondary); font-size: .75rem; font-weight: 600;
  border-radius: var(--radius-sm); margin: 0 2px;
}
.pagination .page-link:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-item.disabled .page-link { background: var(--bg-secondary); color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   LIST GROUP, ALERTS, PROGRESS, NAV
   ══════════════════════════════════════════════════════════════ */
.list-group-item { background: var(--bg-card); border-color: var(--border-subtle); color: var(--text-primary); }
.alert { border-radius: var(--radius-md); }
.progress { background: var(--bg-tertiary); border-radius: 20px; height: 8px; }
.progress-bar { border-radius: 20px; }
.nav-link { color: var(--text-secondary); }
.nav-link:hover { color: var(--accent); }
.border-bottom, .border-top, .border { border-color: var(--border-color) !important; }
.text-body-secondary { color: var(--text-secondary) !important; }
code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: .78rem; color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════════ */
#view-login {
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.04) 0%, transparent 50%);
}
#view-login .card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color);
  backdrop-filter: blur(10px);
}

/* ══════════════════════════════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════════════════════════════ */
.content { padding: 1rem 1.5rem; }
@media (max-width: 768px) { .content { padding: .75rem; } }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .25s ease forwards; }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
.pulse { animation: pulse-dot 2s ease-in-out infinite; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .kpi-card .kpi-value { font-size: 1.3rem; }
  .kanban-col { min-width: 200px; }
}
