/* === APP-LIKE: sin selección de texto ni menú del navegador fuera de inputs === */
*, *::before, *::after {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
input, textarea, select, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}
img { pointer-events: none; draggable: false; }
/* ============================================================= */

:root {
    --primario: #d81b60; 
    --secundario: #8e24aa; 
    --ganancia: #00b894; 
    --gasto: #d63031;
    
    /* Tema Oscuro (Por defecto) */
    --fondo: #141622;
    --fondo-header: #050505;
    --bg-modal: #181a24;
    --bg-card: #23243a;
    --bg-card-alt: #2d232a;
    --texto: #ffffff;
    --texto-muted: #aaaaaa;
    --border: #333333;
    --shadow: rgba(0,0,0,0.3);
    --bg-input: #23243a;
}

[data-theme="light"] {
    /* Tema Claro */
    --fondo: #f4f7f6;
    --fondo-header: #2d3436;
    --bg-modal: #ffffff;
    --bg-card: #ffffff;
    --bg-card-alt: #fff5f5;
    --texto: #2d3436;
    --texto-muted: #666666;
    --border: #dddddd;
    --shadow: rgba(0,0,0,0.1);
    --bg-input: #f4f7f6;
}

html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', sans-serif; background-color: var(--fondo); margin: 0; color: var(--texto); padding-bottom: 20px; -webkit-tap-highlight-color: transparent; transition: background-color 0.3s, color 0.3s; -webkit-user-select: none; user-select: none; }

header { background: linear-gradient(to bottom, var(--fondo-header) 0%, var(--primario) 60%, var(--secundario) 100%); color: white; padding: 30px 15px 60px; text-align: center; border-radius: 0 0 30px 30px; transition: background 0.3s; }
.container { width: 92%; max-width: 600px; margin: -45px auto 0; position: relative; }

.fab-main { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 28px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border: none; cursor: pointer; transition: transform 0.1s; }
button { touch-action: manipulation; }

/* Estilos de Auditoría */
.audit-card { background: var(--bg-card); padding: 15px; border-radius: 15px; margin-bottom: 15px; border-left: 5px solid var(--secundario); transition: background-color 0.3s; }
.audit-card h4 { margin: 0 0 10px 0; color: var(--secundario); font-size: 0.9rem; }
.progress-bar { background: var(--border); height: 10px; border-radius: 5px; overflow: hidden; margin: 5px 0; transition: background-color 0.3s; }
.progress-fill { background: var(--primario); height: 100%; }

/* Modales Modernos - Flotantes y Compactos */
.modal-full {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    will-change: opacity;
    animation: modalFadeIn 0.3s cubic-bezier(.4,0,.2,1);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-modal);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    min-width: 320px;
    margin: 0 auto;
    min-height: auto;
    height: auto;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    will-change: transform, opacity;
    animation: modalPop 0.3s cubic-bezier(.4,0,.2,1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: background-color 0.3s;
    overflow: visible;
    position: relative;
}

