/* ==========================================================================
   KlaroCash VNE - Sistema de Diseño CSS Premium (Dark Mode por Defecto)
   ========================================================================== */

/* Variables y Tokens de Diseño (Premium Light Mode - Klaro Corporate) */
:root {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-border: #e2e8f0;
    
    --primary: #e57020;
    --primary-hover: #cc5a14;
    --primary-glow: rgba(229, 112, 32, 0.15);
    
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --bg-trans-dark: rgba(229, 112, 32, 0.08);
    --bg-trans-medium: rgba(229, 112, 32, 0.04);
    --bg-trans-light: rgba(229, 112, 32, 0.02);

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

/* Resets Básicos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Estilos de Inicio de Sesión (Login)
   ========================================================================== */

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.08), transparent 35%),
                var(--bg-dark);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
                0 10px 10px -5px rgba(0, 0, 0, 0.2);
    animation: fadeInSlide 0.6s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Logos y Títulos */
.logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.logo-icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.logo-text {
    background: linear-gradient(135deg, var(--text-main) 70%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
}

.logo-text span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.header-container .logo-icon-svg {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}

.header-container .logo-box {
    margin-bottom: 0;
    font-size: 1.8rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Formularios e Inputs */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Estilos Homogéneos y Elegantes para Todos los Inputs y Selects del Sistema */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 42px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: #1e293b;
    font-size: 0.88rem;
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
    box-sizing: border-box;
}

.form-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 112, 32, 0.15);
    background: #ffffff;
}

/* Anular el fondo azul/amarillo de autocompletar en navegadores */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-trans-medium);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-trans-dark);
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-main);
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* Footer del Login */
.login-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Estilos del Dashboard
   ========================================================================== */

.dashboard-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-dark);
}

/* Encabezado y Barra de Navegación */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--bg-card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-container .logo-box {
    margin-bottom: 0;
    font-size: 1.8rem;
}

.main-nav {
    display: flex;
    gap: 10px;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    border-bottom: 2px solid var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-name {
    font-size: 0.95rem;
    color: var(--text-main);
}

.btn-logout {
    text-decoration: none;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Área de Contenido Principal */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.welcome-section h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary);
}

/* Cuadrícula de Métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-icon {
    font-size: 1.4rem;
}

.metric-value {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-footer {
    font-size: 0.85rem;
}

/* Modificadores de color para tarjetas */
.metric-card.status-ok {
    border-left: 4px solid var(--accent-green);
}
.metric-card.status-ok .metric-value {
    color: var(--accent-green);
}

.metric-card.status-warn {
    border-left: 4px solid var(--accent-orange);
}
.metric-card.status-warn .metric-value {
    color: var(--accent-orange);
}

.metric-card.status-err {
    border-left: 4px solid var(--accent-red);
}
.metric-card.status-err .metric-value {
    color: var(--accent-red);
}

/* Cuadrícula de Contenido (Mapa y Alertas) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

@media (max-width: 968px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Contenedores de prueba */
.placeholder-map {
    background: var(--bg-trans-medium);
    border: 1px dashed var(--bg-card-border);
    border-radius: var(--radius-md);
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

/* Listado de Alertas */
.alert-list-placeholder {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-trans-medium);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    transition: var(--transition-smooth);
}

.alert-item:hover {
    background: var(--bg-trans-medium);
}

.alert-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.alert-item.error .alert-indicator {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.alert-item.warning .alert-indicator {
    background-color: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange);
}

.alert-info {
    flex: 1;
}

.alert-info strong {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
}

.error-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.alert-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Footer General */
.app-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--bg-card-border);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-trans-light);
}

/* ==========================================================================
   Estilos de Flota y CRUD de Máquinas VNE
   ========================================================================== */

.header-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

@media (max-width: 576px) {
    .header-action-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Tablas Premium */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.premium-table th {
    background: var(--bg-trans-medium);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 24px;
    border-bottom: 1px solid var(--bg-card-border);
}

.premium-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--bg-card-border);
    vertical-align: middle;
}

.premium-table tbody tr {
    transition: var(--transition-smooth);
}

