/* FONT INTER: Look Apple moderno */
:root {
    /* MODO CLARO (APPLE LIGHT) */
    --bg-page: #f5f5f7;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.75);
    --bg-popover: rgba(255, 255, 255, 0.9);
    --bg-input: #f5f5f7;
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --border: rgba(0, 0, 0, 0.1);
    --shadow-main: rgba(0, 0, 0, 0.04);
    --shadow-hover: rgba(0, 0, 0, 0.08);
    --accent: #007aff;
    --accent-soft: rgba(0, 122, 255, 0.1);
}

body.dark-mode {
    /* MODO OSCURO (APPLE DARK / SPACE GREY) */
    --bg-page: #000000;
    --bg-card: #1c1c1e;
    --bg-header: rgba(28, 28, 30, 0.75);
    --bg-popover: rgba(44, 44, 46, 0.95);
    --bg-input: #2c2c2e;
    --text-main: #ffffff;
    --text-sub: #98989d;
    --border: rgba(255, 255, 255, 0.12);
    --shadow-main: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.15);
}

/* Aplicamos las variables a los elementos */
body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}
.module-card, .management-card, .print-card, .form-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 8px 24px var(--shadow-main) !important;
    color: var(--text-main) !important;
}
.hero-title, .brand-text { color: var(--text-main); }
.apple-profile-popover { background: var(--popover-bg) !important; border-color: var(--border-color); color: var(--text-main); }




* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER REFORMADO ESTILO APPLE GLOBAL */
.apple-header {
    position: fixed !important;
    top: 0 !important;
    left: 70px !important;
    width: calc(100% - 70px) !important;
    height: 52px;
    background: var(--bg-header) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border) !important;
    z-index: 5000 !important; /* Subimos a 5000 para que nada la tape */
    display: flex !important;
    justify-content: center !important;
}

.header-container {
    max-width: 1024px;
    height: 100%;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    height: 18px; /* Tamaño discreto y elegante */
    width: auto;
}

.brand-text {
    font-size: 19px;
    font-weight: 500;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-link {
    font-size: 12px;
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 400;
    opacity: 0.8;
}

.header-link:hover {
    opacity: 1;
}

.menu-icon {
    color: #1d1d1f;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Ajuste para que el login no se pegue al header */
.login-wrapper {
    margin-top: 52px; /* Espacio igual al alto del header */
}

/* MAIN WRAPPER */
.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px; /* Padding dinámico para que nunca toque los bordes */
    min-height: calc(100vh - 104px); /* Resta el alto de header y footer */
}

/* LA TARJETA (CARD) */
.login-card {
    width: 100%;
    max-width: 400px; /* Bajamos de 440 a 400 para que se vea más estilizada, como al 90% de zoom */
    background: #ffffff;
    border-radius: 28px;
    padding: 48px 32px; /* Reducimos un poco el padding interno */
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04), 0 20px 60px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0,0,0,0.02);
    transition: transform 0.3s ease; /* Efecto suave al cambiar de tamaño */
}

.apple-id-icon {
    height: 90px; /* Logo 2: DElogoColor.png */
    margin-bottom: 24px;
}

.login-title {
    font-size: 26px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.5px;
    margin-bottom: 34px;
}

