/* ── VISEVER · Control de Transferencias ── */

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

:root {
  --c-primary:   #1C1C1E;
  --c-accent:    #E8B800;
  --c-accent-d:  #B88F00;
  --c-accent-l:  #FFFBEB;
  --c-bg:        #F5F5F7;
  --c-card:      #FFFFFF;
  --c-border:    #E5E7EB;
  --c-text:      #1C1C1E;
  --c-muted:     #6B7280;
  --c-success:   #059669;
  --c-danger:    #DC2626;
  --c-info:      #2563EB;
  --c-day10:     #7C3AED;
  --c-day25:     #0891B2;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --radius:      14px;
  --radius-sm:   8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 99px; }

/* ══════════════════ NAVBAR ══════════════════ */
.app-navbar {
  background: var(--c-primary);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.navbar-brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.navbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.15);
}

.navbar-title {
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.navbar-spacer { flex: 1; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
}

.navbar-avatar {
  width: 32px;
  height: 32px;
  background: var(--c-accent);
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--c-primary);
  flex-shrink: 0;
}

.btn-logout {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-logout:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

/* ══════════════════ LOGIN ══════════════════ */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1C1C1E 0%, #2D2D30 60%, #3A3A3D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--c-card);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}

.login-logo {
  height: 60px;
  width: auto;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
}

.login-subtitle {
  font-size: 13px;
  color: var(--c-muted);
  margin: 4px 0 0;
}

/* ══════════════════ FORMS ══════════════════ */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 7px;
}

.form-control, .form-select {
  display: block;
  width: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: inherit;   /* que el textarea (motivo) use la misma fuente que los inputs */
  font-size: 13.5px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  background: var(--c-card);
  color: var(--c-text);
}
.form-control::placeholder { font-family: inherit; }

.form-control:focus, .form-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(232,184,0,.15);
  outline: none;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  font-size: 15px;
  pointer-events: none;
}

.input-icon-wrap .form-control { padding-left: 38px; }