.premium-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cell-main-text {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.cell-sub-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Badges de Modelo y Estado */
.model-badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.model-badge.virtuo2 {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.model-badge.cashmini {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.ip-code {
    background: var(--bg-trans-medium);
    border: 1px solid var(--bg-card-border);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.9rem;
    color: #38bdf8;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.status-badge.operativo {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-badge.operativo::before {
    background-color: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
    animation: pulse-green 2s infinite;
}

.status-badge.alerta {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.status-badge.alerta::before {
    background-color: var(--accent-orange);
    box-shadow: 0 0 6px var(--accent-orange);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.status-badge.error::before {
    background-color: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red);
    animation: pulse-red 2s infinite;
}

.status-badge.desconectado {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.25);
}
.status-badge.desconectado::before {
    background-color: var(--text-muted);
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Botones de Acción de Fila */
.action-btn-group {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: var(--bg-trans-medium);
    border: 1px solid var(--bg-card-border);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

/* Botón VNE Tool (Color Rosa Corporativo VNE #e6007e) */
.btn-action.tool {
    background: rgba(230, 0, 126, 0.12) !important;
    color: #e6007e !important;
    border: 1px solid rgba(230, 0, 126, 0.3) !important;
}

.btn-action.tool:hover {
    background: #e6007e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(230, 0, 126, 0.35);
    transform: translateY(-2px);
}

/* Modales */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
    from { transform: scale(0.95) translateY(10px); }
    to { transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--bg-card-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}

.flex-1 {
    flex: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-divider {
    border: 0;
    border-top: 1px solid var(--bg-card-border);
    margin: 10px 0;
}

.map-selection-container {
    background: var(--bg-trans-light);
    border: 1px solid var(--bg-card-border);
    padding: 12px;
    border-radius: var(--radius-md);
}

/* Detalle de efectivo */
.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.details-section {
    background: var(--bg-trans-light);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.details-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.details-section p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.cash-levels-table {
    width: 100%;
    border-collapse: collapse;
}

.cash-levels-table th {
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--bg-card-border);
}

.cash-levels-table td {
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.cash-levels-table tr:last-child td {
    border-bottom: 0;
}

.drawer-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.drawer-badge.rec {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.drawer-badge.dep {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

/* ==========================================================================
   Estilos del Consolidador de Efectivo y Fichas de Carga
   ========================================================================== */

.consolidator-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.08), transparent 30%),
                var(--bg-card);
}

.consolidator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.consolidator-total {
    text-align: right;
}

.total-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid var(--accent-green);
    color: #34d399;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 1.6rem;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.no-replenishment-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 24px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
}

.no-replenishment-alert span {
    font-size: 2rem;
}

/* Cuadrícula de Fichas de Dinero */
.tokens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.cash-token-card {
    background: var(--bg-trans-medium);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: var(--transition-smooth);
}

.cash-token-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
}

/* Fichas de Billetes */
.bill-token {
    border-left: 4px solid var(--primary);
}

.bill-token .token-art {
    width: 100%;
    height: 50px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Estilos de Color de Billetes del Euro */
.euro-5 .token-art {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.05));
    border-color: rgba(148, 163, 184, 0.4);
}
.euro-5 .token-value { color: #cbd5e1; }

.euro-10 .token-art {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.4);
}
.euro-10 .token-value { color: #fca5a5; }

.euro-20 .token-art {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
    border-color: rgba(59, 130, 246, 0.4);
}
.euro-20 .token-value { color: #93c5fd; }

.euro-50 .token-art {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.4);
}
.euro-50 .token-value { color: #fcd34d; }

/* Fichas de Monedas */
.coin-token {
    border-left: 4px solid var(--accent-orange);
}

.coin-token .token-art {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 60%, rgba(245, 158, 11, 0.05));
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.coin-token .token-value {
    color: #fcd34d;
}

.token-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.token-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.token-qty {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.token-sum {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Panel de Asignación por Máquina */
.allocation-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.allocation-item {
    background: var(--bg-trans-light);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
}

.allocation-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.allocation-mach-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.allocation-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.allocation-title strong {
    font-size: 1.05rem;
    color: var(--text-main);
}

.allocation-cash-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--bg-card-border);
    padding-top: 10px;
}

.allocation-total-cash {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-toggle-breakdown {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.btn-toggle-breakdown:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.allocation-breakdown {
    background: var(--bg-trans-medium);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--bg-card-border);
    margin-top: 5px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Diseño de Dos Columnas en Dashboard y Consolidador Lateral
   ========================================================================== */

.dashboard-split-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 968px) {
    .dashboard-split-layout {
        grid-template-columns: 1fr;
    }
}

.main-logistics-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-logistics-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Encabezado con Botonera en Tarjetas */
.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.action-buttons-group {
    display: flex;
    gap: 10px;
}

/* Modificadores de la Cabecera de Asignación por Máquina */
.allocation-mach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--bg-card-border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.allocation-mach-total-badge {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #38bdf8;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.allocation-visible-breakdown {
    background: var(--bg-trans-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-card-border);
    padding: 10px;
}

/* Consolidador Lateral Compacto */
.consolidator-sidebar {
    background: radial-gradient(circle at 90% 10%, rgba(16, 185, 129, 0.05), transparent 45%),
                var(--bg-card);
}

.sidebar-consolidator-header {
    text-align: center;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.sidebar-consolidator-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.consolidator-sidebar-total {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
    line-height: 1.2;
    margin-top: 4px;
}

/* Filas Compactas de Fichas */
.compact-tokens-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compact-cash-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-trans-medium);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    gap: 12px;
    transition: var(--transition-smooth);
}

.compact-cash-row:hover {
    background: var(--bg-trans-medium);
    border-color: rgba(255, 255, 255, 0.12);
}

.compact-row-icon {
    font-size: 1.3rem;
}

.compact-row-info {
    flex: 1;
}

.compact-row-info strong {
    font-size: 1rem;
    display: block;
    color: var(--text-main);
}

.compact-row-qty {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.compact-row-qty strong {
    color: var(--text-main);
    font-size: 1rem;
}

.compact-row-sum {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 80px;
    text-align: right;
}

/* Modificadores de color compacto */
.compact-cash-row.bill-row {
    border-left: 3px solid var(--primary);
}
.compact-cash-row.bill-row .compact-row-sum {
    color: #60a5fa;
}

.compact-cash-row.coin-row {
    border-left: 3px solid var(--accent-orange);
}
.compact-cash-row.coin-row .compact-row-sum {
    color: #fbbf24;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN (Formato A4 Limpio para Almacén)
   ========================================================================== */

@media print {
    /* Reseteo general obligatorio para evitar páginas en blanco por overflow */
    html, body, .dashboard-body, main, .main-content, .dashboard-split-layout, .replenishment-tab-pane {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, Helvetica, sans-serif !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10pt !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        position: static !important;
        display: block !important;
        visibility: visible !important;
    }

    /* Ocultar elementos web innecesarios y modales */
    .no-print, 
    .app-header, 
    .metrics-grid, 
    .recent-logs-card, 
    .app-footer,
    .replenishment-tabs,
    .swal2-container,
    .swal2-backdrop-show,
    .modal-backdrop,
    button, 
    a {
        display: none !important;
    }

    .main-content {
        max-width: 100% !important;
        padding: 6px !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Mostrar encabezado de reporte físico */
    .show-print-title {
        display: block !important;
        font-size: 16pt !important;
        font-weight: bold !important;
        text-align: center !important;
        border-bottom: 2px solid #000 !important;
        padding-bottom: 4px !important;
        margin-bottom: 4px !important;
        color: #000 !important;
    }

    .print-date {
        display: block !important;
        font-size: 8.5pt !important;
        color: #444 !important;
        margin-bottom: 12px !important;
        text-align: center !important;
    }

    /* 1. CONSOLIDADO DE BOLSA (Siempre Visible en Parte Superior) */
    .sidebar-logistics-column {
        width: 100% !important;
        margin-bottom: 15px !important;
        display: block !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* En modo Fichas, forzar salto de página tras la saca para separar el resumen de las tarjetas */
    body.print-mode-cards .sidebar-logistics-column {
        page-break-after: always !important;
    }

    /* En modo Matriz, NO forzar salto para que Resumen + Matriz salgan juntos en la Hoja 1 */
    body.print-mode-matrix .sidebar-logistics-column {
        page-break-after: auto !important;
    }

    .consolidator-sidebar {
        background: #fff !important;
        border: 2px solid #000 !important;
        border-radius: 0 !important;
        padding: 8px 12px !important;
        color: #000 !important;
        display: block !important;
        visibility: visible !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .sidebar-consolidator-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-bottom: 4px !important;
        margin-bottom: 6px !important;
        border-bottom: 1px dashed #000 !important;
    }

    .sidebar-consolidator-header h3 {
        color: #000 !important;
        font-size: 11pt !important;
        margin: 0 !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }

    .consolidator-sidebar-total {
        color: #000 !important;
        font-size: 16pt !important;
        font-weight: 800 !important;
        text-shadow: none !important;
        margin: 0 !important;
    }

    .compact-tokens-list {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
    }

    .compact-cash-row {
        background: #fff !important;
        border: 1px solid #444 !important;
        border-left: 3px solid #000 !important;
        color: #000 !important;
        border-radius: 0 !important;
        padding: 3px 6px !important;
        margin-bottom: 0 !important;
        font-size: 8pt !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .compact-cash-row strong,
    .compact-cash-row .compact-row-sum {
        color: #000 !important;
        font-size: 8pt !important;
        font-weight: bold !important;
    }

    /* 2. SECCIÓN PRINCIPAL DE CONTENIDO */
    .main-logistics-column {
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
    }

    .machine-allocation-card {
        background: #fff !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        display: block !important;
    }

    .machine-allocation-card h2 {
        display: none !important;
    }

    /* 3. CONTROL DE MODOS DE IMPRESIÓN */
    body.print-mode-matrix #view-cards-container {
        display: none !important;
    }
    body.print-mode-matrix #view-matrix-container {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        overflow: visible !important;
    }

    body.print-mode-cards #view-matrix-container {
        display: none !important;
    }
    body.print-mode-cards #view-cards-container {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
    }
    body.print-mode-cards details.mach-card-details {
        display: block !important;
        visibility: visible !important;
    }

    body.print-mode-both #view-matrix-container {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        page-break-after: always !important;
        overflow: visible !important;
    }
    body.print-mode-both #view-cards-container {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
    }
    body.print-mode-both details.mach-card-details {
        display: block !important;
        visibility: visible !important;
    }

    /* Formateo de la Matriz Excel en Papel */
    .excel-matrix-table {
        border: 2px solid #000 !important;
        font-size: 8pt !important;
        width: 100% !important;
        border-collapse: collapse !important;
        display: table !important;
        visibility: visible !important;
    }
    .excel-matrix-table thead {
        display: table-header-group !important;
    }
    .excel-matrix-table tbody {
        display: table-row-group !important;
    }
    .excel-matrix-table tfoot {
        display: table-footer-group !important;
    }
    .excel-matrix-table tr {
        display: table-row !important;
        page-break-inside: avoid !important;
    }
    .excel-matrix-table th {
        background: #f1f5f9 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        padding: 4px 5px !important;
        font-size: 7.5pt !important;
        display: table-cell !important;
    }
    .excel-matrix-table td {
        border: 1px solid #666 !important;
        color: #000 !important;
        padding: 4px 5px !important;
        font-size: 7.5pt !important;
        display: table-cell !important;
    }
    .excel-matrix-table tfoot td {
        background: #eee !important;
        color: #000 !important;
        border-top: 2px solid #000 !important;
        font-weight: bold !important;
    }

    .mach-card-details {
        border: 1px solid #000 !important;
        margin-bottom: 12px !important;
        page-break-inside: avoid !important;
    }

    .mach-card-summary {
        background: #eee !important;
        padding: 6px 10px !important;
        color: #000 !important;
        font-weight: bold !important;
    }

    /* Tablas de Fichas Individuales */
    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .print-table th {
        background: #eee !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        padding: 4px !important;
        font-size: 8pt !important;
    }

    .print-table td {
        border: 1px solid #ccc !important;
        color: #000 !important;
        padding: 4px !important;
        font-size: 8pt !important;
    }

    .print-table td strong {
        color: #000 !important;
    }
}

/* ==========================================================================
   Formulario Premium en Modales y Configuración
   ========================================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.form-group:focus-within label {
    color: var(--primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: var(--text-main);
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    font-family: var(--font-sans);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-sizing: border-box;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3.5px var(--primary-glow);
}

/* Selector del mapa y contenedor */
.map-selection-container {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 16px;
    border-radius: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.map-selection-container span {
    font-weight: 600;
    color: #475569;
}

#modal-map {
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

#modal-map:hover {
    border-color: #cbd5e1;
}

/* Modificar botones de pie de modal */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding-top: 15px;
}

.modal-footer .btn {
    padding: 11px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-footer .btn-secondary {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}

.modal-footer .btn-secondary:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.modal-footer .btn-primary {
    background: var(--primary);
    border: 1.5px solid var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(229, 112, 32, 0.2);
}

.modal-footer .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 12px -2px rgba(229, 112, 32, 0.35);
}

/* Estilos personalizados para SweetAlert2 */
.swal2-popup {
    font-family: 'Outfit', sans-serif !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

.swal2-title {
    color: var(--text-main) !important;
    font-weight: 600 !important;
}

.swal2-html-container {
    color: var(--text-muted) !important;
}

.swal2-confirm.swal2-styled {
    background-color: var(--primary) !important;
    border-radius: 8px !important;
}

.swal2-cancel.swal2-styled {
    background-color: #64748b !important;
    border-radius: 8px !important;
}

/* ==========================================================================
   Alineación y Estética "Flat Orange" (Plano, Elegante, Sin Sombras)
   ========================================================================== */

/* Títulos de Página en Naranja Klaro (Flat Orange) */
h1, 
.welcome-section h1, 
.header-action-row h1, 
.sidebar-header h2,
.card h2 {
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    font-weight: 700 !important;
}

/* Quitar box-shadows globales */
.card, 
.metric-card, 
.btn, 
.btn-primary, 
.modal-card, 
.login-card, 
.swal2-popup, 
.compact-cash-row, 
.alert-item,
.form-group input, 
.form-group select {
    box-shadow: none !important;
}

/* Quitar transformaciones y traslaciones al pasar el ratón (Flat design) */
.metric-card:hover,
.alert-item:hover,
.btn:hover,
.btn-primary:hover,
.btn-action:hover,
.nav-item:hover,
.nav-item.active {
    transform: none !important;
}

/* Ajustar botones de acción en la tabla para que sean planos y soporten iconos SVG */
.btn-action {
    border: 1px solid var(--bg-card-border) !important;
    background: #ffffff !important;
    color: var(--text-muted) !important;
    border-radius: 8px !important;
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: none !important;
}

.btn-action:hover {
    background: rgba(229, 112, 32, 0.08) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.btn-action svg {
    width: 18px !important;
    height: 18px !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* Ajustes en los inputs y focos */
.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.input-wrapper input:focus {
    box-shadow: none !important;
    border-color: var(--primary) !important;
    background: #ffffff !important;
}

/* Eliminar efectos de brillo en badges */
.alert-item.error .alert-indicator,
.alert-item.warning .alert-indicator,
.status-badge::before {
    box-shadow: none !important;
    animation: none !important;
}

/* Quitar los iconos de los inputs si los hubiera */
.input-icon {
    display: none !important;
}

.input-wrapper input {
    padding-left: 14px !important; /* Ajustar padding al no haber icono */
}

/* User Dropdown Menu (Flat Orange) */
.user-menu-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    background: #ffffff;
    border: 1px solid var(--bg-card-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    box-shadow: none;
}

.user-dropdown-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(229, 112, 32, 0.04);
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: #ffffff;
    min-width: 190px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-content.show {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-header strong {
    font-size: 0.9rem;
    color: var(--text-main);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--bg-card-border);
}

.dropdown-item {
    color: var(--text-main);
    padding: 10px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-trans-medium);
}

.dropdown-item.text-danger {
    color: var(--accent-red);
}

.dropdown-item.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.08);
}

/* Config Tabs (Flat Orange) */
.config-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--bg-card-border);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.config-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.config-tab-btn:hover {
    color: var(--primary);
    background: rgba(229, 112, 32, 0.04);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.config-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.config-tab-pane {
    display: none;
}

.config-tab-pane.active {
    display: block;
}

/* ==========================================================================
   OPTIMIZACIONES RESPONSIVE (Móviles y Tablets - Dashboard & Navegación)
   ========================================================================== */

@media (max-width: 850px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }

    .header-container .logo-box {
        justify-content: center;
    }

    .main-nav {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        gap: 6px;
        padding-bottom: 6px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav::-webkit-scrollbar {
        height: 3px;
    }

    .main-nav::-webkit-scrollbar-thumb {
        background: rgba(229, 112, 32, 0.3);
        border-radius: 3px;
    }

    .user-menu-dropdown {
        align-self: center;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 16px 12px;
        gap: 20px;
    }

    .welcome-section h1 {
        font-size: 1.6rem;
    }

    .welcome-section p {
        font-size: 0.85rem;
    }

    /* 4 KPIs en cuadrícula 2x2 para móviles */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-title {
        font-size: 0.75rem;
    }

    .metric-value {
        font-size: 1.6rem;
    }

    /* Card Header Actions (Buscador y Sincronizar) */
    .card-header-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .card-header-actions > div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    #table-search {
        width: 100% !important;
    }

    #btn-sync-all {
        width: 100%;
        justify-content: center;
    }

    /* Tabla Responsive con Scroll Táctil */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-sm);
    }

    .premium-table th,
    .premium-table td {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    /* Modales en Móviles */
    .modal-card {
        width: 95vw !important;
        max-height: 88vh !important;
        padding: 16px !important;
        overflow-y: auto !important;
    }
}

/* ==========================================================================
   Estilos de Footer y Release Notes Modal
   ========================================================================== */
.app-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 40px;
    border-top: 1px solid var(--bg-card-border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.app-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.badge-version {
    background: rgba(229, 112, 32, 0.12);
    color: var(--primary);
    border: 1px solid rgba(229, 112, 32, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    display: inline-block;
}

.release-notes-link {
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.release-notes-link:hover {
    color: var(--primary);
    text-decoration-style: solid;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
