/* Vilarma Retail — Estilos (extraídos del prototipo, sin cambios visuales) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --bg:           oklch(0.97 0.007 60);
  --bg-card:      #ffffff;
  --sidebar-bg:   oklch(0.13 0.025 255);
  --sidebar-text: oklch(0.75 0.01 250);
  --sidebar-act:  #ffffff;
  --text:         oklch(0.16 0.02 255);
  --text-muted:   oklch(0.52 0.018 255);
  --border:       oklch(0.90 0.008 255);
  --accent:       oklch(0.52 0.155 218);
  --accent-light: oklch(0.93 0.04 218);
  --success:      oklch(0.55 0.16 145);
  --danger:       oklch(0.52 0.20 25);
  --warn:         oklch(0.68 0.16 80);
  --radius:       10px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: "DM Sans", sans-serif; background: var(--bg); color: var(--text); min-height: 100dvh; display: flex; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── LAYOUT ─────────────────────────────────────────── */
#sidebar {
  width: 220px; min-height: 100dvh; background: var(--sidebar-bg);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 110;
  transition: transform .25s ease;
}
#main { margin-left: 220px; flex: 1; min-height: 100dvh; display: flex; flex-direction: column; }

/* Sidebar backdrop (mobile overlay) */
#sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 105;
  background: rgba(0,0,0,.45); backdrop-filter: blur(1px);
  transition: opacity .25s;
}
#sidebar-backdrop.open { display: block; }

