/* ============================================================
   CONSORC-IO — Identidad Visual Corporativa
   Colores: #3434B6 (azul) · #F96A58 (coral) · #63C1B6 (teal) · #E6E6E6
   Tipografía: Kollektif (títulos) · Inter (cuerpo)
   ============================================================ */

/* ── Web Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* Kollektif – titulares */
@font-face {
  font-family: 'Kollektif';
  src: url('https://cdn.jsdelivr.net/gh/nicholasgasior/kollektif@main/Kollektif-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ── Variables de marca ─────────────────────────────────── */
:root {
  /* Paleta corporativa */
  --brand-blue:    #3434B6;
  --brand-coral:   #F96A58;
  --brand-teal:    #63C1B6;
  --brand-gray:    #E6E6E6;

  /* Variantes */
  --blue-dark:     #2626a0;
  --blue-light:    #4a4acf;
  --blue-glow:     rgba(52, 52, 182, .2);
  --coral-dark:    #e5503d;
  --coral-glow:    rgba(249, 106, 88, .2);
  --teal-dark:     #4aada2;
  --teal-glow:     rgba(99, 193, 182, .18);

  /* Gradiente de marca */
  --grad-brand:    linear-gradient(135deg, #3434B6 0%, #63C1B6 100%);
  --grad-coral:    linear-gradient(135deg, #F96A58 0%, #3434B6 100%);

  /* Superficies (modo claro con identidad) */
  --bg:          #f7f9fc;
  --surface:     #ffffff;
  --card:        #ffffff;
  --card-hover:  #f0f4ff;
  --border:      #e5e7eb;
  --border-soft: #f0f2f7;

  /* Texto */
  --text:   #111827;
  --muted:  #6b7280;
  --faint:  #9ca3af;

  /* Semánticos */
  --success:    #63C1B6;   /* teal de marca */
  --warning:    #F96A58;   /* coral de marca */
  --danger:     #e53e3e;
  --danger-dark:#c53030;
  --primary:    var(--brand-blue);
  --primary-hover: var(--blue-dark);
  --accent:     var(--brand-coral);

  /* Layout */
  --sidebar-w: 224px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 8px 32px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.35);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: .9rem; color: var(--text); }
textarea { resize: vertical; }

/* ── Utilidades ─────────────────────────────────────────── */
.hidden, [hidden] { display: none !important; }
.mt       { margin-top: 1.25rem; }
.text-right { text-align: right; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════
   BRAND / LOGO
══════════════════════════════════════════════════════════ */
.brand-orb {
  width: 48px; height: 48px;
  background: var(--grad-brand);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 24px var(--blue-glow), 0 0 48px rgba(99,193,182,.1);
}
.brand-orb.sm { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 10px; }

/* Nombre de marca en fuente corporativa */
h1, .brand-name, .sidebar-brand .brand-name {
  font-family: 'Kollektif', 'Inter', sans-serif;
}
.dot { color: var(--brand-coral); }

/* Logo real */
.login-logo {
  height: auto;
  /* sin filtro: logo en colores originales (azul corporativo sobre blanco) */
  margin-bottom: .25rem;
  display: block;
}
.login-logo-desktop { width: 260px; }
.login-logo-mobile  { width: 180px; display: none; }

.sidebar-logo {
  width: 130px;
  height: auto;
  flex-shrink: 0;
}

/* Orbe pequeño solo visible en sidebar colapsado */
.sidebar-logo-sm { display: none; }

.brand-sub-wrap { display: flex; flex-direction: column; }
.brand-sub-wrap .brand-sub { color: var(--muted); font-size: .7rem; }

/* ══════════════════════════════════════════════════════════
   PANTALLA DE LOGIN — Tarjeta centrada con fondo de marca
══════════════════════════════════════════════════════════ */
#screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #f7f9fc;
  padding: 2rem 1rem;
}

/* Formas difusas de fondo */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.bg-shape-1 {
  width: 500px; height: 500px;
  background: rgba(99,193,182,.18);
  top: -120px; left: -120px;
}
.bg-shape-2 {
  width: 400px; height: 400px;
  background: rgba(249,106,88,.12);
  bottom: -100px; right: -100px;
}
.bg-shape-3 {
  width: 300px; height: 300px;
  background: rgba(52,52,182,.08);
  top: 40%; left: 60%;
}

/* Tarjeta principal */
.auth-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 24px;
  padding: 0 2.75rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}

/* Barra de acento superior */
.accent-bar {
  height: 5px;
  background: linear-gradient(90deg, #3434B6, #63C1B6);
  border-radius: 24px 24px 0 0;
  margin: 0 -2.75rem 2rem;
}

/* Logo */
.logo-wrap {
  text-align: center;
  margin-bottom: 1.75rem;
}
.login-logo-desktop {
  width: 240px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.login-logo-mobile {
  width: 64px;
  height: auto;
  display: none;
  margin: 0 auto;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}
.auth-tab {
  flex: 1; padding: .5rem; border: none; background: transparent;
  color: #6b7280; border-radius: 8px;
  font-size: .875rem; font-weight: 500;
  transition: all .2s;
}
.auth-tab.active {
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(52,52,182,.3);
}

/* Inputs modo claro */
#screen-login input[type="email"],
#screen-login input[type="password"],
#screen-login input[type="text"] {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  color: #111827;
  border-radius: 10px;
  padding: .72rem 1rem;
}
/* Wrapper para input + ojo */
.input-eye-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-eye-wrap input {
  width: 100%;
  padding-right: 2.75rem !important;
}
.eye-btn {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  padding: 0;
  color: #9ca3af;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color .15s;
}
.eye-btn:hover { color: var(--brand-blue); }
.eye-icon, .eye-off-icon { width: 18px; height: 18px; }

#screen-login input::placeholder { color: #9ca3af; }
#screen-login input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(52,52,182,.1);
  background: #fff;
}
#screen-login .form-group label { color: #374151; }

/* Botón de autenticación */
.btn-auth {
  width: 100%;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .8rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .5rem;
  transition: background .15s, transform .1s;
}
.btn-auth:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}
.btn-auth.btn-coral {
  background: var(--brand-coral);
}
.btn-auth.btn-coral:hover {
  background: var(--coral-dark);
}

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .78rem;
  color: #9ca3af;
}

