/* ============================================================
   Pago Camioneta — Estilos Minimalistas
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-500);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-user {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ─── Container ──────────────────────────────────────────────── */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

h2 {
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

h3 {
    color: var(--gray-700);
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
}

/* ─── Login ──────────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-card h1 {
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: 1.6rem;
}

.login-card .subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* ─── Cards Grid ─────────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ─── Progress Bar ───────────────────────────────────────────── */
.progress-section {
    margin-bottom: 1.5rem;
}

.progress-section label {
    font-size: 0.9rem;
    color: var(--gray-700);
    display: block;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    display: inline-block;
    width: calc(100% - 60px);
    vertical-align: middle;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 6px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-left: 0.5rem;
}

/* ─── Info Box ───────────────────────────────────────────────── */
.info-box {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.info-box p {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.alert a {
    color: inherit;
    font-weight: 600;
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.3rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table th,
.table td {
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-info {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table-info th,
.table-info td {
    padding: 0.5rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table-info th {
    color: var(--gray-500);
    font-size: 0.85rem;
    width: 30%;
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* ─── Text Colors ────────────────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ─── Estado de Cuenta ───────────────────────────────────────── */
.estado-resumen {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* ─── Pago Detalle ───────────────────────────────────────────── */
.pago-detalle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.pago-info {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.pago-imagen {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.imagen-container {
    text-align: center;
    margin-top: 1rem;
}

.constancia-img {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.constancia-img-sm {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.constancia-preview {
    text-align: center;
    margin: 1rem 0;
}

/* ─── Confirm Card ───────────────────────────────────────────── */
.confirm-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    max-width: 500px;
}

.confirm-card p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* ─── Filtros ────────────────────────────────────────────────── */
.filtros {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ─── Actions Cell ───────────────────────────────────────────── */
.actions-cell {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.actions-section {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-user {
        margin-left: 0;
    }

    .cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pago-detalle {
        grid-template-columns: 1fr;
    }

    .table-info th {
        width: auto;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
    }
}
