/* ====================================
   Portal de Clientes - CSS Responsive
   Mobile-First Design
   ==================================== */

/* Variables CSS */
:root {
    --portal-primary: #3498db;
    --portal-primary-dark: #2980b9;
    --portal-secondary: #95a5a6;
    --portal-secondary-dark: #7f8c8d;
    --portal-success: #28a745;
    --portal-warning: #f0ad4e;
    --portal-danger: #d9534f;
    --portal-dark: #2c3e50;
    --portal-gray: #666;
    --portal-light-gray: #f5f5f5;
    --portal-white: #ffffff;
    --portal-border: #ddd;

    --portal-radius: 8px;
    --portal-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --portal-transition: 0.2s ease;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: var(--portal-light-gray);
    -webkit-font-smoothing: antialiased;
}

/* ====================================
   Contenedor Principal
   ==================================== */

.portal-container {
    min-height: 100vh;
    padding: 0;
}

/* ====================================
   Header
   ==================================== */

.portal-header {
    background: var(--portal-dark);
    color: var(--portal-white);
    padding: 1rem;
    text-align: center;
}

.portal-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.portal-header p {
    font-size: 0.875rem;
    margin: 0;
}

.portal-header a {
    color: var(--portal-primary);
    text-decoration: none;
}

.portal-header a:hover {
    text-decoration: underline;
}

/* ====================================
   Contenido Principal
   ==================================== */

.portal-content {
    background: var(--portal-white);
    padding: 1.5rem 1rem;
    min-height: calc(100vh - 80px);
}

.portal-content h2 {
    font-size: 1.5rem;
    color: var(--portal-dark);
    margin-bottom: 0.5rem;
}

.portal-content h3 {
    font-size: 1.25rem;
    color: var(--portal-dark);
    margin: 1.5rem 0 1rem 0;
}

.portal-content p {
    color: var(--portal-gray);
    margin-bottom: 1rem;
}

.portal-content hr {
    border: none;
    border-top: 1px solid var(--portal-border);
    margin: 1.5rem 0;
}

/* ====================================
   Alertas
   ==================================== */

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--portal-radius);
    font-size: 0.95rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ====================================
   Formularios
   ==================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--portal-dark);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--portal-border);
    border-radius: var(--portal-radius);
    font-size: 1rem;
    transition: border-color var(--portal-transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--portal-primary);
}

.form-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--portal-gray);
    margin-top: 0.25rem;
}

.form-file {
    display: block;
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--portal-border);
    border-radius: var(--portal-radius);
    background: var(--portal-light-gray);
    cursor: pointer;
    text-align: center;
}

.form-file:focus {
    outline: none;
    border-color: var(--portal-primary);
}

/* ====================================
   Botones
   ==================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--portal-radius);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--portal-transition);
    min-height: 48px;
}

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

.btn-primary:hover,
.btn-primary:active {
    background: var(--portal-primary-dark);
}

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

.btn-secondary:hover,
.btn-secondary:active {
    background: var(--portal-secondary-dark);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ====================================
   Info Box
   ==================================== */

.info-box {
    background: var(--portal-light-gray);
    padding: 1.25rem;
    border-radius: var(--portal-radius);
    margin-top: 2rem;
}

.info-box h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.info-box ol {
    margin: 0;
    padding-left: 1.25rem;
}

.info-box li {
    margin-bottom: 0.5rem;
    color: var(--portal-gray);
}

/* ====================================
   Cliente Info
   ==================================== */

.cliente-info {
    background: var(--portal-light-gray);
    padding: 1rem;
    border-radius: var(--portal-radius);
    margin-bottom: 1.5rem;
}

.cliente-info p {
    margin: 0;
    font-size: 0.95rem;
}

.cliente-info strong {
    color: var(--portal-dark);
}

/* ====================================
   Boletas Cards (Mobile)
   ==================================== */

.boletas-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.boleta-card {
    background: var(--portal-white);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.boleta-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--portal-light-gray);
    gap: 0.75rem;
}

.boleta-card-header input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.boleta-card-header .boleta-numero {
    font-weight: 600;
    color: var(--portal-dark);
    flex: 1;
}