.auth-form { display: flex; flex-direction: column; gap: .875rem; }
.form-error { color: var(--brand-coral); font-size: .82rem; }

/* Mobile */
@media (max-width: 768px) {
  .auth-card { padding: 0 1.5rem 1.75rem; }
  .accent-bar { margin: 0 -1.5rem 1.75rem; }
  .login-logo-desktop { width: 160px; }
  .login-logo-desktop { width: 200px; }
}

/* ══════════════════════════════════════════════════════════
   LAYOUT APP
══════════════════════════════════════════════════════════ */
#screen-app { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(0,0,0,.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
}

/* Borde decorativo lateral izquierdo (color coral) */
.sidebar::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-brand);
}

.sidebar-top {
  flex: 1; display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.25rem; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; }
.brand-name { font-size: .95rem; font-weight: 700; letter-spacing: -.3px; }
.brand-sub  { font-size: .7rem; color: var(--muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: .2rem; }
.nav-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .6rem .875rem; border-radius: var(--radius);
  color: var(--muted); font-size: .875rem; font-weight: 500;
  transition: all .15s;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--card-hover); color: var(--brand-blue); border-color: rgba(52,52,182,.15); }
.nav-item.active {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(52,52,182,.25);
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

/* Badge de aprobaciones */
.nav-badge {
  background: var(--brand-coral);
  color: #fff; font-size: .65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; margin-left: auto;
  box-shadow: 0 0 8px var(--coral-glow);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: .5rem;
}
.user-pill  { display: flex; align-items: center; gap: .625rem; flex: 1; overflow: hidden; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 0 10px var(--blue-glow);
}
.user-meta { overflow: hidden; }
.user-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role {
  font-size: .7rem; color: var(--brand-teal);
  text-transform: capitalize; font-weight: 500;
}

.btn-logout {
  background: none; border: none; color: var(--muted); font-size: 1.1rem;
  padding: .25rem; border-radius: 6px;
  transition: color .15s, background .15s;
}
.btn-logout:hover { color: var(--brand-coral); background: var(--coral-glow); }

/* Logout en bottom nav: oculto en desktop */
.nav-logout-mobile { display: none; }

/* ── Main ───────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; padding: 2rem 2.25rem;
  min-height: 100vh; overflow-x: hidden;
}

/* ── Cabecera de vista ──────────────────────────────────── */
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem;
}
.view-header h2 {
  font-size: 1.5rem; font-weight: 700;
  font-family: 'Kollektif', 'Inter', sans-serif;
}
.view-sub { color: var(--muted); font-size: .875rem; margin-top: .2rem; }

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
  font-family: 'Kollektif', 'Inter', sans-serif;
}
.card-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-row .card-title { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════
   FORMULARIOS
══════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.form-group label {
  font-size: .75rem; font-weight: 600; color: var(--muted);
  letter-spacing: .4px; text-transform: uppercase;
}
.req { color: var(--brand-coral); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .875rem;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
select:disabled {
  opacity: .45;
  cursor: not-allowed;
  background-color: var(--border-soft);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .875rem center;
  padding-right: 2.25rem;
}

.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .5rem; }
.filter-btns  { display: flex; align-items: flex-end; gap: .5rem; }

/* ══════════════════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .575rem 1.125rem; border: none; border-radius: 8px;
  font-size: .875rem; font-weight: 600; transition: all .15s;
  white-space: nowrap; letter-spacing: .1px;
}
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-full { width: 100%; }
.btn-sm   { padding: .35rem .75rem; font-size: .8rem; }

/* Primario: Azul corporativo */
.btn-primary { background: var(--brand-blue); color: #fff; box-shadow: 0 2px 8px var(--blue-glow); }
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 4px 16px var(--blue-glow); }

/* Secundario */
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }

