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

:root {
    --primary: #001D85;
    --primary-light: #173599;
    --success: #A5DB6D;
    --alert: #E8A090;
    --accent: #A6C8E9;
    --bg: #F7F9FF;
    --text: #1B2552;
    --text-light: #7180A0;
    --border: #E0E7F4;
    --red: #dc2626;
    --orange: #ea580c;
    --yellow: #f59e0b;
    --yellow-light: #fbbf24;
    --green: #86efac;
    --gray: #d1d5db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: white;
    line-height: 1.6;
}

body {
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    margin-bottom: 12px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

/* Banda de marca */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-title {
    display: flex;
    flex-direction: column;
}

.navbar-title h1 {
    margin: 0;
    color: white;
    font-size: 1.8rem;
}

.navbar-title .tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    font-family: 'Poppins', sans-serif;
}

.navbar-date {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Contenedor principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Grid de tarjetas */
.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Tarjeta KPI */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kpi-card {
    text-align: center;
    padding: 30px 20px;
}

.kpi-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 10px 0;
}

.kpi-card .label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card .unit {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Botones */
button, a.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

button:hover, a.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--primary-light);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-alert {
    background: var(--alert);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
}

/* Formularios */
input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--bg);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 90, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.form-group.hidden {
    display: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Tabla */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #f5f5f5;
    border-bottom: 2px solid var(--border);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: #fafafa;
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-red {
    background: #fee2e2;
    color: var(--red);
    border-left: 4px solid var(--red);
}

.alert-orange {
    background: #fed7aa;
    color: var(--orange);
    border-left: 4px solid var(--orange);
}

.alert-yellow {
    background: #fef08a;
    color: #92400e;
    border-left: 4px solid var(--yellow);
}

.alert-green {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid var(--green);
}

/* Chips */
.chip {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Badge de alerta */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.falta_codigo { background: #fee2e2; color: var(--red); }
.badge.falta_fecha { background: #fed7aa; color: var(--orange); }
.badge.sin_contacto { background: #fef9e7; color: #d97706; }
.badge.vencido { background: #fecaca; color: var(--red); }
.badge.hoy { background: #fef08a; color: #92400e; }
.badge.en_fecha { background: #dcfce7; color: #166534; }
.badge.cerrado { background: #f3f4f6; color: #6b7280; }

/* Modo llamada - botones códigos grandes */
.codigo-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 30px;
}

.codigo-btn {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

.codigo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.codigo-btn.G1 { border-color: var(--primary); color: var(--primary); }
.codigo-btn.G2 { border-color: var(--success); color: var(--success); }
.codigo-btn.G3 { border-color: var(--yellow); color: var(--yellow); }
.codigo-btn.G4 { border-color: var(--primary-light); color: var(--primary-light); }
.codigo-btn.G5 { border-color: #f97316; color: #f97316; }
.codigo-btn.G6 { border-color: var(--accent); color: var(--accent); }
.codigo-btn.G7 { border-color: var(--success); color: var(--success); background: #f0fdf4; }
.codigo-btn.G8 { border-color: var(--gray); color: #6b7280; }

.codigo-btn .shortcut {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* Teléfono grande */
.phone-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.phone-box .phone {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.phone-box .actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.phone-box a {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.phone-box a:hover {
    background: rgba(255,255,255,0.3);
}

/* Gráficos */
canvas {
    max-height: 300px;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 30px;
}

/* Timeline */
.timeline {
    padding: 20px 0;
}

.timeline-item {
    padding-left: 30px;
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid white;
}

.timeline-item .date {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.timeline-item .content {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-small { font-size: 0.9rem; }
.italic { font-style: italic; }
.hidden { display: none; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.p-20 { padding: 20px; }

/* Responsive */
@media (max-width: 768px) {
    body { padding: 10px; }
    .navbar { flex-direction: column; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
    .grid.cols-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .codigo-buttons { grid-template-columns: repeat(2, 1fr); }
}

/* Identidad visual ArmoniQ: manual de marca 2026 */

/* Panel de control: tema claro/oscuro */
.dashboard-page { --dash-bg:#f4f6fb; --surface:#fff; --soft:#f8faff; --side:#fff; --ink:#20263a; --muted:#8790a5; --line:#e9edf5; --blue:#4e7af7; --shadow:0 14px 36px rgba(32,43,74,.08); margin:0; padding:0; min-height:100vh; background:var(--dash-bg); color:var(--ink); }
.dashboard-page.dark-theme { --dash-bg:#111321; --surface:#1b1e2e; --soft:#24283a; --side:#171a29; --ink:#f4f6ff; --muted:#a4abc1; --line:#2b3045; --blue:#7192ff; --shadow:0 14px 36px rgba(0,0,0,.22); }
.dashboard-page .dashboard-shell { display:flex; min-height:100vh; }.dashboard-page .sidebar { width:250px; flex:0 0 250px; display:flex; flex-direction:column; padding:28px 16px 20px; overflow-y:auto; color:var(--ink); background:var(--side); box-shadow:1px 0 0 var(--line); }
.dashboard-page .brand { display:flex; align-items:center; gap:11px; padding:4px 12px 35px; }.dashboard-page .brand-mark { width:31px; height:31px; display:grid; place-items:center; color:#fff; font-size:20px; border-radius:10px; background:linear-gradient(135deg,#5b8cff,#bd56f8); box-shadow:0 6px 14px #8c75ed55; }.dashboard-page .brand strong { display:block; font:700 21px/1 'Quicksand',sans-serif; letter-spacing:-.4px; }.dashboard-page .brand small { display:block; color:var(--muted); font-size:10px; margin-top:4px; letter-spacing:.4px; }
.dashboard-page .sidebar-nav { display:flex; flex-direction:column; gap:4px; }.dashboard-page .nav-label { margin:20px 12px 6px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:1.1px; text-transform:uppercase; }.dashboard-page .nav-label:first-child { margin-top:0; }.dashboard-page .nav-item,.dashboard-page .logout-link { min-height:44px; width:100%; padding:0 12px; border:0; border-radius:10px; display:flex; gap:12px; align-items:center; background:transparent; color:var(--muted); cursor:pointer; font:500 13px 'Poppins',sans-serif; text-align:left; text-decoration:none; transition:.2s ease; }.dashboard-page .nav-item:hover,.dashboard-page .logout-link:hover { transform:none; box-shadow:none; background:var(--soft); color:var(--ink); }.dashboard-page .nav-item.active { background:#eaf0ff; color:#426ce5; font-weight:700; }.dashboard-page.dark-theme .nav-item.active { background:#2a365e; color:#b8c9ff; }.dashboard-page .nav-item-icon { width:19px; font-size:18px; line-height:1; text-align:center; }.dashboard-page .nav-pill { margin-left:auto; padding:3px 7px; color:var(--muted); border-radius:99px; background:var(--soft); font-size:9px; }.dashboard-page .sidebar-footer { margin-top:auto; padding-top:18px; border-top:1px solid var(--line); }.dashboard-page .logout-link { margin-top:4px; }
.dashboard-page .main-content { flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }.dashboard-page .topbar { min-height:108px; padding:25px 42px 19px; display:flex; align-items:center; justify-content:space-between; gap:24px; background:var(--dash-bg); }.dashboard-page .eyebrow,.dashboard-page .card-kicker { margin:0 0 4px; color:var(--muted); font-size:9px; font-weight:700; letter-spacing:1.15px; }.dashboard-page .topbar h1 { margin:0; color:var(--ink); font:700 27px/1.15 'Quicksand',sans-serif; letter-spacing:-.6px; }.dashboard-page .topbar-actions { display:flex; align-items:center; gap:15px; }.dashboard-page .theme-switcher { display:flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:11px; background:var(--surface); }.dashboard-page .theme-button { width:31px; height:29px; padding:0; color:var(--muted); border-radius:8px; background:transparent; box-shadow:none; font-size:15px; line-height:1; }.dashboard-page .theme-button:hover { transform:none; box-shadow:none; color:var(--ink); }.dashboard-page .theme-button.is-selected { color:#fff; background:#547cf2; }.dashboard-page .date-chip { color:var(--muted); font-size:11px; white-space:nowrap; }.dashboard-page .user-chip { display:flex; align-items:center; gap:8px; padding-left:5px; color:var(--ink); font-size:12px; font-weight:600; white-space:nowrap; }.dashboard-page .user-avatar { width:31px; height:31px; display:grid; place-items:center; color:#fff; border-radius:50%; background:linear-gradient(145deg,#ffa58f,#9776d5); font-weight:700; }.dashboard-page #asesorInfo { color:inherit !important; }
.dashboard-page .content-area { flex:1; overflow:auto; padding:0 42px 42px; background:var(--dash-bg); }.dashboard-page .dashboard-grid { max-width:1450px; margin:0 auto; }.dashboard-page .stat-row { display:grid; grid-template-columns:repeat(4,minmax(160px,1fr)); gap:16px; margin-bottom:16px; }.dashboard-page .stat-card,.dashboard-page .chart-card { position:relative; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:var(--shadow); }.dashboard-page .stat-card { padding:20px 19px 17px; color:var(--ink); }.dashboard-page .stat-card:hover,.dashboard-page .chart-card:hover { box-shadow:0 18px 42px rgba(36,48,82,.12); }.dashboard-page .stat-icon { position:absolute; right:17px; top:16px; width:29px; height:29px; display:grid; place-items:center; border-radius:9px; font-size:14px; font-weight:700; }.dashboard-page .stat-icon.blue{color:#4778f3;background:#eaf0ff}.dashboard-page .stat-icon.purple{color:#a855f7;background:#f5eaff}.dashboard-page .stat-icon.green{color:#0f9e78;background:#def8ef}.dashboard-page .stat-icon.orange{color:#e68130;background:#fff0df}.dashboard-page .stat-card .label { color:var(--muted); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.65px; }.dashboard-page .stat-card .value { margin:8px 0 3px; color:var(--ink); font:700 31px/1 'Quicksand',sans-serif; letter-spacing:-.6px; }.dashboard-page .stat-card .sublabel { color:var(--muted); font-size:10px; }
.dashboard-page .charts-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; }.dashboard-page .chart-card { padding:19px 20px; min-width:0; }.dashboard-page .card-heading { display:flex; justify-content:space-between; align-items:flex-start; min-height:38px; }.dashboard-page .card-heading h3 { margin:0; color:var(--ink); font:700 16px/1.3 'Quicksand',sans-serif; }.dashboard-page .card-action { color:var(--muted); letter-spacing:2px; }.dashboard-page .chart-container { position:relative; height:252px; margin:12px 0 0; }.dashboard-page .compact-chart { height:215px; }.dashboard-page .activity-card { min-height:283px; }.dashboard-page .activity-list { max-height:215px; overflow:auto; padding-right:3px; margin-top:12px; }.dashboard-page .activity-item { padding:10px 0; border-bottom:1px solid var(--line); }.dashboard-page .activity-item:last-child { border-bottom:0; }.dashboard-page .activity-title { color:var(--ink); font-size:12px; font-weight:600; }.dashboard-page .activity-meta { margin-top:3px; color:var(--muted); font-size:10px; }.dashboard-page .status-live { color:#10a37f; font-size:10px; font-weight:600; }.dashboard-page .performance-card { margin-bottom:16px; }.dashboard-page .table-wrap { overflow-x:auto; margin:12px -3px -3px; }.dashboard-page .performance-table { min-width:720px; margin:0; color:var(--ink); background:transparent; }.dashboard-page .performance-table thead { background:var(--soft); }.dashboard-page .performance-table th { padding:11px 13px; color:var(--muted); border:0; font-size:10px; font-weight:600; white-space:nowrap; }.dashboard-page .performance-table td { padding:13px; border-color:var(--line); font-size:11px; }.dashboard-page .performance-table tbody tr:hover { background:var(--soft); }.dashboard-page .metric-badge { padding:5px 8px; font-size:10px; }.dashboard-page .metric-green{background:#dff8ee;color:#087e5c}.dashboard-page .metric-yellow{background:#fff3d7;color:#a86500}.dashboard-page .metric-red{background:#ffebec;color:#b8324a}.dashboard-page.dark-theme .metric-green{background:#173f37;color:#83e6c8}.dashboard-page.dark-theme .metric-yellow{background:#4c3a1b;color:#f4cf82}.dashboard-page.dark-theme .metric-red{background:#4b2632;color:#ffabb8}
@media(max-width:1060px){.dashboard-page .sidebar{width:205px;flex-basis:205px}.dashboard-page .topbar,.dashboard-page .content-area{padding-left:25px;padding-right:25px}.dashboard-page .stat-row{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.dashboard-page .sidebar{display:none}.dashboard-page .topbar{min-height:auto;padding:22px 18px;align-items:flex-start}.dashboard-page .content-area{padding:0 18px 28px}.dashboard-page .topbar-actions{gap:9px}.dashboard-page .date-chip{display:none}.dashboard-page .user-chip span:last-child{display:none}.dashboard-page .stat-row,.dashboard-page .charts-row{grid-template-columns:1fr}.dashboard-page .topbar h1{font-size:23px}}

/* Aplicación de los colores corporativos: azul #001D85, verde #A5DB6D, celeste #A6C8E9 y lavanda #A5A2DC. */
.dashboard-page { --dash-bg:#f7f9ff; --surface:#ffffff; --soft:#f2f5fc; --side:#ffffff; --ink:#1b2552; --muted:#7180a0; --line:#e0e7f4; --blue:#001d85; --brand-green:#a5db6d; --brand-sky:#a6c8e9; --brand-lavender:#a5a2dc; --shadow:0 14px 36px rgba(0,29,133,.08); font-family:'Poppins',sans-serif; }
.dashboard-page.dark-theme { --dash-bg:#07113d; --surface:#101d51; --soft:#172760; --side:#091647; --ink:#f8fbff; --muted:#b4c2df; --line:#2a3a70; --blue:#a5db6d; --shadow:0 14px 36px rgba(0,0,0,.26); }
.dashboard-page .brand { min-height:64px; display:flex; align-items:center; padding:0 6px 31px; text-decoration:none; }
.dashboard-page .brand-logo { width:174px; max-width:100%; height:63px; display:block; object-fit:contain; object-position:center; }
.dashboard-page .brand-logo-dark { display:none; }
.dashboard-page.dark-theme .brand-logo-light { display:none; }
.dashboard-page.dark-theme .brand-logo-dark { display:block; }
.dashboard-page .sidebar { border-right:1px solid var(--line); }
.dashboard-page .nav-item.active { color:#001d85; background:#edf3ff; box-shadow:inset 3px 0 0 #a5db6d; }
.dashboard-page.dark-theme .nav-item.active { color:#fff; background:#1d3374; box-shadow:inset 3px 0 0 #a5db6d; }
.dashboard-page .theme-button.is-selected { color:#001d85; background:#a5db6d; }
.dashboard-page.dark-theme .theme-button.is-selected { color:#001d85; background:#a5db6d; }
.dashboard-page .user-avatar { color:#001d85; background:linear-gradient(145deg,#a6c8e9,#a5db6d); }
.dashboard-page .stat-icon.blue { color:#001d85; background:#e8efff; }
.dashboard-page .stat-icon.purple { color:#625fa8; background:#efeffb; }
.dashboard-page .stat-icon.green { color:#366420; background:#edf8e4; }
.dashboard-page .stat-icon.orange { color:#7d5b12; background:#fff5d9; }
.dashboard-page .status-live { color:#517d2d; }

/* Compatibilidad de tema para los módulos Clientes, Reportes y Analytics. */
.dashboard-page { --background:var(--dash-bg); --text:var(--ink); --text-secondary:var(--muted); --border:var(--line); }
.dashboard-page.dark-theme { --background:#07113d; --text:#f8fbff; --text-secondary:#b4c2df; --border:#2a3a70; }
html.dark-theme .dashboard-page { --dash-bg:#07113d; --surface:#101d51; --soft:#172760; --side:#091647; --ink:#f8fbff; --muted:#b4c2df; --line:#2a3a70; --blue:#a5db6d; --background:#07113d; --text:#f8fbff; --text-secondary:#b4c2df; --border:#2a3a70; --shadow:0 14px 36px rgba(0,0,0,.26); }
html.dark-theme .dashboard-page .brand-logo-light { display:none; }
html.dark-theme .dashboard-page .brand-logo-dark { display:block; }

/* Responsive: celular, tablet y iPad (se carga en todas las pantallas). */
@media (max-width: 760px) {
    /* Navegación: en celular la barra lateral pasa a una barra inferior con iconos. */
    .dashboard-page .dashboard-shell { flex-direction: column; }
    .dashboard-page .sidebar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 200;
        width: auto; flex: none; height: auto; flex-direction: row; align-items: center; gap: 4px;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); overflow: visible;
        border-right: 0; border-top: 1px solid var(--line); background: var(--side); box-shadow: 0 -6px 18px rgba(0, 29, 133, .08);
    }
    .dashboard-page .brand,
    .dashboard-page .nav-label { display: none; }
    .dashboard-page .sidebar-nav { flex: 1 1 auto; min-width: 0; flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; }
    .dashboard-page .sidebar-nav::-webkit-scrollbar { display: none; }
    .dashboard-page .sidebar-footer { display: flex; flex: 0 0 auto; flex-direction: row; gap: 2px; padding: 0; }
    .dashboard-page .nav-item {
        width: auto; min-width: 62px; min-height: 52px; flex: 0 0 auto; padding: 4px 6px;
        flex-direction: column; justify-content: center; gap: 2px; font-size: 10px; line-height: 1.2; text-align: center; white-space: nowrap;
    }
    .dashboard-page .logout-link { width: auto; min-height: 52px; padding: 4px 8px; font-size: 10px; }
    .dashboard-page .main-content { overflow: visible; }
    .dashboard-page .content-area { overflow: visible; padding-bottom: 104px; }
    .dashboard-page .topbar { flex-wrap: wrap; gap: 12px; }
    .dashboard-page .topbar-actions { flex-wrap: wrap; width: 100%; }

    /* Tablas: se deslizan horizontalmente en lugar de cortarse. */
    .leads-table-wrapper,
    .clientes-table-wrapper,
    .table-wrapper,
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Campos sin zoom automático en iPhone y botones con área táctil cómoda. */
    input, select, textarea { font-size: 16px; }
    button, .nav-item, .action-btn, .card-action-btn { min-height: 40px; }

    /* Ventanas emergentes: ocupan casi toda la pantalla y se desplazan por dentro. */
    .modal { padding: 10px; }
    .modal-content { width: 100%; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* iPad y tablets (vertical y horizontal): mantienen la barra lateral pero más compacta. */
@media (min-width: 761px) and (max-width: 1100px) {
    .dashboard-page .sidebar { width: 200px; flex-basis: 200px; padding-left: 12px; padding-right: 12px; }
    .dashboard-page .topbar,
    .dashboard-page .content-area { padding-left: 22px; padding-right: 22px; }
    .dashboard-page .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-page .charts-row { grid-template-columns: 1fr; }
}

/* Pantallas táctiles: áreas de toque más grandes. */
@media (hover: none) and (pointer: coarse) {
    .dashboard-page .nav-item { min-height: 48px; }
    .card-action-btn, .action-btn, .btn-primary, .btn-secondary, .btn-danger { min-height: 44px; }
}