/* INPUT STACK (El bloque de iCloud) */
.input-stack {
    border: 1px solid var(--border-grey);
    border-radius: 14px;
    overflow: hidden;
    background: var(--input-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
}

.input-stack:focus-within {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.input-field input {
    width: 100%;
    padding: 18px 16px;
    border: none;
    outline: none;
    font-size: 17px;
    background: transparent;
    color: #1d1d1f;
}

.divider {
    height: 1px;
    background-color: var(--border-grey);
    margin: 0 16px;
}

/* CHECKBOX ESTILO APPLE */
.options-row {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.check-container {
    font-size: 14px;
    color: #424245;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

/* BOTÓN DE FLECHA */
.apple-submit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #86868b;
    transition: color 0.2s;
    margin-bottom: 20px;
}

.apple-submit-btn:hover {
    color: #1d1d1f;
}

.arrow-icon {
    width: 44px;
    height: 44px;
}

/* LINKS AZULES */
.card-footer-links a {
    display: block;
    font-size: 14px;
    color: var(--apple-blue);
    text-decoration: none;
    margin-bottom: 12px;
}

.card-footer-links a:hover {
    text-decoration: underline;
}

/* ERROR MESSAGE */
.apple-error {
    background: #fff1f0;
    border: 1px solid #ffa39e;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #f5222d;
}

/* FOOTER */
.apple-footer {
    background: #f5f5f7;
    padding: 24px 0;
    font-size: 12px;
    color: var(--apple-grey);
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-left a {
    color: var(--apple-grey);
    text-decoration: none;
}

.footer-left a:hover {
    color: #1d1d1f;
}

.dot {
    height: 2px;
    width: 2px;
    background: #86868b;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .footer-left {
        justify-content: center;
    }
}

/* AJUSTES PARA PANTALLAS PEQUEÑAS (MÓVILES) */
@media (max-width: 480px) {
    .login-card {
        max-width: 100%;
        border-radius: 0; /* En móviles muy pequeños Apple suele eliminar bordes redondeados */
        box-shadow: none; /* Diseño plano para móviles */
        border: none;
        padding: 20px;
    }
    
    .login-title {
        font-size: 22px; /* Título más pequeño en móvil */
    }

    .header-container {
        padding: 0 15px;
    }

    .apple-footer {
        padding: 20px 0;
        position: relative; /* Cambiar de absolute a relative */
        width: 100%;
    }
}

/* AJUSTES PARA PANTALLAS MEDIANAS (TABLETS / LAPTOPS PEQUEÑAS) */
@media (max-height: 700px) {
    .login-wrapper {
        padding-top: 80px; /* Evita que el contenido choque con el header fixed */
    }
    
    .apple-id-icon {
        height: 70px; /* Reducimos el logo central si la pantalla es bajita */
        margin-bottom: 15px;
    }

    .login-title {
        margin-bottom: 20px;
    }
}

/* --- DASHBOARD SPECIFIC STYLES --- */

body.dashboard-body {
    background-color: #f5f5f7; /* Gris seda de Apple */
    color: #1d1d1f;
}

.dashboard-header-pro {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.dashboard-container {
    padding-left: 80px;   /* espacio para el sidebar */
    width: 100%;
}

.dashboard-container {
    margin-top: 0;
    padding-top: 0;
}



/* Hero Section */
.welcome-section {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 0.8s ease-out;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -1.2px;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 21px;
    color: #86868b;
    font-weight: 400;
}

/* Grid System */
.modules-grid {
    margin-top: 50px;
    display: grid;
    /* Forzamos 5 columnas iguales */
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px; /* Reducimos el espacio entre tarjetas */
    padding-top: 10px;
}

/* Cards Estilo Apple */
.module-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 20px; /* Bajamos de 30px a 20px */
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    min-height: 250px; /* Asegura que todas midan lo mismo de alto */
}


.module-card:hover {
    transform: translateY(-5px); /* Subida más discreta y elegante */
    box-shadow: 0 15px 35px var(--shadow-hover) !important;
}


.module-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.icon-box {
    width: 54px;
    height: 54px;
    border-radius: 14px; /* Bordes más suaves estilo iOS */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Sombra muy sutil */
}

/* COLORES DE SISTEMA APPLE (Nítidos y nítidos) */
.blue-gradient { background-color: #007AFF; }   /* iOS Blue */
.orange-gradient { background-color: #FF9500; } /* iOS Orange */
.purple-gradient { background-color: #5856D6; } /* iOS Indigo */
.grey-gradient { background-color: #8E8E93; }   /* iOS Gray */

.module-card h2 {
    font-size: 17px; /* Bajamos de 20px a 17px */
    font-weight: 600;
    margin-bottom: 8px;
}

.module-card p {
    font-size: 13px; /* Bajamos de 15px a 13px */
    color: #86868b;
    line-height: 1.3;
}

.module-card h2, .hero-title, .brand-text {
    color: var(--text-main) !important;
}

.module-card p, .hero-subtitle {
    color: var(--text-sub) !important;
}

.card-footer {
    margin-top: 20px; /* Bajamos de 30px a 20px */
    padding-top: 12px;
    border-top: 1px solid #f5f5f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #0066cc;
    font-weight: 500;
    font-size: 13px; /* Un poco más pequeño */
}

/* Elementos del Header */
.pro-badge {
    background: #1d1d1f;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
}

.user-greeting {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 400;
}

.user-avatar {
    font-size: 24px;
    color: #86868b;
}

/* Botón Logout */
.quick-actions {
    text-align: center;
}

.logout-link {
    color: #ff3b30; /* Rojo Apple Error */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.logout-link:hover {
    opacity: 0.7;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 18px; }
}

/* --- REFORMAS GLOBALES --- */
body {
    -webkit-font-smoothing: antialiased; /* Suavizado de fuente estilo macOS */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* --- REFORMA GRILLA (4 EN UNA FILA) --- */
.modules-grid.four-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columnas de igual tamaño */
    gap: 20px;
    max-width: 100%;
}

.module-card {
    border-radius: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    height: 100%; /* Asegura que todas midan lo mismo de alto */
}

/* FUERZA 5 COLUMNAS EN UNA FILA */
.modules-grid.six-columns {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important; /* 6 en monitor grande */
    gap: 15px !important;
    width: 100% !important;
}

/* Ajuste preventivo para que quepan bien */
.five-columns .module-card {
    padding: 20px 15px !important; /* Menos espacio interno lateral */
    min-height: 250px !important;
}

/* RESPONSIVE: En monitores más pequeños las pone en 3 y 3 */
@media (max-width: 1400px) {
    .modules-grid.six-columns {
        grid-template-columns: repeat(3, 1fr) !important; 
    }
}

@media (max-width: 900px) {
    .modules-grid.six-columns {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- REFORMA TEXTOS --- */
.hero-title {
    font-weight: 600;
    letter-spacing: -1.5px;
    color: #1d1d1f;
}

.module-card h2 {
    font-weight: 600;
    font-size: 19px;
    letter-spacing: -0.5px;
}

.module-card p {
    font-weight: 400;
    color: #6e6e73;
    font-size: 14px;
}

/* --- BOTÓN LOGOUT PROFESIONAL --- */
.system-actions {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-apple-logout:hover {
    background: #ff3b30;
    color: #fff;
    box-shadow: 0 5px 15px rgba(255, 59, 48, 0.2);
    transform: translateY(-2px);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .modules-grid.four-columns {
        grid-template-columns: repeat(2, 1fr); /* 2x2 en tablets */
    }
}

@media (max-width: 600px) {
    .modules-grid.four-columns {
        grid-template-columns: 1fr; /* 1 columna en móviles */
    }
}

/* Status Pills */
.status-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.status-item {
    font-size: 13px;
    color: #6e6e73;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.05);
}

.dot { height: 8px; width: 8px; border-radius: 50%; }
.dot.blue { background: #007AFF; }
.dot.orange { background: #FF9500; }
.dot.green { background: #34C759; }

/* Refinamiento de Tarjetas */
.module-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
    transition: all 0.4s cubic-bezier(0.15, 0, 0.15, 1);
}

.module-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
}

/* Colores de Icon Box más suaves (System Translucent) */
.blue-sys { background: rgba(0, 122, 255, 0.1); color: #007AFF; }
.orange-sys { background: rgba(255, 149, 0, 0.1); color: #FF9500; }
.purple-sys { background: rgba(88, 86, 214, 0.1); color: #5856D6; }
.grey-sys { background: rgba(142, 142, 147, 0.1); color: #8E8E93; }

/* Botón de Logout mejor integrado */
.system-actions {
    margin-top: 80px;
    border-top: 1px solid #d2d2d7;
    padding-top: 40px;
}

/* --- ESTILOS DE FORMULARIO APPLE PRO --- */

.form-wrapper {
    max-width: 1100px; /* Aumentamos de 900 a 1100 para dar aire a los lados */
    margin: 0;
    padding: 0;
}

.form-card {
    background: #fff;
    border-radius: 32px;
    padding: 50px; /* Más padding interno para elegancia */
    box-shadow: 0 10px 40px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
}

.form-group-section {
    margin-bottom: 35px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.section-header i {
    font-size: 18px;
    color: #007AFF;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Grilla de inputs estilo iOS */
.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px; /* Aumentamos el espacio entre columnas */
}

.input-grid.full-width {
    grid-template-columns: 1fr;
}

.apple-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.apple-input label {
    font-size: 12px;
    font-weight: 500;
    color: #86868b;
    margin-left: 4px;
}

.apple-input input, 
.apple-input select, 
.apple-input textarea {
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 14px;
    color: #1d1d1f;
    outline: none;
    transition: all 0.2s ease;
    width: 100%; /* Obliga a estirarse al máximo */
    min-width: 100%;
    max-width: 100%;
    /* FORZAMOS LA FUENTE APPLE */
    font-family: 'Inter', -apple-system, sans-serif !important;
    line-height: 1.5;
    resize: vertical; /* Permite estirar hacia abajo pero no hacia los lados para no dañar el diseño */
}

.full-width {
    grid-column: 1 / -1; /* Asegura que el grid no lo encierre en una columna pequeña */
}

.apple-input input:focus, 
.apple-input textarea:focus {
    background: #fff;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0,122,255,0.1);
}

/* Evita que los inputs empujen el grid hacia afuera */
.apple-input input, .apple-input select, .apple-input textarea {
    width: 100%;
    min-width: 0; /* Clave para evitar el desborde en grids */
}

/* --- MEJORA DEL SELECT ESTILO APPLE --- */
.apple-input select {
    appearance: none; /* Elimina la flecha fea por defecto */
    -webkit-appearance: none;
    -moz-appearance: none;
    
    background-color: #f5f5f7;
    /* Añadimos una flecha sutil estilo Apple (SVG) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='3' 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 15px center;
    background-size: 12px;
    
    padding: 12px 40px 12px 15px; /* Espacio extra a la derecha para la flecha */
    font-family: 'Inter', sans-serif !important; /* Forzamos la fuente */
    font-size: 14px;
    color: #1d1d1f;
    border: 1px solid transparent;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

/* Estilo cuando pasas el mouse o haces foco */
.apple-input select:focus {
    background-color: #fff;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0,122,255,0.1);
}

/* Estilo para las opciones internas (Solo funciona en algunos navegadores, pero ayuda) */
.apple-input select option {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background-color: #fff;
    color: #1d1d1f;
    padding: 10px;
}

/* Inputs duales (Marca/Modelo o Servicio/Estado) */
.dual-input {
    display: flex;
    gap: 10px;
}

.dual-input input, .dual-input select {
    flex: 1;
}

/* Botones Pro */
.form-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-primary-apple {
    background: #007AFF;
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 350px;
    transition: all 0.3s ease;
}

.btn-primary-apple:hover {
    background: #006ce0;
    transform: none; /* Apple no suele usar saltos, solo cambios de color sutiles */
    box-shadow: 0 4px 12px rgba(0,122,255,0.2);
}

.btn-primary-apple:active {
    background: #0056b3;
    transform: scale(0.98); /* Micro-interacción al hacer clic */
}

.btn-cancel-apple {
    color: #007AFF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* Animación de entrada */
.animate-in {
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .input-grid { grid-template-columns: 1fr; }
    .form-card { padding: 25px; }
}

.falla-reportada-row {
    margin-bottom: 25px; /* Crea el espacio que pediste con lo que sigue abajo */
}

/* --- EL BOTÓN "APPLE SIGNATURE" --- */
/* Un botón estilo macOS/iOS de sistema Pro */
.btn-primary-apple {
    background: #007AFF;
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 12px; /* Radio de curvatura exacto de Apple */
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.2px;
    cursor: pointer;
    width: auto; /* Ya no ocupa todo el ancho, se ve más refinado */
    min-width: 280px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- ESTILO CALENDARIO APPLE PRO --- */

/* Contenedor relativo para el icono personalizado */
.apple-input-date {
    position: relative;
    display: flex;
    align-items: center;
}

/* Forzamos el estilo del input date */
input[type="date"] {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px;
    color: #1d1d1f;
    cursor: pointer;
    text-transform: uppercase; /* Para que se vea más técnico: DD/MM/AAAA */
}

/* Ocultamos el icono de calendario feo por defecto del navegador */
input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

/* Añadimos nuestro propio icono sutil estilo Apple (SVG) */
.apple-input-date::after {
    content: "";
    position: absolute;
    right: 15px;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none; /* Permite que el click pase al input */
}

/* Estilo para los textos internos (dd, mm, aaaa) */
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
    color: #86868b;
    padding: 0 2px;
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: #1d1d1f;
}

/* --- ESTILOS PRINT-OPTIONS APPLE PRO --- */

.print-wrapper {
    max-width: 600px;
    margin: 100px auto 40px;
    padding: 0 20px;
}

.print-card {
    background: #fff;
    border-radius: 32px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04);
}

.status-check {
    width: 60px;
    height: 60px;
    background: #34C759; /* Verde Apple */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.2);
}

.order-headline {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
}

.order-id-label {
    font-size: 17px;
    color: #86868b;
    font-weight: 500;
    margin-bottom: 30px;
}

/* Resumen de Información Estilo iOS List */
.summary-box {
    background: #f5f5f7;
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    margin-bottom: 30px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #86868b;
    font-size: 14px;
    font-weight: 500;
}

.summary-value {
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 600;
}

/* Botonera Principal */
.print-actions {
    display: flex;
    flex-direction: column;
    gap: 14px; /* Espaciado más aireado */
    max-width: 320px; /* Ancho más contenido y elegante */
    margin: 0 auto;
}

.btn-apple-pro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 10px; /* Curvatura oficial de botones de sistema */
    font-size: 15px; /* Tamaño Apple estándar para botones de acción */
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid transparent;
    -webkit-font-smoothing: antialiased;
}

.btn-blue:hover {
    background-color: #0077ed; /* Brillo sutil */
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.btn-blue:active {
    background-color: #0062c3;
    transform: scale(0.98); /* Micro-interacción de presión */
}

.btn-blue {
    background-color: #0071e3;
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-dark {
    background-color: #f5f5f7; /* Gris fondo de botón secundario */
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.btn-dark:hover {
    background-color: #e8e8ed;
    border-color: #86868b;
}

.btn-dark:active {
    background-color: #d2d2d7;
    transform: scale(0.98);
}

.btn-apple-pro i {
    font-size: 14px;
    opacity: 0.9;
}

.btn-apple-pro:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Destructive Actions */
.management-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.secondary-action {
    color: #0066cc;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.secondary-action:hover {
    text-decoration: underline;
}

.action-danger {
    color: #ff3b30;
}

/* --- MANAGEMENT VIEW (APPLE TABLE) --- */

.management-wrapper {
    max-width: 1450px !important; /* Aumentamos de 1350 a 1450 para dar más aire */
    margin: 80px auto 40px;
    padding: 0 40px;
    width: calc(100% - 100px) !important;
}

.management-card {
    background: #fff;
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
}

.table-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.count-badge {
    background: #f5f5f7;
    color: #86868b;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.apple-table-container {
    overflow-x: auto;
}

.apple-table {
    width: 100% !important;
    border-collapse: collapse;
    table-layout: auto; /* Cambiamos de fixed a auto para que las columnas se encojan si es necesario */
    min-width: 100% !important; /* Eliminamos el valor de 1000px que tenías antes */
}

/* Ajuste para que los iconos de acción no se amontonen */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: nowrap; /* Evita que los iconos salten de línea */
}


.apple-table th {
    text-align: left;
    padding: 15px;
    color: #86868b;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f7;
}

.apple-table td {
    padding: 15px 10px; /* Menos espacio vertical para evitar el estiramiento */
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f7;
    word-wrap: break-word; /* Si algo es muy largo, lo corta con elegancia */
}

.apple-table tr:last-child td {
    border-bottom: none;
}

.id-cell {
    font-size: 12px;
    font-weight: 600;
    color: #1d1d1f;
    white-space: nowrap; /* El ID no debe saltar de línea */
}

.device-sub {
    font-size: 11px;
    color: #86868b;
    font-family: monospace; /* Los IMEI se leen mejor en fuente fija */
}

.date-cell {
    font-size: 13px;
    color: #1d1d1f;
    white-space: nowrap;
}


.client-name {
    font-weight: 600;
    color: #1d1d1f;
}

.client-sub {
    font-size: 12px;
    color: #86868b;
}

/* BADGES APPLE STYLE */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap; /* CLAVE: Evita que el texto salte hacia abajo */
}

.badge.recibido { background: #e1f0ff; color: #007aff; }
.badge.entregado { background: #e2fbe8; color: #34c759; }

/* ACCIONES */
.action-buttons {
    display: flex;
    justify-content: flex-end; /* Alineados a la derecha */
    gap: 6px; /* Espacio mínimo profesional entre iconos */
    width: 100%;
    min-width: 180px; /* Espacio justo para los 6 iconos sin sobrar */
}


.action-buttons a {
    color: #86868b;
    transition: color 0.2s;
    font-size: 16px;
}

.action-buttons a:hover {
    color: #007aff;
}

.text-right { text-align: right; }

.empty-state {
    text-align: center;
    padding: 60px !important;
    color: #86868b;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.2;
}

/* --- MEJORAS DE LISTADO PRO --- */

.table-tools {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-form i.fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    font-size: 14px;
}

.search-form input {
    width: 100%;
    padding: 12px 45px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-form input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0,122,255,0.1);
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #d2d2d7;
    text-decoration: none;
}

.header-link-btn {
    background: #007AFF;
    color: #ffffff !important;
    /* Fuente oficial del ecosistema Apple */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 14px;
    font-weight: 500; /* Peso medio, ni muy delgada ni muy gruesa */
    letter-spacing: -0.2px; /* El secreto: letras un poco más juntas para look Premium */
    
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Espacio perfecto entre el '+' y el texto */
    
    /* Suavizado de fuente (Anti-aliasing) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    outline: none;
}

/* Iconos de acción refinados */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #86868b; /* Gris Apple neutro */
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


.icon-btn:hover {
    background-color: #f5f5f7;
    color: #1d1d1f;
    transform: scale(1.1);
}

.delete-btn:hover {
    color: #ff3b30 !important;
    background-color: rgba(255, 59, 48, 0.1) !important;
}

/* Colores de stock dinámicos */
.text-orange { color: #FF9500 !important; font-weight: 600; }
.text-success { color: #34C759 !important; font-weight: 600; }
.text-danger { color: #FF3B30 !important; font-weight: 600; }

/* Efecto hover rojo sutil para eliminar */
.delete-btn:hover {
    background-color: rgba(255, 59, 48, 0.1) !important;
    color: #FF3B30 !important;
}

.device-info {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 13px;
    line-height: 1.2;
}

/* --- FINACE PANEL APPLE STYLE --- */

.finance-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.finance-card {
    background: #fff;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-balance {
    background: #1d1d1f; /* Negro Apple */
    color: #fff;
}

.f-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 8px;
}

.f-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
}

.f-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 30px;
    opacity: 0.1;
}

.f-progress-bar {
    height: 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    margin-top: 15px;
}

.f-progress-bar .progress {
    height: 100%;
    background: #34C759;
    border-radius: 10px;
}

/* Clases de utilidad para la tabla */
.fw-600 { font-weight: 600; }
.text-success { color: #34C759; }
.text-danger { color: #FF3B30; }
.text-muted { color: #86868b; }

.action-circle-btn {
    width: 32px;
    height: 32px;
    background: #f5f5f7;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1d1d1f;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-circle-btn:hover {
    background: #007aff;
    color: #fff;
    transform: scale(1.1);
}

@media (max-width: 900px) {
    .finance-summary { grid-template-columns: 1fr; }
}

/* --- REFORMA BOTÓN DE RECIBO APPLE STYLE --- */

.apple-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background-color: rgba(0, 113, 227, 0.08); /* Azul traslúcido oficial */
    color: #0071e3; /* Azul Apple */
    text-decoration: none;
    border-radius: 20px; /* Forma de píldora estilo iOS */
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.apple-view-btn i {
    font-size: 14px;
}

.apple-view-btn:hover {
    background-color: #0071e3;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
    transform: translateY(-1px);
}

.apple-view-btn:active {
    transform: scale(0.96);
}

/* Ajuste de tipografía para la tabla de finanzas */
.apple-table th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: #86868b;
}

/* --- BOTÓN DE ENTREGA RÁPIDA --- */
.deliver-btn {
    background: transparent !important;
    border: none !important;
}

.delivered-icon {
    color: #34C759;
    opacity: 0.5;
    cursor: default;
}


.deliver-btn:hover {
    color: #34C759 !important;
    background: rgba(52, 199, 89, 0.1) !important;
}

.disabled-btn {
    opacity: 0.3;
    cursor: default;
    color: #86868b;
}

/* Animación sutil para los iconos de acción */
.action-buttons .icon-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-buttons .icon-btn {
    width: 28px; /* Iconos ligeramente más pequeños para ganar espacio */
    height: 28px;
    font-size: 13px;
}

/* --- MODAL DE SISTEMA APPLE --- */
.apple-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.apple-modal {
    background: rgba(255, 255, 255, 0.9);
    width: 270px; /* Ancho estándar de alertas iPhone */
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-family: 'Inter', -apple-system, sans-serif !important;
    animation: appleAlertScale 0.2s ease-out;
}

@keyframes appleAlertScale {
    from { opacity: 0; transform: scale(1.2); }
    to { opacity: 1; transform: scale(1); }
}

.apple-modal-content {
    padding: 20px;
}

.apple-modal i {
    font-size: 32px;
    color: #34C759;
    margin-bottom: 12px;
}

.apple-modal h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #000;
}

.apple-modal p {
    font-size: 13px;
    color: #000;
    line-height: 1.3;
    margin-bottom: 0;
}

.apple-modal-buttons {
    display: flex;
    flex-direction: column;
    border-top: 0.5px solid rgba(0,0,0,0.2);
}

.apple-modal-btn {
    background: transparent;
    border: none;
    border-bottom: 0.5px solid rgba(0,0,0,0.2);
    padding: 12px;
    font-size: 17px;
    font-family: 'Inter', sans-serif !important;
    cursor: pointer;
    color: #007AFF;
    width: 100%;
}

.apple-modal-btn:last-child {
    border-bottom: none;
}

.apple-modal-btn.confirm {
    font-weight: 600; /* Texto más fuerte para confirmar */
}

.apple-modal-btn.cancel {
    font-weight: 400;
}

.apple-modal-btn:hover {
    background: rgba(0,0,0,0.05);
}

.apple-modal-btn:hover { background: #f5f5f7; }
.apple-modal-btn.confirm { font-weight: 600; }
.apple-modal-btn.cancel { color: #ff3b30; }

.text-orange { color: #FF9500; }
.text-success { color: #34C759; }
.text-danger { color: #FF3B30; }

/* Efecto deshabilitado sutil */
.badge.grey-sys {
    background: rgba(142, 142, 147, 0.1);
    color: #8E8E93;
}

/* --- CORRECCIÓN DE BOTONES Y MODALES PRO --- */

/* Eliminar el borde negro y pulir el botón de añadir */
.header-link-btn {
    background: #007AFF;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 10px; /* Radio oficial Apple */
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: none; /* ELIMINA EL FILO NEGRO */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3);
    outline: none;
}

.header-link-btn:hover {
    background: #006ce0;
    transform: none; /* Apple no usa saltos, solo cambio de color */
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.header-link-btn:active {
    transform: scale(0.97); /* Micro-interacción de click real */
}

/* REFORMA TOTAL DEL MODAL DE INVENTARIO */
.apple-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    padding: 0; /* Quitamos padding para manejarlo por secciones */
    width: 380px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

.apple-modal-content {
    padding: 32px 28px;
}

.apple-modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.apple-modal-content p {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 24px;
}

/* Estilo de inputs dentro del modal */
.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apple-modal input, .apple-modal select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0,0,0,0.05);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
}

.apple-modal input:focus {
    background: #fff;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0,122,255,0.15);
}

/* Botones del modal estilo Alerta */
.apple-modal-buttons {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.apple-modal-btn {
    padding: 14px;
    font-size: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s;
}

.apple-modal-btn.confirm {
    color: #007AFF;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.apple-modal-btn.cancel {
    color: #ff3b30;
}

.apple-modal-btn:hover {
    background: rgba(0,0,0,0.03);
}

/* Badge para estado LISTO (Reparado) */
.badge.listo {
    background: #e2fbe8; /* Verde muy suave */
    color: #34C759;      /* Verde Apple */
}

/* ============================================================
   iDROID SPOTLIGHT ULTIMATE (ESTILO APPLE SEQUOIA)
   ============================================================ */

/* Contenedor flotante principal */
.apple-spotlight-results {
    display: none; /* Se activa por JS */
    position: absolute !important;
    top: 45px !important; /* Baja el menú para que no tape la barra */
    left: 0 !important;
    right: 0 !important; /* Se ajusta al ancho de la barra automáticamente */
    width: 100% !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15) !important;
    z-index: 99999 !important;
    padding: 8px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* Fila de resultado: FLEXBOX BLINDADO */
.sp-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 2px;
}

.sp-row:hover {
    background: var(--accent-soft) !important;
}

/* Grupo de información (Izquierda) */
.sp-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    flex: 1; /* Esto empuja las acciones a la derecha */
    min-width: 0;
}

.sp-id-tag {
    font-size: 10px;
    font-weight: 700;
    color: #007AFF;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.sp-client-name {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-device-name {
    font-size: 12px;
    color: #86868b;
    text-align: left;
}

/* Grupo de acciones (Derecha) */
.sp-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 15px;
    flex-shrink: 0; /* Evita que los botones se encojan */
}

/* El botón circular de la impresora */
.sp-btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input) !important; /* Se adapta al gris del modo */
    border: none;
    color: var(--text-sub) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* RESET DE POSICIÓN PARA CENTRADO PERFECTO */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important; /* Elimina el espacio de texto */
    position: relative !important;
    overflow: hidden;
}


.sp-btn-circle i {
    font-size: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    position: static !important; /* Bloquea cualquier salto previo */
    transform: none !important;
}

.sp-btn-circle:hover {
    background: #007AFF;
    color: #fff;
    transform: scale(1.1);
}

.sp-arrow {
    font-size: 12px;
    color: #d2d2d7;
}

/* Mensaje sin resultados */
.no-results {
    padding: 30px;
    text-align: center;
    color: #86868b;
    font-size: 14px;
}

/* --- PERFIL POPOVER APPLE STYLE --- */
.profile-trigger {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 10px; padding: 5px;
    border-radius: 20px; transition: background 0.2s;
}
.profile-trigger:hover { background: rgba(0,0,0,0.03); }

.apple-profile-popover {
    display: none; /* Oculto por defecto */
    position: absolute; top: 60px; right: 20px;
    width: 280px; 
    /* Hemos quitado los !important de aquí para evitar conflictos */
    background: var(--bg-popover); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 20px; 
    border: 1px solid var(--border); 
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    z-index: 9999; /* Mantenemos un alto z-index, pero sin !important para que .show pueda modificar */
}
/* ============================================================
   SOLUCIÓN DEFINITIVA DE PERFIL POPOVER (v4)
   ============================================================ */

/* 1. Define el comportamiento del panel cuando está visible */
.apple-profile-popover.show {
    display: flex !important; /* Fuerza a mostrarse como flex */
    animation: applePop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- PERFIL POPOVER APPLE STYLE (CORREGIDO Y OPACO POR DEFECTO) --- */
.apple-profile-popover {
    display: none; /* Oculto por defecto */
    position: absolute; 
    top: 55px; /* Alineación vertical con los iconos */
    right: 20px;
    width: 290px; /* Ancho optimizado */
    
    /* HACEMOS EL FONDO OPACO BLANCO (O SU EQUIVALENTE EN MODO OSCURO) */
    background: var(--bg-card) !important; /* Usamos el bg-card que es opaco */
    
    /* ELIMINAMOS EL BLUR POR DEFECTO DEL POPOVER GENERAL */
    backdrop-filter: none; 
    -webkit-backdrop-filter: none;
    
    border-radius: 22px; /* Redondez Apple */
    border: 1px solid var(--border); 
    box-shadow: 0 18px 40px rgba(0,0,0,0.12); /* Sombra más profunda */
    z-index: 10002 !important; /* Prioridad máxima para que no quede detrás de nada */

    /* Preparamos el contenedor para Flexbox desde el inicio */
    flex-direction: column; 
    max-height: 580px; /* Altura máxima para el scroll */
    overflow: hidden; /* Oculta cualquier cosa que se salga del borde redondeado */
}

/* REGLAS PARA EL SCROLL INTERNO Y LAYOUT DE LOS POPOVERS */
.apple-profile-popover .popover-header {
    flex-shrink: 0; /* Header no se encoge */
}
.apple-profile-popover .popover-content {
    flex-grow: 1; /* El contenido central ocupa todo el espacio disponible */
    overflow-y: auto; /* Y SOLO ESTA PARTE TENDRÁ SCROLL SI ES NECESARIO */
    padding-right: 5px; /* Espacio para el scrollbar */
}
.apple-profile-popover .popover-footer {
    flex-shrink: 0; /* Footer no se encoge */
}

/* Estilos del scrollbar macOS-like (solo para Webkit) */
.apple-profile-popover .popover-content::-webkit-scrollbar {
  width: 6px;
}
.apple-profile-popover .popover-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}
.apple-profile-popover .popover-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

@keyframes applePop {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-header { padding: 25px 20px; text-align: center; border-bottom: 1px solid rgba(0,0,0,0.05); }
.large-avatar { font-size: 50px; color: #86868b; margin-bottom: 10px; }
.popover-header h3 { font-size: 17px; font-weight: 600; color: #1d1d1f; }
.popover-header p { font-size: 12px; color: #86868b; }

.popover-content { padding: 10px; }
.popover-section { margin-bottom: 15px; }
.section-title { font-size: 11px; font-weight: 600; color: #86868b; text-transform: uppercase; padding: 5px 10px; }

.popover-item {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 10px; border: none; background: transparent;
    border-radius: 8px; cursor: pointer; color: #1d1d1f; font-size: 14px;
}
.popover-item:hover { background: rgba(0,0,0,0.05); }
.popover-item i { color: #007AFF; width: 16px; }

.popover-stats { display: flex; gap: 8px; padding: 5px 10px; }
.stat-pill {
    flex: 1; background: #fff; padding: 8px; border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.03); display: flex; flex-direction: column;
}
.stat-num { font-size: 16px; font-weight: 700; color: #007AFF; }
.stat-desc { font-size: 10px; color: #86868b; }

.popover-footer { padding: 15px; text-align: center; border-top: 1px solid rgba(0,0,0,0.05); }
.logout-danger { color: #ff3b30; text-decoration: none; font-size: 14px; font-weight: 500; }

/* Input para el modal de edición */
.apple-modal-input {
    width: 100%; padding: 12px; border-radius: 10px;
    border: 1px solid #d2d2d7; margin-top: 15px; outline: none;
}
.apple-modal-input:focus { border-color: #007AFF; }

/* --- AJUSTE ICONO DE PERFIL CABECERA --- */
.user-avatar-wrapper i {
    color: #86868b !important; /* El gris exacto del panel de abajo */
    font-size: 24px; /* Tamaño equilibrado para el header */
    display: block;
    transition: color 0.2s ease;
}

/* Efecto al pasar el mouse por el nombre o el icono */
.profile-trigger:hover .user-avatar-wrapper i {
    color: #1d1d1f !important; /* Se oscurece un poco al pasar el mouse, estilo Apple */
}

/* Si ves un borde negro alrededor del botón, esto lo elimina */
.profile-trigger {
    background: none;
    border: none;
    outline: none;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

/* --- CONTACT FINDER STYLE --- */
.contact-finder {
    position: relative;
    margin-left: auto; /* Lo empuja a la derecha del header de sección */
    width: 250px;
}

.contact-finder i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #86868b;
}

.contact-finder input {
    width: 100%;
    padding: 6px 10px 6px 30px !important;
    font-size: 12px !important;
    background: #f5f5f7 !important;
    border: none !important; /* ELIMINA EL BORDE NEGRO */
    border-radius: 8px !important;
    outline: none !important; /* EVITA QUE APAREZCA AL HACER CLIC */
}

.contact-results-dropdown {
    display: none;
    position: absolute;
    top: 35px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 100;
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.contact-opt {
    padding: 10px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f7;
}

.contact-opt:hover { background: #007AFF; color: #fff; }
.contact-opt strong { font-size: 13px; }
.contact-opt span { font-size: 11px; opacity: 0.8; }

/* --- ALINEACIÓN SIMÉTRICA PRO --- */

.apple-table th, 
.apple-table td {
    text-align: center !important; /* Centrado horizontal total */
    vertical-align: middle !important; /* Centrado vertical total */
}

/* Forzamos que los bloques de texto internos también se centren */
.client-name, .client-sub, .device-info, .device-sub, .main-text, .sub-text, .sub-text-mono {
    text-align: center;
    width: 100%;
}

/* REFORMA DE BOTONES DE ACCIÓN: Centrados en su celda */
.action-buttons {
    display: flex;
    justify-content: center; /* Cambiado de flex-end a center */
    gap: 12px;
    width: 100%;
}

/* Ajuste para el badge de estado para que no se estire */
.badge {
    display: inline-block;
    margin: 0 auto;
}

/* --- ICONOS DE CABECERA APPLE --- */
.icon-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: #86868b;
    font-size: 18px;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-trigger:hover {
    background: rgba(0,0,0,0.05);
    color: #1d1d1f;
}

/* Ajuste específico para el panel de ajustes */
.settings-popover {
    right: 135px !important; /* Lo mueve más a la izquierda para alinear con el engranaje */
    width: 260px;
}

.settings-popover .popover-arrow {
    right: 25px !important; /* Alinea la flechita del panel con el icono del engranaje */
}

.popover-item, .popover-item:hover, .apple-view-btn, .secondary-action {
    text-decoration: none !important;
}

.popover-item span {
    color: var(--text-main);
}

.popover-divider {
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin: 8px 10px;
}

.support-popover {
    right: 175px !important;
    /* ELIMINAR O ANULAR backdrop-filter y background-color si quieres que sea opaco */
    /* background: var(--bg-card); */ 
    /* backdrop-filter: none; -webkit-backdrop-filter: none; */
}


/* --- ESTADO VACÍO CENTRADO (APPLE STYLE) --- */
.empty-state {
    text-align: center !important;
    padding: 100px 0 !important; /* Aumentamos el espacio vertical */
    color: #86868b;
    background-color: transparent !important;
}

.empty-state i {
    display: block; /* Obligamos al icono a ser un bloque para centrarlo */
    font-size: 54px; /* Icono más grande y elegante */
    margin: 0 auto 20px auto; /* Centrado horizontal y margen inferior */
    opacity: 0.2; /* Toque sutil de Apple */
    color: #1d1d1f;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    opacity: 0.6;
}

/* --- ESTILO SUGERENCIAS INTELIGENTES --- */
input[list] {
    cursor: pointer;
}

/* Mejoramos el hover en los campos predictivos */
input[list]:focus {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,113,227,0.15);
}

/* Ocultamos la flecha de datalist en algunos navegadores para que se vea más limpio */
input::-webkit-calendar-picker-indicator {
    opacity: 0.3;
    transition: opacity 0.2s;
    cursor: pointer;
}

input:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* --- SMART PICKER APPLE STYLE --- */
.picker-container {
    position: relative;
}

.apple-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-height: 250px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    padding: 6px;
}

/* Scrollbar elegante para el menú */
.apple-picker-dropdown::-webkit-scrollbar { width: 5px; }
.apple-picker-dropdown::-webkit-scrollbar-thumb { 
    background: rgba(0,0,0,0.1); 
    border-radius: 10px; 
}

.picker-option {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.picker-option:hover {
    background-color: #007AFF;
    color: #fff;
}

.picker-group-title {
    font-size: 10px;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    padding: 8px 14px 4px;
    letter-spacing: 0.5px;
}

.scan-visual-area {
    padding: 30px 20px;
    text-align: center;
}

.scan-visual-area i {
    font-size: 42px;
    color: #007AFF;
    margin-bottom: 15px;
    display: block;
}

.scan-visual-area h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #000;
}

.scan-visual-area p {
    font-size: 13px;
    color: #86868b;
    line-height: 1.4;
}

.scanner-actions {
    display: flex;
    flex-direction: column;
    border-top: 0.5px solid rgba(0,0,0,0.15);
}

.apple-sheet {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    position: relative;
}

.sheet-handle {
    width: 40px; height: 5px; background: #d2d2d7;
    border-radius: 10px; margin: 0 auto 15px;
}

.sheet-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}

.close-sheet-btn {
    background: none; border: none; font-size: 24px;
    color: #d2d2d7; cursor: pointer;
}

.ql-id { font-size: 12px; font-weight: 700; color: #007AFF; margin-bottom: 5px; }
.ql-main-info h2 { font-size: 24px; margin: 5px 0; letter-spacing: -0.5px; }
.ql-main-info p { color: #86868b; font-size: 15px; margin-bottom: 20px; }

.ql-finance-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 15px; background: #f5f5f7;
    padding: 15px; border-radius: 16px; margin-bottom: 20px;
}

.ql-fin-item span { display: block; font-size: 11px; color: #86868b; text-transform: uppercase; }
.ql-fin-item strong { font-size: 18px; }

.ql-actions-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ql-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px; background: #f5f5f7; border-radius: 12px;
    text-decoration: none; color: #1d1d1f; font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: 0.2s;
}

.ql-btn:hover { background: #e8e8ed; }
.ql-confirm { background: #34C759; color: #fff; }
.ql-confirm:hover { background: #28a745; }
.ql-disabled { opacity: 0.5; cursor: default; }

/* ============================================================
   iDROID SEARCH & SCANNER - RECONSTRUCCIÓN FINAL (ESTILO APPLE)
   ============================================================ */

/* Icono Lupa (Dentro del input a la izquierda) */
.search-icon-fixed {
    position: absolute !important;
    left: 14px !important;
    color: var(--text-sub) !important;
    font-size: 14px !important;
    z-index: 10 !important;
    pointer-events: none !important; /* Permite que el clic pase a través del icono hacia el input */
}

/* El Input de texto transparente */
.apple-search-input {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 15px 0 38px !important;
    font-size: 14px !important;
    color: #1c1c1e !important;
    outline: none !important;
}

.apple-search-input, .apple-modal-input, .apple-input input, .apple-input textarea {
    background: var(--bg-input) !important;
    color: var(--text-main) !important;
}

/* 2. Botón de Escaneo (Cuadrado redondeado e independiente) */
.barcode-scan-btn {
    width: 40px !important;
    height: 40px !important;
    background: #f2f2f7 !important;
    border: none !important;
    border-radius: 12px !important;
    color: #007aff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.barcode-scan-btn:hover {
    background: #e5e5ea !important;
    transform: scale(1.05) !important;
}

.barcode-scan-btn:active {
    transform: scale(0.95) !important;
}

.barcode-scan-btn i {
    font-size: 18px !important;
}

/* 3. El Modal de Escaneo - CENTRADO ABSOLUTO */
.apple-modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
}

.scanner-box {
    width: 300px !important; /* Ancho fijo para control total */
    background: #ffffff !important;
    border-radius: 22px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Centrado horizontal de hijos */
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.scan-content-area {
    padding: 35px 20px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Fuerza el centro de los textos */
    text-align: center !important;
}

.scan-content-area i {
    font-size: 42px !important;
    color: #007aff !important;
    margin-bottom: 15px !important;
}

.scan-content-area h3 {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #000 !important;
    margin: 0 0 8px 0 !important;
    width: 100% !important; /* Asegura que ocupe todo el ancho para centrar */
}

.scan-content-area p {
    font-size: 14px !important;
    color: #424245 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    width: 100% !important;
}

.scanner-footer {
    width: 100% !important;
    border-top: 0.5px solid rgba(0,0,0,0.1) !important;
    background: rgba(255,255,255,0.5);
}

.btn-cancel-scan {
    width: 100% !important;
    padding: 15px !important;
    background: transparent !important;
    border: none !important;
    color: #ff3b30 !important; /* Rojo Apple */
    font-size: 17px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    outline: none !important;
}

.btn-cancel-scan:hover {
    background: rgba(255, 59, 48, 0.05) !important;
}

/* --- REFORMA DE INTELIGENCIA FINANCIERA (ESTILO APPLE DASHBOARD) --- */
.finance-insights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Columnas perfectas */
    gap: 20px;
    margin-bottom: 35px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px var(--shadow-main);
    transition: all 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px var(--shadow-hover);
    border-color: rgba(0, 113, 227, 0.2);
}

.i-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Colores traslúcidos estilo Apple Control Center */
.blue-bg { background: rgba(0, 113, 227, 0.1); color: #007AFF; }
.green-bg { background: rgba(52, 199, 89, 0.1); color: #34C759; }
.purple-bg { background: rgba(175, 82, 222, 0.1); color: #AF52DE; }
.orange-bg { background: rgba(255, 149, 0, 0.1); color: #FF9500; }

.i-data {
    display: flex;
    flex-direction: column;
}

.i-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.i-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.pro-border {
    border: 1.5px solid rgba(0, 113, 227, 0.2);
    background: linear-gradient(to bottom right, #ffffff, #fbfbfb);
}

/* Responsive para pantallas pequeñas */
@media (max-width: 1100px) {
    .finance-insights-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   REPARACIÓN DE RAIZ: DOCK LATERAL Y LIENZO
   ============================================================ */

/* 1. EL DOCK: Posición fija y distribución vertical */
.apple-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 70px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 0 !important;
    z-index: 5000 !important; /* Valor alto para que nada lo tape */
}

/* 2. EL LOGO: Blindaje de tamaño para que no explote */
.img-sidebar-fix {
    width: 28px !important; /* TAMAÑO PEQUEÑO FIJO */
    height: 28px !important;
    object-fit: contain !important;
    display: block !important;
}

.sidebar-logo-container {
    display: block !important;
    margin-bottom: 20px !important;
}

/* 3. CENTRADO VERTICAL DE ICONOS */
.sidebar-middle {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important; /* ESTO CENTRA LOS ICONOS EN EL MEDIO DE LA PANTALLA */
    justify-content: center !important;
}

.nav-group-vertical {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
}

.nav-item {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    color: #86868b;
    font-size: 20px !important;
    transition: all 0.2s ease !important;
    
    /* --- ESTO ELIMINA LA RAYA EXTRAÑA --- */
    text-decoration: none !important; 
    border-bottom: none !important;
    outline: none !important;
}

.nav-item i {
    text-decoration: none !important;
}

.nav-item:hover {
    background: rgba(0, 113, 227, 0.1) !important;
    color: #007AFF !important;
    transform: scale(1.1);
}

/* ============================================================
   REMAQUETACIÓN ESTRUCTURAL iDROID (NIVEL APPLE HQ)
   ============================================================ */
/* 2. EL CONTENEDOR DE TARJETAS: Equilibrio de proporciones */
.modules-grid.five-columns {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 1140px !important; /* Ancho ideal para centrado visual Apple */
    margin: 40px auto 0 auto !important;
}

/* 3. LA TARJETA: Acabado de hardware Apple */
.module-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 24px 20px;
    text-decoration: none;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px var(--shadow-main);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.15, 0, 0.15, 1);
    /* Altura fija para que todas sean hermanas gemelas */
    height: 240px; 
}

.module-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px var(--shadow-hover);
    border-color: rgba(0, 113, 227, 0.2);
}


/* 5. TEXTOS Y ICONOS DENTRO DE TARJETA */
.module-card h2 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 15px;
    color: var(--text-main);
}

.module-card p {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-sub);
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 20px;
}

/* ============================================================
   iDROID OS - ARQUITECTURA DE VISTA MAESTRA (APPLE STANDARD)
   ============================================================ */

/* 1. EL LIENZO PRINCIPAL */
.dashboard-container, 
.management-wrapper, 
.form-wrapper {
    margin-left: 70px !important; /* Espacio del Dock */
    width: calc(100% - 70px) !important; /* Ocupa exactamente el resto de la pantalla */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* CENTRADO HORIZONTAL REAL */
    padding: 80px 40px 40px 40px !important;
    box-sizing: border-box !important;
}

/* Limitador de ancho para que nada se estire feo */
.dashboard-container > *, 
.management-wrapper > *, 
.form-card {
    max-width: 1100px !important; /* ANCHO MAESTRO */
    width: 100% !important;
}

/* 2. EL HEADER SUPERIOR (Alineado con el contenido) */
.apple-header {
    left: 70px !important; /* Alineado con el inicio del contenido */
    width: calc(100% - 70px) !important;
    display: flex !important;
    justify-content: center !important; /* Centra el contenido del header */
}

.header-container {
    width: 100% !important;
    max-width: 1140px !important; /* Misma medida que las tarjetas para simetría total */
    padding: 0 20px !important;
}

/* 3. HERRAMIENTAS DE BÚSQUEDA (Sin amontonar) */
.dashboard-header-pro {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-bottom: 40px !important;
    gap: 30px !important;
}

.search-tools-container {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    /* Quitamos el margin-top porque transform es más potente */
    transform: translateY(18px) !important; /* Cambia 18px por 25px si quieres que baje más aún */
}

.search-bar-wrapper {
    position: relative !important;
    width: 320px !important;
    background: var(--bg-input) !important;
    border-radius: 12px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    z-index: 10 !important; /* Asegura que esté por encima de otros elementos */
}

.search-icon-fixed {
    position: absolute !important;
    left: 14px !important; /* Posición fija a la izquierda */
    color: var(--text-sub) !important;
    font-size: 14px !important;
    z-index: 10 !important;
    pointer-events: none !important;
}

.apple-search-input {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding-left: 40px !important; /* ESPACIO VITAL PARA QUE LA LUPA NO TAPE EL TEXTO */
    padding-right: 15px !important;
    font-size: 14px !important;
    color: var(--text-main) !important;
    outline: none !important;
}

/* Botón de escaneo independiente */
.barcode-scan-btn {
    width: 40px !important;
    height: 40px !important;
    background: var(--bg-input) !important;
    border: none !important;
    border-radius: 12px !important;
    color: var(--accent) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 4. EL BOTÓN DE LOGOUT (REFORMADO) */
.system-actions {
    margin-top: 60px !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    border-top: 1px solid var(--border) !important;
    padding-top: 40px !important;
}

.btn-apple-logout {
    background: #ff3b30 !important; /* Rojo Apple Sólido */
    color: white !important;
    padding: 12px 30px !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.2) !important;
    transition: all 0.2s ease !important;
}

.btn-apple-logout:hover {
    transform: scale(1.02) !important;
    background: #e03127 !important;
}

.dashboard-wrapper {
    max-width: 1400px;   /* controla el ancho visual */
    margin: 0 auto;      /* 🔥 centra todo */
    width: 100%;
}


@media (min-width: 1600px) {
    .dashboard-wrapper {
        max-width: 1440px;
    }
}

.dashboard-header-pro, 
.table-header, 
.section-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ajuste adicional para el wrapper que creaste */
.dashboard-wrapper {
    margin-top: 0 !important; 
}

.client-name, .device-info {
    max-width: 300px; /* Damos más espacio para que quepa el nombre y el badge */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apple-table-container {
    overflow-x: hidden !important; /* Mata el scroll definitivamente */
}

.evidence-upload-area:hover {
    background: #f0f0f2 !important;
    border-color: #007AFF !important;
}

/* --- BOTÓN CALENDARIO PREMIUM --- */
.apple-calendar-picker {
    position: relative;
    background: #ffffff;
    border: 1px solid #d2d2d7;
    padding: 8px 18px;
    border-radius: 12px; /* Radio sutil de Apple */
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    justify-content: center;
}

.apple-calendar-picker:hover {
    background: #f5f5f7;
    border-color: #007AFF;
}

.apple-calendar-picker i {
    color: #007AFF;
    font-size: 16px;
    /* Ajuste de alineación óptica */
    transform: translateY(0px);
}

.apple-calendar-picker input[type="date"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Ocultamos el input real pero sigue siendo clickable */
    cursor: pointer;
    z-index: 2;
}

.calendar-label {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    font-family: 'Inter', sans-serif;
    /* Evita que el texto se mueva */
    pointer-events: none; 
}

/* Flecha sutil a la derecha */
.apple-calendar-picker::after {
    content: '\f078'; /* Icono de flecha hacia abajo */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: #86868b;
    margin-left: 4px;
}

/* Ajuste de Tabla Directorio (Compacto y Centrado) */
.apple-table th {
    text-align: center !important;
    padding: 15px 10px !important;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: #86868b;
}

.apple-table td {
    padding: 12px 10px !important; /* Altura de celda más pequeña y elegante */
    vertical-align: middle !important;
    border-bottom: 1px solid #f5f5f7;
}

.contact-row:hover {
    background-color: #fafafa !important;
}

/* Reset del documento (quitar sombras y fuentes mono) */
.id-cell {
    background: none !important;
    box-shadow: none !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
}

/* Elimina cualquier margen residual que pueda estar moviendo la tabla a la izquierda */
.apple-table {
    margin: 0 auto !important;
    width: 100% !important;
}

/* Forzamos que todas las columnas tengan un alineado base central */
.apple-table th, .apple-table td {
    text-align: center !important;
}

/* Ajuste para que los nombres largos no empujen las otras columnas */
.client-name {
    max-width: 200px; /* Limita el texto del nombre para mantener el centro */
}

/* --- ESTILO DE MENÚ DE AVATAR PROFESIONAL --- */
.avatar-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.2s ease;
    
    /* Forzamos la tipografía Apple */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1d1d1f;
    text-align: left;
}

.avatar-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.avatar-menu-item i {
    width: 16px;
    font-size: 14px;
    text-align: center;
    display: block;
    /* Ajuste para centrar icono con el texto */
    margin-top: -1px;
}

.avatar-menu-item span {
    line-height: 1;
}

/* iDroid Scanner Pro - Apple Design */
.scanner-visual-aid {
    background: #fbfbfd;
    border: 2px dashed #d2d2d7;
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.scanner-laser {
    position: absolute;
    left: 0; top: 0; width: 100%; height: 2px;
    background: rgba(0, 122, 255, 0.5);
    box-shadow: 0 0 15px #007AFF;
    animation: laser-scan 2.5s infinite ease-in-out;
}

@keyframes laser-scan {
    0% { top: 20%; }
    50% { top: 80%; }
    100% { top: 20%; }
}

.scan-instruction-box {
    display: flex; gap: 15px; align-items: center; 
    background: rgba(0,122,255,0.05); padding: 15px; border-radius: 14px;
    text-align: left; margin-top: 15px;
}

.ql-badge-status {
    padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase;
}

/* iDroid Scanner Visual Aid */
.scanner-visual-aid {
    background: #fbfbfd; border: 2px dashed #d2d2d7; border-radius: 20px;
    padding: 30px; margin: 20px 0; position: relative; overflow: hidden;
}
.scanner-laser {
    position: absolute; left: 0; top: 20%; width: 100%; height: 2px;
    background: #007AFF; box-shadow: 0 0 12px #007AFF;
    animation: laser-move 2s infinite ease-in-out;
}
@keyframes laser-move {
    0%, 100% { top: 25%; }
    50% { top: 75%; }
}
.scan-instruction {
    display: flex; align-items: center; gap: 10px; background: rgba(0,122,255,0.05);
    padding: 12px; border-radius: 12px; margin-top: 15px; text-align: left;
}

/* Selector de Categorías Estilo Apple */
/* iDroid Premium Selector - macOS Edition */
#categoryFilter {
    appearance: none;
    -webkit-appearance: none;
    background-color: #ffffff;
    /* Icono Chevron más fino y elegante */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding: 14px 45px 14px 18px;
    
    /* El secreto Apple: Borde casi invisible + sombra de profundidad */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%; /* Para que iguale al buscador */
}

#categoryFilter:hover {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

#categoryFilter:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
    transform: translateY(0);
}

.apple-toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 12px 25px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-toast.show { top: 30px; }

.toast-content { display: flex; align-items: center; gap: 12px; }
.toast-content i { font-size: 18px; }
.apple-toast.success i { color: #34C759; }
.apple-toast.error i { color: #FF3B30; }
.toast-content span { font-size: 14px; font-weight: 600; color: #1d1d1f; }

/* Apple Switch */
.apple-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.apple-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e9e9eb; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: #34C759; }
input:checked + .slider:before { transform: translateX(18px); }

/* Efecto visual para links restringidos */
.restricted-link { opacity: 0.6; }

@keyframes appleShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}
.shake-error { animation: appleShake 0.4s ease-in-out; border: 1px solid #ff3b30 !important; }


/* --- ESTILOS DE EXPORTACIÓN iDROID PRO --- */

/* 1. Botón de la Cabecera (Soft Blue) */
.apple-export-btn {
    background: rgba(0, 122, 255, 0.08) !important;
    color: #007AFF !important;
    border: 1px solid rgba(0, 122, 255, 0.2) !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    height: 35px !important;
}

.apple-export-btn:hover {
    background: #007AFF !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.25) !important;
    transform: translateY(-1px) !important;
}

.apple-export-btn:hover i { transform: scale(1.1); }

/* 2. Contenedor del Icono en el Modal */
.export-icon-wrapper {
    width: 60px; height: 60px; 
    border-radius: 18px; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    margin: 0 auto 15px;
}

/* Centrado Maestro para Iconos en Contenedores Cuadrados */
.export-icon-wrapper i, 
.export-option-btn i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important; /* Elimina el empuje de base del texto */
    margin: 0 !important;
    padding: 0 !important;
}

.export-icon-wrapper {
    width: 60px; height: 60px;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 18px;
    margin: 0 auto 15px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 3. Botones de Opción (Inventario Completo) */
.export-option-btn {
    display: flex; 
    align-items: center; 
    gap: 14px; 
    padding: 12px 18px;
    background: #fbfbfd; 
    border: 1px solid rgba(0,0,0,0.03); 
    border-radius: 16px;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    width: 100%; 
    text-decoration: none; 
    color: #1d1d1f;
}

.export-option-btn:hover { 
    background: #ffffff; 
    border-color: rgba(52, 199, 89, 0.3); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.04); 
    transform: translateY(-2px); 
}

.export-option-btn .btn-title { 
    display: block; 
    font-size: 14.5px; 
    font-weight: 500; 
    letter-spacing: -0.2px;
    color: #1d1d1f;
}

.export-option-btn .btn-desc { 
    display: block;
    font-size: 11.5px; 
    color: #86868b; 
    font-weight: 400;
}

/* 4. Selector de Categoría Estilo Apple */
.apple-input-pro {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    background: #f5f5f7;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    outline: none;
    appearance: none; /* Quita el estilo nativo para control total */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2386868b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

/* 5. Footer del Modal */
.modal-footer-compact {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f2f2f7;
}

/* Ajuste preventivo para el modal */
#exportInventoryModal .apple-modal {
    width: 360px !important;
    padding: 25px 25px 20px !important;
}

/* 1. Botón "Exportar Categoría" - Versión Premium */
#exportInventoryModal .apple-modal-btn.confirm {
    background: #34C759 !important; /* Verde Apple */
    color: #ffffff !important;
    border: none !important;
    height: 48px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
    width: 100% !important;
    margin-top: 10px !important;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.2) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

#exportInventoryModal .apple-modal-btn.confirm:hover {
    background: #28a745 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 15px rgba(52, 199, 89, 0.3) !important;
}

/* 2. Arreglo de Centrado del Icono de Mundo (Inventario Completo) */
.export-option-btn {
    display: flex !important;
    align-items: center !important; /* Centrado vertical absoluto */
    justify-content: flex-start !important;
    padding: 14px 20px !important;
    gap: 16px !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
    background: #fbfbfd !important;
    border-radius: 16px !important;
}

.export-option-btn i {
    font-size: 18px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Aseguramos que el icono sea visible sobre el fondo suave */
    opacity: 1 !important; 
    visibility: visible !important;
}

/* 3. Mejora del Selector (Dropdown) */
#exportCategorySelect {
    background-color: #f5f5f7 !important;
    border: 1px solid #d2d2d7 !important;
    border-radius: 12px !important;
    padding: 12px 15px !important;
    font-weight: 500 !important;
    color: #1d1d1f !important;
    margin-bottom: 5px !important;
}

/* DISEÑO PREMIUM QUICK LOOK iDROID */
.ql-apple-wrapper {
    padding: 10px 5px;
    font-family: 'Inter', -apple-system, sans-serif;
}

.ql-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.ql-id-pill {
    display: flex;
    flex-direction: column;
}

.ql-id-label {
    font-size: 10px;
    font-weight: 800;
    color: #86868b;
    letter-spacing: 0.5px;
}

.ql-id-number {
    font-size: 18px;
    font-weight: 700;
    color: #007AFF;
    letter-spacing: -0.5px;
}

.ql-client-name {
    font-size: 28px;
    font-weight: 800;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -1px;
}

.ql-device-detail {
    color: #86868b;
    font-size: 15px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ql-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 30px 0;
}

.ql-data-item {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
}

.ql-data-item label {
    font-size: 10px;
    font-weight: 700;
    color: #86868b;
    margin-bottom: 5px;
}

.ql-amount { font-size: 19px; font-weight: 800; }
.ql-amount.unpaid { color: #ff3b30; }
.ql-amount.paid { color: #34c759; }

.ql-fault-section {
    margin-bottom: 30px;
    padding: 0 5px;
}

.ql-fault-section label {
    font-size: 11px;
    font-weight: 700;
    color: #1d1d1f;
    display: block;
    margin-bottom: 10px;
}

.ql-fault-text {
    background: #fff;
    border: 1px solid #d2d2d7;
    padding: 15px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #424245;
}

/* BOTONES ESTILO APPLE */
.ql-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 5px; /* Espacio extra antes de los botones */
}

.ql-btn-apple.ghost.full-width {
    margin-bottom: 5px;
}

.ql-btn-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.ql-btn-apple.primary { background: #007AFF; color: white; }
.ql-btn-apple.secondary { background: #f5f5f7; color: #1d1d1f; }
.ql-btn-apple.ghost { background: transparent; color: #007AFF; border: 1px solid #d2d2d7; }
.full-width { grid-column: span 2; }

.ql-btn-apple:active { transform: scale(0.97); }

/* CORRECCIÓN DE ENCABEZADO QUICK LOOK */
.ql-sheet-header {
    margin-bottom: 10px;
    padding: 15px 0;
    /* Quitamos el border-bottom si quieres que se vea más minimalista, 
       o lo dejamos muy sutil */
    border-bottom: 1px solid #f2f2f7; 
}

.ql-handle {
    width: 36px;
    height: 5px;
    background-color: #d1d1d6;
    border-radius: 3px;
    margin: 0 auto 15px auto;
}

.ql-title-center {
    font-size: 17px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.ql-close-x {
    position: absolute;
    right: 0;
    top: 15px;
    background: none;
    border: none;
    color: #d1d1d6;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.2s;
}

.ql-close-x:hover {
    color: #8e8e93;
}

/* BADGES DE ESTADO ESTILO APPLE PILL */
.ql-badge-pill {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ql-badge-pill.recibido {
    background-color: #e1f0ff;
    color: #007aff;
}

.ql-badge-pill.entregado {
    background-color: #e2f7ed;
    color: #34c759;
}

.ql-badge-pill.listo {
    background-color: #fff4e5;
    color: #ff9500;
}

/* Ajuste adicional para que el wrapper no herede paddings extra del modal base */
.ql-apple-wrapper {
    padding: 20px 25px 30px 25px !important; /* Aumentamos el padding inferior (30px) */
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Ajuste de posición para la X de cierre */
.ql-close-x {
    position: absolute;
    right: 15px; /* Separación del borde derecho */
    top: 22px;   /* Alineación vertical con el título */
    background: none;
    border: none;
    color: #d1d1d6;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
}

.apple-sheet {
    border-radius: 32px !important; /* Redondeado en las 4 esquinas */
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); /* Sombra más profunda para dar profundidad */
    padding: 0 !important; /* Dejamos que el wrapper maneje el espacio */
    border: 1px solid rgba(0,0,0,0.05);
}
/* Estilo para que el estado destaque */
.ql-badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    height: 32px;
}

/* ============================================================
   IDROID INTELLIGENCE SHELF - APPLE PREMIUM DESIGN
   ============================================================ */

.dynamic-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    padding: 0 5px;
}

.shelf-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.shelf-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 122, 255, 0.1);
}

/* CONTENEDOR DE ICONO CIRCULAR */
.shelf-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* Colores de Iconos basados en la psicología de iOS */
.shelf-icon.blue { background: #F2F7FF; color: #007AFF; }
.shelf-icon.orange { background: #FFF9F2; color: #FF9500; }
.shelf-icon.green { background: #F2FFF7; color: #34C759; }

/* ESTRUCTURA DE TEXTO */
.shelf-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.shelf-label {
    font-size: 11px;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.shelf-value {
    font-size: 18px;
    font-weight: 800;
    color: #1d1d1f;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* BARRA DE PROGRESO "iOS STYLE" */
.shelf-progress-wrapper {
    margin-top: 8px;
}

.shelf-progress-container {
    width: 100%;
    height: 8px;
    background: #F2F2F7;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.shelf-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007AFF, #5AC8FA);
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1);
}

/* DETALLE PARA TEXTOS ESPECIALES */
.urgent-text {
    color: #FF3B30;
    display: block;
    margin-top: 2px;
}

.money-text {
    color: #1d1d1f;
    font-family: 'Inter', sans-serif;
}

/* AJUSTE PARA MODO OSCURO */
.dark-mode .shelf-card {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dark-mode .shelf-value { color: #ffffff; }
.dark-mode .shelf-icon.blue { background: rgba(0, 122, 255, 0.15); }
.dark-mode .shelf-icon.orange { background: rgba(255, 149, 0, 0.15); }
.dark-mode .shelf-icon.green { background: rgba(52, 199, 89, 0.15); }
.dark-mode .shelf-progress-container { background: #2c2c2e; }