/* Ghost */
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--border-soft); }

/* Success: Teal corporativo */
.btn-success { background: var(--brand-teal); color: #0d1228; font-weight: 700; }
.btn-success:hover { background: var(--teal-dark); }

/* Warning: Coral corporativo */
.btn-warning { background: var(--brand-coral); color: #fff; }
.btn-warning:hover { background: var(--coral-dark); }

/* Danger */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }

/* ══════════════════════════════════════════════════════════
   CRONÓMETRO
══════════════════════════════════════════════════════════ */
/* Layout de 2 columnas en desktop: form | recientes */
.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.5rem;
  align-items: start;
}
.entry-form-col,
.entry-recent-col { min-width: 0; }

/* Recientes: scroll interno si hay muchas entradas */
.entry-recent-col .card { max-height: calc(100vh - 160px); overflow-y: auto; }

/* En tablet/móvil: una sola columna */
@media (max-width: 900px) {
  .entry-layout {
    grid-template-columns: 1fr;
  }
  .entry-recent-col .card { max-height: none; overflow-y: visible; }
}

/* ══════════════════════════════════════════════════════════
   TABLAS
══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.table-card { padding: 0; }
.table-card .table-wrap { border-radius: var(--radius-lg); }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  padding: .75rem 1rem;
  text-align: left; font-size: .72rem; font-weight: 700;
  color: var(--brand-blue); text-transform: uppercase; letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fc;
  white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }
tbody tr { border-bottom: 1px solid var(--border-soft); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(52,52,182,.07); }
tbody td { padding: .75rem 1rem; vertical-align: middle; }
.loading-msg { text-align: center; color: var(--faint); padding: 2rem; }

/* ══════════════════════════════════════════════════════════
   HISTORIAL — FILTROS & RESUMEN
══════════════════════════════════════════════════════════ */
.filters-card { padding: 1.25rem 1.5rem; }
.filters-grid { display: flex; flex-wrap: wrap; gap: .875rem; align-items: flex-end; }
.filters-grid .form-group { min-width: 140px; }

