/* ==========================================================================
   MUEVE MARKETPLACE - BASE & CORE DESIGN SYSTEM (static/css/base.css)
   ========================================================================== */

:root {
    --color-primario: #11346b;
    --color-secundario: #2671f0;
    --color-secundario-hover: #1a56cc;
    --fondo-general: #f4f6f9;
    --texto-oscuro: #2d3748;
    --texto-mutado: #718096;
    --borde-suave: #e2e8f0;
    --blanco: #ffffff;
    --sidebar-width: 260px;
    --color-exito: #16a34a;
    --color-peligro: #dc2626;
    --color-alerta: #d97706;
    --color-info: #0284c7;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--fondo-general);
    margin: 0;
    padding: 0;
    color: var(--texto-oscuro);
    min-height: 100vh;
}

/* ==========================================================================
   LAYOUT Y ESTRUCTURA PRINCIPAL
   ========================================================================== */

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 100vh;
    background-color: var(--fondo-general);
}

.top-header {
    background: var(--blanco);
    padding: 15px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid #edf2f7;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    font-size: 14px;
    color: var(--texto-mutado);
    font-weight: 500;
}

.btn-nav {
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.fav-btn {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.fav-btn:hover {
    background: #fee2e2;
}

.logout-btn {
    background: #fee2e2;
    color: #ef4444;
}

.logout-btn:hover {
    background: #fecaca;
}

/* ==========================================================================
   FRANJA AZUL DE BÚSQUEDA (HERO SEARCH)
   ========================================================================== */

.hero-search {
    background: var(--color-primario);
    padding: 25px 5%;
    text-align: center;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.1);
}

.search-container {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    position: relative;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.search-category-select {
    background: #f1f5f9;
    border: none;
    border-right: 1px solid #cbd5e1;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    outline: none;
    cursor: pointer;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.search-container input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.search-container button {
    background: var(--color-secundario);
    color: white;
    border: none;
    padding: 0 30px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    font-size: 16px;
}

.search-container button:hover {
    background: var(--color-secundario-hover);
}

/* ==========================================================================
   CONTENEDORES DE PÁGINA Y ENCABEZADOS
   ========================================================================== */

.content-area {
    padding: 30px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    margin: 0;
    color: var(--texto-oscuro);
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   MODALES Y FORMULARIOS EMERGENTES
   ========================================================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box h3 {
    margin-top: 0;
    color: var(--texto-oscuro);
    font-size: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-secundario);
    box-shadow: 0 0 0 3px rgba(38, 113, 240, 0.15);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
}

.btn-cancelar {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.btn-cancelar:hover {
    background: #e2e8f0;
}

.btn-confirmar {
    background: var(--color-secundario);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: 0.2s;
}

.btn-confirmar:hover {
    background: var(--color-secundario-hover);
}

/* ==========================================================================
   BADGES Y ESTADOS
   ========================================================================== */

.badge-plan {
    background: #fbbf24;
    color: #92400e;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-estado {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.badge-confirmado, .badge-aprobado, .badge-activo, .badge-entregado {
    background: #dcfce7;
    color: #166534;
}

.badge-rechazado, .badge-inactivo, .badge-cancelado {
    background: #fee2e2;
    color: #991b1b;
}

.badge-en-camino, .badge-despachado {
    background: #dbeafe;
    color: #1e40af;
}

/* ==========================================================================
   ALERTAS Y PERÍODOS DE GRACIA
   ========================================================================== */

.grace-alert-banner, .grace-alert-box {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 14px;
    display: none;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
}

.grace-alert-box h3, .grace-alert-banner h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grace-alert-box p, .grace-alert-banner p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
}

.btn-cta-urgente, .grace-alert-banner .btn-cta-renovar {
    background: #fbbf24;
    color: #92400e;
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-cta-urgente:hover, .grace-alert-banner .btn-cta-renovar:hover {
    background: #fde68a;
    transform: translateY(-2px);
}
