* {
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000; 
    color: #FFFFFF; 
    line-height: 1.6;
}

.app-container {
    min-height: 100vh; 
    display: flex; 
    flex-direction: column;
}

.header {
    background: #1A1A1A; 
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #333333;
}

.header h1 {
    font-size: 1.8rem; 
    font-weight: 300; 
    letter-spacing: -0.5px;
}

.header .subtitle {
    color: #666666; 
    font-size: 0.9rem; 
    margin-top: 0.25rem;
}

.main-content {
    flex: 1; 
    padding: 2rem; 
    max-width: 1200px; 
    margin: 0 auto; 
    width: 100%;
}

/* BOTONES PRINCIPALES ARRIBA */
.actions-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem; 
    margin-bottom: 3rem;
}

.action-card {
    background: #1A1A1A; 
    padding: 2rem; 
    border-radius: 12px;
    border: none; 
    text-decoration: none;
    color: #FFFFFF; 
    transition: all 0.2s ease;
}

.action-card:hover {
    background: #333333; 
    transform: translateY(-2px);
    text-decoration: none; 
    color: #FFFFFF;
}

.action-icon {
    font-size: 2.5rem; 
    margin-bottom: 1rem; 
    opacity: 0.9;
}

.action-title {
    font-size: 1.3rem; 
    font-weight: 500; 
    margin-bottom: 0.5rem;
}

.action-description {
    color: #666666; 
    font-size: 0.95rem; 
    line-height: 1.5;
}

/* ESTADÍSTICAS ABAJO */
.stats-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem; 
    margin-bottom: 3rem;
}

.stat-card {
    background: #1A1A1A; 
    padding: 2rem; 
    border-radius: 12px;
    border: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px); 
    border-color: #666666;
}

.stat-icon { 
    font-size: 2rem; 
    margin-bottom: 1rem; 
    opacity: 0.9; 
}

.stat-number { 
    font-size: 2.5rem; 
    font-weight: 200; 
    margin-bottom: 0.5rem; 
}

.stat-label {
    color: #666666; 
    font-size: 0.9rem;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.quick-actions {
    margin-top: 3rem; 
    padding-top: 2rem;
    border-top: 1px solid #333333;
}

.quick-title {
    font-size: 1.2rem; 
    margin-bottom: 1.5rem;
    color: #666666; 
    font-weight: 400;
}

.btn {
    background: #FFFFFF;
    color: #000000;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.btn:hover {
    background: #333333; 
    border-color: #666666;
    text-decoration: none; 
    color: #FFFFFF;
}

@media (max-width: 768px) {
    .main-content { 
        padding: 1rem; 
    }
    .stats-grid, .actions-grid { 
        grid-template-columns: 1fr; 
    }
}

/* Botones de navegación principales */
.btn-nav {
    background: #FFFFFF;
    color: #000000;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.btn-nav:hover {
    background: #333333;
    color: #FFFFFF;
}

/* Botones para tablas - como btn-nav pero más compactos */
.btn-tabla {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin: 2px;
}
.btn-tabla:hover {
    background: #f8f9fa;
    border-color: #6e8efb;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.btn-tabla-eliminar {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}
.btn-tabla-eliminar:hover {
    background: #c82333;
    border-color: #bd2130;
}


/* Badges de estado para presupuestos - Colores MUY FUERTES */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    color: #000000 !important;
    border: 2px solid;
}

/* Estados específicos - Colores MUY FUERTES */
.badge.borrador {
    background-color: #d3d3d3;
    border-color: #a0a0a0;
}

.badge.pendiente {
    background-color: #ffeb3b;
    border-color: #fbc02d;
}

.badge.aprobado {
    background-color: #4fc3f7;
    border-color: #0288d1;
}

.badge.firmado {
    background-color: #66bb6a;
    border-color: #388e3c;
}

.badge.rechazado {
    background-color: #ef5350;
    border-color: #d32f2f;
}

/* ===== MENSAJES FLASH ===== */
.flash-messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

.flash-message {
    background: #1A1A1A;
    border-left: 4px solid #2ecc71;
    color: white;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: flashSlideIn 0.3s ease-out;
}

.flash-message-success { border-left-color: #2ecc71; }
.flash-message-error { border-left-color: #e74c3c; }
.flash-message-warning { border-left-color: #f39c12; }
.flash-message-info { border-left-color: #3498db; }

@keyframes flashSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===============================================
   MENÚ DE USUARIO (HEADER)
   =============================================== */
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    background: #2d3136;
    border: 1px solid #40464e;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.user-menu-btn:hover {
    background: #363b42;
    border-color: #0066cc;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #ffffff;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1d22;
    border: 1px solid #2a2d33;
    border-radius: 10px;
    min-width: 220px;
    padding: 8px 0;
    margin-top: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.user-menu-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #cccccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.dropdown-divider {
    height: 1px;
    background: #2a2d33;
    margin: 6px 0;
}

.logout-item {
    color: #f87171 !important;
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ===============================================
   MODALES DE USUARIO (PERFIL / CONTRASEÑA)
   =============================================== */
.user-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.user-modal-overlay.active { display: flex; }

.user-modal-content {
    background: #1a1d22;
    border: 1px solid #2a2d33;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.user-modal-content h3 {
    color: #ffffff;
    margin: 0 0 24px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.user-modal-content label {
    display: block;
    color: #a0a5b0;
    font-size: 0.85rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.user-modal-content input {
    width: 100%;
    padding: 11px 14px;
    background: #14161a;
    border: 1px solid #2a2d33;
    border-radius: 10px;
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.user-modal-content input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

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

.user-modal-actions .btn-save {
    background: #0ea5e9;
    color: #ffffff;
    border: none;
    padding: 11px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.user-modal-actions .btn-save:hover { background: #0284c7; }

.user-modal-actions .btn-cancel {
    background: rgba(255, 255, 255, 0.04);
    color: #a0a5b0;
    border: 1px solid #2a2d33;
    padding: 11px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.user-modal-actions .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