.summary-bar { display: flex; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.summary-chip {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1.25rem;
  display: flex; flex-direction: column; gap: .2rem; min-width: 120px;
  position: relative; overflow: hidden;
}
.summary-chip::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-brand);
}
.sc-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.sc-value {
  font-size: 1.5rem; font-weight: 700; color: var(--brand-blue);
  font-family: 'JetBrains Mono', monospace;
}

/* ══════════════════════════════════════════════════════════
   RESUMEN / KPIs
══════════════════════════════════════════════════════════ */
.report-controls { display: flex; flex-wrap: wrap; gap: .875rem; align-items: flex-end; }
.report-controls .form-group { min-width: 140px; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem;
}
.kpi-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; text-align: center;
  position: relative; overflow: hidden;
}
.kpi-card:nth-child(1)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(52,52,182,.06) 0%, transparent 60%); pointer-events: none; }
.kpi-card:nth-child(2)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(249,106,88,.06) 0%, transparent 60%); pointer-events: none; }
.kpi-card:nth-child(3)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(99,193,182,.06) 0%, transparent 60%); pointer-events: none; }
.kpi-card:nth-child(4)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(52,52,182,.04) 0%, transparent 60%); pointer-events: none; }

.kpi-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .5rem; font-weight: 600; }
.kpi-val   { font-size: 2rem; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; }

.chart-wrap { position: relative; height: 320px; margin-top: .5rem; }

