*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #1B3A5C; --primary-light: #2a5580; --gold: #F4BC18;
  --bg: #f0f4f8; --surface: #fff; --border: #d0dae6;
  --text: #1a2a3a; --muted: #6b7c93; --radius: 10px;
  --font: 'Segoe UI', system-ui, sans-serif;
  --pendiente: #e67e22; --confirmado: #2ecc71; --completado: #3498db; --cancelado: #e74c3c;
  --danger: #dc3545;
}
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Topbar ── */
.topbar {
  background: var(--primary); color: white; padding: 0 1.5rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.topbar-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.topbar-user { opacity: 0.85; }
.role-badge { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 10px; background: rgba(244,188,24,0.25); color: var(--gold); border: 1px solid rgba(244,188,24,0.4); text-transform: uppercase; letter-spacing: 0.5px; }
.btn-logout { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 0.35rem 0.9rem; border-radius: 6px; cursor: pointer; font-size: 0.82rem; font-family: inherit; transition: background 0.18s; }
.btn-logout:hover { background: rgba(255,255,255,0.22); }

/* ── Tabs ── */
.tab-nav { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; padding: 0 1.5rem; }
.tab-btn { padding: 0.85rem 1.25rem; font-size: 0.88rem; font-weight: 600; color: var(--muted); background: none; border: none; border-bottom: 2.5px solid transparent; cursor: pointer; font-family: inherit; transition: all 0.15s; margin-bottom: -1px; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.dash-pill { padding:0.32rem 0.95rem; border-radius:20px; border:1.5px solid var(--border); background:transparent; cursor:pointer; font-size:0.82rem; font-weight:600; color:var(--muted); font-family:inherit; transition:all 0.15s; }
.dash-pill:hover { border-color:var(--primary); color:var(--primary); }
.dash-pill.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ── Stats cards ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-box { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; border-left: 4px solid var(--primary); box-shadow: 0 1px 6px rgba(27,58,92,0.07); }
.stat-box.pendiente { border-color: var(--pendiente); }
.stat-box.confirmado { border-color: var(--confirmado); }
.stat-box.completado { border-color: var(--completado); }
.stat-box.cancelado  { border-color: var(--cancelado); }
.stat-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); line-height: 1.1; margin-top: 2px; }

