 
/* Inkolor Mobile Responsive CSS
 * Archivo NUEVO. No modifica ninguna estructura HTML existente.
 * Solo hace que los layouts actuales se vean bien en móvil.
 */

/* === 1. MÓVIL: Sidebar colapsable === */
@media (max-width: 768px) {
    /* Por defecto el sidebar está oculto en móvil */
    .ink-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 50;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    .ink-sidebar.is-open {
        left: 0;
    }
    /* Overlay oscuro detrás del sidebar */
    .ink-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        display: none;
    }
    .ink-sidebar-overlay.is-visible {
        display: block;
    }
    /* Botón hamburguesa */
    .ink-menu-toggle {
        display: inline-flex !important;
    }
    /* Contenido ocupa todo el ancho */
    .ink-main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    /* Header: padding para que el boton hamburguesa (44px + margen) no tape el titulo */
    .ink-main-content > header,
    .ink-main-content header {
        padding-left: 64px !important;
        padding-right: 12px !important;
    }
    .ink-main-content > header h1,
    .ink-main-content header h1 {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }
}

/* Escritorio: ocultar botón hamburguesa */
@media (min-width: 769px) {
    .ink-menu-toggle {
        display: none !important;
    }
    .ink-sidebar-overlay {
        display: none !important;
    }
}

/* === 2. MÓVIL: Tipografía y espaciado === */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    h1 {
        font-size: 1.4rem !important;
    }
    h2 {
        font-size: 1.2rem !important;
    }
    /* Reducir padding general */
    .ink-padded {
        padding: 0.75rem !important;
    }
}

/* === 3. MÓVIL: Inputs grandes (touch-friendly) === */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;  /* Evita zoom en iOS */
        min-height: 44px !important;  /* Tamaño mínimo para dedos */
        padding: 0.6rem 0.75rem !important;
    }
    button,
    .btn,
    a.btn {
        min-height: 44px !important;
        padding: 0.7rem 1.2rem !important;
    }
    /* Los enlaces de navegación del sidebar también más grandes */
    .ink-sidebar nav a {
        min-height: 48px !important;
        font-size: 15px !important;
    }
}

/* === 4. MÓVIL: Tablas con scroll horizontal === */
@media (max-width: 768px) {
    .ink-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ink-table-wrapper table {
        min-width: 600px;  /* Fuerza scroll horizontal si no cabe */
    }
}

/* === 5. MÓVIL: Header === */
@media (max-width: 768px) {
    .ink-header {
        padding: 0.75rem 1rem !important;
        position: sticky;
        top: 0;
        z-index: 30;
        gap: 0.75rem;
    }
    .ink-header h1 {
        font-size: 1.1rem !important;
    }
}

/* === 6. MÓVIL: Flash messages === */
@media (max-width: 768px) {
    .ink-flash {
        margin: 0.5rem !important;
        padding: 0.75rem !important;
        font-size: 14px !important;
    }
}

/* === 7. MÓVIL: Botón flotante de acción (FAB) === */
@media (max-width: 768px) {
    .ink-fab {
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        z-index: 35;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}

/* === 8. MÓVIL: Modales y dialogs === */
@media (max-width: 768px) {
    .ink-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 0.5rem !important;
        max-height: 90vh !important;
    }
}

/* === 9. MÓVIL: Forzar imagenes y videos responsivos === */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* === 10. MÓVIL: Layout general flexible === */
@media (max-width: 768px) {
    .ink-grid-responsive {
        display: flex !important;
        flex-direction: column !important;
    }
    .ink-grid-responsive > * {
        margin-bottom: 1rem;
    }
    /* Contenedores flexibles */
    .ink-flex-wrap-mobile {
        flex-wrap: wrap !important;
    }
}


/* === 11. MÓVIL: Tablas convertidas a tarjetas (cards) ===
 * Solo en pantallas pequeñas. NO toca el escritorio.
 * Usa data-label inyectado por JS.
 */
@media (max-width: 768px) {
    .bg-white table.w-full.text-sm,
    .bg-white table.w-full {
        border: 0 !important;
        width: 100% !important;
    }
    .bg-white table.w-full.text-sm thead,
    .bg-white table.w-full thead {
        display: none;
    }
    .bg-white table.w-full.text-sm tbody,
    .bg-white table.w-full tbody {
        display: block;
        width: 100%;
    }
    .bg-white table.w-full.text-sm tbody tr,
    .bg-white table.w-full tbody tr {
        display: block;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        width: 100%;
    }
    .bg-white table.w-full.text-sm tbody tr:hover,
    .bg-white table.w-full tbody tr:hover {
        background: #f9fafb;
    }
    .bg-white table.w-full.text-sm tbody td,
    .bg-white table.w-full tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.4rem 0 !important;
        border: 0 !important;
        text-align: right;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.875rem;
    }
    .bg-white table.w-full.text-sm tbody td[data-label]::before,
    .bg-white table.w-full tbody td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        font-size: 0.7rem;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-right: 0.5rem;
    }
    .bg-white table.w-full.text-sm tbody td[data-label] > *,
    .bg-white table.w-full tbody td[data-label] > * {
        flex: 1 1 auto;
        text-align: right;
        min-width: 0;
    }
    .bg-white table.w-full.text-sm tbody tr td:first-child,
    .bg-white table.w-full tbody tr td:first-child {
        font-weight: 700;
        font-size: 1rem;
        color: #1e3a8a;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid #f3f4f6 !important;
        margin-bottom: 0.25rem;
    }
    .bg-white table.w-full.text-sm tbody tr td:last-child,
    .bg-white table.w-full tbody tr td:last-child {
        margin-top: 0.5rem;
        padding-top: 0.5rem !important;
        border-top: 1px solid #f3f4f6 !important;
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }
    .bg-white table.w-full.text-sm tbody tr td:last-child > a,
    .bg-white table.w-full tbody tr td:last-child > a {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.7rem 1rem;
        background: #2563eb;
        color: #ffffff !important;
        border-radius: 0.4rem;
        font-weight: 600;
        font-size: 0.95rem;
        text-decoration: none !important;
        min-height: 44px;
        width: 100%;
    }
    .bg-white table.w-full.text-sm tbody tr td:last-child > a:hover,
    .bg-white table.w-full tbody tr td:last-child > a:hover {
        background: #1d4ed8;
    }
    .bg-white table.w-full.text-sm tbody tr td:last-child .flex,
    .bg-white table.w-full tbody tr td:last-child .flex {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
    }
    .bg-white table.w-full.text-sm tbody tr td:last-child img,
    .bg-white table.w-full tbody tr td:last-child img {
        width: 60px !important;
        height: 60px !important;
        align-self: center;
    }
    .bg-white table.w-full.text-sm tbody tr:nth-child(even),
    .bg-white table.w-full tbody tr:nth-child(even) {
        background: #ffffff;
    }
    .bg-white table.w-full.text-sm tbody tr:nth-child(even):hover,
    .bg-white table.w-full tbody tr:nth-child(even):hover {
        background: #f9fafb;
    }
}

/* === 12. JS para inyectar data-label en td (móvil) === */