/* ══════════════════════════════════════════════════════════
   ADMIN
══════════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex; gap: .5rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border); padding-bottom: .75rem;
}
.admin-tab {
  background: none; border: none; color: var(--muted);
  font-size: .875rem; font-weight: 600; padding: .4rem .875rem;
  border-radius: 7px; transition: all .15s;
}
.admin-tab.active { background: rgba(52,52,182,.08); color: var(--brand-blue); border-bottom: 2px solid var(--brand-blue); }
.admin-tab:hover:not(.active) { background: var(--card-hover); color: var(--text); }
.admin-panel + .admin-panel { margin-top: 1.25rem; }

/* Rol badge */
.role-badge {
  display: inline-block; padding: .15rem .65rem; border-radius: 4px;
  font-size: .73rem; font-weight: 700; text-transform: capitalize; letter-spacing: .3px;
}
.role-admin     { background: rgba(52,52,182,.1); color: var(--brand-blue); border: 1px solid rgba(52,52,182,.25); }
.role-gerente   { background: rgba(99,193,182,.12); color: #2d9e94; border: 1px solid rgba(99,193,182,.3); }
.role-consultor { background: #f3f4f6; color: var(--muted); border: 1px solid var(--border); }

/* Status dot */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.dot-green { background: var(--brand-teal); box-shadow: 0 0 6px rgba(99,193,182,.5); }
.dot-red   { background: var(--brand-coral); box-shadow: 0 0 6px rgba(249,106,88,.4); }

/* ══════════════════════════════════════════════════════════
   APROBACIONES — chips de estado
══════════════════════════════════════════════════════════ */
.status-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .65rem; border-radius: 20px;
  font-size: .73rem; font-weight: 700; white-space: nowrap;
}
.status-pendiente { background: rgba(249,106,88,.12); color: var(--brand-coral); border: 1px solid rgba(249,106,88,.2); }
.status-aprobado  { background: rgba(99,193,182,.12);  color: var(--brand-teal);  border: 1px solid rgba(99,193,182,.2); }
.status-rechazado { background: rgba(229,62,62,.12);   color: #fc8181;            border: 1px solid rgba(229,62,62,.2); }

.approval-actions { display: flex; gap: .4rem; }

/* ══════════════════════════════════════════════════════════
   ONBOARDING
══════════════════════════════════════════════════════════ */
.ob-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 20, 50, .65); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
  animation: obFadeIn .25s ease;
}
@keyframes obFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ob-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 520px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: obSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes obSlideUp { from { transform: translateY(32px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Barra de progreso */
.ob-progress-bar {
  height: 4px; background: var(--border); width: 100%;
}
.ob-progress-fill {
  height: 100%; background: var(--grad-brand);
  transition: width .4s cubic-bezier(.4,0,.2,1);
  border-radius: 0 4px 4px 0;
}

/* Cuerpo */
.ob-body {
  padding: 2.25rem 2.25rem 1.25rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .6rem;
}
.ob-step-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin-bottom: .5rem;
  background: var(--blue-glow, #e8f0ff);
  transition: background .3s;
}
.ob-step-num {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--brand-blue); opacity: .7;
  margin: 0;
}
.ob-title {
  font-size: 1.45rem; font-weight: 800;
  color: var(--text); margin: 0; line-height: 1.25;
  font-family: 'Inter', sans-serif;
}
.ob-desc {
  font-size: .925rem; color: var(--muted); margin: 0;
  line-height: 1.6; max-width: 400px;
}

/* Lista de items */
.ob-list {
  list-style: none; padding: 0; margin: .25rem 0 0;
  display: flex; flex-direction: column; gap: .4rem;
  text-align: left; width: 100%; max-width: 380px;
}
.ob-list li {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .875rem; color: var(--text); line-height: 1.5;
}
.ob-list li::before {
  content: ''; flex-shrink: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-blue); margin-top: .42rem;
}

/* Tip */
.ob-tip {
  background: var(--blue-glow, #e8f0ff);
  border-left: 3px solid var(--brand-blue);
  border-radius: 0 8px 8px 0;
  padding: .65rem 1rem;
  font-size: .825rem; color: var(--brand-blue);
  text-align: left; width: 100%; max-width: 380px;
  line-height: 1.5;
}

/* Puntos de navegación */
.ob-dots {
  display: flex; justify-content: center; gap: .4rem;
  padding: .25rem 0 1rem;
}
.ob-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: all .25s;
  border: none; padding: 0; cursor: pointer;
}
.ob-dot.active {
  background: var(--brand-blue); width: 20px; border-radius: 4px;
}

/* Botones */
.ob-actions {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.ob-btn-group { display: flex; gap: .5rem; }
.ob-btn-skip {
  background: none; border: none; color: var(--muted);
  font-size: .825rem; padding: .4rem .75rem; border-radius: 8px;
  cursor: pointer; transition: color .15s, background .15s;
}
.ob-btn-skip:hover { color: var(--text); background: var(--bg); }
.ob-btn-ghost {
  background: none; border: 1px solid var(--border);
  color: var(--text); font-size: .875rem; font-weight: 500;
  padding: .55rem 1.1rem; border-radius: 10px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.ob-btn-ghost:hover { background: var(--bg); }
.ob-btn-ghost:disabled { opacity: .35; cursor: default; }
.ob-btn-primary {
  background: var(--grad-brand); color: #fff;
  border: none; font-size: .875rem; font-weight: 600;
  padding: .55rem 1.4rem; border-radius: 10px;
  cursor: pointer; transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.ob-btn-primary:hover { opacity: .88; }
.ob-btn-primary:active { transform: scale(.97); }

@media (max-width: 540px) {
  .ob-card { border-radius: 16px 16px 0 0; }
  .ob-overlay { align-items: flex-end; padding: 0; }
  .ob-body { padding: 1.75rem 1.5rem 1rem; }
  .ob-title { font-size: 1.2rem; }
  .ob-actions { flex-wrap: wrap; gap: .5rem; }
  .ob-btn-skip { order: 3; width: 100%; text-align: center; }
}

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
#modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
#modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow);
  animation: popIn .15s ease;
  position: relative; overflow: hidden;
}
#modal-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-brand);
}
@keyframes popIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; font-family: 'Kollektif', 'Inter', sans-serif; }
.modal-close {
  background: none; border: none; color: var(--muted); font-size: 1.1rem;
  padding: .25rem .5rem; border-radius: 6px; transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--brand-coral); background: var(--coral-glow); }
#modal-body { display: flex; flex-direction: column; gap: 1rem; }

/* ══════════════════════════════════════════════════════════
   TOASTS
══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem; z-index: 9999;
}
.toast {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1.125rem;
  font-size: .875rem; max-width: 320px;
  display: flex; align-items: center; gap: .625rem;
  box-shadow: var(--shadow);
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { border-left: 3px solid var(--brand-teal); }
.toast-error   { border-left: 3px solid var(--brand-coral); }
.toast-info    { border-left: 3px solid var(--brand-blue); }

/* ══════════════════════════════════════════════════════════
   BADGE FACTURABLE
══════════════════════════════════════════════════════════ */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .35rem;
}
.label-row label { margin-bottom: 0; }