/* ── Filters ── */
.filters { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.25rem; box-shadow: 0 1px 6px rgba(27,58,92,0.07); }
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.filter-group select, .filter-group input[type=date], .filter-group input[type=text] { padding: 0.45rem 0.75rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: 0.88rem; font-family: inherit; background: white; outline: none; min-width: 130px; }
.filter-group select:focus, .filter-group input:focus { border-color: var(--primary); }
.filter-group input[type=text] { min-width: 180px; }
.btn-primary { padding: 0.45rem 1.1rem; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.88rem; font-family: inherit; font-weight: 600; transition: background 0.18s; align-self: flex-end; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { padding: 0.45rem 0.8rem; background: transparent; color: var(--muted); border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-family: inherit; transition: all 0.18s; align-self: flex-end; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── Table ── */
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 6px rgba(27,58,92,0.07); overflow: hidden; }
.table-header { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.table-header h2 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.table-header-right { display: flex; align-items: center; gap: 0.5rem; }
.table-count { font-size: 0.82rem; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { background: #f5f8fc; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.tbl td { padding: 0.75rem 1rem; border-bottom: 1px solid #edf1f7; font-size: 0.88rem; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f9fbfd; }
.badge { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: capitalize; }
.badge-pendiente  { background: #fef3e2; color: #c0622a; }
.badge-confirmado { background: #e6f9f0; color: #1a8049; }
.badge-completado { background: #e8f4fd; color: #1a6099; }
.badge-cancelado  { background: #fde8e8; color: #b22222; }
.badge-whatsapp   { background: #e8f7f0; color: #1a6644; }
.badge-web        { background: #eef2ff; color: #3344aa; }
.badge-superadmin { background: #fff8e1; color: #b8860b; }
.badge-admin      { background: #e8f4fd; color: #1a6099; }
.badge-operador   { background: #f0f4f8; color: #6b7c93; }
.btn-action { padding: 0.25rem 0.6rem; border-radius: 5px; font-size: 0.78rem; border: 1px solid var(--border); background: white; cursor: pointer; font-family: inherit; transition: all 0.15s; margin-right: 3px; }
.btn-action:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-action.danger:hover { background: var(--danger); border-color: var(--danger); color: white; }
.btn-action.confirm { color: #1a8049; border-color: #2ecc71; }
.btn-action.confirm:hover { background: #2ecc71; border-color: #2ecc71; color: white; }
.btn-action.complete { color: #1a6099; border-color: #3498db; }
.btn-action.complete:hover { background: #3498db; border-color: #3498db; color: white; }

/* ── Empty / loading ── */
.table-empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 1rem; border-top: 1px solid var(--border); }
.page-btn { padding: 0.35rem 0.75rem; border: 1.5px solid var(--border); border-radius: 6px; background: white; cursor: pointer; font-family: inherit; font-size: 0.85rem; transition: all 0.15s; }
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-info { font-size: 0.82rem; color: var(--muted); }

/* ── Agenda week view ── */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.day-card { background: var(--surface); border-radius: var(--radius); padding: 1rem 0.75rem; text-align: center; cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 6px rgba(27,58,92,0.07); transition: all 0.15s; }
.day-card:hover { border-color: var(--primary); }
.day-card.today { border-color: var(--gold); background: #fffbee; }
.day-card.selected { border-color: var(--primary); background: #eef3f8; }
.day-name { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.day-num  { font-size: 1.4rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.day-count { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-top: 3px; }
.day-count.has-turns { color: var(--primary); }

/* ── Stats charts ── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.chart-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: 0 1px 6px rgba(27,58,92,0.07); }
.chart-card h3 { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 1rem; }
.chart-bar-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; font-size: 0.82rem; }
.chart-bar-label { width: 100px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.chart-bar-track { flex: 1; background: #eef2f7; border-radius: 4px; height: 10px; }
.chart-bar-fill { height: 10px; border-radius: 4px; background: var(--primary); min-width: 3px; transition: width 0.4s; }
.chart-bar-val { font-weight: 700; color: var(--primary); width: 28px; text-align: right; flex-shrink: 0; }
.trend-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #f0f4f8; font-size: 0.88rem; }
.trend-row:last-child { border-bottom: none; }
.trend-up   { color: #1a8049; font-weight: 700; }
.trend-down { color: #b22222; font-weight: 700; }
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 60px; margin-top: 0.75rem; }
.spark-bar { flex: 1; background: var(--primary); border-radius: 2px 2px 0 0; opacity: 0.65; min-height: 2px; transition: height 0.3s; }
.spark-bar:hover { opacity: 1; }
.stat-sub { font-size: 0.7rem; color: var(--muted); margin-top: 3px; font-weight: 400; }
.chart-bar-pct { font-size: 0.7rem; color: var(--muted); width: 34px; text-align: right; flex-shrink: 0; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: white; border-radius: var(--radius); box-shadow: 0 8px 48px rgba(0,0,0,0.22); width: 100%; max-width: 480px; padding: 1.75rem; transform: translateY(10px); transition: transform 0.18s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 1.25rem; }
.modal-field { margin-bottom: 1rem; }
.modal-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.modal-field select, .modal-field textarea, .modal-field input { width: 100%; padding: 0.5rem 0.75rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: 0.9rem; font-family: inherit; outline: none; }
.modal-field select:focus, .modal-field textarea:focus, .modal-field input:focus { border-color: var(--primary); }
.modal-field textarea { resize: vertical; min-height: 80px; }
.modal-field small { font-size: 0.78rem; color: var(--muted); margin-top: 3px; display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }
.btn-save { padding: 0.55rem 1.25rem; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 0.9rem; transition: background 0.18s; }
.btn-save:hover { background: var(--primary-light); }
.btn-cancel-modal { padding: 0.55rem 1rem; background: transparent; border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 0.9rem; transition: all 0.18s; }
.btn-cancel-modal:hover { border-color: var(--primary); color: var(--primary); }
.modal-error { color: var(--danger); font-size: 0.82rem; margin-top: 0.5rem; display: none; }
.modal-error.show { display: block; }
.detail-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.88rem; }
.detail-row strong { color: var(--muted); min-width: 120px; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.3px; }

.stat-clickable { cursor: pointer; transition: transform 0.13s, box-shadow 0.13s; }
.stat-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(27,58,92,0.14); }
.stat-clickable.active-filter { outline: 2px solid var(--primary); }

@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr 1fr; } .week-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .stats-row { grid-template-columns: repeat(2, 1fr); } .tbl th:nth-child(4), .tbl td:nth-child(4), .tbl th:nth-child(5), .tbl td:nth-child(5) { display: none; } .stats-grid { grid-template-columns: 1fr; } }

/* ── Agenda sub-nav ── */
.agenda-sub-nav { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.agenda-sub-btn { padding: 0.45rem 1.1rem; background: white; border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-family: inherit; font-weight: 600; color: var(--muted); transition: all 0.15s; }
.agenda-sub-btn:hover { border-color: var(--primary); color: var(--primary); }
.agenda-sub-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Calendar nav bar (shared by month & year) ── */
.cal-nav { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: var(--radius); padding: 0.9rem 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 6px rgba(27,58,92,0.07); }
.cal-nav-title { font-size: 1rem; font-weight: 700; color: var(--primary); }
.cal-nav-btn { background: none; border: 1.5px solid var(--border); border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 1.2rem; color: var(--primary); display: flex; align-items: center; justify-content: center; transition: all 0.15s; line-height: 1; }
.cal-nav-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Monthly calendar grid ── */
.cal-grid-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 6px rgba(27,58,92,0.07); overflow: hidden; margin-bottom: 1.25rem; }
.cal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); background: #f5f8fc; border-bottom: 1px solid var(--border); }
.cal-dow { text-align: center; padding: 0.6rem 0; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 70px; padding: 0.5rem 0.6rem; border-bottom: 1px solid #edf1f7; border-right: 1px solid #edf1f7; cursor: pointer; transition: background 0.12s; }
.cal-cell:hover:not(.other-month) { background: #f0f4f8; }
.cal-cell.other-month { background: #fafbfc; cursor: default; border-color: #f3f5f8; }
.cal-cell.today { background: #fffbee; }
.cal-cell.today .cal-day-num { color: #b8860b; font-weight: 800; }
.cal-cell.selected { background: #eef3f8; outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-day-num { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.cal-cell.other-month .cal-day-num { color: #c0cfe0; }
.cal-day-count { font-size: 0.7rem; font-weight: 700; color: white; background: var(--primary); border-radius: 10px; padding: 1px 6px; display: inline-block; margin-top: 4px; }

/* ── Annual grid ── */
.year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.month-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center; cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 6px rgba(27,58,92,0.07); transition: all 0.15s; }
.month-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(27,58,92,0.12); }
.month-card.current-month { border-color: var(--gold); background: #fffbee; }
.month-name { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 0.4rem; }
.month-count { font-size: 1.9rem; font-weight: 800; line-height: 1; color: #c0cfe0; }
.month-card.has-turns .month-count { color: var(--primary); }
.month-label { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

@media (max-width: 900px) { .year-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Productos ── */
.badge-kit       { background: #fff3e0; color: #e65100; }
.badge-repuesto  { background: #fce4ec; color: #ad1457; }
.badge-servicio  { background: #e8f5e9; color: #2e7d32; }
.badge-accesorio { background: #e3f2fd; color: #1565c0; }
.stock-bajo { color: var(--danger); font-weight: 700; }
.stock-nav-badge { display:inline-flex; align-items:center; justify-content:center; background:var(--danger); color:#fff; font-size:0.65rem; font-weight:700; border-radius:10px; min-width:1.15rem; height:1.15rem; padding:0 0.25rem; margin-left:0.35rem; vertical-align:middle; }

/* ── Cuenta Corriente ── */
.saldo-debe  { color: var(--danger); font-weight: 700; }
.saldo-favor { color: #1a8049; font-weight: 700; }
.badge-debito  { background: #fde8e8; color: #b22222; }
.badge-credito { background: #e6f9f0; color: #1a8049; }
.badge-anulado { background: #f0f0f0; color: #999; }
.cc-back-btn { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: 1.5px solid var(--border); border-radius: 6px; padding: 0.4rem 0.85rem; cursor: pointer; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--muted); transition: all 0.15s; margin-bottom: 1rem; }
.cc-back-btn:hover { border-color: var(--primary); color: var(--primary); }
.saldo-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 1px 6px rgba(27,58,92,0.07); display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.saldo-card-name { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.saldo-card-info { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.saldo-card-amount { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.saldo-card-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }

/* ── Clientes ── */
.client-found-strip { display:flex; align-items:center; gap:0.6rem; background:#e6f9f0; border:1.5px solid #2ecc71; border-radius:6px; padding:0.45rem 0.85rem; font-size:0.85rem; color:#1a8049; font-weight:600; margin-bottom:0.85rem; }
.client-found-strip .cf-clear { margin-left:auto; background:none; border:none; cursor:pointer; font-size:1rem; color:#1a8049; line-height:1; padding:0 2px; }
.dni-search-row { display:flex; gap:0.5rem; }
.dni-search-row input { flex:1; }
.btn-lookup { padding:0.5rem 1rem; background:#f0f4f8; border:1.5px solid var(--border); border-radius:6px; cursor:pointer; font-family:inherit; font-size:0.85rem; font-weight:600; transition:all 0.15s; white-space:nowrap; }
.btn-lookup:hover { background:var(--primary); color:white; border-color:var(--primary); }
.badge-cliente { background:#e8f7f0; color:#1a6644; }

@media (max-width: 600px) {
  .year-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-cell { min-height: 48px; padding: 0.3rem; }
  .cal-day-num { font-size: 0.78rem; }
}

/* ══ MOBILE ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  /* Topbar */
  .topbar { padding: 0 0.9rem; height: 52px; }
  .topbar-user { display: none; }
  .topbar-brand span { font-size: 0.85rem; }

  /* Tabs — scrollable */
  .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 0.5rem; }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; padding: 0.7rem 0.9rem; font-size: 0.8rem; }

  /* Container */
  .container { padding: 0.9rem 0.75rem; }

  /* Stats */
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
  .stat-value { font-size: 1.45rem; }
  .stat-box { padding: 0.8rem 1rem; }

  /* Filters — apilados */
  .filters { flex-direction: column; gap: 0.55rem; padding: 0.85rem; }
  .filter-group { width: 100%; }
  .filter-group select,
  .filter-group input[type=date],
  .filter-group input[type=text] { width: 100%; min-width: unset; font-size: 1rem; padding: 0.55rem 0.75rem; }
  .filters .btn-primary,
  .filters .btn-secondary { width: 100%; padding: 0.6rem; font-size: 0.9rem; }

  /* Table header */
  .table-header { flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem; }
  .table-header h2 { font-size: 0.9rem; }
  .table-header-right { gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
  #btnNuevoTurno { order: -1; }

  /* Tabla → tarjetas */
  .tbl { display: block; }
  .tbl thead { display: none; }
  .tbl tbody { display: block; padding: 0.5rem 0.75rem; }
  .tbl tr {
    display: block;
    background: white;
    margin-bottom: 0.65rem;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(27,58,92,0.06);
  }
  .tbl tr:hover td { background: transparent; }
  .tbl td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f4f8;
    font-size: 0.85rem;
    text-align: right;
    gap: 0.5rem;
  }
  .tbl td:last-child { border-bottom: none; padding-top: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
  .tbl td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .tbl td:last-child::before { display: none; }
  .btn-action { padding: 0.4rem 0.75rem; font-size: 0.82rem; }

  /* Paginación */
  .page-btn { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

  /* Modals — bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 18px 18px 0 0;
    max-height: 92dvh;
    overflow-y: auto;
    transform: translateY(100%);
    width: 100%;
    max-width: 100%;
    padding: 1.25rem 1rem 2rem;
  }
  .modal-overlay.open .modal { transform: translateY(0); }
  /* Grids dentro del modal → 1 columna */
  .modal div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .modal-field select,
  .modal-field input,
  .modal-field textarea { font-size: 1rem; padding: 0.6rem 0.75rem; }
  .btn-save, .btn-cancel-modal { padding: 0.65rem 1.1rem; font-size: 0.95rem; }

  /* Agenda sub-nav */
  .agenda-sub-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .agenda-sub-nav::-webkit-scrollbar { display: none; }
  .agenda-sub-btn { white-space: nowrap; padding: 0.5rem 1rem; }

  /* Week grid compacto */
  .week-grid { gap: 0.3rem; }
  .day-card { padding: 0.55rem 0.25rem; }
  .day-num { font-size: 1.15rem; }
  .day-name { font-size: 0.62rem; }
  .day-count { font-size: 0.62rem; }

  /* Cal nav */
  .cal-nav, .year-nav { padding: 0.7rem 1rem; }
}