.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-brand-name { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.sidebar-brand-sub  { font-size: 0.72rem; color: var(--sidebar-text); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; color: var(--sidebar-text);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s; border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item svg { opacity: .7; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: rgba(255,255,255,.12); color: var(--sidebar-act); }
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-footer-text { font-size: 0.72rem; color: var(--sidebar-text); }

/* ── TOP BAR (mobile) ──────────────────────────────── */
#topbar {
  display: none; position: sticky; top: 0; z-index: 90;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 0 16px; height: 52px; align-items: center; justify-content: space-between;
}
.topbar-title { font-weight: 600; font-size: 0.95rem; }
.burger { background: none; border: none; padding: 4px; display: flex; align-items: center; justify-content: center; }

/* ── BOTTOM NAV (mobile) ───────────────────────────── */
#bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bnav-items { display: flex; justify-content: space-around; }
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; font-size: 0.67rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; background: none; border: none;
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bnav-item span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bnav-item.active { color: var(--accent); }
.bnav-item svg { opacity: .6; flex-shrink: 0; }
.bnav-item.active svg { opacity: 1; }

/* ── VIEW CONTAINER ────────────────────────────────── */
.view-container { padding: 28px 28px 60px; max-width: 1320px; }
.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.view-title  { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.view-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.section-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 20px; }

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 0.875rem; font-weight: 500;
  border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 7px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: #fee2e2; color: var(--danger); }
.btn-icon.xs { width: 20px; height: 20px; border-radius: 4px; }

/* ── TOOLBAR ─────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; flex: 1; min-width: 200px; }
.search-box input { border: none; outline: none; background: transparent; font-size: 0.875rem; color: var(--text); padding: 8px 0; width: 100%; }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
.filter-select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 0.875rem; color: var(--text); background: var(--bg-card); outline: none; cursor: pointer; }

/* ── BADGES ─────────────────────────────────────────── */
.sec-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 0.75rem; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.turno-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 0.75rem; font-weight: 500; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.equipo-tag { font-size: 0.75rem; color: var(--text-muted); }
.badge-vacante { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; background: #f3f4f6; color: #9ca3af; border: 1.5px dashed #d1d5db; }
.meta-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 0.75rem; background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.time-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 5px; font-size: 0.82rem; font-weight: 600; background: var(--accent-light); color: var(--accent); font-variant-numeric: tabular-nums; }
.absence-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 5px; font-size: 0.8rem; font-weight: 500; }
.absence-badge.vac { background: #fef3c7; color: #92400e; }
.absence-badge.libre { background: #f0fdf4; color: #166534; }

/* ── TABLE ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { padding: 11px 16px; text-align: left; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: oklch(0.98 0.004 255); }
.row-vacante td { opacity: .75; }
.row-vacante:hover td { opacity: 1; }
.row-actions { display: flex; gap: 4px; }
.emp-cell { display: flex; align-items: center; gap: 10px; }
.emp-avatar { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.emp-avatar.sm { width: 28px; height: 28px; border-radius: 6px; font-size: 0.65rem; }
.emp-name { font-weight: 600; font-size: 0.875rem; display: flex; align-items: center; gap: 4px; }
.emp-cargo { font-size: 0.775rem; color: var(--text-muted); }
.dias-libres { font-size: 0.775rem; color: var(--text-muted); }
.mono { font-variant-numeric: tabular-nums; font-size: 0.8rem; }

/* ── MOBILE EMPLOYEE CARDS ─────────────────────────── */
.emp-cards { display: flex; flex-direction: column; gap: 10px; }
.emp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.emp-card-vacante { border-style: dashed; opacity: .8; }
.emp-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.emp-card-info { flex: 1; }
.emp-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.emp-card-horario { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg-card); border-radius: 14px; width: 100%; max-width: 580px; max-height: 92dvh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-sm { max-width: 400px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.05rem; font-weight: 700; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; border-top: 1px solid var(--border); }
.modal-form { padding: 20px 24px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-span2 { grid-column: 1 / -1; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.form-group input, .form-group select, .form-group textarea { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 0.875rem; color: var(--text); background: var(--bg); outline: none; transition: border-color .15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); background: var(--bg-card); }
.form-check-row { flex-direction: row; gap: 20px; align-items: center; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
.check-label input { width: 15px; height: 15px; accent-color: var(--accent); }
.turno-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.turno-opt { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); font-size: 0.82rem; font-weight: 500; background: var(--bg); color: var(--text-muted); cursor: pointer; transition: all .15s; }
.turno-opt.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.days-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.day-opt { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); font-size: 0.78rem; font-weight: 600; background: var(--bg); color: var(--text-muted); cursor: pointer; transition: all .15s; }
.day-opt.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: var(--text-muted); gap: 12px; }
.empty-state p { font-size: 0.9rem; }
.empty-state.compact { padding: 24px; }

/* ── SCHEDULE ─────────────────────────────────────────── */
.date-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; width: fit-content; }
.date-nav-center { display: flex; align-items: center; gap: 12px; }
.date-input { border: none; outline: none; background: transparent; font-size: 0.875rem; font-family: inherit; color: var(--text); cursor: pointer; }
.date-label { font-size: 0.875rem; font-weight: 500; color: var(--text); white-space: nowrap; }
.sec-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.schedule-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Full-bleed: el grid rompe el padding del view-container para usar todo el ancho */
.schedule-bleed { margin-left: -28px; margin-right: -28px; border-radius: 0; border-left: none; border-right: none; }
.schedule-header { display: flex; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 2; min-width: 900px; }
.grid-row { display: flex; border-bottom: 1px solid var(--border); min-width: 900px; }
.grid-row:last-child { border-bottom: none; }
.grid-row-vacante { opacity: .7; }
.grid-row-label { width: 190px; min-width: 190px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--border); }
.grid-emp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.grid-emp-name { font-size: 0.9rem; font-weight: 700; line-height: 1.3; }
.grid-emp-sec  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.coverage-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.grid-row-timeline { flex: 1; position: relative; height: 72px; }
.coverage-row { display: flex; border-bottom: 2px solid var(--border); min-width: 900px; }
.coverage-timeline { flex: 1; position: relative; height: 48px; overflow: hidden; }
.coverage-cell { position: absolute; bottom: 0; display: flex; align-items: flex-start; justify-content: center; transition: all .2s; }
.cov-num { font-size: 0.65rem; font-weight: 800; color: oklch(0.28 0.12 218); padding-top: 1px; }
.schedule-time-axis { flex: 1; position: relative; height: 46px; }
.time-tick { position: absolute; transform: translateX(-50%); font-size: 0.82rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; top: 10px; white-space: nowrap; }
.time-tick::before { content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 1px; height: 8px; background: var(--border); }
.shift-bar { position: absolute; top: 12px; height: 48px; border-radius: 8px; border: 2px solid transparent; display: flex; align-items: center; overflow: hidden; transition: opacity .2s; min-width: 6px; }
.shift-bar:hover { opacity: .85; z-index: 2; }
.shift-bar-vacante { background: transparent !important; border-style: dashed !important; opacity: .6; }
.shift-bar-label { font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,.95); padding: 0 10px; white-space: nowrap; overflow: hidden; letter-spacing: .01em; }
.shift-bar-vacante .shift-bar-label { color: inherit; }
.absent-tag { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 0.82rem; font-weight: 500; padding: 4px 12px; border-radius: 6px; }
.absent-vac { background: #fef3c7; color: #92400e; }
.absent-libre { background: #f0fdf4; color: #166534; }
.now-marker { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 5; }
.now-marker-line { width: 2px; background: #ef4444; flex: 1; opacity: .8; }
.now-marker-label { font-size: 0.6rem; font-weight: 700; color: #ef4444; white-space: nowrap; margin-top: -1px; background: var(--bg-card); padding: 0 3px; border-radius: 3px; }
.schedule-empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Mobile schedule list */
.schedule-mobile-list { margin-top: 8px; }
.schedule-card { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px; gap: 14px; box-shadow: var(--shadow-sm); min-height: 64px; align-items: center; }
.schedule-card-vacante { border-style: dashed; opacity: .75; }
.schedule-card-left { width: 5px; border-radius: 4px; flex-shrink: 0; align-self: stretch; }
.schedule-card-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.schedule-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── DASHBOARD ─────────────────────────────────────────── */
.dash-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.dash-stats-grid > * { min-width: 0; }
.dash-stats-3 { grid-template-columns: repeat(3, 1fr) !important; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-card-icon { color: var(--accent); margin-bottom: 10px; opacity: .9; }
.stat-card-val { font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.stat-card-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-top: 2px; overflow-wrap: break-word; hyphens: auto; }
.stat-card-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; overflow-wrap: break-word; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.dash-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dash-panel-header h3 { font-size: 0.875rem; font-weight: 700; }
.live-dot { font-size: 0.68rem; font-weight: 700; color: #15803d; background: #dcfce7; padding: 2px 8px; border-radius: 20px; }
.working-list { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.working-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 7px; }
.working-item:hover { background: var(--bg); }
.working-name { font-size: 0.86rem; font-weight: 600; margin-bottom: 3px; }
.working-meta { display: flex; align-items: center; gap: 6px; }
.dash-invoice-list { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.dash-inv-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 8px; border-radius: 7px; }
.dash-inv-item:hover { background: var(--bg); }
.dash-inv-prov { font-size: 0.86rem; font-weight: 600; }
.dash-inv-concept { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.dash-inv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.dash-inv-amount { font-size: 0.86rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-coverage-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; }
.sec-cov-chip { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); font-size: 0.82rem; background: var(--bg); }
.sec-cov-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sec-cov-label { font-weight: 500; }
.sec-cov-count { font-weight: 700; color: var(--text-muted); font-size: 0.78rem; }
.urgent-count { color: var(--danger); font-weight: 600; }

/* ── STAFFING ─────────────────────────────────────────── */
.eff-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
.eff-big-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow-sm); }
.eff-big-card.secondary { background: var(--bg); }
.eff-big-val { font-size: 3.4rem; font-weight: 800; letter-spacing: -.05em; color: var(--accent); line-height: 1; }
.eff-big-card.secondary .eff-big-val { color: var(--text); }
.eff-big-label { font-size: 0.95rem; font-weight: 600; color: var(--text-muted); margin-top: 8px; }
.eff-big-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.eff-section-list { display: flex; flex-direction: column; gap: 20px; }
.eff-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow-sm); }
.eff-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.eff-sec-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.eff-sec-name { font-weight: 700; font-size: 1.05rem; }
.eff-row-stats { display: flex; align-items: center; gap: 14px; }
.eff-fte { font-size: 1.05rem; font-weight: 800; }
.eff-horas { font-size: 0.88rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.eff-bar-track { height: 8px; background: var(--bg); border-radius: 4px; margin-bottom: 14px; overflow: hidden; }
.eff-bar { height: 100%; border-radius: 4px; transition: width .5s ease; }
.eff-emp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.eff-emp-chip { padding: 5px 14px; border-radius: 6px; font-size: 0.82rem; font-weight: 500; border: 1px solid transparent; }
.eff-emp-chip.vacante { border-style: dashed; font-style: italic; }
.eff-emp-chip.baja { opacity:.6; text-decoration:line-through; }

/* ── VACATIONS ─────────────────────────────────────────── */
.vac-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.vac-calendar-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: 20px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-month-label { font-size: 0.9rem; font-weight: 700; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 16px; }
.cal-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 4px; text-transform: uppercase; letter-spacing: .04em; }
.cal-day { min-height: 44px; border-radius: 7px; padding: 5px; position: relative; cursor: default; transition: background .1s; display: flex; flex-direction: column; align-items: center; }
.cal-day.today { background: var(--accent-light); }
.cal-day.has-absents { background: oklch(0.97 0.01 60); }
.cal-day-num { font-size: 0.8rem; font-weight: 500; color: var(--text); }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day-dots { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; margin-top: 3px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cal-legend { border-top: 1px solid var(--border); padding-top: 14px; }
.cal-legend-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px; }
.cal-legend-emp { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; padding: 3px 0; }
.vac-emp-list { display: flex; flex-direction: column; gap: 12px; }
.vac-emp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.vac-emp-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vac-emp-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 3px; }
.vac-none { font-size: 0.8rem; color: var(--text-muted); font-style: italic; padding: 4px 0; }
.vac-periods { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.vac-period { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text); background: #fef9c3; padding: 5px 10px; border-radius: 6px; }
.vac-domingos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dom-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.dom-chip { font-size: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.vac-section { margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.vac-section:first-of-type { border-top:none; padding-top:0; }
.vac-section-label { font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:7px; }

/* ── INVOICES ─────────────────────────────────────────── */
.inv-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.inv-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); }
.inv-stat-card.danger { border-color: #fecaca; background: #fff5f5; }
.inv-stat-card.success { border-color: #bbf7d0; background: #f0fdf4; }
.inv-stat-card.warn { border-color: #fde68a; background: #fffbeb; }
.inv-stat-val { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.inv-stat-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.inv-stat-count { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.n8n-alert { display: flex; align-items: flex-start; gap: 10px; background: oklch(0.96 0.04 255); border: 1px solid oklch(0.88 0.07 255); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 0.83rem; color: oklch(0.35 0.1 255); }
.inv-list { display: flex; flex-direction: column; gap: 10px; }
.inv-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.inv-card:hover { box-shadow: var(--shadow); }
.inv-card-urgent { border-left: 3px solid var(--danger); }
.inv-card-very-urgent { border-left: 4px solid #ef4444; background: linear-gradient(to right, #fff5f5, var(--bg-card)); }
.inv-card-paid { opacity: .65; }
.inv-card-main { flex: 1; }
.inv-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.inv-proveedor { font-size: 0.9rem; font-weight: 700; }
.inv-amount { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-concepto { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.inv-iban { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.inv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-date { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inv-notas { margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); background: var(--bg); padding: 6px 10px; border-radius: 6px; border-left: 2px solid var(--border); }
.inv-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.estado-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 0.73rem; font-weight: 600; }
.origen-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-size: 0.73rem; font-weight: 600; }
.origen-badge.auto { background: oklch(0.94 0.04 255); color: oklch(0.45 0.15 255); }
.origen-badge.manual { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.urgency-dot { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px; font-size: 0.73rem; font-weight: 600; border: 1px solid transparent; }
.urgency-pip { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.urgency-banner { display:flex; align-items:center; gap:12px; padding:12px 16px; background:#fee2e2; border:1.5px solid #fca5a5; border-radius:var(--radius); margin-bottom:16px; font-size:0.86rem; color:#991b1b; font-weight:500; }

/* Payment calendar */
.tab-bar { display:flex; gap:4px; margin-bottom:18px; background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:4px; width:fit-content; }
.tab-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:7px; border:none; background:transparent; font-size:0.83rem; font-weight:500; color:var(--text-muted); cursor:pointer; transition:all .15s; }
.tab-btn.active { background:var(--bg-card); color:var(--text); box-shadow:var(--shadow-sm); }
.pay-cal-layout { display:grid; grid-template-columns:320px 1fr; gap:20px; align-items:start; }
.pay-cal-panel { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; position:sticky; top:20px; }
.pay-cal-day { min-height:50px; }
.pay-cal-day.has-pay { background:oklch(0.96 0.03 60); }
.pay-day-badges { display:flex; align-items:center; gap:3px; margin-top:3px; justify-content:center; }
.pay-day-dot { width:8px; height:8px; border-radius:50%; }
.pay-day-dot.urgent { background:#ef4444; }
.pay-day-dot.normal { background:#3b82f6; }
.pay-cal-legend { display:flex; gap:14px; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
.pay-cal-list { display:flex; flex-direction:column; gap:14px; }
.pay-cal-day-group { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.pay-cal-date-header { display:flex; align-items:center; gap:8px; padding:10px 14px; background:var(--bg); border-bottom:1px solid var(--border); font-size:0.82rem; font-weight:600; }
.pay-overdue-tag { margin-left:auto; font-size:0.7rem; font-weight:700; padding:2px 8px; border-radius:5px; background:#fee2e2; color:#b91c1c; }
.pay-urgent-tag  { margin-left:auto; font-size:0.7rem; font-weight:700; padding:2px 8px; border-radius:5px; background:#fef3c7; color:#92400e; }
.pay-ok-tag      { margin-left:auto; font-size:0.7rem; font-weight:700; padding:2px 8px; border-radius:5px; background:#dcfce7; color:#15803d; }
.pay-cal-inv-item { display:flex; align-items:center; justify-content:space-between; padding:9px 14px; border-bottom:1px solid var(--border); gap:12px; }
.pay-cal-inv-item:last-child { border-bottom:none; }
.pay-cal-prov { font-size:0.86rem; font-weight:600; }
.pay-cal-concept { font-size:0.75rem; color:var(--text-muted); margin-top:1px; }
.pay-cal-amount { font-size:0.88rem; font-weight:700; font-variant-numeric:tabular-nums; flex-shrink:0; }

/* Time ticks */
.time-tick-hour { font-size:0.82rem; font-weight:600; color:var(--text); }
.time-tick-half { opacity:.0; pointer-events:none; } /* solo el tick visual, sin label */
.time-tick-half::before { opacity:0.5; }

/* ── BAJA ─────────────────────────────────────────────── */
.badge-baja { display:inline-flex; align-items:center; margin-left:6px; padding:1px 7px; border-radius:4px; font-size:0.68rem; font-weight:700; background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }
.btn-baja { background:#fff0f0 !important; color:#b91c1c !important; border:1px solid #fecaca !important; font-size:0.75rem !important; padding:4px 10px !important; }
.btn-baja:hover { background:#fee2e2 !important; }
.btn-baja-active { background:#b91c1c !important; color:#fff !important; border:none !important; font-size:0.75rem !important; padding:4px 10px !important; }
.grid-row-baja { opacity:.6; }
.grid-row-baja .grid-emp-name { text-decoration:line-through; text-decoration-color:#b91c1c80; }
.absent-baja { background:#fee2e2; color:#b91c1c; }
.row-baja { opacity:.7; }
.emp-card-baja { border-left:3px solid #b91c1c; }

/* ── FTE & CONTRACT BADGES ───────────────────────────── */
.fte-badge { display:inline-flex; align-items:center; padding:2px 8px; border-radius:5px; font-size:0.72rem; font-weight:700; background:var(--accent-light); color:var(--accent); font-variant-numeric:tabular-nums; margin-left:4px; }
.contrato-badge { display:inline-flex; align-items:center; padding:2px 8px; border-radius:5px; font-size:0.72rem; font-weight:600; }
.contrato-badge.indefinido { background:#f0fdf4; color:#15803d; }
.contrato-badge.temporal { background:#fef3c7; color:#92400e; }
.contrato-badge.temporal.urgent { background:#fee2e2; color:#b91c1c; animation:pulse-contract 2s ease-in-out infinite; }
@keyframes pulse-contract { 0%,100%{opacity:1} 50%{opacity:.7} }
.emp-horario-small { font-size:0.72rem; color:var(--text-muted); margin-top:1px; font-variant-numeric:tabular-nums; }

/* ── COMODÍN ─────────────────────────────────────────── */
.comodin-info { display:flex; align-items:flex-start; gap:8px; padding:10px 14px; background:oklch(0.96 0.04 280); border:1px solid oklch(0.88 0.07 280); border-radius:8px; font-size:0.82rem; color:oklch(0.4 0.12 280); }
.comodin-tag { display:inline-flex; margin-left:4px; padding:1px 6px; border-radius:3px; font-size:0.6rem; font-weight:700; background:#ede9fe; color:#6d28d9; vertical-align:middle; }
.comodin-assign-btn { position:absolute; left:10px; top:50%; transform:translateY(-50%); font-size:0.75rem; font-weight:600; padding:4px 12px; border-radius:6px; border:1.5px dashed #7c3aed; background:transparent; color:#7c3aed; cursor:pointer; transition:all .15s; }
.comodin-assign-btn:hover { background:#ede9fe; }
.shift-bar-comodin { border-style:dashed !important; opacity:.8; }
.turno-comodin { background:#ede9fe !important; color:#6d28d9 !important; }

/* ── FTE HISTORY CHART ───────────────────────────────── */
.eff-history-panel { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:28px 32px; margin-bottom:40px; box-shadow:var(--shadow-sm); }
.eff-history-chart { display:flex; align-items:flex-end; gap:12px; height:200px; margin:20px 0 6px; overflow-x:auto; padding-bottom:4px; }
.eff-bar-col { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:52px; }
.eff-bar-val { font-size:0.72rem; font-weight:700; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.eff-bar-track-v { flex:1; width:38px; background:var(--bg); border-radius:6px; overflow:hidden; display:flex; align-items:flex-end; }
.eff-bar-fill { width:100%; border-radius:6px; background:var(--accent); opacity:.6; transition:height .4s ease; }
.eff-bar-fill.current { opacity:1; }
.eff-bar-month { font-size:0.72rem; color:var(--text-muted); white-space:nowrap; }
.eff-bar-month.current { color:var(--accent); font-weight:700; }

/* ── LOGIN ───────────────────────────────────────────── */
.login-screen { min-height:100dvh; display:flex; align-items:center; justify-content:center; background:var(--sidebar-bg); padding:20px; }
.login-card { background:var(--bg-card); border-radius:16px; padding:36px 40px; width:100%; max-width:380px; box-shadow:0 24px 80px rgba(0,0,0,.3); }
.login-logo { display:flex; align-items:center; gap:14px; margin-bottom:32px; }
.login-logo-icon { width:52px; height:52px; background:var(--accent); border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0; }
.login-brand { font-size:1.15rem; font-weight:700; letter-spacing:-.02em; }
.login-brand-sub { font-size:0.75rem; color:var(--text-muted); margin-top:2px; }
.login-form { display:flex; flex-direction:column; gap:16px; }
.login-btn { width:100%; justify-content:center; padding:11px; font-size:0.95rem; margin-top:4px; }
.login-error { display:flex; align-items:center; gap:8px; padding:10px 14px; background:#fee2e2; border:1px solid #fecaca; border-radius:8px; font-size:0.82rem; color:#b91c1c; font-weight:500; }
.login-footer { text-align:center; font-size:0.75rem; color:var(--text-muted); margin-top:20px; }
.input-error { border-color:#f87171 !important; background:#fff5f5 !important; }

/* ── USER BADGE ──────────────────────────────────────── */
.user-badge-wrap { position:relative; cursor:pointer; }
.user-badge { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:9px; transition:background .15s; }
.user-badge:hover { background:rgba(255,255,255,.08); }
.user-avatar { width:30px; height:30px; border-radius:7px; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:0.68rem; font-weight:700; flex-shrink:0; }
.user-avatar.sm { width:26px; height:26px; border-radius:6px; font-size:0.62rem; }
.user-info { flex:1; min-width:0; }
.user-name { font-size:0.8rem; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-rol  { font-size:0.68rem; color:var(--sidebar-text); }
.user-dropdown { position:absolute; bottom:calc(100% + 6px); left:0; right:0; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow); z-index:200; padding:12px; }
.user-dropdown-name { font-size:0.82rem; font-weight:700; }
.user-dropdown-rol  { font-size:0.72rem; color:var(--text-muted); margin-bottom:8px; }
.user-dropdown-divider { height:1px; background:var(--border); margin:8px 0; }
.user-dropdown-btn { display:flex; align-items:center; gap:8px; width:100%; padding:7px 8px; border:none; background:transparent; border-radius:6px; font-size:0.82rem; color:var(--danger); cursor:pointer; font-family:inherit; font-weight:500; }
.user-dropdown-btn:hover { background:#fee2e2; }

/* ── ADMIN ───────────────────────────────────────────── */
.badge-me { display:inline-flex; align-items:center; margin-left:6px; padding:1px 7px; border-radius:4px; font-size:0.68rem; font-weight:700; background:var(--accent-light); color:var(--accent); }
.rol-badge { display:inline-flex; align-items:center; padding:2px 9px; border-radius:5px; font-size:0.73rem; font-weight:600; }
.rol-badge.admin { background:#ede9fe; color:#6d28d9; }
.rol-badge.user  { background:var(--bg); color:var(--text-muted); border:1px solid var(--border); }
.row-inactive td { opacity:.5; }
.row-inactive:hover td { opacity:.8; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0 !important; }
  #topbar { display: flex; }
  #bottom-nav { display: block; }
  .view-container { padding: 12px 14px 88px; }
  .view-header { margin-bottom: 14px; }
  .desktop-only { display: none !important; }
  .dash-stats-grid { grid-template-columns: 1fr 1fr; }
  .dash-stats-3 { grid-template-columns: 1fr 1fr !important; }
  .dash-cols { grid-template-columns: 1fr; }
  .inv-summary-grid { grid-template-columns: 1fr 1fr; }
  .eff-summary { grid-template-columns: 1fr; }
  .vac-layout { grid-template-columns: 1fr; }
  .vac-calendar-panel { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .form-span2 { grid-column: 1; }
  .modal { max-width: 100%; border-radius: 14px; }
  /* Cuadrante: en móvil el grid hace scroll horizontal (NO se oculta) */
  .schedule-bleed { margin-left: -14px; margin-right: -14px; }
  .pay-cal-layout { grid-template-columns:1fr; }
  .pay-cal-panel { position:static; }
  /* Dashboard stat cards en móvil */
  .stat-card { padding: 14px 16px; }
  .stat-card-icon { margin-bottom: 6px; }
  .stat-card-val { font-size: 1.4rem; }
  .stat-card-label { font-size: 0.75rem; }
  .stat-card-sub { font-size: 0.7rem; }
  /* Working items más cómodos */
  .working-item { padding: 10px 12px; }
  .working-name { font-size: 0.95rem; }
  /* Cuadrante móvil */
  .date-nav { gap: 6px; }
}
@media (min-width: 901px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 600px) {
  .inv-card { flex-direction: column; }
  .inv-card-actions { justify-content: flex-end; }
  .inv-summary-grid { grid-template-columns: 1fr 1fr; }
  /* Dashboard: 3ª card en segunda fila queda a ancho completo */
  .dash-stats-3 .stat-card:last-child:nth-child(odd) { grid-column: span 2; }
  /* Cuadrante: sección toggle compacta */
  .cuad-toggle-row { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }
}

/* ── SPINNER ─────────────────────────────────────────── */
.spinner { display:inline-block; width:20px; height:20px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-overlay { display:flex; align-items:center; justify-content:center; padding:60px; }
.loading-overlay .spinner { width:32px; height:32px; border-color:var(--border); border-top-color:var(--accent); }