.facturable-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 20px;
  white-space: nowrap;
}
.fact-yes {
  background: rgba(99,193,182,.12);
  color: #2d9e94;
  border: 1px solid rgba(99,193,182,.3);
}
.fact-no {
  background: rgba(107,114,128,.08);
  color: #6b7280;
  border: 1px solid rgba(107,114,128,.2);
}

/* ══════════════════════════════════════════════════════════
   CHECKLIST DE TAREAS (modal usuario)
══════════════════════════════════════════════════════════ */
.task-checklist {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: #fafafa;
}
.task-group-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand-blue);
  padding-top: .25rem;
}
.task-check-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  padding: .2rem 0;
}
.task-check-item input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--brand-blue);
  cursor: pointer;
  flex-shrink: 0;
}
.task-group { display: flex; flex-direction: column; gap: .2rem; }

/* ══════════════════════════════════════════════════════════
   ENTRADAS RECIENTES (mini list)
══════════════════════════════════════════════════════════ */
.recent-list { display: flex; flex-direction: column; gap: .5rem; }
.recent-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: .25rem 1rem;
  padding: .75rem .875rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border-soft);
  transition: background .15s, border-color .15s;
}
.recent-item:hover { background: var(--card-hover); border-color: rgba(52,52,182,.2); }

/* fila 1: meta (fecha + horas) abarca toda la fila */
.ri-meta {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: center;
}
/* fila 2: main (tarea + proyecto) */
.ri-main  { grid-column: 1; display: flex; flex-direction: column; gap: .15rem; overflow: hidden; }
/* fila 3: footer (status + acciones) */
.ri-footer {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .15rem;
}