/* ══════════════════ BUTTONS ══════════════════ */
.btn-accent {
  background: var(--c-accent);
  color: var(--c-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-accent:hover {
  background: var(--c-accent-d);
  color: var(--c-primary);
  transform: translateY(-1px);
}

.btn-accent:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-ghost:hover {
  background: var(--c-bg);
  color: var(--c-text);
  border-color: #D1D5DB;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--c-danger);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-danger-ghost:hover {
  background: #FEF2F2;
  border-color: #FECACA;
}

/* ══════════════════ CONTENT AREA ══════════════════ */
.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ── Selector de empresa (entorno) ── */
.env-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 6px 10px; margin-bottom: 16px;
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.env-label {
  color: var(--c-muted); display: flex; align-items: center; font-size: 14px;
}
.env-switch {
  display: inline-flex; background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 8px; padding: 2px; gap: 2px;
}
.env-btn {
  padding: 4px 11px; border-radius: 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em;
  color: var(--c-muted); text-decoration: none; transition: all .14s;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.env-btn:hover { color: var(--c-text); }
.env-btn.active { background: var(--c-accent); color: var(--c-primary); box-shadow: var(--shadow-sm); }
.env-hint { font-size: 11.5px; color: var(--c-muted); margin-left: auto; }
@media (max-width: 640px) { .env-hint { display: none; } }

/* ── Solicitudes de gasto ── */
/* Columna centrada y cómoda (estas vistas son estrechas, no se cortan) */
.content-narrow { max-width: 860px; margin: 0 auto; }
.badge.sol-pendiente  { background: #FEF3C7; color: #B45309; }
.badge.sol-autorizada { background: #DBEAFE; color: #1D4ED8; }
.badge.sol-pagada     { background: #DCFCE7; color: #166534; }
.badge.sol-rechazada  { background: #FEE2E2; color: #B91C1C; }

/* Línea de progreso creada → autorizada → pagada */
.sol-flow { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.sol-flow .flow-step { display: flex; align-items: center; gap: 8px; }
.sol-flow .flow-step > div { display: flex; flex-direction: column; line-height: 1.2; }
.sol-flow .flow-step strong { font-size: 12.5px; color: var(--c-muted); font-weight: 700; }
.sol-flow .flow-step small { font-size: 11px; color: #9CA3AF; }
.sol-flow .flow-dot {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; background: #E5E7EB; color: #9CA3AF;
}
.sol-flow .flow-step.done .flow-dot { background: #16A34A; color: #fff; }
.sol-flow .flow-step.done strong { color: var(--c-text); }
.sol-flow .flow-step.ko .flow-dot { background: #DC2626; color: #fff; }
.sol-flow .flow-line { flex: 1; min-width: 24px; height: 3px; border-radius: 2px; background: #E5E7EB; }
.sol-flow .flow-line.on { background: #16A34A; }
.sol-flow .flow-line.ko { background: #DC2626; }
.sol-field { display: flex; gap: 16px; padding: 11px 0; border-bottom: 1px solid #F3F4F6; font-size: 14px; }
.sol-field:last-child { border-bottom: none; }
.sol-k { width: 150px; flex-shrink: 0; color: var(--c-muted); font-weight: 600;
         font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
.sol-v { flex: 1; color: var(--c-text); }

/* ── Marcar transferencia como PAGADA (Laura / Ana) ── */
.pay-toggle {
  width: 24px; height: 24px; border-radius: 50%; padding: 0;
  border: 2px solid #D1D5DB; background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all .15s; vertical-align: middle;
}
.pay-toggle i { opacity: 0; color: #16A34A; transition: opacity .15s; }
.pay-toggle:hover { border-color: #16A34A; }
.pay-toggle:hover i { opacity: .45; }
.pay-toggle.on { background: #16A34A; border-color: #16A34A; }
.pay-toggle.on i { opacity: 1; color: #fff; }
.pay-ro {
  width: 22px; height: 22px; border-radius: 50%; vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.pay-ro.on  { background: #DCFCE7; color: #16A34A; }
.pay-ro.off { border: 2px solid #E5E7EB; color: transparent; }
/* Fila pagada: tinte verde suave + acento verde a la izquierda */
table.main-table tbody tr.pagada > td { background: #F2FCF5; }
table.main-table tbody tr.pagada:hover > td { background: #E7F9ED; }
table.main-table tbody tr.pagada > td:first-child { box-shadow: inset 3px 0 0 #16A34A; }

/* ── Control horario ── */
/* Barra de navegación: selector de vista + pestañas de semana en la misma fila */
.hz-navbar { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.hz-navbar .week-tabs { margin-bottom: 0; }
.hz-views { display: inline-flex; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 12px; padding: 4px; gap: 3px; }
.hz-view {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 9px;
  text-decoration: none; color: var(--c-muted); font-size: 13px; font-weight: 700;
  white-space: nowrap; transition: all .14s;
}
.hz-view:hover { color: var(--c-text); }
.hz-view.active { background: var(--c-card); color: var(--c-text); box-shadow: 0 1px 3px rgba(0,0,0,.09); }
.hz-view.active i { color: var(--c-accent); }
.week-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.week-tab {
  padding: 7px 14px; border-radius: 10px; border: 1px solid var(--c-border);
  background: var(--c-card); text-decoration: none; color: var(--c-muted);
  font-size: 13px; font-weight: 700; text-align: center; line-height: 1.25; transition: all .14s;
}
.week-tab small { display: block; font-weight: 500; font-size: 11px; opacity: .85; }
.week-tab:hover { border-color: var(--c-accent); color: var(--c-text); }
.week-tab.active { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-primary); }
table.horas-table tbody tr.eq-head td {
  background: var(--c-bg); font-weight: 800; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--c-muted); padding: 8px 16px;
}
.hora-in {
  width: 54px; text-align: center; border: 1px solid var(--c-border); border-radius: 6px;
  padding: 6px 4px; font-size: 13px; font-family: inherit;
}
.hora-in:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 2px rgba(232,184,0,.15); }
.hora-in::-webkit-outer-spin-button, .hora-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hora-in:disabled { background: #F3F4F6; cursor: not-allowed; }
table.horas-table th.otro-mes, table.horas-table td.otro-mes { background: #FAFAFA; }
table.horas-table td.otro-mes .hora-in { background: #FAFAFA; color: #9CA3AF; border-style: dashed; }
table.horas-table tbody tr.eq-subtotal td { border-top: 1px solid var(--c-border); background: #FCFCFD; }
.btn-mini {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--c-border);
  background: var(--c-card); color: var(--c-muted); cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; transition: all .14s;
}
.btn-mini:hover { border-color: var(--c-accent); color: var(--c-text); background: #FFFBEB; }
.btn-mini-del:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }
/* Trabajadores por mes (equipos) */
.aviso-mes { display: flex; gap: 9px; align-items: flex-start; background: #FFFBEB; border: 1px solid #F5E4A8;
  color: #6B5A16; border-radius: 12px; padding: 11px 15px; font-size: 13px; margin-bottom: 18px; }
.aviso-mes i { color: var(--c-accent); font-size: 15px; margin-top: 1px; }
.team-card { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.team-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px;
  background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
.team-name { font-weight: 800; font-size: 14px; color: var(--c-text); }
.team-name small { color: var(--c-muted); font-weight: 700; margin-left: 8px; background: var(--c-card);
  border: 1px solid var(--c-border); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.team-add { padding: 12px 16px; background: #FFFDF3; border-bottom: 1px solid var(--c-border); }
.team-add form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.team-new { border-style: dashed; }
.team-new .team-head { background: transparent; }
.member-row { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid #F2F2F4; }
.member-row:last-child { border-bottom: none; }
.member-form { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; flex: 1; }
.member-name { font-weight: 600; min-width: 140px; }
.member-field { font-size: 12px; color: var(--c-muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.member-field .inp-sm { width: 66px; }
.inp-sm { padding: 6px 9px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--c-text); }
.inp-sm:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 2px rgba(232,184,0,.15); }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text); white-space: nowrap; cursor: pointer; }
.chk input { width: 16px; height: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
/* Trabajadores: arrastrar y soltar por equipos */
.content-wide { max-width: none; }
.trab-layout { display: flex; flex-direction: column; gap: 18px; }
.pool-card2 { background: var(--c-card); border: 1px dashed #D9C88E; background: #FFFDF6; border-radius: 14px; padding: 16px 18px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 16px; align-items: start; }
.chips { display: flex; flex-direction: column; gap: 8px; min-height: 46px; padding: 5px; border-radius: 10px; transition: background .12s, box-shadow .12s; }
.chips.drag-over { background: #FFF8DD; box-shadow: inset 0 0 0 2px var(--c-accent); }
.chip { display: flex; flex-direction: column; gap: 6px; background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: 10px; padding: 9px 11px; cursor: grab; transition: box-shadow .12s, border-color .12s; }
.chip:hover { border-color: #D8D8DC; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.chip.dragging { opacity: .4; }
.chip:active { cursor: grabbing; }
.pool-zone .chip { background: var(--c-card); }
.chip-head { display: flex; align-items: center; gap: 9px; }
.chip .grip { color: #C7C7CC; font-size: 14px; flex: none; }
.chip-name { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.chip-fields { display: flex; gap: 16px; padding-left: 26px; }
.pool-zone .chip-fields { padding-left: 23px; }
.chip-field { font-size: 11.5px; color: var(--c-muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.chip-field .inp-xs { width: 62px; }
.pool-zone { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 9px; }
.chip.flat { cursor: default; }
.inp-xs { padding: 5px 7px; border: 1px solid var(--c-border); border-radius: 7px; font-size: 12.5px; font-family: inherit; color: var(--c-text); }
.inp-xs:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 2px rgba(232,184,0,.15); }
.inp-xs.saved { border-color: #16A34A; box-shadow: 0 0 0 2px rgba(22,163,74,.18); }
.crown { border: none; background: none; cursor: pointer; color: #D4D4D8; font-size: 15px; padding: 2px; line-height: 1; }
.crown.is-jefe { color: var(--c-accent); }
.crown:hover { color: var(--c-accent); }
.chip-x { border: none; background: none; cursor: pointer; color: #C7C7CC; font-size: 13px; padding: 2px; line-height: 1; }
.chip-x:hover { color: #DC2626; }
.pool-zone .crown, .pool-zone .chip-x { display: none; }
.pool-hint { font-size: 12.5px; color: var(--c-muted); margin: 2px 0 10px; }
.nuevo-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.team-empty { font-size: 12.5px; color: var(--c-muted); text-align: center; padding: 10px; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex: 1;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--c-muted);
  margin: 0;
}

/* ── Selectors ── */
.month-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

.select-month, .select-year {
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--c-card);
  cursor: pointer;
  color: var(--c-text);
}

.select-month:focus, .select-year:focus {
  outline: none;
  border-color: var(--c-accent);
}

/* ══════════════════ STAT CARDS ══════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

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

.stat-card-accent {
  border-left: 4px solid var(--c-accent);
}

.stat-card-day10 {
  border-left: 4px solid var(--c-day10);
}

.stat-card-day25 {
  border-left: 4px solid var(--c-day25);
}

.stat-card-count {
  border-left: 4px solid var(--c-success);
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--c-text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-value.is-zero { color: var(--c-muted); }

.stat-meta {
  font-size: 11.5px;
  color: var(--c-muted);
}

.stat-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  font-size: 28px;
  opacity: .10;
}

/* ══════════════════ CHARTS ══════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}

.chart-card {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 4px;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--c-muted);
  margin-bottom: 18px;
}

.chart-canvas-wrap {
  position: relative;
  height: 220px;
}

/* ══════════════════ TABLE CARD ══════════════════ */
.table-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
}

.table-card-header {
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-card-title {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.table-search {
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 34px;
  font-size: 13px;
  width: 220px;
  background: var(--c-bg);
  transition: border-color .15s;
}

.table-search:focus {
  outline: none;
  border-color: var(--c-accent);
  background: #fff;
}

.search-wrap {
  position: relative;
}

.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  font-size: 14px;
  pointer-events: none;
}

.table-responsive { overflow-x: auto; }

table.main-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.main-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--c-muted);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

table.main-table tbody tr {
  border-bottom: 1px solid #F3F4F6;
  transition: background .12s;
}

table.main-table tbody tr:last-child { border-bottom: none; }

table.main-table tbody tr:hover { background: #FAFAFA; }

table.main-table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  color: var(--c-text);
}

.td-fecha { white-space: nowrap; font-weight: 500; }

.td-importe {
  font-weight: 700;
  color: var(--c-success);
  white-space: nowrap;
  font-size: 14px;
}

.td-factura {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--c-muted);
  background: var(--c-bg);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-day10 {
  background: #EDE9FE;
  color: var(--c-day10);
}

.badge-day25 {
  background: #E0F2FE;
  color: var(--c-day25);
}

.badge-jose {
  background: #FEF9C3;
  color: #A16207;
}

.badge-carlos {
  background: #DCFCE7;
  color: #166534;
}

.badge-cari {
  background: #DBEAFE;
  color: #1D4ED8;
}

.badge-otro {
  background: #F3F4F6;
  color: #374151;
}

.badge-pendiente {
  background: #FEF3C7;
  color: #B45309;
}

/* Sección de pendientes de aceptar */
.pendientes-card {
  border: 1px solid #FDE68A;
  box-shadow: 0 1px 3px rgba(217,119,6,.10);
}
.pendientes-card .table-card-header {
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  padding-bottom: 16px;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.pendientes-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  background: #D97706;
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}

/* Botón aceptar (jefes) */
.btn-aceptar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-aceptar:hover { background: #047857; transform: translateY(-1px); }
.btn-aceptar:active { transform: translateY(0); }

/* Opción "Pendiente de aceptar" en el formulario */
.radio-pendiente input:checked + label {
  border-color: #D97706;
  background: #FFFBEB;
  color: #B45309;
}

/* ── Naturaleza (Compras / Transporte) ── */
.badge-compras    { background: #E0E7FF; color: #4338CA; }
.badge-transporte { background: #FFEDD5; color: #C2410C; }
.badge-formacion  { background: #CCFBF1; color: #0F766E; }
.radio-compras input:checked + label    { border-color: #6366F1; background: #EEF2FF; color: #3730A3; }
.radio-transporte input:checked + label { border-color: #F97316; background: #FFF7ED; color: #9A3412; }
.radio-formacion input:checked + label  { border-color: #14B8A6; background: #F0FDFA; color: #0F766E; }

.nat-head { display:flex; justify-content:space-between; align-items:center; font-size:13px; font-weight:600; color:var(--c-text); margin-bottom:7px; }
.nat-pct { font-weight:800; font-size:14px; }
.nat-key { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:middle; }
.nat-key-compras { background:#6366F1; }
.nat-key-transporte { background:#F97316; }
.nat-key-formacion { background:#14B8A6; }
.nat-bar-wrap { background:#F3F4F6; border-radius:99px; height:9px; overflow:hidden; }
.nat-bar { height:100%; border-radius:99px; transition:width .4s ease; }
.nat-bar-compras { background:#6366F1; }
.nat-bar-transporte { background:#F97316; }
.nat-bar-formacion { background:#14B8A6; }
.nat-amount { font-size:11.5px; color:var(--c-muted); margin-top:5px; }

/* ── Verificación (doble check de los jefes) ── */
.verif-cell { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.verif-dot {
  width:26px; height:26px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:800; border:2px solid; flex-shrink:0;
}
.verif-on-jose   { background:#FEF9C3; border-color:#EAB308; color:#A16207; }  /* José Ángel: amarillo */
.verif-on-carlos { background:#DCFCE7; border-color:#16A34A; color:#15803D; }  /* Carlos: verde */
.verif-off       { background:#F9FAFB; border-color:#E5E7EB; color:#C0C5CE; }  /* pendiente: gris */

.btn-verif {
  display:inline-flex; align-items:center; gap:5px;
  background:#fff; color:var(--c-success); border:1.5px solid #A7F3D0;
  border-radius:var(--radius-sm); padding:5px 10px; font-size:12px; font-weight:700;
  cursor:pointer; transition:all .15s;
}
.btn-verif:hover { background:#ECFDF5; border-color:var(--c-success); }
.btn-verif-undo {
  display:inline-flex; align-items:center; gap:5px;
  background:var(--c-success); color:#fff; border:none;
  border-radius:var(--radius-sm); padding:5px 10px; font-size:12px; font-weight:700;
  cursor:pointer; transition:background .15s;
}
.btn-verif-undo:hover { background:#047857; }

/* ── Pestañas (Transferencias / Estadísticas) ── */
.tabs-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--c-border);
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 11px 18px;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.active { color: var(--c-primary); border-bottom-color: var(--c-accent); }

/* ── Botón "Validar todas" (jefes) ── */
.btn-validar-todas {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--c-success);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-validar-todas:hover { background: #047857; transform: translateY(-1px); }

/* ── PDF icon ── */
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-info);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s;
}

.pdf-btn:hover { background: #EFF6FF; color: var(--c-info); }

.no-pdf {
  font-size: 12px;
  color: #D1D5DB;
}

/* ── Actions ── */
.actions-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-edit {
  background: transparent;
  border: none;
  color: var(--c-muted);
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all .12s;
}

.btn-edit:hover { background: var(--c-bg); color: var(--c-accent-d); }

.btn-del {
  background: transparent;
  border: none;
  color: var(--c-muted);
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all .12s;
}

.btn-del:hover { background: #FEF2F2; color: var(--c-danger); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--c-muted);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.empty-sub   { font-size: 13px; }

/* ══════════════════ MODAL ══════════════════ */
.modal-backdrop.show { opacity: .5; }

.modal-content {
  border: none;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
  overflow: hidden;
}

.modal-header {
  background: var(--c-primary);
  padding: 20px 24px;
  border: none;
}

.modal-title-text {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.btn-close-modal {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.btn-close-modal:hover { background: rgba(255,255,255,.25); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--c-border); }

/* ── Radio group ── */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-option {
  flex: 1;
  min-width: 80px;
}

.radio-option input[type="radio"] { display: none; }

.radio-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
  color: var(--c-muted);
  user-select: none;
}

.radio-option input:checked + label {
  border-color: var(--c-accent);
  background: var(--c-accent-l);
  color: var(--c-primary);
}

.radio-jose input:checked + label   { border-color: #EAB308; background: #FFFBEB; color: #92400E; }
.radio-carlos input:checked + label { border-color: #10B981; background: #ECFDF5; color: #065F46; }
.radio-cari input:checked + label   { border-color: #3B82F6; background: #EFF6FF; color: #1E40AF; }
.radio-otro input:checked + label   { border-color: #6B7280; background: #F9FAFB; color: #374151; }

/* ── File upload area ── */
.upload-area {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--c-bg);
  position: relative;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--c-accent);
  background: var(--c-accent-l);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 24px; color: var(--c-muted); margin-bottom: 6px; }
.upload-text { font-size: 12.5px; color: var(--c-muted); }
.upload-sub  { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* ── Top proveedores ── */
.top-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.top-table td { padding: 7px 0; border-bottom: 1px solid #F3F4F6; }
.top-table tr:last-child td { border-bottom: none; }
.top-prov-name { font-weight: 600; color: var(--c-text); }
.top-prov-bar-wrap {
  background: #F3F4F6;
  border-radius: 99px;
  height: 5px;
  flex: 1;
  overflow: hidden;
}
.top-prov-bar {
  height: 100%;
  border-radius: 99px;
  background: var(--c-accent);
}
.top-prov-amount { font-weight: 700; color: var(--c-success); text-align: right; white-space: nowrap; }

/* ── Live indicator (viewer) ── */
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--c-success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
  margin-right: 6px;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(5,150,105,.4); }
  70%  { box-shadow: 0 0 0 6px rgba(5,150,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}

.live-badge {
  display: inline-flex;
  align-items: center;
  background: #ECFDF5;
  color: #065F46;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}

/* ── Toasts ── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast-item {
  background: var(--c-card);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid transparent;
  animation: slideIn .25s ease;
}

.toast-success { border-color: var(--c-success); }
.toast-danger  { border-color: var(--c-danger); }
.toast-info    { border-color: var(--c-info); }
.toast-warning { border-color: var(--c-accent); }

.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--c-success); }
.toast-danger  .toast-icon { color: var(--c-danger); }
.toast-info    .toast-icon { color: var(--c-info); }
.toast-warning .toast-icon { color: var(--c-accent-d); }

.toast-msg { font-size: 13px; font-weight: 500; color: var(--c-text); flex: 1; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Utility ── */
.divider { height: 1px; background: var(--c-border); margin: 16px 0; }
.text-muted { color: var(--c-muted) !important; }
.fw-700 { font-weight: 700; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }

/* ══════════════════ FORMULARIO A PANTALLA COMPLETA ══════════════════ */
.form-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-bg);
  z-index: 3000;
  display: none;
  overflow-y: auto;
}
.form-overlay.show { display: block; }

.form-overlay-topbar {
  position: sticky;
  top: 0;
  background: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 24px;
  z-index: 5;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.form-overlay-topbar .titulo {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-volver:hover { background: rgba(255,255,255,.22); }

.form-overlay-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.form-card {
  background: var(--c-card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  padding: 30px;
}

.form-overlay-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--c-border);
}

/* Bloque destacado (mes de la transferencia) */
.form-section {
  background: var(--c-accent-l);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 18px;
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-accent-d);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-section-hint {
  font-weight: 500;
  font-size: 11.5px;
  color: var(--c-muted);
}

@media (max-width: 680px) {
  .form-card { padding: 20px; }
  .form-overlay-inner { padding: 16px 14px 40px; }
}

/* ════════════════════ SHELL · MENÚ LATERAL ════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--c-primary);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: margin-left .22s ease;
}
.sidebar-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo { height: 32px; width: auto; filter: brightness(0) invert(1); }
.sidebar-brand { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar-brand-name { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.sidebar-brand-sub { color: var(--c-accent); font-size: 11px; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; }
.nav-top { display: flex; flex-direction: column; }
/* La sección de administración se queda anclada abajo y separada del resto */
.nav-bottom {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-group-title {
  color: rgba(255,255,255,.4); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; padding: 0 10px; margin: 16px 0 7px;
}
.nav-group-title:first-child { margin-top: 4px; }
.nav-bottom .nav-group-title { margin-top: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 3px; border-radius: 9px;
  color: rgba(255,255,255,.72); font-size: 12.5px; font-weight: 600;
  text-decoration: none; transition: background .14s, color .14s;
}
.nav-link i { font-size: 15px; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: var(--c-accent); color: var(--c-primary); }
.nav-badge {
  flex: none; align-self: center; margin-left: auto; box-sizing: border-box;
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px;
  background: #DC2626; color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
}
.nav-link.active .nav-badge { background: #1C1C1E; color: #fff; }
/* Extranjero — semáforo de vencimiento */
.dp { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.dp-venc { background: #FEE2E2; color: #B91C1C; }
.dp-prox { background: #FEF3C7; color: #92620A; }
.dp-ok   { background: #DCFCE7; color: #166534; }
.dp-none { background: #F1F1F4; color: #6B6B70; }
.dp-cobr { background: #E0F2FE; color: #0369A1; }
tr.ext-gest { opacity: .5; }
tr.ext-gest .dp { filter: grayscale(.4); }
.ext-filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.ext-filtros select, .ext-filtros input[type=text] { padding: 8px 11px; border: 1px solid var(--c-border);
  border-radius: 9px; font-size: 13px; font-family: inherit; color: var(--c-text); background: var(--c-card); }
.sync-info { font-size: 12px; color: var(--c-muted); display: flex; align-items: center; gap: 6px; }
.btn-flag { border: 1px solid var(--c-border); background: var(--c-card); border-radius: 8px; cursor: pointer;
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--c-muted); }
.btn-flag:hover { border-color: var(--c-accent); color: var(--c-text); }
.btn-flag.on { background: #166534; border-color: #166534; color: #fff; }
.forma-btn { border: none; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--c-text);
  padding: 3px 8px; border-radius: 7px; border-bottom: 1px dashed var(--c-border); white-space: nowrap; }
.forma-btn:hover { background: #FFFBEB; border-bottom-color: var(--c-accent); }
.forma-btn.manual { font-weight: 700; color: #92620A; border-bottom-color: #E8B800; }
/* Centro de notificaciones (campana) */
.topbar-notif { position: relative; margin-right: 6px; }
.notif-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--c-muted);
  font-size: 19px; padding: 6px 9px; border-radius: 10px; line-height: 1; }
.notif-btn:hover { background: var(--c-bg); color: var(--c-text); }
.notif-count { position: absolute; top: 1px; right: 2px; background: #DC2626; color: #fff; font-size: 10px;
  font-weight: 800; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 350px; max-width: 92vw;
  background: var(--c-card); border: 1px solid var(--c-border); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.16); z-index: 300; overflow: hidden; display: none; }
.notif-panel.show { display: block; }
.notif-head { padding: 12px 16px; font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 8px; }
.notif-head-badge { margin-left: auto; background: #DC2626; color: #fff; font-size: 11px; font-weight: 800;
  padding: 1px 8px; border-radius: 20px; }
.notif-list { max-height: 372px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 11px 16px; text-decoration: none; color: var(--c-text);
  border-bottom: 1px solid #F2F2F4; }
.notif-item:hover { background: var(--c-bg); }
.notif-ico { width: 32px; height: 32px; flex: none; border-radius: 9px; background: #FFF7DE; color: #92620A;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.notif-item.urgente .notif-ico { background: #FEE2E2; color: #B91C1C; }
.notif-body { display: flex; flex-direction: column; min-width: 0; }
.notif-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-detail { font-size: 12px; color: var(--c-muted); }
.notif-item.urgente .notif-detail { color: #B91C1C; font-weight: 600; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--c-muted); font-size: 13px; line-height: 1.9; }
.notif-empty i { font-size: 24px; color: #16A34A; opacity: .7; }
.notif-foot { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 700;
  color: var(--c-text); text-decoration: none; border-top: 1px solid var(--c-border); background: var(--c-bg); }
.notif-foot:hover { color: var(--c-accent); }
/* Estado de conexión de usuarios */
.conx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #C7C7CC;
  margin-right: 5px; vertical-align: middle; }
.conx-dot.online { background: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.btn-aviso { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px;
  border: 1px solid #E8B800; background: #FFFBEB; color: #92620A; font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all .14s; }
.btn-aviso:hover:not(:disabled) { background: var(--c-accent); color: #1C1C1E; }
.btn-aviso:disabled { opacity: .5; cursor: not-allowed; border-color: var(--c-border); background: var(--c-bg); color: var(--c-muted); }
.sidebar-foot {
  padding: 14px 18px; color: rgba(255,255,255,.3); font-size: 11px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  height: 60px; background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 900;
}
.hamburger {
  background: transparent; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 9px;
  font-size: 20px; color: var(--c-text);
  display: flex; align-items: center; justify-content: center; transition: background .14s;
}
.hamburger:hover { background: var(--c-bg); }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--c-text); }
.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-avatar {
  width: 32px; height: 32px; background: var(--c-accent); color: var(--c-primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; flex-shrink: 0;
}
.topbar-name { font-size: 13px; font-weight: 600; color: var(--c-text); }
.app-topbar .btn-logout {
  background: var(--c-bg); color: var(--c-muted); border: 1px solid var(--c-border);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all .14s;
}
.app-topbar .btn-logout:hover { background: #FEF2F2; color: var(--c-danger); border-color: #FECACA; }

/* Aire respecto a la barra lateral. El ancho de cada página lo controla su
   propio contenedor (.content, o el max-width de las tarjetas). */
.app-content { flex: 1; padding: 26px 32px; }

@media (max-width: 700px) {
  .app-content { padding: 18px 14px; }
}

/* Plegado del menú con las 3 rayitas */
.app-layout.sidebar-collapsed .sidebar { margin-left: -248px; }

/* Fondo oscuro tras el menú (solo visible como cajón en móvil/portátil) */
.sidebar-backdrop { display: none; }
/* Texto que solo se muestra en móvil */
.solo-movil { display: none; }

/* ═══ RESPONSIVE: adaptar a pantallas más pequeñas ═══ */
/* Tablas anchas (transferencias) se compactan para caber sin scroll horizontal. */
@media (max-width: 1400px) {
  .app-content { padding: 22px 22px; }
  table.main-table { font-size: 12.5px; }
  table.main-table thead th { padding: 12px 10px; }
  table.main-table tbody td  { padding: 11px 10px; }
}

/* ≤1200px: el menú pasa a ser un CAJÓN deslizante (oculto por defecto). */
@media (max-width: 1200px) {
  .app-content { padding: 18px 14px; }
  table.main-table { font-size: 11.5px; }
  table.main-table thead th { padding: 10px 7px; letter-spacing: 0; }
  table.main-table tbody td  { padding: 9px 7px; }
  .td-importe { font-size: 12px; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 1500;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 4px 0 28px rgba(0,0,0,.4);
  }
  .app-layout.mobile-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1400;
    background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .app-layout.mobile-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}

/* ≤640px: MÓVIL. Las tablas se muestran como tarjetas apiladas y legibles. */
@media (max-width: 640px) {
  .app-topbar { padding: 0 10px; gap: 4px; }
  .topbar-name { display: none; }
  .topbar-title { font-size: 14px; }
  /* El topbar se llena en pantallas estrechas (engranaje + campana + avatar +
     Salir): el nombre ya se esconde arriba, y aquí dejamos Salir solo con el
     icono para que no se corte nada por el borde derecho. */
  .btn-logout-text { display: none; }
  .app-topbar .btn-logout { padding: 8px; }
  .topbar-user { gap: 6px; }
  .topbar-notif { margin-right: 2px; }
  .page-title { font-size: 19px; }
  /* Panel de notificaciones: en el móvil se ancla A LA PANTALLA (fijo, bajo el
     topbar de 60px, con márgenes a los dos lados) en vez de a la campana, que si no
     se sale por la izquierda al ser más ancho que el hueco. */
  .notif-panel { position: fixed; top: 66px; left: 10px; right: 10px;
    width: auto; max-width: none; z-index: 1000; }
  .notif-list { max-height: 60vh; }
  /* Campos a 16px: evita el zoom automático de iOS al enfocar */
  .form-control, .form-select, .table-search, .select-month, .select-year { font-size: 16px; }

  /* En el móvil la barra de herramientas se apila: el título arriba a todo el
     ancho y los botones/acciones debajo, para que el título no se espachurre. */
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex: none; }

  table.main-table thead { display: none; }
  table.main-table tbody tr {
    display: block; background: var(--c-card);
    border: 1px solid var(--c-border); border-radius: 12px;
    padding: 4px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  }
  table.main-table tbody td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 10px 0; border: none; border-bottom: 1px solid #F3F4F6;
    text-align: right; white-space: normal; font-size: 13.5px; min-height: 40px;
  }
  table.main-table tbody tr td:last-child { border-bottom: none; }
  table.main-table tbody td::before {
    content: attr(data-label); text-align: left; flex-shrink: 0;
    font-weight: 700; color: var(--c-muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: .03em;
  }
  table.main-table tbody td:not([data-label])::before { content: none; }
  /* Fila de "vacío" (colspan) ocupa toda la tarjeta, centrada */
  table.main-table tbody td[colspan] { display: block; text-align: center; }
  table.main-table tbody td[colspan]::before { content: none; }
  /* Botones y badges algo más grandes para el dedo */
  .btn-edit, .btn-del { width: auto; height: auto; padding: 7px 12px; }
  .toolbar .btn-accent { flex: 1; justify-content: center; }
  .solo-movil { display: inline; }
}

/* ════════════════════ MÓDULO CANDIDATOS ════════════════════ */
.cand-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.cand-card {
  background: var(--c-card); border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,.05); box-shadow: var(--shadow-sm);
  padding: 18px; transition: box-shadow .2s, transform .2s; text-decoration: none; color: inherit;
  display: block;
}
.cand-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cand-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cand-name { font-size: 15px; font-weight: 700; color: var(--c-text); }
.cand-puesto { font-size: 12.5px; color: var(--c-muted); margin-top: 2px; }
.cand-meta { margin-top: 12px; font-size: 12.5px; color: var(--c-muted); display: flex; flex-direction: column; gap: 4px; }
.cand-meta i { width: 16px; color: #9CA3AF; }

.cand-estado { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:99px; font-size:11px; font-weight:700; white-space:nowrap; }
.cand-green  { background:#DCFCE7; color:#166534; }
.cand-orange { background:#FEF3C7; color:#B45309; }
.cand-red    { background:#FEE2E2; color:#991B1B; }
.cand-blue   { background:#DBEAFE; color:#1D4ED8; }
.cand-grey   { background:#F3F4F6; color:#4B5563; }

.cand-carnets { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.carnet-chip { background:#EEF2FF; color:#3730A3; font-size:10.5px; font-weight:700; padding:2px 7px; border-radius:6px; }

.cand-stat-row { display:flex; gap:14px; flex-wrap:wrap; }
.detalle-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
@media (max-width:700px){ .detalle-grid{ grid-template-columns:1fr; } }
.det-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--c-muted); margin-bottom:3px; }
.det-value { font-size:14px; color:var(--c-text); font-weight:500; }

.carnet-check {
  display:inline-flex; align-items:center; gap:7px;
  background:var(--c-bg); border:1.5px solid var(--c-border); border-radius:8px;
  padding:8px 13px; cursor:pointer; font-size:13px; font-weight:600; user-select:none;
  transition:border-color .14s, background .14s;
}
.carnet-check:hover { border-color:#D1D5DB; }
.carnet-check input { accent-color: var(--c-accent-d); width:15px; height:15px; }

.cstat-bar-row { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.cstat-bar-label { width:150px; font-size:13px; font-weight:600; color:var(--c-text); flex-shrink:0; }
.cstat-bar-wrap { flex:1; background:#F3F4F6; border-radius:99px; height:22px; overflow:hidden; position:relative; }
.cstat-bar { height:100%; border-radius:99px; background:var(--c-accent); min-width:2px; }
.cstat-bar-val { font-size:12px; font-weight:800; color:var(--c-text); width:34px; text-align:right; }

/* ════════════════════ MÓDULO GIROS ════════════════════ */
.giro-cobrado   { background:#DCFCE7; color:#166534; }
.giro-pendiente { background:#FEF3C7; color:#B45309; }
.giro-vencido   { background:#FEE2E2; color:#991B1B; }
.dia-chip {
  display:inline-flex; align-items:center; background:var(--c-bg);
  border:1px solid var(--c-border); color:var(--c-text);
  font-size:11px; font-weight:700; padding:3px 8px; border-radius:6px; white-space:nowrap;
}
.dia-venc { background:#FEE2E2; border-color:#FECACA; color:#991B1B; }
.radio-pend-giro input:checked + label { border-color:#D97706; background:#FFFBEB; color:#B45309; }
.radio-cobr-giro input:checked + label { border-color:#16A34A; background:#ECFDF5; color:#166534; }
