:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --accent: #0f766e;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45; font-size: 14px;
}

/* Login */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.login-card {
  background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 440px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.35);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.login-brand h1 { font-size: 20px; font-weight: 800; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: #334155; }
.login-form input { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
.full-btn { width: 100%; padding: 11px; font-size: 14px; margin-top: 4px; }
.login-error { background: var(--danger-bg); color: var(--danger); padding: 8px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.demo-accounts-box { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; font-size: 12px; color: var(--muted); }
.demo-accounts-box summary { cursor: pointer; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.demo-btn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }

/* Topbar */
.topbar {
  background: #0f172a; color: #fff; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #14b8a6);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.brand-logo.lg { width: 46px; height: 46px; font-size: 18px; }
.brand h1 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand-sub { font-size: 11px; color: #94a3b8; }
.badge-accent { background: rgba(20,184,166,0.22); color: #5eead4; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }

.nav-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  background: transparent; color: #cbd5e1; border: none; padding: 7px 11px;
  border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 12.5px; transition: all 0.15s;
}
.tab-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tab-btn.active { background: #2563eb; color: #fff; }

.topbar-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.seller-filter-select {
  background: #1e293b; color: #fff; border: 1px solid #334155; border-radius: 8px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
}

/* Notifications */
.notif-wrap { position: relative; }
.notif-btn { position: relative; padding: 6px 10px !important; }
.notif-badge {
  background: #ef4444; color: #fff; border-radius: 99px; padding: 1px 6px; font-size: 11px; font-weight: 800;
}
.notif-dropdown {
  position: absolute; right: 0; top: 42px; width: 370px; max-height: 440px; overflow-y: auto;
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 18px 36px rgba(0,0,0,0.25); z-index: 90; padding: 12px;
}
.notif-item { padding: 8px; border-bottom: 1px solid var(--border); font-size: 12px; cursor: pointer; border-radius: 6px; }
.notif-item:hover { background: #f1f5f9; }

/* Buttons */
.btn {
  border: none; border-radius: 8px; padding: 7px 13px; font-weight: 600; font-size: 12.5px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-sm { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #0f766e; color: #fff; }
.btn-secondary:hover { background: #115e59; }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; }
.btn-ghost-dark { background: #e2e8f0; color: #0f172a; }
.modal .btn-ghost { background: #e2e8f0; color: var(--text); }
.btn-danger-outline { background: transparent; border: 1px solid #ef4444; color: #b91c1c; }
.btn-danger-outline:hover { background: #fee2e2; }

/* Layout */
.main-content { max-width: 1500px; margin: 18px auto; padding: 0 18px 40px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.kpi-value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-calendar { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
@media (max-width: 1024px) { .grid-calendar { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 10px; }
.card-header h2 { font-size: 15.5px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.subhead { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.divider { border-top: 1px solid var(--border); margin: 14px 0; }

/* Traffic light dots & highlighted rows */
.tl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.tl-dot.green { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.tl-dot.yellow { background: #d97706; box-shadow: 0 0 0 3px #fef3c7; }
.tl-dot.red { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
tr.row-red td { background: #fef2f2 !important; }
tr.row-yellow td { background: #fffbeb !important; }

/* Funnel & Monthly Bars */
.funnel-list { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 175px 1fr 120px; align-items: center; gap: 10px; }
.funnel-stage-name { font-weight: 600; font-size: 12.5px; }
.funnel-bar-bg { background: #f1f5f9; border-radius: 6px; height: 23px; overflow: hidden; }
.funnel-bar-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; padding-left: 8px; color: #fff; font-size: 11px; font-weight: 700; }
.funnel-amount { text-align: right; font-weight: 700; font-size: 12.5px; }

.monthly-bars { display: flex; align-items: flex-end; gap: 10px; height: 215px; padding-top: 14px; overflow-x: auto; }
.month-col { flex: 1; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.month-stack { width: 40px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; background: #f1f5f9; }
.bar-new { background: #3b82f6; }
.bar-rec { background: #0f766e; }
.month-lbl { font-size: 11px; font-weight: 700; }
.month-val { font-size: 11px; color: var(--muted); text-align: center; }
.legend-inline { display: flex; gap: 14px; font-size: 12px; margin-bottom: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; padding: 8px 9px; background: var(--surface-2); border-bottom: 2px solid var(--border); font-size: 11px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
td { padding: 8px 9px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill-green { background: var(--success-bg); color: var(--success); }
.pill-amber { background: var(--warning-bg); color: var(--warning); }
.pill-red { background: var(--danger-bg); color: var(--danger); }
.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-slate { background: #e2e8f0; color: #334155; }
.badge-danger { background: var(--danger); color: #fff; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }

/* Toolbar & Kanban */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-filters { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.toolbar-filters input, .toolbar-filters select { padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 12.5px; min-width: 175px; }
.toolbar-legend { display: flex; gap: 10px; align-items: center; font-size: 12px; font-weight: 600; }

.kanban-board { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { background: #e8edf3; border-radius: var(--radius); padding: 9px; min-height: 460px; display: flex; flex-direction: column; gap: 8px; }
.kanban-col-header { padding-bottom: 7px; border-bottom: 2px solid #cbd5e1; }
.kanban-col-title { font-size: 12.5px; font-weight: 700; }
.kanban-col-sum { font-size: 11px; color: var(--muted); font-weight: 600; }

.deal-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px; display: flex; flex-direction: column; gap: 4px; }
.deal-card.tl-red { border-left: 4px solid #dc2626; background: #fffafa; }
.deal-card.tl-yellow { border-left: 4px solid #d97706; }
.deal-card.tl-green { border-left: 4px solid #16a34a; }
.deal-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.deal-title { font-weight: 700; font-size: 12.5px; }
.deal-company { font-size: 11.5px; color: #334155; }
.deal-ticket { font-size: 14px; font-weight: 800; }
.deal-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.deal-actions { display: flex; gap: 5px; margin-top: 4px; }

/* Calendar */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 70px; border: 1px solid var(--border); border-radius: 6px; padding: 5px;
  background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.cal-cell:hover { border-color: var(--primary); }
.cal-cell.today { border: 2px solid var(--primary); background: #eff6ff; }
.cal-cell.selected { background: #dbeafe; }
.cal-day-num { font-size: 11.5px; font-weight: 700; }
.cal-chip { font-size: 10px; padding: 1px 4px; border-radius: 4px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.overdue { background: var(--danger-bg); color: var(--danger); }
.cal-chip.task { background: #dbeafe; color: #1e40af; }
.cal-chip.act { background: var(--success-bg); color: var(--success); }
.cal-day-detail { margin-top: 12px; padding: 10px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border); }

.todo-item {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.todo-item.overdue { border-left: 4px solid #dc2626; background: #fef2f2; }
.todo-item.today { border-left: 4px solid #d97706; background: #fffbeb; }
.todo-item.done { opacity: 0.65; background: #f8fafc; }

/* Client 360 Subtabs */
.detail-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-tab-btn { background: #f1f5f9; border: none; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 12px; cursor: pointer; }
.detail-tab-btn.active { background: var(--primary); color: #fff; }
.detail-pane { display: none; }
.detail-pane.active { display: block; }

.lan-banner { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px; font-size: 12.5px; }
.lan-url { font-family: monospace; font-size: 15px; font-weight: 800; color: #1d4ed8; margin-top: 4px; }

/* Modals & Forms */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.58); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-backdrop.hidden { display: none; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.28); }
.modal-sm { max-width: 460px; }
.modal-lg { max-width: 960px; }
.modal-header { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.form-grid.single-col { grid-template-columns: 1fr; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #334155; }
.form-grid label.full-width { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 13px; font-family: inherit; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 8px !important; margin-top: 6px; }
.form-section-title { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; z-index: 200; }
.toast.hidden { display: none; }
.hidden { display: none !important; }

/* Helpers Desktop vs Móvil (iOS & Android) */
.tab-btn { display: inline-flex; align-items: center; gap: 5px; }
.tab-ico { font-size: 13px; line-height: 1; }
.kanban-stage-pills { display: none; }
.mobile-only-cards { display: none; }

/* Proyección Mensual Separada (Nuevos vs Recurrentes vs Cuota) */
.proj-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.proj-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.proj-box.new-clients { border-top: 4px solid #2563eb; }
.proj-box.rec-clients { border-top: 4px solid #0f766e; }
.proj-box.total-month { border-top: 4px solid #0f172a; background: #fff; }
.proj-box-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; display: flex; justify-content: space-between; align-items: center; }
.proj-metric-row { display: flex; justify-content: space-between; font-size: 12.5px; color: #334155; }
.proj-metric-row strong { color: #0f172a; }
.progress-track { width: 100%; height: 9px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; transition: width 0.3s; }
.progress-fill.ok { background: #16a34a; }
.progress-fill.warn { background: #d97706; }
.progress-fill.low { background: #dc2626; }
.quota-input { width: 120px; padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: right; font-weight: 700; font-size: 13px; }
tr.row-company-total td { background: #eff6ff !important; font-weight: 700; border-top: 2px solid #93c5fd; }

/* ==================== OPTIMIZACIÓN MÓVIL (iOS Safari & Android Chrome) ==================== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }

  /* Evita el auto-zoom molesto en iOS Safari al enfocar inputs/selects */
  input, select, textarea {
    font-size: 16px !important;
    min-height: 44px;
  }
  textarea { min-height: 76px; }
  .btn, button { min-height: 40px; }
  .btn-sm { min-height: 36px; padding: 6px 10px; font-size: 12px; }

  /* Topbar compacto arriba + barra de navegación fija abajo para el pulgar */
  .topbar {
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    gap: 8px;
  }
  .brand-logo { width: 32px; height: 32px; font-size: 12px; }
  .brand h1 { font-size: 14px; }
  .brand-sub { font-size: 10.5px; max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .topbar-actions {
    width: 100%;
    display: flex;
    gap: 6px;
    justify-content: space-between;
  }
  .seller-filter-select {
    width: 100%;
    order: -1;
    flex-basis: 100%;
    min-height: 40px;
    font-size: 14px !important;
  }
  #btnNewClient, #btnNewQuote { flex: 1; padding: 8px 10px; font-size: 13px; }

  /* Bottom Navigation Bar estilo App Nativa iOS/Android */
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: #0f172a;
    border-top: 1px solid #334155;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    flex-wrap: nowrap;
    gap: 2px;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.25);
  }
  .tab-btn {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px;
    min-height: 46px;
    border-radius: 8px;
    font-size: 10px;
    color: #94a3b8;
  }
  .tab-ico { font-size: 17px; }
  .tab-lbl { font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; }
  .tab-btn.active { background: rgba(37, 99, 235, 0.25); color: #ffffff; }

  /* Espacio inferior para que el bottom bar no tape el contenido ni el toast */
  .main-content {
    margin: 12px auto;
    padding: 0 10px calc(86px + env(safe-area-inset-bottom));
  }
  .toast {
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    text-align: center;
  }

  /* Notificaciones sin desbordar pantalla */
  .notif-dropdown {
    position: fixed;
    top: 62px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 70vh;
  }

  /* Grids y KPIs */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card { padding: 10px 12px; }
  .kpi-value { font-size: 18px; }
  .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 12px; margin-bottom: 12px; }
  .card-header { flex-direction: column; gap: 6px; }

  /* Embudo compacto */
  .funnel-row { grid-template-columns: 1fr auto; gap: 6px; }
  .funnel-stage-name { grid-column: 1 / 2; font-size: 12px; }
  .funnel-amount { grid-column: 2 / 3; grid-row: 1; font-size: 12px; }
  .funnel-bar-bg { grid-column: 1 / -1; height: 20px; }

  /* Tablas con scroll táctil fluido */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .desktop-only-table { display: none; }
  .mobile-only-cards { display: flex; flex-direction: column; gap: 10px; }
  .mobile-client-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .mobile-client-card.tl-red { border-left: 5px solid #dc2626; background: #fffafa; }
  .mobile-client-card.tl-yellow { border-left: 5px solid #d97706; background: #fffdf5; }
  .mobile-client-card.tl-green { border-left: 5px solid #16a34a; }
  .mcc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .mcc-actions { display: flex; gap: 6px; }
  .mcc-actions .btn { flex: 1; }

  /* Filtros apilados */
  .toolbar-filters { flex-direction: column; width: 100%; }
  .toolbar-filters input, .toolbar-filters select { width: 100%; min-width: 0; }

  /* Kanban con Scroll Snap horizontal + píldoras de salto rápido */
  .kanban-stage-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .stage-pill-btn {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    min-height: 34px;
  }
  .stage-pill-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
  .kanban-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col {
    flex: 0 0 85vw;
    min-height: 380px;
    scroll-snap-align: center;
  }

  /* Calendario compacto en móvil */
  .cal-cell { min-height: 50px; padding: 3px; }
  .cal-day-num { font-size: 11px; }
  .cal-chip { font-size: 9px; padding: 1px 2px; }

  /* Formularios en 1 columna y Modales Bottom-Sheet */
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal-sm, .modal-lg {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-header { position: sticky; top: 0; background: #fff; z-index: 5; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
  .detail-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .detail-tab-btn { flex: 0 0 auto; min-height: 36px; }
}