@keyframes modalPop {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content form, .modal-content > div, .modal-content > form {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.modal-header {
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.modal-header h2 {
    color: var(--primario);
    font-size: 1.4rem;
    margin: 0;
    text-align: left;
    flex: 1;
}

.modal-header button {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--texto-muted);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.modal-header button:hover {
    background: var(--border);
    color: var(--texto);
    transform: translateY(-1px);
}

.modal-header button:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

@media (max-width: 600px) {
    .modal-full {
        padding: 10px;
    }
    .modal-content {
        max-width: 100%;
        min-width: 300px;
        border-radius: 16px;
    }
    .modal-content form, .modal-content > div, .modal-content > form {
        padding: 16px;
    }
    .modal-header {
        padding: 16px 16px 0 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .modal-header h2 {
        text-align: center;
        font-size: 1.2rem;
    }
    .modal-header button {
        align-self: flex-end;
        width: auto;
        min-width: 80px;
    }
    .modal-full input, .modal-full select, .btn-orange {
        font-size: 1rem;
        padding: 12px 14px;
        margin-top: 8px;
    }
}

/* Mejoras para Tablets y Diseño General */
@media (min-width: 601px) and (max-width: 1024px) {
    body {
        font-size: 16px;
    }

    .container {
        max-width: 800px;
        margin: -45px auto 0;
    }

    .calendar-grid {
        gap: 6px;
    }

    .calendar-day {
        min-height: 80px;
        padding: 6px;
    }

    .tabs-container {
        margin-bottom: 0;
    }

    .tab-content {
        padding: 24px;
    }
}

/* Mejoras para Escritorio */
@media (min-width: 1025px) {
    .container {
        max-width: 900px;
    }
}

/* Estilos mejorados para inputs y selects */
.modal-full input, .modal-full select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    margin: 8px 0 0 0;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--bg-input);
    color: var(--texto);
    font-size: 1rem;
    outline: none;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s;
}

.modal-full input:focus, .modal-full select:focus {
    background: var(--bg-input);
    box-shadow: 0 0 0 3px rgba(216, 27, 96, 0.1);
    border-color: var(--primario);
    transform: translateY(-1px);
}

.modal-full select option {
    background: var(--bg-card);
    color: var(--texto);
    font-weight: 500;
    padding: 8px;
}

/* Botón principal mejorado */
.btn-orange {
    margin-top: 18px;
    font-size: 1.1rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(255,140,0,0.2);
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: #fff !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    min-height: 50px;
    touch-action: manipulation;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-orange:hover {
    background: linear-gradient(135deg, #ffb74d, #ff9800);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,140,0,0.3);
}

.btn-orange:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

/* Labels mejorados */
.modal-full label {
    color: var(--primario);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animación de entrada para elementos del modal */
.modal-content > * {
    animation: slideInUp 0.4s cubic-bezier(.4,0,.2,1);
    animation-fill-mode: both;
}

.modal-content > *:nth-child(1) { animation-delay: 0.1s; }
.modal-content > *:nth-child(2) { animation-delay: 0.15s; }
.modal-content > *:nth-child(3) { animation-delay: 0.2s; }
.modal-content > *:nth-child(4) { animation-delay: 0.25s; }
.modal-content > *:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botones de Edición Modernos */
.edit-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.edit-action-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    touch-action: manipulation;
}

.edit-action-btn.cancel {
    background: linear-gradient(135deg, #636e72, #b2bec3);
    color: white;
    border-color: #636e72;
}

.edit-action-btn.cancel:hover {
    background: linear-gradient(135deg, #2d3436, #636e72);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 110, 114, 0.3);
}

.edit-action-btn.delete {
    background: linear-gradient(135deg, #d63031, #e17055);
    color: white;
    border-color: #d63031;
}

.edit-action-btn.delete:hover {
    background: linear-gradient(135deg, #b91c1c, #d63031);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 48, 49, 0.3);
}

.edit-action-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s;
}

@media (max-width: 600px) {
    .edit-buttons-container {
        gap: 10px;
        margin-top: 16px;
        padding-top: 16px;
    }
    .edit-action-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 40px;
    }
}

.modal-content { overflow: visible; }
#lista-clientes-venta, #lista-completa, #top-ventas, #top-clientes, #chart-gastos, #lista-cli-audit, #recibo-print-area { overflow-y: auto !important; -ms-overflow-style: none; scrollbar-width: none; }
#lista-clientes-venta::-webkit-scrollbar, #lista-completa::-webkit-scrollbar, #top-ventas::-webkit-scrollbar, #top-clientes::-webkit-scrollbar, #chart-gastos::-webkit-scrollbar, #recibo-print-area::-webkit-scrollbar { display: none; }

@keyframes modalPop { from { transform: scale(0.92) translateY(40px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-full input, .modal-full select { display: block; width: 100%; max-width: 100%; box-sizing: border-box; padding: 14px 16px; margin: 8px 0 0 0; border-radius: 13px; border: 1px solid var(--border); background: var(--bg-input); color: var(--texto); font-size: 1rem; outline: none; box-shadow: 0 2px 8px var(--shadow); transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.2s; }
.modal-full input, .modal-full select, input, textarea { -webkit-user-select: auto; user-select: auto; }
.modal-full input:focus, .modal-full select:focus { background: var(--bg-input); box-shadow: 0 0 0 2px var(--primario); border-color: var(--primario); }
.modal-full select option { background: var(--bg-card); color: var(--texto); font-weight: bold; }

.modal-full .btn-orange { margin-top: 18px; font-size: 1rem; border-radius: 16px; box-shadow: 0 4px 16px rgba(255,140,0,0.13); width: 100%; max-width: 100%; background: #ff9800 !important; color: #fff !important; border: none; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.2s, transform 0.1s; min-height: 48px; touch-action: manipulation; }
.modal-full .btn-orange svg { margin-right: 4px; vertical-align: middle; }
.modal-full .btn-orange:hover { background: #ffb74d !important; color: var(--bg-card) !important; }
.modal-full .btn-orange:active { transform: scale(0.96) !important; transition: transform 0.1s !important; }

.card-mov { background: var(--bg-card); padding: 16px; border-radius: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px var(--shadow); color: var(--texto); transition: transform 0.2s, opacity 0.2s, background-color 0.3s; touch-action: manipulation; }
.card-mov:active { transform: scale(0.97); opacity: 0.9; transition: transform 0.1s, opacity 0.1s; }

.btn-ver-todo { background: var(--bg-card); border: 1px solid var(--border); width: 100%; padding: 14px; border-radius: 15px; font-weight: bold; color: var(--texto); margin-top: 20px; box-shadow: 0 2px 5px var(--shadow); min-height: 48px; transition: transform 0.2s, background-color 0.3s, color 0.3s; cursor: pointer; }
.btn-ver-todo:active { transform: scale(0.96); transition: transform 0.1s; }

@media print {
    @page { margin: 10mm; }
    html, body { width: 100%; height: auto !important; margin: 0; padding: 0; background: #fff !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; overflow: visible !important; display: block !important; }
    body * { visibility: hidden; }
    #recibo-print-area, #recibo-print-area * { visibility: visible; }
    #recibo-print-area { position: relative !important; left: 0; top: 0; width: 100% !important; max-width: 100% !important; height: auto !important; max-height: none !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
    .modal-full { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: auto !important; background: transparent !important; overflow: visible !important; display: block !important; }
    .modal-content { position: static !important; transform: none !important; animation: none !important; background: transparent !important; box-shadow: none !important; height: auto !important; min-height: auto !important; overflow: visible !important; padding: 0 !important; display: block !important; }
}

/* Nuevos Estilos para el Dashboard de Auditoría */
.kpi-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.kpi-box { flex: 1; min-width: 90px; background: var(--bg-input); padding: 15px 10px; border-radius: 14px; text-align: center; border: 1px solid var(--border); box-shadow: 0 4px 10px var(--shadow); display: flex; flex-direction: column; justify-content: center; }
.kpi-box small { color: var(--texto-muted); font-size: 0.8rem; font-weight: bold; text-transform: uppercase; margin-bottom: 5px; }
.kpi-box span { font-size: 1.4rem; font-weight: bold; }
.chart-multi-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0; background: var(--bg-input); }
.chart-multi-bar > div { transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--texto-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* Animaciones Globales */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulseGlowCenter { 0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.95); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); filter: drop-shadow(0 0 8px #00b894); } }
@keyframes pulseText { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; text-shadow: 0 0 20px rgba(0,184,148,0.6); } }
@keyframes loadProgress { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Indicador de escritura IA (Tres puntos animados) */
.typing-indicator { display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 5px; }
.typing-indicator span { display: inline-block; width: 8px; height: 8px; background-color: var(--secundario); border-radius: 50%; animation: typing 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* --- CALENDARIO VISUAL --- */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-header button { background: var(--bg-input); border: 1px solid var(--border); color: var(--texto); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: bold; transition: transform 0.2s; }
.calendar-header button:active { transform: scale(0.9); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: bold; font-size: 0.8rem; color: var(--texto-muted); margin-bottom: 8px; }

/* --- TABS DASHBOARD/CRM --- */
.tabs-container { display: flex; background: var(--bg-card); border-radius: 15px 15px 0 0; margin-bottom: 0; overflow: hidden; box-shadow: 0 2px 10px var(--shadow); }
.tab-btn { flex: 1; padding: 15px 10px; background: transparent; border: none; color: var(--texto-muted); font-weight: bold; font-size: 0.9rem; cursor: pointer; transition: all 0.3s; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab-btn.active { background: var(--primario); color: white; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); }
.tab-btn:not(.active):hover { background: rgba(255,255,255,0.05); color: var(--texto); }
.tab-btn svg { width: 18px; height: 18px; }

.tab-content { display: none; background: var(--bg-card); border-radius: 0 0 20px 20px; padding: 20px; box-shadow: 0 4px 15px var(--shadow); }
.tab-content.active { display: block; }

/* --- ACTION BUTTONS GRID --- */
.action-buttons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.action-btn { background: linear-gradient(135deg, var(--primario), var(--secundario)); border: none; border-radius: 15px; padding: 18px 10px; color: white; font-weight: bold; font-size: 0.85rem; cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 4px 15px rgba(216,27,96,0.3); min-height: 80px; justify-content: center; }
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(216,27,96,0.4); }
.action-btn:active { transform: scale(0.95); transition: transform 0.1s; }
.action-btn svg { width: 24px; height: 24px; }

/* --- KPI PANELS GRID --- */
.kpi-panels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.kpi-panel { background: var(--bg-card); border-radius: 15px; padding: 15px; text-align: center; box-shadow: 0 4px 15px var(--shadow); border-top: 4px solid var(--primario); transition: transform 0.3s; }
.kpi-panel:hover { transform: translateY(-2px); }
.kpi-panel h4 { margin: 0 0 8px 0; color: var(--primario); font-size: 0.8rem; font-weight: bold; text-transform: uppercase; }
.kpi-panel .value { font-size: 1.4rem; font-weight: bold; color: var(--texto); margin-bottom: 5px; }
.kpi-panel .label { font-size: 0.75rem; color: var(--texto-muted); text-transform: uppercase; font-weight: bold; }

/* --- AUDITORÍA INCRUSTADA --- */
.audit-embedded { background: var(--bg-card); border-radius: 15px; padding: 20px; box-shadow: 0 4px 15px var(--shadow); }
.audit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.audit-header h3 { color: var(--primario); margin: 0; display: flex; align-items: center; gap: 8px; }
.audit-header select { padding: 8px 12px; border-radius: 10px; background: var(--bg-input); color: var(--texto); border: 1px solid var(--border); font-weight: bold; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; min-height: 65px; padding: 4px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.calendar-day.empty { background: transparent; border: none; }
.calendar-day.today { border: 2px solid var(--primario); background: rgba(216, 27, 96, 0.1); }
.calendar-day-num { font-weight: bold; font-size: 0.85rem; text-align: right; color: var(--texto-muted); margin-bottom: 2px; }
.calendar-day.today .calendar-day-num { color: var(--primario); }
.event-dot { font-size: 0.65rem; background: var(--secundario); color: white; padding: 3px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.1s; }
.event-dot:active { transform: scale(0.95); }

/* ============================================================
   BOTONES FLOTANTES ARRASTRABLES (PWA Pro)
   ============================================================ */
.fab-draggable {
    position: fixed;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 8997;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
    will-change: left, top;
    -webkit-tap-highlight-color: transparent;
}
.fab-draggable.dragging {
    cursor: grabbing !important;
    transform: scale(1.15) !important;
    transition: none !important;
}
.fab-draggable:active { transform: scale(0.95); }
.fab-config-bg  { background: linear-gradient(135deg, #636e72, #2d3436); box-shadow: 0 4px 16px rgba(0,0,0,0.45); }
.fab-crm-bg     { background: linear-gradient(135deg, #d81b60, #8e24aa);  box-shadow: 0 4px 16px rgba(216,27,96,0.45); }
.fab-inicio-bg  { background: linear-gradient(135deg, #00b894, #0984e3);  box-shadow: 0 4px 16px rgba(0,184,148,0.45); }
.fab-draggable:hover { filter: brightness(1.15); }

/* ============================================================
   PWA SAFE AREA — soporte para pantallas con notch (Android/iOS)
   ============================================================ */
body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

/* ============================================================
   RESPONSIVE — Teléfonos pequeños (< 380px)
   ============================================================ */
@media (max-width: 380px) {
    .action-buttons-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .action-button span   { font-size: 0.75rem; }
    .kpi-panels-grid      { gap: 8px; }
    .kpi-panel h3         { font-size: 1.1rem; }
    .kpi-icon             { font-size: 1.4rem; }
    header                { padding: 20px 10px 50px; }
    header h1             { font-size: 1.4rem; }
    .container            { width: 96%; margin-top: -35px; }
    .tab-button           { font-size: 0.8rem; padding: 10px 5px; gap: 5px; }
}

/* ============================================================
   RESPONSIVE — Tablets (601px – 1024px)
   ============================================================ */
@media (min-width: 601px) and (max-width: 1024px) {
    .container            { max-width: 680px; }
    .action-buttons-grid  { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .action-button        { padding: 22px 10px; }
    .kpi-panels-grid      { gap: 16px; }
    .kpi-panel h3         { font-size: 1.5rem; }
    .tabs-container       { border-radius: 15px; }
    .tab-button           { font-size: 1rem; padding: 14px; }
    .card-mov             { padding: 18px 20px; }
    .modal-content        { max-width: 560px; }
    .fab-draggable        { width: 58px; height: 58px; }
}

/* ============================================================
   RESPONSIVE — Desktop grande (> 1024px)
   ============================================================ */
@media (min-width: 1025px) {
    .container            { max-width: 780px; }
    .action-buttons-grid  { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .fab-draggable        { width: 56px; height: 56px; }
}

/* Panel de chat IA adaptativo en pantallas pequeñas */
@media (max-width: 480px) {
    #ia-chat-panel {
        width: 96vw !important;
        right: 2vw !important;
        left: 2vw !important;
        bottom: 80px !important;
        height: 70vh !important;
        max-height: 70vh !important;
    }
}

/* Scroll suave en toda la app */
* { -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
input, textarea, select { -webkit-user-select: auto !important; user-select: auto !important; }