.ri-date  { font-size: .75rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.ri-task  { font-size: .875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-proj  { font-size: .75rem; color: var(--muted); }
.ri-client-label { font-weight: 600; color: var(--brand-blue); }
.ri-notas {
  font-size: .75rem; color: var(--muted);
  font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 400px;
}
.ri-hours { font-family: 'JetBrains Mono', monospace; font-size: .95rem; font-weight: 700; color: var(--brand-blue); white-space: nowrap; }
.ri-actions { display: flex; gap: .25rem; }

/* ── Botones icono (edit/delete) ────────────────────────── */
.icon-btn {
  background: none; border: none; color: var(--muted);
  padding: .3rem .4rem; border-radius: 5px; font-size: .85rem;
  transition: all .15s;
}
.icon-btn:hover      { background: var(--border); color: var(--text); }
.icon-btn.del:hover  { background: var(--coral-glow); color: var(--brand-coral); }
.icon-btn.edit:hover { background: var(--blue-glow); color: #7b7fff; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
/* Top bar móvil: oculto por defecto, visible solo en ≤640px */
.mobile-topbar { display: none; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 900px): sidebar colapsa a iconos
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .nav-label, .brand-name, .brand-sub, .user-meta, .brand-sub-wrap, .sidebar-logo { display: none; }
  .sidebar-logo-sm { display: flex; }
  .login-logo-desktop { display: none; }
  .login-logo-mobile  { display: block; }
  .sidebar-brand { justify-content: center; }
  .nav-item { justify-content: center; padding: .65rem; }
  .user-pill { justify-content: center; }
  .sidebar-footer { flex-direction: column; align-items: center; gap: .5rem; }
  .sidebar-top { padding: .75rem; gap: 1rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .main { padding: 1.25rem 1rem; }
  .view-header h2 { font-size: 1.25rem; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MÓVIL (≤ 640px): bottom nav, layout apilado
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* ── Sidebar → barra de navegación inferior ── */
  .sidebar {
    width: 100% !important;
    height: 60px;
    top: auto; bottom: 0; left: 0; right: 0;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    z-index: 200;
  }
  .sidebar::before {
    top: 0; bottom: auto; left: 0; right: 0;
    width: 100%; height: 3px;
  }
  .sidebar-top {
    flex-direction: row;
    flex: 1;
    padding: 0;
    gap: 0;
    overflow: hidden;
    justify-content: space-around;
    align-items: center;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav {
    flex-direction: row;
    gap: 0;
    flex: 1;
    justify-content: space-around;
  }
  .nav-item {
    flex-direction: column;
    gap: 2px;
    padding: .35rem .5rem;
    border-radius: 8px;
    font-size: .6rem;
    min-width: 52px;
    align-items: center;
    border: none !important;
  }
  .nav-label { display: block !important; font-size: .6rem; line-height: 1; }
  .nav-icon { width: auto; font-size: 1.2rem; }
  .nav-badge { position: absolute; top: 4px; right: 4px; }
  .nav-item { position: relative; }
  .sidebar-footer { display: none; }
  .nav-logout-mobile {
    display: flex !important;
    color: var(--brand-coral) !important;
  }
  .nav-logout-mobile:hover { background: var(--coral-glow) !important; }

  /* ── Top bar con logo ── */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    z-index: 190;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
  }
  .mobile-topbar-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
  }
  .mobile-topbar-avatar {
    width: 34px; height: 34px;
    font-size: .9rem;
    flex-shrink: 0;
  }

  /* ── Main: margen arriba (topbar) y abajo (bottom nav) ── */
  .main {
    margin-left: 0 !important;
    margin-top: 52px;
    margin-bottom: 60px;
    padding: 1rem .875rem;
    min-height: calc(100vh - 112px);
  }

  /* ── Cabecera de vista ── */
  .view-header {
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
  }
  .view-header h2 { font-size: 1.15rem; }
  .view-header .btn { align-self: flex-start; }

  /* ── Cards ── */
  .card { padding: 1rem; }
  .filters-card { padding: 1rem; }

  /* ── KPIs ── */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: .625rem; }
  .kpi-val  { font-size: 1.5rem; }
  .kpi-card { padding: .875rem 1rem; }

  /* ── Formulario de registro ── */
  .form-row { grid-template-columns: 1fr; overflow: hidden; }
  .form-row > * { min-width: 0; width: 100%; }
  input[type="date"] { width: 100%; min-width: 0; appearance: none; -webkit-appearance: none; font-size: .95rem; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .entry-layout { grid-template-columns: 1fr; }

  /* ── Filtros ── */
  .filters-grid { flex-direction: column; }
  .filters-grid .form-group { min-width: 0; width: 100%; }
  .filter-btns { width: 100%; }
  .filter-btns .btn { flex: 1; justify-content: center; }
  .report-controls { flex-direction: column; }
  .report-controls .form-group { width: 100%; }

  /* ── Summary bar ── */
  .summary-bar { gap: .5rem; }
  .summary-chip { min-width: 0; flex: 1; padding: .625rem 1rem; }
  .sc-value { font-size: 1.2rem; }

  /* ── Entradas recientes ── */
  .recent-item { padding: .75rem; gap: .2rem .5rem; }
  .ri-task { font-size: .82rem; }
  .ri-hours { font-size: .88rem; }

  /* ── Tablas ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  thead th, tbody td { padding: .5rem .75rem; font-size: .8rem; }

  /* ── Admin tabs ── */
  .admin-tabs { gap: .25rem; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
  .admin-tab  { white-space: nowrap; font-size: .78rem; padding: .4rem .75rem; }

  /* ── Modal ── */
  #modal-overlay { align-items: flex-end; padding: 0; }
  #modal-box {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .2s ease;
  }
  @keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  /* ── Toasts ── */
  #toast-container { bottom: 70px; right: .75rem; left: .75rem; }
  .toast { max-width: 100%; }

  /* ── Chart ── */
  .chart-wrap { height: 220px; }

  /* ── Login ── */
  .auth-card { padding: 0 1.25rem 1.5rem; }
  .accent-bar { margin: 0 -1.25rem 1.5rem; }
  #screen-login {
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2.5rem 1.25rem 2rem;
  }
  .login-logo-mobile { width: 180px; }
}
