/* ============================================
   ESTILOS PRINCIPALES - ESTRUCTURA FINANCIERA
   Diseño estilo FEMPHA EMPRENDE - v2.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #f97316;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --pink: #ec4899;
    --purple: #8b5cf6;
    --cyan: #06b6d4;
    --dark: #1f2937;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    
    --sidebar-gradient: linear-gradient(180deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --header-height: 65px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --radius: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-gradient);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    height: 40px;
    width: auto;
    margin-bottom: 5px;
}

.sidebar-brand {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-direction: column;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-brand span {
    opacity: 0.95;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-top: 15px;
    margin-bottom: 8px;
    padding: 0 12px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--white);
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
    color: var(--dark);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 30px;
}

/* Page Header con gradiente */
.page-header {
    background: var(--sidebar-gradient);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    opacity: 0.9;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2 i {
    color: var(--primary);
}

/* ============================================
   CARDS EN FILA
   ============================================ */

.cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cards-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon.blue { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7, #9333ea); }
.stat-icon.cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-icon.pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.stat-icon.white { background: rgba(255,255,255,0.2); }

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-percent {
    font-size: 0.8rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.stat-link {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.stat-link:hover {
    text-decoration: underline;
}

/* Highlight Cards */
.stat-card.highlight-blue {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.stat-card.highlight-blue .stat-label,
.stat-card.highlight-blue .stat-value,
.stat-card.highlight-blue .stat-percent {
    color: white;
}

.stat-card.highlight-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.stat-card.highlight-orange .stat-label,
.stat-card.highlight-orange .stat-value,
.stat-card.highlight-orange .stat-percent {
    color: white;
}

.stat-card.highlight-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.stat-card.highlight-purple .stat-label,
.stat-card.highlight-purple .stat-value,
.stat-card.highlight-purple .stat-percent {
    color: white;
}

.stat-card.highlight-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.stat-card.highlight-green .stat-label,
.stat-card.highlight-green .stat-value,
.stat-card.highlight-green .stat-percent {
    color: white;
}

.stat-card.highlight-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.stat-card.highlight-red .stat-label,
.stat-card.highlight-red .stat-value,
.stat-card.highlight-red .stat-percent {
    color: white;
}

/* ============================================
   CHARTS
   ============================================ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    position: relative;
    height: 280px;
    padding: 10px;
}

/* ============================================
   CARDS GENERALES
   ============================================ */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
}

/* ============================================
   INFO CARDS (¿Cómo funciona?)
   ============================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.info-card {
    text-align: center;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.info-card:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    margin: 0 auto 12px;
}

.info-icon.blue { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.info-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.info-icon.orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.info-icon.purple { background: linear-gradient(135deg, #a855f7, #9333ea); }

.info-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon-only {
    padding: 8px;
    width: 32px;
    height: 32px;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control-sm {
    padding: 8px 12px;
    font-size: 0.9rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   TABLAS
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table input.form-control {
    border: 1px solid var(--gray-300);
}

/* ============================================
   PROYECTOS GRID
   ============================================ */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 20px;
    color: white;
}

.project-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.project-card-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.project-card-body {
    padding: 20px;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.project-stat {
    text-align: center;
    flex: 1;
}

.project-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.project-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.project-card-footer {
    padding: 15px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.project-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-primary { background: #e0e7ff; color: #4338ca; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #cffafe; color: #0e7490; }

/* ============================================
   CATEGORÍAS DE COSTOS
   ============================================ */

.category-section {
    margin-bottom: 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.category-header {
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark);
    background: var(--gray-50);
}

.category-header.costo-fijo { border-left: 4px solid #6366f1; }
.category-header.costo-variable { border-left: 4px solid #22c55e; }
.category-header.costo-directo { border-left: 4px solid #8b5cf6; }
.category-header.costo-indirecto { border-left: 4px solid #f59e0b; }
.category-header.gasto-fijo { border-left: 4px solid #ef4444; }
.category-header.gasto-variable { border-left: 4px solid #ec4899; }

.category-body {
    padding: 20px;
}

.category-total {
    background: var(--gray-50);
    padding: 12px 20px;
    text-align: right;
    font-weight: 600;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESUMEN FINANCIERO
   ============================================ */

.financial-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-top: 20px;
}

.summary-item {
    text-align: center;
}

.summary-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.summary-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.summary-item .value.positive { color: var(--success); }
.summary-item .value.negative { color: var(--danger); }

/* ============================================
   TOTALES DESTACADOS
   ============================================ */

.total-box {
    padding: 20px;
    border-radius: var(--radius);
    text-align: right;
    margin-top: 20px;
}

.total-box.costos {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.total-box.gastos {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.total-box.utilidad-positiva {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.total-box.utilidad-negativa {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.total-box strong {
    font-size: 1.2rem;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--dark);
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #22c55e;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* ============================================
   HELPER CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ============================================
   PRODUCTOS EN PROYECTO
   ============================================ */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.product-item {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 20px;
    border-left: 4px solid var(--primary);
}

.product-item h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.product-summary {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.product-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.85rem;
}

.product-summary-row.total {
    border-top: 1px solid var(--gray-200);
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 600;
}

/* ============================================
   PRORRATEO BAR
   ============================================ */

.prorrateo-bar {
    display: flex;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    margin: 15px 0;
}

.prorrateo-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 40px;
}

/* ============================================
   PONDERACIÓN
   ============================================ */

.ponderacion-warning { color: #dc2626; font-weight: 600; }
.ponderacion-ok { color: #16a34a; font-weight: 600; }

/* ============================================
   SELECT PRODUCTO
   ============================================ */

.select-producto {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 4px;
    font-family: 'Poppins', sans-serif;
}

.select-producto:focus {
    border-color: #6366f1;
    outline: none;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        padding: 0 20px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .financial-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: 5px;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Help tooltip */
.help-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--info);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
    margin-left: 5px;
}