.boleta-card-header .boleta-estado {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.boleta-estado-pendiente {
    background: #fff3cd;
    color: #856404;
}

.boleta-estado-rechazada {
    background: #f8d7da;
    color: #721c24;
}

.boleta-estado-revision {
    background: #cce5ff;
    color: #004085;
}

.boleta-card-body {
    padding: 1rem;
}

.boleta-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.boleta-detail:last-child {
    border-bottom: none;
}

.boleta-detail-label {
    color: var(--portal-gray);
    font-size: 0.9rem;
}

.boleta-detail-value {
    font-weight: 500;
    color: var(--portal-dark);
}

.boleta-total {
    font-size: 1.25rem;
    color: var(--portal-primary);
}

.boleta-rechazo {
    background: #fff3cd;
    padding: 0.75rem;
    border-radius: var(--portal-radius);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.boleta-rechazo strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #856404;
}

/* ====================================
   Resumen de Pago
   ==================================== */

.pago-resumen {
    background: var(--portal-dark);
    color: var(--portal-white);
    padding: 1.25rem;
    border-radius: var(--portal-radius);
    margin: 1.5rem 0;
    text-align: center;
}

.pago-resumen-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.pago-resumen-total {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* ====================================
   Select All Bar
   ==================================== */

.select-all-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--portal-light-gray);
    border-radius: var(--portal-radius);
    margin-bottom: 1rem;
}

.select-all-bar input[type="checkbox"] {
    width: 24px;
    height: 24px;
}

.select-all-bar label {
    font-weight: 500;
    color: var(--portal-dark);
}

/* ====================================
   Sin Boletas
   ==================================== */

.no-boletas {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #d4edda;
    border-radius: var(--portal-radius);
}

.no-boletas-icon {
    font-size: 3rem;
    color: var(--portal-success);
    margin-bottom: 1rem;
}

.no-boletas h3 {
    color: #155724;
    margin-bottom: 0.5rem;
}

.no-boletas p {
    color: #155724;
    margin: 0;
}

/* ====================================
   Confirmacion
   ==================================== */

.confirmacion {
    text-align: center;
    padding: 2rem 1rem;
}

.confirmacion-icon {
    font-size: 4rem;
    color: var(--portal-success);
    margin-bottom: 1rem;
}

.confirmacion h2 {
    color: var(--portal-success);
    margin-bottom: 1rem;
}

.confirmacion p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* ====================================
   Tabla Desktop (oculta en mobile)
   ==================================== */

.tabla-desktop {
    display: none;
}

/* ====================================
   Responsive - Tablet y Desktop
   ==================================== */

@media (min-width: 768px) {
    .portal-container {
        max-width: 900px;
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .portal-header {
        border-radius: var(--portal-radius) var(--portal-radius) 0 0;
        padding: 1.5rem;
    }

    .portal-header h1 {
        font-size: 1.5rem;
    }

    .portal-content {
        padding: 2rem;
        border-radius: 0 0 var(--portal-radius) var(--portal-radius);
        box-shadow: var(--portal-shadow);
    }

    .btn-group {
        flex-direction: row;
        justify-content: flex-start;
    }

    .btn-block {
        width: auto;
    }

    /* Mostrar tabla en desktop, ocultar cards */
    .tabla-desktop {
        display: table;
        width: 100%;
        border-collapse: collapse;
    }

    .tabla-desktop th,
    .tabla-desktop td {
        padding: 0.875rem;
        border: 1px solid var(--portal-border);
        text-align: left;
    }

    .tabla-desktop th {
        background: var(--portal-light-gray);
        font-weight: 600;
        color: var(--portal-dark);
    }

    .tabla-desktop tr:hover {
        background: #fafafa;
    }

    .tabla-desktop .text-center {
        text-align: center;
    }

    .tabla-desktop .text-right {
        text-align: right;
    }

    .tabla-desktop tfoot tr {
        background: var(--portal-light-gray);
        font-weight: 600;
    }

    .boletas-list {
        display: none;
    }

    .pago-resumen {
        max-width: 300px;
        margin-left: auto;
        margin-right: 0;
    }
}

/* ====================================
   Utilidades
   ==================================== */

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--portal-gray);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ====================================
   Accesibilidad
   ==================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
