/* ==========================================
   REDISPOL COTIZACIONES - ESTILOS WEB MODERNOS
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #e0f2fe;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #cbd5e1;
    --primary: #ef4444;
    --primary-hover: #dc2626;
    --primary-glow: rgba(239, 68, 68, 0.25);
    --accent-blue: #2563eb;
    --accent-green: #059669;
    --accent-yellow: #d97706;
    --accent-purple: #7c3aed;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: #cbd5e1;
    --shadow-main: 0 10px 25px -5px rgba(14, 165, 233, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image:
        radial-gradient(at 10% 10%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);
}

/* Navbar Navigation */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.08);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-brand img {
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.btn-logout {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

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

/* Main Container */
.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Cards & Layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.06);
}

.stat-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-main);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.stat-icon.yellow {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.stat-info h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-info .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

/* Action Controls & Toolbar */
.toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.06);
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    width: 320px;
    max-width: 100%;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 0.4rem;
    width: 100%;
    font-size: 0.95rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-warning {
    background: var(--accent-yellow);
    color: white;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

/* Data Tables */
.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    width: 100%;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.06);
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.custom-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 2px solid #bfdbfe;
}

.custom-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.92rem;
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition);
}

.custom-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

/* Modals y Ventanas Virtuales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content,
.virtual-window,
.ventana-virtual,
.window-content,
.dialog-box,
.login-wrapper {
    background: #ffffff !important;
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-content,
.modal-overlay.active .virtual-window,
.modal-overlay.active .ventana-virtual {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-close {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.5rem;
    cursor: pointer;
}

.btn-close:hover {
    color: #0f172a;
}

/* Estilos adaptados para elementos dentro de ventanas virtuales con fondo blanco */
.modal-content label,
.virtual-window label,
.ventana-virtual label,
.window-content label,
.dialog-box label {
    color: #334155;
}

.modal-content .form-control,
.virtual-window .form-control,
.ventana-virtual .form-control,
.window-content .form-control,
.dialog-box .form-control {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.modal-content .form-control:focus,
.virtual-window .form-control:focus,
.ventana-virtual .form-control:focus,
.window-content .form-control:focus,
.dialog-box .form-control:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-content .btn-secondary,
.virtual-window .btn-secondary,
.ventana-virtual .btn-secondary,
.window-content .btn-secondary,
.dialog-box .btn-secondary {
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.modal-content .btn-secondary:hover,
.virtual-window .btn-secondary:hover,
.ventana-virtual .btn-secondary:hover,
.window-content .btn-secondary:hover,
.dialog-box .btn-secondary:hover {
    background: #cbd5e1;
}

.modal-content select option,
.virtual-window select option,
.ventana-virtual select option {
    background: #ffffff;
    color: #0f172a;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #ffffff;
    color: #0f172a;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s forwards;
}

.toast.success {
    border-left-color: var(--accent-green);
}

.toast.error {
    border-left-color: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}