/* ============================================================================
   VARIABLES CSS - Sistema de Diseño Unificado
   ============================================================================ */
:root {
    /* === TIPOGRAFÍA - Familia de Fuentes === */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    
    /* === TIPOGRAFÍA - Escala de Tamaños === */
    --font-2xs: 0.625rem;   /* 10px - Badges muy pequeños */
    --font-xs: 0.75rem;     /* 12px - Etiquetas, badges */
    --font-sm: 0.875rem;    /* 14px - Texto secundario */
    --font-base: 1rem;      /* 16px - Texto normal */
    --font-md: 1.125rem;    /* 18px - Subtítulos */
    --font-lg: 1.25rem;     /* 20px - Títulos de sección */
    --font-xl: 1.5rem;      /* 24px - Títulos de modal */
    --font-2xl: 1.75rem;    /* 28px - Títulos grandes */
    --font-3xl: 2rem;       /* 32px - Títulos principales */
    --font-4xl: 2.5rem;     /* 40px - Iconos grandes */
    --font-5xl: 3rem;       /* 48px - Iconos muy grandes */
    
    /* === TIPOGRAFÍA - Pesos === */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* === TIPOGRAFÍA - Altura de línea === */
    --line-tight: 1.25;
    --line-normal: 1.5;
    --line-relaxed: 1.75;
    
    /* === COLORES - Paleta Principal === */
    --color-primary: #3182ce;
    --color-primary-dark: #2c5282;
    --color-secondary: #718096;
    --color-success: #38a169;
    --color-warning: #d69e2e;
    --color-danger: #e53e3e;
    --color-info: #3182ce;
    
    /* === COLORES - Texto === */
    --color-text-primary: #2d3748;
    --color-text-secondary: #718096;
    --color-text-muted: #a0aec0;
    --color-text-inverse: #ffffff;
    
    /* === COLORES - Fondo === */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f7fafc;
    --color-bg-tertiary: #edf2f7;
    
    /* === ESPACIADO === */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* === BORDES === */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* === SOMBRAS === */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
    font-size: var(--font-base);
    line-height: var(--line-normal);
}

/* Dashboard container */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, #2c3e50 0%, #4a5568 100%);
    color: white;
    padding: 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-logo {
    display: flex;
    align-items: center;
}

.header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header-left h1 {
    font-size: var(--font-md);
    font-weight: var(--font-semibold);
    margin-bottom: 0;
}

.company-info {
    font-size: var(--font-sm);
    opacity: 0.9;
    font-weight: var(--font-normal);
}

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

.user-info {
    font-size: var(--font-sm);
    opacity: 0.9;
}

.logout-button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-sm);
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Main navigation */
.main-navigation {
    background: white;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-container {
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Navigation items */
.nav-item {
    position: relative;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: none;
    border: none;
    color: #2d3748;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.nav-button:hover,
.nav-button.active {
    background-color: #f7fafc;
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
}

.nav-icon {
    font-size: 18px;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-item.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-item.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #2d3748;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f7fafc;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f7fafc;
    color: #1e3a5f;
    padding-left: 20px;
}

.dropdown-divider {
    height: 1px;
    margin: 8px 0;
    background-color: #e2e8f0;
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Section header */
.section-header {
    background: #1e3a5f;
    color: white;
    padding: 24px 2rem;
    margin-bottom: 24px;
    border-radius: 12px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-header p {
    opacity: 0.9;
    font-size: 16px;
}

/* Content area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Updated card styles */
.welcome-card,
.database-info-card,
.quick-actions-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.welcome-card:hover,
.database-info-card:hover,
.quick-actions-card:hover {
    transform: translateY(-2px);
}

.welcome-card h3,
.database-info-card h3,
.quick-actions-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

/* Quick actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.quick-action-btn:hover {
    border-color: #3182ce;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.2);
    color: #3182ce;
}

.quick-action-btn .action-icon {
    font-size: 24px;
}

/* Main content updates */
.dashboard-main {
    padding: 2rem;
    width: 100%;
    min-height: 100vh;
    margin-left: 60px;
    box-sizing: border-box;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive navigation */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-button {
        padding: 12px 16px;
        font-size: 14px;
    }

    .nav-icon {
        font-size: 16px;
    }

    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        width: 90%;
        max-width: 300px;
    }

    .nav-item.open .dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }
}

/* Content styles for different sections */
.content-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.content-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.content-card p {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Section actions */
.section-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.primary-button {
    background: #1e3a5f;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.secondary-button {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    border-color: #3182ce;
    color: #3182ce;
    transform: translateY(-2px);
}

.button-icon {
    font-size: 14px;
}

/* Placeholder features */
.placeholder-features {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.placeholder-features h4 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 12px;
}

.placeholder-features ul {
    list-style: none;
    padding: 0;
}

.placeholder-features li {
    padding: 8px 0;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.placeholder-features li::before {
    content: "✓";
    color: #48bb78;
    font-weight: bold;
    font-size: 14px;
}

/* Stats grid for reports */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border: 2px solid #90cdf4;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

/* Balance grid */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.balance-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.balance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.balance-title {
    font-size: 14px;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
}

.balance-amount.spent {
    color: #e53e3e;
}

.balance-amount.available {
    color: #38a169;
}

/* Manual sections */
.manual-sections {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.manual-item {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manual-item:hover {
    border-color: #3182ce;
    background: #ebf8ff;
    transform: translateY(-2px);
}

.manual-item h4 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 8px;
}

.manual-item p {
    color: #4a5568;
    margin: 0;
}

/* Config sections */
.config-sections {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.config-item {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-item:hover {
    border-color: #3182ce;
    background: #ebf8ff;
    transform: translateY(-2px);
}

.config-item h4 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 8px;
}

.config-item p {
    color: #4a5568;
    margin: 0;
}

/* Pending list */
.pending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.pending-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.pending-item:hover {
    border-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pending-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
    text-align: center;
}

.status-pending {
    background-color: #fed7d7;
    color: #c53030;
}

.status-review {
    background-color: #fef5e7;
    color: #dd6b20;
}

.pending-title {
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

.pending-date {
    color: #718096;
    font-size: 14px;
}

/* Project selection styles */
.project-selection-header {
    text-align: center;
    margin-bottom: 24px;
}

.project-stats {
    margin-top: 12px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
    display: inline-block;
}

.stat-item {
    color: #4a5568;
    font-size: 14px;
}

/* Project search */
.project-search {
    position: relative;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
}

/* Project Selection Combobox Styles */
.project-selector-container {
    margin: 2rem auto;
    max-width: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.selector-section {
    margin-bottom: 1.5rem;
}

.selector-section h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.search-input, .project-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.search-input:focus, .project-select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.project-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.project-select option {
    padding: 8px;
    background: white;
    color: #2d3748;
}

.selected-project-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    display: none;
}

.selected-project-preview h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.preview-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    gap: 1rem;
}

.preview-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
    font-size: 0.9rem;
}

.preview-value {
    color: #2d3748;
    flex: 1;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-continue {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-height: 48px;
}

.btn-continue:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

.btn-continue.enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3);
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.stats-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #1e3a5f;
    color: white;
    border-radius: 8px;
}

.stat-item {
    font-size: 1rem;
}

.stat-item strong {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Responsive adjustments for combobox */
@media (max-width: 768px) {
    .project-selector-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-continue,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Requirement Form Styles */
.requirement-form-container {
    max-width: 95%;
    margin: 0 auto;
    width: 100%;
}

.project-info-header {
    background: #1e3a5f;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.project-info-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
}

.project-info-header p {
    margin: 0.25rem 0;
    opacity: 0.9;
}

.requirement-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f1f5f9;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-group input[type="number"] {
    text-align: right;
}

.form-group input[type="date"] {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f1f5f9;
    flex-wrap: wrap;
}

.form-actions .btn-secondary {
    flex: 0 0 auto;
}

.form-actions .btn-continue {
    flex: 1;
    min-width: 200px;
}

/* Form responsive */
@media (max-width: 768px) {
    .requirement-form-container {
        margin: 1rem;
    }
    
    .requirement-form {
        padding: 1.5rem;
    }
    
    .project-info-header {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-continue,
    .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

.project-details {
    margin-bottom: 20px;
}

.project-detail {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
}

.detail-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 80px;
    font-size: 14px;
}

.detail-value {
    color: #2d3748;
    font-size: 14px;
    flex: 1;
}

.project-actions {
    display: flex;
    justify-content: center;
}

.select-project-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

/* No projects message */
.no-projects-message {
    text-align: center;
    padding: 40px 20px;
    color: #4a5568;
}

.no-projects-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-projects-message h4 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #2d3748;
}

.no-projects-message p {
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Selected project banner */
.selected-project-banner {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-banner-content h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.project-banner-content p {
    margin: 0;
    opacity: 0.9;
}

.change-project-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.change-project-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Form placeholder */
.form-placeholder {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.form-placeholder h4 {
    color: #2d3748;
    margin-bottom: 12px;
}

.form-placeholder h5 {
    color: #4a5568;
    margin-bottom: 12px;
    text-align: left;
}

/* Responsive design for project selection */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .project-card {
        padding: 16px;
    }
    
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .project-name {
        margin-right: 0;
    }
    
    .selected-project-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .section-header {
        padding: 16px;
        text-align: center;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 8px;
        border-radius: 8px;
    }

    .nav-item.open .dropdown-menu {
        transform: none;
    }
}

/* User details */
.user-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.user-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-detail-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-detail-value {
    font-size: 16px;
    color: #2d3748;
    padding: 8px 12px;
    background-color: #f7fafc;
    border-radius: 6px;
    border-left: 4px solid #3182ce;
}

/* Database details */
.database-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.database-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.database-detail-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.database-detail-value {
    font-size: 16px;
    color: #2d3748;
    padding: 8px 12px;
    background-color: #e6fffa;
    border-radius: 6px;
    border-left: 4px solid #38b2ac;
}

/* Actions grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #2d3748;
}

.action-button:hover {
    border-color: #3182ce;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.2);
}

.action-icon {
    font-size: 32px;
}

/* Loading states */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #718096;
    font-style: italic;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #1e3a5f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #c6f6d5;
    color: #2f855a;
}

.status-inactive {
    background-color: #fed7d7;
    color: #c53030;
}

.status-indicator::before {
    content: '●';
    font-size: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-main {
        padding: 16px;
    }

    .welcome-card,
    .database-info-card,
    .actions-card {
        padding: 16px;
    }

    .user-details,
    .database-details {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .header-left h1 {
        font-size: 24px;
    }

    /* Responsive adjustments for combobox */
    .project-selector-container {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-continue,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ===== ESTILOS PARA TABLA DE REQUERIMIENTOS ===== */

/* Container principal de la tabla */
.requirements-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 1.5rem;
}

/* Header de la tabla */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.table-header h4 {
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.btn-add-requirement {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.btn-add-requirement:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-add-requirement span {
    font-size: 1rem;
}

/* Tabla responsiva */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

.requirements-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.875rem;
}

.requirements-table thead {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
}

.requirements-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.requirements-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.requirements-table tbody tr:hover {
    background-color: #f7fafc;
}

.requirements-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

/* Columnas específicas */
.requirements-table .cantidad {
    text-align: right;
    font-weight: 600;
    color: #2b6cb0;
}

.requirements-table .comentario {
    max-width: 200px;
    word-wrap: break-word;
    color: #4a5568;
}

.requirements-table .precio {
    text-align: right;
    font-weight: 500;
    color: #2d3748;
}

.requirements-table .total-cell {
    font-weight: 700;
    color: #2b6cb0;
    background-color: #f0f8ff;
}

.requirements-table .partida-name {
    max-width: 300px;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Badge para tipos */
.tipo-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tipo-mano-de-obra {
    background-color: #fed7d7;
    color: #c53030;
}

.tipo-materiales {
    background-color: #bee3f8;
    color: #2b6cb0;
}

.tipo-equipo {
    background-color: #d9f7be;
    color: #38a169;
}

.tipo-sub-contrato {
    background-color: #feebc8;
    color: #dd6b20;
}

/* Acciones de la tabla */
.actions {
    text-align: center;
    white-space: nowrap;
}

.actions button {
    background: none;
    border: none;
    padding: 0.5rem;
    margin: 0 0.125rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-detail {
    color: #4299e1;
}

.btn-detail:hover {
    background-color: #ebf8ff;
    transform: scale(1.1);
}

.btn-edit {
    color: #ed8936;
}

.btn-edit:hover {
    background-color: #fef5e7;
    transform: scale(1.1);
}

.btn-delete {
    color: #f56565;
}

.btn-delete:hover {
    background-color: #fed7d7;
    transform: scale(1.1);
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #718096;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.empty-state p {
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Sección de resumen */
.summary-section {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-top: 1px solid #e2e8f0;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

/* Modal para agregar/editar partidas */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #1e293b;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background-color: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Modal de detalle */
.detail-modal {
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.detail-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.detail-content h3 {
    background: #1e3a5f;
    color: white;
    padding: 1.5rem 2rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
}

.detail-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.detail-item {
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3182ce;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item strong {
    color: #2d3748;
    font-weight: 600;
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background-color: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Responsive para tabla de requerimientos */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .requirements-table {
        font-size: 0.75rem;
    }
    
    .requirements-table th,
    .requirements-table td {
        padding: 0.5rem;
    }
    
    .summary-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

/* Estilos específicos para tabla editable de requerimientos */
.requirement-form-container {
    width: 95%;
    max-width: none;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.project-info-header {
    background: #1e3a5f;
    color: white;
    padding: 1.5rem 2rem;
    border-bottom: 3px solid #5a67d8;
}

.project-info-content .project-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-details {
    display: flex;
    gap: 2rem;
    font-size: 14px;
    opacity: 0.9;
}

.project-details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requerimientos-section {
    padding: 2rem;
    width: 100%;
    overflow-x: auto;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.table-stats {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: linear-gradient(135deg, #edf2f7 0%, #f7fafc 100%);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table-controls {
    display: flex;
    gap: 0.75rem;
}

.table-controls .btn {
    padding: 0.5rem 1rem;
    font-size: 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(237, 137, 54, 0.3);
}

.table-container {
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
    margin-bottom: 1.5rem;
    width: 100%;
}

.editable-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 1600px;
}

.editable-table thead {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.editable-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.editable-table th:last-child {
    border-right: none;
}

.editable-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.editable-table tbody tr:hover {
    background-color: #f7fafc;
}

.editable-row:nth-child(even) {
    background-color: #f8f9fa;
}

.editable-row:nth-child(even):hover {
    background-color: #e2e8f0;
}

.editable-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-right: 1px solid #e2e8f0;
}

.editable-table td:last-child {
    border-right: none;
}

.row-number {
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    background-color: #f7fafc;
    font-size: 13px;
}

.editable-table input, 
.editable-table select {
    width: 100%;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    background: white;
    transition: all 0.2s ease;
}

.editable-table input:focus, 
.editable-table select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.editable-table input:read-only {
    background-color: #f7fafc;
    color: #4a5568;
    cursor: not-allowed;
}

.partida-cell {
    position: relative;
    min-width: 200px;
}

.partida-suggestions {
    position: fixed;
    background: white;
    border: 2px solid #4299e1;
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999 !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 300px;
}

.partida-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.15s ease;
}

.partida-suggestion:hover {
    background-color: #edf2f7;
}

.partida-suggestion:last-child {
    border-bottom: none;
}

.partida-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.partida-code {
    font-size: 12px;
    color: #718096;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ====================================================================
   ESTILOS PARA SUGERENCIAS DE RECURSOS
   ==================================================================== */

.recurso-suggestions {
    position: fixed;
    background: white;
    border: 2px solid #48bb78;
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999 !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 250px;
}

.recurso-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.15s ease;
}

.recurso-suggestion:hover {
    background-color: #f0fff4;
}

.recurso-suggestion:last-child {
    border-bottom: none;
}

.recurso-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.recurso-codigo,
.recurso-unidad {
    font-size: 11px;
    color: #718096;
}

/* ====================================================================
   ESTILOS PARA CAMPO DE IMAGEN DE REFERENCIA
   ==================================================================== */

.imagen-cell {
    padding: 0.5rem !important;
    text-align: center;
    vertical-align: middle;
}

.imagen-input {
    width: 100%;
    padding: 0.25rem;
    font-size: 11px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.imagen-input:hover {
    border-color: #4299e1;
    background-color: #f7fafc;
}

.imagen-input::-webkit-file-upload-button {
    padding: 0.25rem 0.5rem;
    font-size: 11px;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.imagen-input::-webkit-file-upload-button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.file-help {
    display: block;
    font-size: 10px;
    color: #718096;
    margin-top: 2px;
    font-style: italic;
}

/* ====================================================================
   ESTILOS PARA COPY/PASTE DESDE EXCEL
   ==================================================================== */

/* Filas incompletas desde paste */
.paste-incomplete {
    background-color: #fef5e7 !important;
    border-left: 3px solid #ed8936;
}

.paste-incomplete:hover {
    background-color: #fed7aa !important;
}

/* ===================================
   Estilos para imagen de referencia en modal Historial
   =================================== */

.imagen-referencia-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 15px;
    background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.imagen-preview {
    flex: 0 0 300px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
}

.imagen-preview img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.imagen-preview img:hover {
    transform: scale(1.05);
}

.imagen-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.imagen-info .detalle-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.btn-descargar-imagen {
    padding: 10px 20px;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-descargar-imagen:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

.btn-descargar-imagen i {
    font-size: 16px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .imagen-referencia-container {
        flex-direction: column;
    }
    
    .imagen-preview {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* Campos que necesitan completarse manualmente */
.field-incomplete {
    position: relative;
}

.field-incomplete::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #ed8936;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.field-incomplete input,
.field-incomplete select {
    background-color: #fef5e7 !important;
    border-color: #ed8936 !important;
}

.field-incomplete input::placeholder,
.field-incomplete select option[value=""] {
    color: #c05621 !important;
    font-weight: 500;
}

/* Animación sutil para campos incompletos */
.field-incomplete {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(237, 137, 54, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(237, 137, 54, 0.1);
    }
}

/* Estado completado */
.field-completed {
    border-color: #38a169 !important;
}

.field-completed input,
.field-completed select {
    border-color: #38a169 !important;
    background-color: #f0fff4 !important;
}

/* ====================================================================
   FIN ESTILOS COPY/PASTE
   ==================================================================== */

.btn-detail {
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-detail:hover {
    background: #3182ce;
    transform: scale(1.05);
}

.empty-message {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 2rem;
    background-color: #f7fafc;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.tip-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #718096;
    font-size: 14px;
}

.tip-info i {
    color: #ed8936;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.action-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    min-width: 140px;
    justify-content: center;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

/* Estilos específicos para campos */
.tipo-select {
    font-weight: 500;
    min-width: 110px;
}

.cantidad-input {
    text-align: right;
    font-weight: 600;
    color: #2d3748;
}

.fecha-input {
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Responsive para tabla editable */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
    }
    
    .dashboard-main {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .requerimientos-section {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .table-controls {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        justify-content: center;
        width: 100%;
    }
}

/* ================================
   MÓDULO DE CONFORMACIÓN
   ================================ */

.conformacion-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 1rem;
}

.conformacion-header {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.2);
}

.conformacion-header .section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.conformacion-header .section-icon {
    font-size: 24px;
}

.conformacion-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.conformacion-header .section-description {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.filters-panel {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
}

.filter-icon {
    font-size: 16px;
}

.filter-select {
    flex: 1;
    min-width: 300px;
    padding: 0.75rem 1rem;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

/* Compact filters layout - Versión minimalista mejorada */
.filters-panel-compact {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.filter-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 140px;
}

.filter-compact label {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    opacity: 0.8;
}

.filter-select-compact, .filter-input-compact {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    transition: all 0.3s ease;
    color: #2d3748;
}

.filter-select-compact:focus, .filter-input-compact:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    transform: translateY(-1px);
}

.filter-select-compact:hover, .filter-input-compact:hover {
    border-color: #a0aec0;
}

/* Botones de acción compactos minimalistas */
.btn-search-compact, .btn-reset-compact, .btn-export-compact {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.btn-search-compact {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.2);
}

.btn-search-compact:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.btn-reset-compact {
    background: linear-gradient(135deg, #edf2f7 0%, #f7fafc 100%);
    color: #4a5568;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-reset-compact:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #edf2f7 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.btn-export-compact {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
}

.btn-export-compact:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

/* Panel de acciones mejorado */
.actions-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.actions-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.actions-stats {
    font-size: 13px;
    color: #4a5568;
    background: #edf2f7;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.actions-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Botones de acción minimalistas */
.btn-action {
    padding: 0.625rem 1.25rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: fit-content;
}

.btn-action:hover:not(:disabled) {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-color: #a0aec0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: #2d3748;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f7fafc;
    color: #a0aec0;
}

.btn-primary {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transform: none;
    box-shadow: none;
}

.filter-compact .filter-label {
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    font-size: 13px;
}

.filter-compact .filter-select {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-compact .filter-select:focus {
    outline: none;
    border-color: #48bb78;
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.1);
}

.filter-actions-compact {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.filter-actions-compact .btn {
    padding: 0.5rem 1rem;
    font-size: 13px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Estilos específicos para filas de aprobaciones */
.aprobacion-row {
    transition: all 0.2s ease;
}

.aprobacion-row:hover {
    background-color: #f7fafc;
}

.aprobacion-row:nth-child(even) {
    background-color: #f8f9fa;
}

.aprobacion-row:nth-child(even):hover {
    background-color: #e2e8f0;
}

/* Estilos para inputs editables en aprobaciones */
.editable-input, .editable-select {
    width: 100%;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 13px;
    font-family: inherit;  /* evita que el <select> use la fuente del SO */
    color: inherit;
    background: white;
    transition: all 0.2s ease;
}

.editable-input:focus, .editable-select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.editable-input:read-only {
    background-color: #f7fafc;
    color: #4a5568;
    cursor: not-allowed;
}

/* Estilos específicos para campos de aprobación */
.pu-input, .cantidad-atendida-input {
    text-align: right;
}

.estado-select {
    font-weight: 500;
}

.estado-select option[value="aprobado"] {
    color: #22543d;
}

.estado-select option[value="rechazado"] {
    color: #c53030;
}

.estado-select option[value="pendiente"] {
    color: #d69e2e;
}

.comentario-input {
    min-width: 140px;
}

.subtotal-display {
    font-weight: 600;
    color: #2d3748;
    font-size: 13px;
}

/* Botones de acciones en celdas */
.cell-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}

.cell-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
    border-radius: 4px;
    min-width: auto;
}

/* Mensaje vacío estándar */
.empty-message {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

.empty-message i {
    margin-right: 0.5rem;
    color: #9ca3af;
}

/* Botones específicos para aprobaciones */
.btn-cotizacion, .btn-detalles {
    padding: 0.35rem 0.7rem;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cotizacion {
    background: #f7fafc;
    border: 1px solid #cbd5e0;
    font-size: 14px;
}

.btn-cotizacion.has-cotizacion {
    background: #c6f6d5;
    border-color: #48bb78;
    color: #22543d;
}

.btn-cotizacion:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.btn-detalles {
    background: #4299e1;
    color: white;
    border: 1px solid #3182ce;
}

.btn-detalles:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-cotizacion:not(:disabled):hover {
    background: #edf2f7;
    transform: translateY(-1px);
}

.btn-cotizacion.has-cotizacion:hover {
    background: #9ae6b4;
}

/* Anchos específicos para tabla de aprobaciones */
#aprobacionesTable {
    table-layout: fixed !important;
    width: 100% !important;
}

#aprobacionesTable .col-codigo-partida { width: 100px !important; min-width: 100px !important; max-width: 100px !important; }
#aprobacionesTable .col-partida { width: 220px !important; min-width: 220px !important; max-width: 220px !important; }
#aprobacionesTable .col-recurso { width: 170px !important; min-width: 170px !important; max-width: 170px !important; }
#aprobacionesTable .col-unidad { width: 70px !important; min-width: 70px !important; max-width: 70px !important; }
#aprobacionesTable .col-cant-sol { width: 80px !important; min-width: 80px !important; max-width: 80px !important; }
#aprobacionesTable .col-fecha-req { width: 110px !important; min-width: 110px !important; max-width: 110px !important; }
#aprobacionesTable .col-confirmador { width: 120px !important; min-width: 120px !important; max-width: 120px !important; }
#aprobacionesTable .col-pu { width: 120px !important; min-width: 120px !important; max-width: 120px !important; }
#aprobacionesTable .col-cant-atend { width: 90px !important; min-width: 90px !important; max-width: 90px !important; }
#aprobacionesTable .col-estado { width: 130px !important; min-width: 130px !important; max-width: 130px !important; }
#aprobacionesTable .col-ruc { width: 130px !important; min-width: 130px !important; max-width: 130px !important; }
#aprobacionesTable .col-factura { width: 140px !important; min-width: 140px !important; max-width: 140px !important; }
#aprobacionesTable .col-subtotal { width: 110px !important; min-width: 110px !important; max-width: 110px !important; }
#aprobacionesTable .col-comentario { width: 180px !important; min-width: 180px !important; max-width: 180px !important; }
#aprobacionesTable .col-cotizaciones { width: 70px !important; min-width: 70px !important; max-width: 70px !important; }
#aprobacionesTable .col-detalles { width: 70px !important; min-width: 70px !important; max-width: 70px !important; }

/* Aplicar también a las celdas por posición como respaldo */
#aprobacionesTable th:nth-child(1), #aprobacionesTable td:nth-child(1) { width: 100px !important; }  /* Cód. Partida */
#aprobacionesTable th:nth-child(2), #aprobacionesTable td:nth-child(2) { width: 220px !important; } /* Partida */
#aprobacionesTable th:nth-child(3), #aprobacionesTable td:nth-child(3) { width: 170px !important; } /* Recurso */
#aprobacionesTable th:nth-child(4), #aprobacionesTable td:nth-child(4) { width: 70px !important; }  /* Unidad */
#aprobacionesTable th:nth-child(5), #aprobacionesTable td:nth-child(5) { width: 80px !important; }  /* Cant. Sol. */
#aprobacionesTable th:nth-child(6), #aprobacionesTable td:nth-child(6) { width: 110px !important; } /* Fecha Req. */
#aprobacionesTable th:nth-child(7), #aprobacionesTable td:nth-child(7) { width: 120px !important; } /* Confirmador */
#aprobacionesTable th:nth-child(8), #aprobacionesTable td:nth-child(8) { width: 120px !important; } /* P.U. */
#aprobacionesTable th:nth-child(9), #aprobacionesTable td:nth-child(9) { width: 90px !important; }  /* Cant. Atend. */
#aprobacionesTable th:nth-child(10), #aprobacionesTable td:nth-child(10) { width: 130px !important; } /* Estado */
#aprobacionesTable th:nth-child(11), #aprobacionesTable td:nth-child(11) { width: 130px !important; } /* RUC */
#aprobacionesTable th:nth-child(12), #aprobacionesTable td:nth-child(12) { width: 140px !important; } /* Factura */
#aprobacionesTable th:nth-child(13), #aprobacionesTable td:nth-child(13) { width: 110px !important; } /* Subtotal */
#aprobacionesTable th:nth-child(14), #aprobacionesTable td:nth-child(14) { width: 180px !important; } /* Comentario */
#aprobacionesTable th:nth-child(15), #aprobacionesTable td:nth-child(15) { width: 70px !important; }  /* Cotizaciones */
#aprobacionesTable th:nth-child(16), #aprobacionesTable td:nth-child(16) { width: 70px !important; }  /* Detalles */

/* Responsive adjustments for compact filters */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filter-compact {
        min-width: 100%;
    }
    
    .filter-compact label {
        min-width: 24px;
        font-size: 18px;
    }
    
    .actions-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-action, .btn-primary {
        justify-content: center;
        min-width: 100%;
    }
}

@media (max-width: 1200px) {
    .filters-row {
        gap: 0.5rem;
    }
    
    .filter-compact {
        min-width: 160px;
    }
    
    .actions-buttons {
        gap: 0.5rem;
    }
    
    .btn-action, .btn-primary {
        padding: 0.5rem 1rem;
        font-size: 12px;
    }
}

@media (min-width: 1400px) {
    .filters-panel-compact {
        padding: 1.25rem 2rem;
    }
    
    .actions-panel {
        padding: 1.5rem 2rem;
    }
}

.pending-requirements-panel {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.panel-header {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 18px;
    font-weight: 600;
}

.panel-icon {
    font-size: 20px;
}

.status-counter {
    font-size: 14px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.status-confirmed {
    color: #68d391;
}

.status-rejected {
    color: #fc8181;
}

.status-pending {
    color: #fbb747;
}

.actions-panel {
    padding: 1rem 1.5rem;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.conformacion-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1200px;
}

.conformacion-table thead {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.conformacion-table th,
.conformacion-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

.conformacion-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conformacion-table tbody tr {
    transition: background-color 0.2s ease;
}

.conformacion-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.conformacion-table tbody tr:hover {
    background-color: #e3f2fd;
}

.checkbox-cell {
    text-align: center;
    padding: 0.5rem;
}

.checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    transform: scale(1.2);
}

.confirm-checkbox:checked {
    accent-color: #48bb78;
}

.reject-checkbox:checked {
    accent-color: #f56565;
}

.comment-cell {
    padding: 0.25rem;
}

.comment-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
}

.loading-message,
.error-message,
.no-data-message {
    text-align: center;
    padding: 3rem 2rem;
    color: #718096;
}

.no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.no-data-icon {
    font-size: 48px;
    opacity: 0.6;
}

.no-data-message h4 {
    margin: 0;
    color: #4a5568;
    font-size: 18px;
}

.no-data-message p {
    margin: 0;
    color: #718096;
}

.error-message {
    color: #e53e3e;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    margin: 1rem;
}

.access-denied-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.access-denied-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.access-denied-icon {
    font-size: 64px;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.access-denied-card h2 {
    color: #e53e3e;
    margin-bottom: 1rem;
}

.access-denied-card p {
    color: #718096;
    margin-bottom: 1rem;
}

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-card {
    background: white;
    border: 2px solid #feb2b2;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.1);
}

.error-icon {
    font-size: 64px;
    margin-bottom: 1rem;
}

/* Responsive para conformación */
@media (max-width: 768px) {
    .conformacion-container {
        padding: 0.5rem;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: auto;
        width: 100%;
    }
    
    .actions-panel {
        flex-direction: column;
    }
    
    .conformacion-table {
        font-size: 11px;
        min-width: 900px;
    }
    
    .conformacion-table th,
    .conformacion-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Estilos para botón de detalles */
.btn-detalles {
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    transition: background-color 0.2s ease;
}

.btn-detalles:hover {
    background: #3182ce;
}

.btn-detalles i {
    font-size: 14px;
}

.detalles-cell {
    text-align: center;
    padding: 4px !important;
}

/* ================================================================= */
/* MÓDULO DE REPORTES - ESTILOS ESPECÍFICOS */
/* ================================================================= */

/* Container principal del módulo de reportes */
.reporte-container {
    padding: 24px;
    max-width: none;
    width: 100%;
    margin: 0;
    background-color: #f7fafc;
    min-height: calc(100vh - 120px);
}

/* Header del módulo de reportes */
.reporte-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.reporte-header .section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.reporte-header .section-icon {
    font-size: 28px;
}

.reporte-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.reporte-header .section-description {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Panel de estadísticas */
.estadisticas-panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #dee2e6;
    min-height: 60px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.total {
    border-left-color: #6366f1;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
}

.stat-card.solicitado {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fefbf2 0%, #fef3c7 100%);
}

.stat-card.confirmado {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
}

.stat-card.aprobado {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.stat-card.atendido {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.stat-card.rechazado {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.stat-icon {
    font-size: 18px;
    opacity: 0.8;
    min-width: 18px;
}

.stat-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
    line-height: 1.2;
}

.stat-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
    line-height: 1.2;
}

/* ============================================
   TARJETAS MINI DE ESTADÍSTICAS (REPORTES)
   ============================================ */
.stat-card-mini {
    background: white;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 3px solid #dee2e6;
    min-height: 50px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card-mini .stat-number {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-card-mini .stat-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
    margin-top: 2px;
}

.stat-card-mini.total { border-left-color: #6366f1; background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%); }
.stat-card-mini.solicitado { border-left-color: #f59e0b; background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.stat-card-mini.confirmado { border-left-color: #10b981; background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%); }
.stat-card-mini.aprobado { border-left-color: #3b82f6; background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.stat-card-mini.por_pagar { border-left-color: #f97316; background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); }
.stat-card-mini.enviado { border-left-color: #8b5cf6; background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%); }
.stat-card-mini.almacenado { border-left-color: #06b6d4; background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%); }

/* Tarjetas con monto integrado */
.stat-card-mini.with-amount {
    padding: 6px 10px;
}

.stat-card-mini .stat-amount {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    line-height: 1;
    margin-top: 2px;
}

.stat-card-mini.aprobado .stat-amount { color: #f59e0b; }
.stat-card-mini.enviado .stat-amount { color: #10b981; }
.stat-card-mini.almacenado .stat-amount { color: #06b6d4; }

/* ============================================
   TARJETAS DE INDICADORES FINANCIEROS
   ============================================ */
.financial-stats {
    display: flex;
    gap: 10px;
}

.finance-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.finance-card i {
    font-size: 20px;
    opacity: 0.8;
}

.finance-card .finance-info {
    display: flex;
    flex-direction: column;
}

.finance-card .finance-amount {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.finance-card .finance-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.finance-card.pending {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.finance-card.pending i { color: #f59e0b; }

.finance-card.paid {
    border-left: 3px solid #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
}
.finance-card.paid i { color: #10b981; }

.finance-card.spent {
    border-left: 3px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}
.finance-card.spent i { color: #ef4444; }

/* Tabla de reportes (solo lectura) */
.readonly-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    border-collapse: collapse;
}

.readonly-table thead {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: white;
}

.readonly-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.readonly-table tbody tr {
    transition: background-color 0.2s;
}

.readonly-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.readonly-table tbody tr:hover {
    background-color: #f3f4f6;
}

.readonly-table tbody tr.selected {
    background-color: #eff6ff !important;
    border-left: 3px solid #3b82f6;
}

.readonly-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    vertical-align: middle;
}

.readonly-table .id-cell {
    font-weight: 600;
    color: #4f46e5;
    text-align: center;
}

/* Estados en tabla de reportes */
.estado-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    min-width: 80px;
}

.estado-solicitado {
    background-color: #fef3c7;
    color: #92400e;
}

.estado-confirmado {
    background-color: #d1fae5;
    color: #065f46;
}

.estado-aprobado {
    background-color: #dbeafe;
    color: #1e40af;
}

.estado-atendido {
    background-color: #ede9fe;
    color: #6b21a8;
}

.estado-rechazado {
    background-color: #fecaca;
    color: #991b1b;
}

.estado-default {
    background-color: #f3f4f6;
    color: #374151;
}

/* Panel de información del reporte */
.info-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.info-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
}

.info-content p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.info-content strong {
    color: #374151;
    font-weight: 600;
}

/* Responsive para módulo de reportes */
@media (max-width: 768px) {
    .reporte-container {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .info-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MODAL DE DETALLES DE REQUERIMIENTO
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 1800px;
    width: 95%;
    min-width: 1000px;
    max-height: 92vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    background: #1e293b;
    color: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
}

.modal-title i {
    font-size: 1rem;
    color: #94a3b8;
}

.modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.modal-body {
    padding: 0;
}

/* Pestañas del modal */
.modal-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}

.modal-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.modal-tab i {
    font-size: 0.85rem;
}

.modal-tab:hover {
    background: #e2e8f0;
    color: #374151;
}

.modal-tab.active {
    background: white;
    color: #1e40af;
    border-bottom: 2px solid #1e40af;
}

.modal-tab-content {
    display: none;
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-tab-content.active {
    display: block;
}

/* Tabla de requerimientos relacionados */
.requerimientos-relacionados-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.requerimientos-relacionados-table th {
    background: #1e3a5f;
    color: white;
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.requerimientos-relacionados-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.requerimientos-relacionados-table tbody tr {
    transition: all 0.2s ease;
}

.requerimientos-relacionados-table tbody tr:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.requerimientos-relacionados-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.requerimientos-relacionados-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

.requerimientos-relacionados-table tr.current-row {
    background: linear-gradient(90deg, #e6f3ff 0%, #f0f8ff 100%) !important;
    border-left: 4px solid #3182ce;
    font-weight: 500;
}

.requerimientos-relacionados-table tr.current-row:hover {
    background: linear-gradient(90deg, #dbeafe 0%, #e6f3ff 100%) !important;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-confirmado {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-pendiente {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.status-aprobado {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.cantidad-highlight {
    font-weight: 700;
    color: #3182ce;
    background: rgba(49, 130, 206, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.fecha-cell {
    white-space: nowrap;
    font-family: 'Segoe UI', monospace;
    font-size: 0.8rem;
    color: #64748b;
}

.no-requerimientos {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-style: italic;
}

/* Filtro de búsqueda en modal */
.search-filter-container {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-filter {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.search-filter:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.clear-filter {
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.clear-filter:hover {
    background: #e2e8f0;
    color: #475569;
}

.search-results-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

/* Estilos para el comparativo */
.loading-comparativo,
.error-comparativo {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4a5568;
    min-width: 45px;
    text-align: right;
}

.text-danger {
    color: #ef4444 !important;
    font-weight: 600;
}

.text-success {
    color: #10b981 !important;
    font-weight: 600;
}

.detalle-section {
    margin-bottom: 1.5rem;
}

.detalle-section h3 {
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.detalle-item {
    background: #f7fafc;
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid #3182ce;
}

.detalle-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.detalle-value {
    color: #2d3748;
    font-size: 0.9rem;
    word-break: break-word;
}

.detalle-value.empty {
    color: #a0aec0;
    font-style: italic;
}

.detalle-value.highlight {
    background: #1e3a5f;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.detalle-description {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-style: italic;
}

.detalle-comentarios {
    grid-column: 1 / -1;
}

.detalle-comentarios .detalle-value {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    min-height: 80px;
    white-space: pre-wrap;
}

/* Responsive para modal */
@media (max-width: 1400px) {
    .modal-content {
        max-width: 1100px;
        width: 96%;
    }
}

@media (max-width: 1200px) {
    .modal-content {
        max-width: 900px;
        width: 95%;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        max-height: 92vh;
        max-width: none;
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .modal-title {
        font-size: 1.3rem;
        letter-spacing: 0.3px;
    }
    
    .modal-tab-content {
        padding: 1.5rem;
    }
    
    .detalle-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .detalle-item {
        padding: 0.5rem;
    }

    .detalle-label {
        font-size: 0.75rem;
    }

    .detalle-value {
        font-size: 0.85rem;
    }

    .search-filter-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .requerimientos-relacionados-table {
        font-size: 0.8rem;
    }

    .requerimientos-relacionados-table th,
    .requerimientos-relacionados-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* ==========================================
   KPIs STYLES
   ========================================== */

.kpis-container {
    margin-top: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.kpis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.kpis-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.25rem;
}

.btn-refresh {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-refresh:hover {
    background: #0056b3;
}

.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.kpi-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-total { border-left-color: #6c757d; }
.kpi-solicitados { border-left-color: #ffc107; }
.kpi-confirmados { border-left-color: #28a745; }
.kpi-atendidos { border-left-color: #007bff; }
.kpi-eficiencia { border-left-color: #17a2b8; }
.kpi-tiempo { border-left-color: #fd7e14; }

.kpi-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 2rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-percentage {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
}

.kpi-trend {
    font-size: 0.8rem;
    color: #6c757d;
}

.kpi-sublabel {
    font-size: 0.75rem;
    color: #adb5bd;
}

/* ================================================================================ */
/* MÓDULO DE COTIZACIONES */
/* ================================================================================ */

.cotizaciones-container {
    padding: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
}

.cotizaciones-header {
    margin-bottom: 1.5rem;
}

.cotizaciones-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cotizaciones-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    min-height: 600px;
}

/* Panel de Requerimientos */
.requerimientos-panel {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: normal;
}

.requerimientos-list {
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.requerimiento-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.requerimiento-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.requerimiento-card.selected {
    border-color: #007bff;
    background: #e7f3ff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.req-codigo {
    font-weight: 600;
    color: #495057;
}

.req-tipo {
    background: #e9ecef;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.estado-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.estado-solicitado {
    background: #fff3cd;
    color: #856404;
}

.estado-confirmado {
    background: #d1ecf1;
    color: #0c5460;
}

.estado-aprobado {
    background: #d4edda;
    color: #155724;
}

.estado-rechazado {
    background: #f8d7da;
    color: #721c24;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.req-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item .label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
    min-width: 80px;
}

.info-item .value {
    color: #495057;
    font-size: 0.85rem;
}

.cotizaciones-summary {
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.cotizaciones-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Panel de Cotizaciones */
.cotizaciones-panel {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.cotizaciones-content {
    padding: 1rem;
    min-height: 400px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    min-height: 300px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h4 {
    color: #495057;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1rem 1.5rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Formularios */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Botones */
.btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-primary:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #545b62;
}

.btn-icon {
    font-size: 0.8rem;
}

/* Filtros */
.filters-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.filters-header h3 {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.filter-select,
.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.filters-actions {
    display: flex;
    gap: 0.75rem;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-message {
    color: #495057;
    font-size: 0.9rem;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-success {
    border-left: 4px solid #28a745;
}

/* Loading message */
.loading-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* ============================================================================
   FILE UPLOAD STYLES FOR COTIZACIONES
   ============================================================================ */

/* Contenedor de subida de archivos */
.file-upload-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 1rem;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-container:hover {
    border-color: #4299e1;
    background: #ebf8ff;
}

.file-upload-container.file-selected {
    border-color: #38a169;
    background: #f0fff4;
    border-style: solid;
}

/* Input file oculto */
.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

/* Display de subida */
.file-upload-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    color: #4a5568;
    font-size: 0.9rem;
    pointer-events: none;
}

.file-upload-display i {
    font-size: 1.5rem;
    color: #4299e1;
}

.file-upload-text {
    color: #718096;
    font-weight: 500;
}

.file-selected-name {
    color: #38a169;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botón limpiar archivo */
.btn-file-clear {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 0.375rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    z-index: 3;
    position: relative;
}

.btn-file-clear:hover {
    background: #feb2b2;
    border-color: #fc8181;
}

/* Texto de ayuda */
.file-help-text {
    display: block;
    margin-top: 0.5rem;
    color: #a0aec0;
    font-size: 0.8rem;
    font-style: italic;
}

/* Estados del contenedor de archivo */
.file-upload-container.dragover {
    border-color: #4299e1;
    background: #ebf8ff;
    transform: scale(1.02);
}

/* Lista de cotizaciones con documentos */
.cotizacion-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
    transition: all 0.2s ease;
}

.cotizacion-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cotizacion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.cotizacion-proveedor {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

.cotizacion-monto {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.cotizacion-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cotizacion-fecha {
    color: #718096;
    font-size: 0.85rem;
}

.cotizacion-obs {
    color: #4a5568;
    font-size: 0.9rem;
    margin: 0;
    padding: 0.5rem;
    background: #f7fafc;
    border-radius: 6px;
    border-left: 3px solid #4299e1;
}

.cotizacion-documento {
    margin-top: 0.5rem;
}

.documento-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4299e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.documento-link:hover {
    background: #bee3f8;
    border-color: #90cdf4;
    text-decoration: none;
    color: #2b6cb0;
}

.cotizacion-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    color: #a0aec0;
    font-size: 0.8rem;
}

/* Estados vacío y error */
.cotizaciones-empty,
.cotizaciones-error {
    text-align: center;
    padding: 2rem;
    color: #718096;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
}

.cotizaciones-empty i,
.cotizaciones-error i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #a0aec0;
}

.cotizaciones-error {
    border-color: #feb2b2;
    background: #fed7d7;
    color: #c53030;
}

.cotizaciones-error i {
    color: #e53e3e;
}

/* Responsive */
@media (max-width: 768px) {
    .cotizaciones-main {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .cotizacion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-upload-container {
        padding: 0.75rem;
    }
    
    .file-upload-display {
        font-size: 0.85rem;
    }
}

/* Estilos para documentos en cotizaciones */
.cotizacion-documento {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.documento-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.documento-nombre {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    flex: 1;
}

.documento-acciones {
    display: flex;
    gap: 0.5rem;
}

.btn-documento {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-ver {
    background: #4299e1;
    color: white;
    border: 1px solid #4299e1;
}

.btn-ver:hover {
    background: #3182ce;
    border-color: #3182ce;
    color: white;
    text-decoration: none;
}

.btn-descargar {
    background: #48bb78;
    color: white;
    border: 1px solid #48bb78;
}

.btn-descargar:hover {
    background: #38a169;
    border-color: #38a169;
    color: white;
    text-decoration: none;
}

@media (max-width: 768px) {
    .documento-acciones {
        flex-direction: column;
    }
    
    .btn-documento {
        justify-content: center;
        width: 100%;
    }
}

/* ========================================
   MODAL GLOBAL PARA EDICIÓN
   ======================================== */
.modal-edicion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal-edicion-overlay.visible {
    display: flex !important;
}

.modal-edicion-container {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease-out;
}

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

.modal-edicion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #1e3a5f;
    border-radius: 8px 8px 0 0;
}

.modal-edicion-header h3 {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.modal-edicion-close {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #fff;
    line-height: 1;
    padding: 0;
    transition: opacity 0.15s;
}

.modal-edicion-close:hover {
    opacity: 0.8;
}

.modal-edicion-body {
    padding: 1.5rem;
}

.modal-edicion-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
}

/* =============================================================================
   ESTILOS ESTANDARIZADOS PARA MODALES - Información del Requerimiento
   ============================================================================= */

/* Caja de información del requerimiento - Estilo unificado */
.requerimiento-info-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.requerimiento-info-box p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.5;
}

.requerimiento-info-box p:last-child {
    margin-bottom: 0;
}

.requerimiento-info-box strong {
    color: #2d3748;
    font-weight: 600;
    margin-right: 0.25rem;
}

.requerimiento-info-box .badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.requerimiento-info-box .badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

.requerimiento-info-box .badge-success {
    background: #d1fae5;
    color: #047857;
}

.requerimiento-info-box .badge-warning {
    background: #fef3c7;
    color: #b45309;
}

/* Sección de detalle - Estilo compacto para cotizaciones */
.detalle-section-compact {
    margin-bottom: 1.5rem;
}

.detalle-section-compact h3 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detalle-section-compact h3 i {
    color: #6366f1;
}

/* Formulario de cotización - Estilo estándar */
.cotizacion-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
}

.cotizacion-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cotizacion-form .form-group {
    margin-bottom: 0;
}

.cotizacion-form .form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.cotizacion-form .form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cotizacion-form .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.cotizacion-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Estilos para upload de archivos */
.file-upload-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-upload-container .file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1.5px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    transition: all 0.2s;
}

.file-upload-container:hover .file-upload-display {
    border-color: #6366f1;
    background: #f5f3ff;
}

.file-upload-display i {
    font-size: 1.25rem;
    color: #9ca3af;
}

.file-upload-text {
    font-size: 0.875rem;
}

.file-selected-name {
    color: #10b981;
    font-weight: 500;
}

.btn-file-clear {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 3;
}

.btn-file-clear:hover {
    background: #fecaca;
}

.file-help-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Lista de cotizaciones existentes */
.cotizaciones-list {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.cotizaciones-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.cotizaciones-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.cotizaciones-empty p {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.cotizaciones-empty small {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* Tarjeta de cotización individual */
.cotizacion-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.cotizacion-card:last-child {
    border-bottom: none;
}

.cotizacion-card:hover {
    background: #f9fafb;
}

.cotizacion-card.ganadora {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid #10b981;
}

.cotizacion-info {
    flex: 1;
}

.cotizacion-proveedor {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.cotizacion-proveedor small {
    font-weight: 400;
    color: #6b7280;
    margin-left: 0.5rem;
}

.cotizacion-monto {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

.cotizacion-fecha {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.cotizacion-actions {
    display: flex;
    gap: 0.5rem;
}

.cotizacion-actions .btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cotizacion-actions .btn-icon.btn-ver {
    background: #e0f2fe;
    color: #0284c7;
}

.cotizacion-actions .btn-icon.btn-ver:hover {
    background: #bae6fd;
}

.cotizacion-actions .btn-icon.btn-seleccionar {
    background: #d1fae5;
    color: #059669;
}

.cotizacion-actions .btn-icon.btn-seleccionar:hover {
    background: #a7f3d0;
}

.cotizacion-actions .btn-icon.btn-eliminar {
    background: #fee2e2;
    color: #dc2626;
}

.cotizacion-actions .btn-icon.btn-eliminar:hover {
    background: #fecaca;
}

/* Badge de estado en cotización */
.cotizacion-estado {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.cotizacion-estado.pendiente {
    background: #fef3c7;
    color: #b45309;
}

.cotizacion-estado.seleccionada {
    background: #d1fae5;
    color: #047857;
}

.cotizacion-estado.rechazada {
    background: #fee2e2;
    color: #dc2626;
}

/* =============================================================================
   CONTENEDOR DE SCROLL PARA TABLAS
   ============================================================================= */

.tabla-scroll-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 320px); /* Altura máxima dinámica */
    border-radius: 8px;
    background: white;
    border: 1px solid #e5e7eb;
}

/* =============================================================================
   TABLA DE COTIZACIONES - Estilos estandarizados
   ============================================================================= */

.cotizaciones-tabla-container {
    margin-top: 0;
    border-radius: 8px;
    overflow-x: auto;
    background: white;
}

.cotizaciones-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: white;
    table-layout: fixed;
}

/* Anchos de columnas específicos para tabla de cotizaciones en modal */
.cotizaciones-tabla .proveedor-columna { 
    width: 200px; 
    max-width: 200px;
    overflow: hidden;
}
.cotizaciones-tabla .monto-columna { width: 85px; text-align: right; }
.cotizaciones-tabla .cantidad-columna { width: 50px; text-align: center; }
.cotizaciones-tabla .subtotal-columna { width: 95px; text-align: right; }
.cotizaciones-tabla .fecha-columna { width: 80px; text-align: center; }
.cotizaciones-tabla .credito-columna { width: 45px; text-align: center; }
.cotizaciones-tabla .entrega-columna { width: 50px; text-align: center; }
.cotizaciones-tabla .tipo-columna { width: 45px; text-align: center; }
.cotizaciones-tabla .estado-columna { width: 90px; text-align: center; }
.cotizaciones-tabla .documento-columna { width: 60px; text-align: center; }
.cotizaciones-tabla .acciones-columna { width: 80px; text-align: center; }

/* Encabezados alineados con las columnas */
.cotizaciones-tabla th:nth-child(1) { width: 200px; } /* Proveedor */
.cotizaciones-tabla th:nth-child(2) { width: 85px; text-align: right; } /* P. Unit */
.cotizaciones-tabla th:nth-child(3) { width: 50px; text-align: center; } /* Cant */
.cotizaciones-tabla th:nth-child(4) { width: 95px; text-align: right; } /* Subtotal */
.cotizaciones-tabla th:nth-child(5) { width: 80px; text-align: center; } /* Fecha */
.cotizaciones-tabla th:nth-child(6) { width: 45px; text-align: center; } /* Créd */
.cotizaciones-tabla th:nth-child(7) { width: 50px; text-align: center; } /* Entreg */
.cotizaciones-tabla th:nth-child(8) { width: 45px; text-align: center; } /* Tipo */
.cotizaciones-tabla th:nth-child(9) { width: 90px; text-align: center; } /* Estado */
.cotizaciones-tabla th:nth-child(10) { width: 60px; text-align: center; } /* Doc */
.cotizaciones-tabla th:nth-child(11) { width: 80px; text-align: center; } /* Acciones */

/* Header fijo (sticky) */
.cotizaciones-tabla thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.cotizaciones-tabla th {
    background: #f8fafc;
    padding: 0.875rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    /* Evitar transparencia en sticky */
    box-shadow: 0 1px 0 #e5e7eb;
}

/* Tabla de Salida de Almacén - Encabezado oscuro */
#salidaTable thead tr {
    background: #2c3e50 !important;
}

#salidaTable thead th,
#salidaTable.cotizaciones-tabla thead th,
table#salidaTable thead th {
    background: #2c3e50 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 12px 8px;
    border-bottom: 2px solid #1a252f;
    box-shadow: none;
}

/* Tabla de Salidas SR (Servicios) — estándar #1e3a5f */
#salidasSRTable thead tr {
    background: #1e3a5f !important;
}

#salidasSRTable thead th,
#salidasSRTable.cotizaciones-tabla thead th,
table#salidasSRTable thead th {
    background: #1e3a5f !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 7px 8px !important;
    font-size: 11px !important;
    border-right: 1px solid rgba(255,255,255,0.15) !important;
    border-bottom: none !important;
}

#salidasSRTable thead th:nth-child(1)  { width: 28px !important; }
#salidasSRTable thead th:nth-child(2)  { width: 82px !important; }
#salidasSRTable thead th:nth-child(3)  { width: 120px !important; }
#salidasSRTable thead th:nth-child(8)  { background: #152d4a !important; } /* Saldo */

/* Celdas del cuerpo: fondo blanco, sin herencia de .cotizaciones-tabla */
#salidasSRTable tbody tr { background: #fff; }
#salidasSRTable tbody tr:hover { background: #f8fafc; }
#salidasSRTable tbody td { padding: 4px 6px !important; vertical-align: middle; }
#salidasSRTable .input-celda { background: transparent !important; border: none !important; font-size: 12px; }
#salidasSRTable .input-celda[readonly] { color: #374151; cursor: default; }
#salidasSRTable .input-celda:not([readonly]) { background: #fff !important; border: 1px solid #d1d5db !important; border-radius: 3px; }

.cotizaciones-tabla td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    line-height: 1.4;
}

/* Permitir wrap en celdas de texto largo */
.cotizaciones-tabla td {
    white-space: normal;
    word-break: break-word;
}

/* Celdas que NO deben hacer wrap (datos cortos/numéricos) */
.cotizaciones-tabla td.no-wrap,
.cotizaciones-tabla td:first-child,  /* ID siempre primera columna */
.cotizaciones-tabla th {
    white-space: nowrap;
}

/* Clase para forzar nowrap en columnas específicas */
.cotizaciones-tabla .cell-nowrap,
.cotizaciones-tabla .cell-id,
.cotizaciones-tabla .cell-codigo,
.cotizaciones-tabla .cell-cantidad,
.cotizaciones-tabla .cell-unidad,
.cotizaciones-tabla .cell-fecha,
.cotizaciones-tabla .cell-pu,
.cotizaciones-tabla .cell-subtotal,
.cotizaciones-tabla .cell-estado {
    white-space: nowrap !important;
    word-break: normal !important;
}

.cotizacion-fila {
    transition: background 0.2s;
}

.cotizacion-fila:hover {
    background-color: #f9fafb;
}

.cotizacion-fila.fila-seleccionada {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

/* Resaltar filas con cotizaciones */
.cotizacion-fila.fila-con-cotizacion {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 3px solid #f59e0b;
}

.cotizacion-fila.fila-con-cotizacion:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Fila OBSERVADA: fondo rosado con borde izquierdo rojo */
.cotizacion-fila.fila-observada td {
    background: #fff1f2 !important;
    border-top: 1px solid #fecdd3;
    color: #881337;
}
.cotizacion-fila.fila-observada {
    border-left: 3px solid #f43f5e;
}
.cotizacion-fila.fila-observada:hover td {
    background: #ffe4e6 !important;
}
.cotizacion-fila.fila-observada input,
.cotizacion-fila.fila-observada select {
    background: #fff1f2 !important;
    color: #881337;
}

/* Badge de cotizaciones en botón */
.btn-tiene-cotizaciones {
    position: relative;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-color: #d97706 !important;
}

.btn-tiene-cotizaciones:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

.badge-cotizaciones {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
    line-height: 1.2;
}

/* ========================================
   TABLA EDITABLE TIPO EXCEL
   ======================================== */

.tabla-editable {
    border-collapse: collapse;
}

.tabla-editable thead tr {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.tabla-editable th {
    color: white !important;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    padding: 8px 6px;
    border: 1px solid rgba(255,255,255,0.2);
    white-space: nowrap;
}

.tabla-editable td {
    padding: 2px 4px;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
}

.tabla-editable .fila-salida {
    background: white;
}

.tabla-editable .fila-salida:nth-child(even) {
    background: #fafbfc;
}

.tabla-editable .fila-salida:hover {
    background: #f0f7ff;
}

/* Inputs dentro de la tabla editable */
.input-celda {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 12px;
    background: transparent;
    transition: all 0.15s;
}

.input-celda:focus {
    outline: none;
    border-color: #17a2b8;
    background: white;
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.15);
}

/* Estados de validación de input */
.input-celda.input-valid {
    border-color: #28a745;
    background: #f0fff0;
}

.input-celda.input-valid:focus {
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.input-celda.input-error {
    border-color: #dc3545;
    background: #fff5f5;
}

.input-celda.input-error:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Fila con error */
.fila-salida.fila-error {
    background: #fff5f5 !important;
}

.fila-salida.fila-error td {
    border-color: #f5c6cb;
}

/* Columna de stock disponible */
.stock-disponible {
    display: block;
    text-align: center;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #28a745;
}

.fila-salida.fila-error .stock-disponible {
    color: #dc3545 !important;
    font-weight: 700;
}

/* Fila guardada */
.fila-salida.fila-guardada {
    background: #f0fff4 !important;
}

.fila-salida.fila-guardada td {
    border-color: #c3e6cb;
}

.fila-salida.fila-guardada input {
    background: #f8f9fa !important;
    color: #495057;
}

/* Fila en edición */
.fila-salida.fila-editando {
    background: #fff8e1 !important;
}

.fila-salida.fila-editando td {
    border-color: #ffeeba;
}

.fila-salida.fila-editando input:not([readonly]) {
    background: #ffffff !important;
    border: 2px solid #ffc107;
}

/* Botones de acción en filas */
.acciones-fila {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.btn-icon-mini {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-icon-mini:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* ============================================
   BOTÓN EXPANDIR LOTES EN STOCK
   ============================================ */
.btn-expandir-lotes {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #17a2b8;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-expandir-lotes:hover {
    background: #138496;
    transform: scale(1.1);
}

.btn-expandir-lotes.activo {
    background: #dc3545;
}

.btn-expandir-lotes.activo:hover {
    background: #c82333;
}

/* Fila de detalle de lotes */
.fila-lotes-detalle {
    background: #f8f9fa;
}

.fila-lotes-detalle td {
    padding: 0 !important;
}

.lotes-container {
    padding: 15px;
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    border-top: 2px solid #17a2b8;
    border-bottom: 2px solid #17a2b8;
}

.lotes-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: #495057;
    font-size: 0.9em;
}

.tabla-lotes {
    width: 100%;
    font-size: 0.85em;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tabla-lotes th {
    padding: 8px;
    text-align: left;
    background: #495057;
    color: white;
    font-weight: 500;
    font-size: 0.9em;
}

.tabla-lotes td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.tabla-lotes tbody tr:hover {
    background: rgba(0,0,0,0.02) !important;
}

.input-celda:hover:not(:focus) {
    background: rgba(0,0,0,0.02);
}

.input-celda::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Input de fecha */
.input-celda[type="date"] {
    font-family: inherit;
}

/* Input numérico */
.input-celda[type="number"] {
    text-align: right;
}

/* Celdas de totales (span) */
.subtotal-salida,
.igv-salida,
.total-salida {
    display: block;
    text-align: right;
    padding: 4px 6px;
    font-size: 12px;
    color: #495057;
}

.total-salida {
    font-weight: 600;
    color: #2c5aa0;
}

/* Botones mini dentro de la tabla */
.btn-icon-mini {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.btn-icon-mini:hover {
    background: #e9ecef;
    color: #495057;
}

.btn-icon-mini.btn-editar-fila:hover {
    background: #d4edda;
    color: #155724;
}

.btn-icon-mini.btn-eliminar-fila:hover {
    background: #f8d7da;
    color: #721c24;
}

/* Radio button de fila activa */
.radio-fila {
    cursor: pointer;
}

/* Columnas de la tabla */
.proveedor-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    max-width: 100%;
    overflow: hidden;
}

.proveedor-info strong {
    color: #1f2937;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 185px;
}

.ruc-small {
    color: #6b7280;
    font-size: 0.75rem;
}

/* Badges de monto */
.monto-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.monto-badge.pen {
    background: #d1fae5;
    color: #047857;
}

.monto-badge.usd {
    background: #dbeafe;
    color: #1e40af;
}

.monto-badge.eur {
    background: #fce7f3;
    color: #9d174d;
}

/* Badges de estado */
.estado-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.estado-pendiente {
    background: #fef3c7;
    color: #b45309;
}

.estado-seleccionada {
    background: #d1fae5;
    color: #047857;
}

.estado-sugerida {
    background: #dbeafe;
    color: #1d4ed8;
}

.fila-sugerida {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-left: 3px solid #3b82f6 !important;
}

.estado-rechazada {
    background: #fee2e2;
    color: #b91c1c;
}

/* Badge de ganador */
.ganador-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #92400e;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

/* Badges de tipo de comprobante */
.tipo-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tipo-factura {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.tipo-rh {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.tipo-recibo {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.tipo-invoice {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.tipo-columna {
    text-align: center;
    width: 50px;
}

/* Botones de documento mini */
.documento-acciones-compactas {
    display: flex;
    gap: 0.35rem;
}

.btn-documento-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: #e5e7eb;
    color: #374151;
}

.btn-documento-mini:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

.btn-documento-mini.btn-ver:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

.btn-documento-mini.btn-descargar:hover {
    background: #10b981;
    color: white;
    transform: scale(1.05);
}

/* Botones de acción mini */
.btn-seleccionar-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: #10b981;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: white;
    transition: all 0.2s ease;
    margin-right: 0.25rem;
}

.btn-seleccionar-mini:hover {
    background: #059669;
    color: white;
    transform: scale(1.05);
}

.btn-eliminar-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: #fee2e2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #dc2626;
    transition: all 0.2s ease;
}

.btn-eliminar-mini:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.05);
}

/* Botón cambiar cotización ganadora */
.btn-cambiar-cotizacion {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
}

.btn-cambiar-cotizacion:hover {
    background: #fde68a !important;
    border-color: #d97706 !important;
    transform: scale(1.05);
}

/* Botón ganador - indica que esta cotización es la seleccionada */
.btn-ganador {
    background: #dcfce7 !important;
    border-color: #22c55e !important;
}

.btn-ganador:hover {
    background: #bbf7d0 !important;
    border-color: #16a34a !important;
}

/* Botón deshabilitado */
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

.btn-disabled:hover {
    transform: none;
}

.sin-documento {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.8rem;
}

/* Responsive para tabla de cotizaciones */
@media (max-width: 768px) {
    .cotizaciones-tabla {
        font-size: 0.8rem;
    }
    
    .cotizaciones-tabla th,
    .cotizaciones-tabla td {
        padding: 0.6rem 0.4rem;
    }
    
    .btn-documento-mini,
    .btn-seleccionar-mini,
    .btn-eliminar-mini {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
}

/* Fila con menor costo - amarillo para orientación */
.cotizacion-fila.fila-menor-costo {
    background: #fef9c3;
}

.cotizacion-fila.fila-menor-costo:hover {
    background: #fef08a;
}

/* Fila seleccionada como ganadora - verde */
.cotizacion-fila.fila-seleccionada {
    background: #dcfce7 !important;
}

.cotizacion-fila.fila-seleccionada:hover {
    background: #bbf7d0 !important;
}

/* Fila rechazada - rojo claro */
.cotizacion-fila.fila-rechazada {
    background: #fee2e2 !important;
}

.cotizacion-fila.fila-rechazada:hover {
    background: #fecaca !important;
}

/* Columnas de la tabla */
.monto-columna,
.cantidad-columna,
.subtotal-columna {
    text-align: right;
    white-space: nowrap;
}

.subtotal-columna strong {
    color: #059669;
}

/* ============================================================================
   ESTILOS PARA INPUTS EN TABLA DE SOLICITUDES
   ============================================================================ */

/* Inputs y selects dentro de la tabla cotizaciones-tabla */
.cotizaciones-tabla input[type="text"],
.cotizaciones-tabla input[type="number"],
.cotizaciones-tabla input[type="date"],
.cotizaciones-tabla select {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
    color: #374151;
    outline: none;
    box-sizing: border-box;
}

.cotizaciones-tabla input[type="text"]:focus,
.cotizaciones-tabla input[type="number"]:focus,
.cotizaciones-tabla input[type="date"]:focus,
.cotizaciones-tabla select:focus {
    background: #eff6ff;
    border-radius: 4px;
}

.cotizaciones-tabla input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.cotizaciones-tabla select {
    cursor: pointer;
    appearance: auto;
}

/* Celdas con inputs - quitar padding extra */
.cotizaciones-tabla td.partida-cell,
.cotizaciones-tabla td.tipo-cell,
.cotizaciones-tabla td.codigo-cell,
.cotizaciones-tabla td.recurso-cell,
.cotizaciones-tabla td.unidad-cell,
.cotizaciones-tabla td.cantidad-cell,
.cotizaciones-tabla td.fecha-cell,
.cotizaciones-tabla td.comentario-cell {
    padding: 0.25rem 0.5rem;
}

/* Textarea para recurso y comentario */
.cotizaciones-tabla textarea.recurso-input,
.cotizaciones-tabla textarea.comentario-input {
    width: 100%;
    min-height: 32px;
    max-height: 120px;
    resize: vertical;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.4;
    overflow-y: auto;
}

.cotizaciones-tabla textarea.recurso-input:focus,
.cotizaciones-tabla textarea.comentario-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Celda de partida con búsqueda */
.cotizaciones-tabla .partida-cell {
    position: relative;
    min-width: 180px;
}

.cotizaciones-tabla .partida-search {
    font-weight: 500;
}

.cotizaciones-tabla .partida-search:read-only {
    background: transparent;
    cursor: default;
    color: #1f2937;
}

/* Input de imagen */
.cotizaciones-tabla .imagen-cell {
    padding: 0.25rem !important;
    text-align: center;
    width: 80px;
}

.cotizaciones-tabla input[type="file"] {
    width: 100%;
    font-size: 0.7rem;
    padding: 0.25rem;
}

.cotizaciones-tabla .file-help {
    display: none;
}

/* Columna de número de fila */
.cotizaciones-tabla .row-number {
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    width: 40px;
}

/* Columna de acciones */
.cotizaciones-tabla .acciones-columna {
    text-align: center;
    width: 50px;
    padding: 0.25rem !important;
}

/* Fila editable seleccionada */
.cotizaciones-tabla .editable-row.selected {
    background: #dbeafe !important;
}

/* Campos incompletos (desde paste) */
.cotizaciones-tabla .field-incomplete input,
.cotizaciones-tabla .field-incomplete select {
    background: #fef3c7;
}

.cotizaciones-tabla .field-incomplete input:focus,
.cotizaciones-tabla .field-incomplete select:focus {
    background: #fef9c3;
}

/* Mensaje de fila vacía */
.cotizaciones-tabla .empty-row td {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.cotizaciones-tabla .empty-message {
    font-style: italic;
}

.cotizaciones-tabla .empty-message i {
    margin-right: 0.5rem;
    color: #9ca3af;
}

/* Ancho de columnas para tabla de solicitudes */
.cotizaciones-tabla th:nth-child(1) { width: 40px; }   /* # */
.cotizaciones-tabla th:nth-child(2) { min-width: 180px; } /* Partida */
.cotizaciones-tabla th:nth-child(3) { width: 120px; }  /* Tipo */
.cotizaciones-tabla th:nth-child(4) { width: 120px; }  /* Código */
.cotizaciones-tabla th:nth-child(5) { min-width: 200px; } /* Recurso */
.cotizaciones-tabla th:nth-child(6) { width: 80px; }   /* Unidad */
.cotizaciones-tabla th:nth-child(7) { width: 90px; }   /* Cantidad */
.cotizaciones-tabla th:nth-child(8) { width: 120px; }  /* Fecha */
.cotizaciones-tabla th:nth-child(9) { min-width: 150px; } /* Comentario */
.cotizaciones-tabla th:nth-child(10) { width: 80px; }  /* Imagen */
.cotizaciones-tabla th:nth-child(11) { width: 50px; }  /* Acciones */

/* ============================================================================
   BOTONES DE ACCIONES EN TABLA DE SOLICITUDES
   ============================================================================ */

.acciones-cell {
    padding: 0.25rem 0.5rem !important;
    text-align: center;
    vertical-align: middle;
}

.acciones-grupo {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    align-items: center;
}

.btn-accion {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s ease;
    padding: 0;
    color: #4b5563;
}

/* Asegurar que los iconos FontAwesome se muestren en botones de acción */
.btn-accion i.fas,
.btn-accion i.far,
.btn-accion i.fa {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-style: normal;
    display: inline-block;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.btn-accion:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.05);
}

/* Botón adjuntar */
.btn-adjuntar {
    color: #6b7280;
    border-color: #e5e7eb;
}

.btn-adjuntar:hover {
    color: #3b82f6;
    background: #eff6ff;
    border-color: #93c5fd;
}

.btn-adjuntar.tiene-archivo {
    color: #10b981;
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.btn-adjuntar.tiene-archivo:hover {
    background: #d1fae5;
    border-color: #34d399;
}

/* Botón ver */
.btn-ver {
    color: #6366f1;
    border-color: #c7d2fe;
    background: #eef2ff;
}

.btn-ver:hover {
    color: #4f46e5;
    background: #e0e7ff;
    border-color: #a5b4fc;
}

/* Botón eliminar */
.btn-eliminar {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-eliminar:hover {
    color: #dc2626;
    background: #fee2e2;
    border-color: #f87171;
}

/* ============================================================================
   ESTILOS PARA TABLA DE CONFORMACIÓN
   ============================================================================ */

.tabla-conformacion {
    table-layout: fixed;
    width: 100%;
}

.tabla-conformacion th,
.tabla-conformacion td {
    font-size: 0.8rem;
    padding: 0.5rem 0.3rem !important;
}

.tabla-conformacion th {
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Clases de alineación */
.tabla-conformacion .text-center { text-align: center; }
.tabla-conformacion .text-right { text-align: right; }

/* Celdas de checkbox */
.tabla-conformacion .cell-check {
    padding: 2px !important;
}

.tabla-conformacion input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Celda de código */
.tabla-conformacion .cell-codigo {
    color: #6b7280;
}

/* Celdas de texto con truncado */
.tabla-conformacion .cell-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Input de comentario */
.tabla-conformacion .comment-input {
    width: 100%;
    padding: 3px 5px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    font-size: 0.8rem;
}

.tabla-conformacion .comment-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Input de comentario compacto */
.tabla-conformacion .comment-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 11px;
    background: white;
}

.tabla-conformacion .comment-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* ============================================================================
   CLASES DE UTILIDAD - Tipografía
   Usar estas clases en lugar de estilos inline
   ============================================================================ */

/* Tamaños de fuente */
.text-2xs { font-size: var(--font-2xs) !important; }
.text-xs { font-size: var(--font-xs) !important; }
.text-sm { font-size: var(--font-sm) !important; }
.text-base { font-size: var(--font-base) !important; }
.text-md { font-size: var(--font-md) !important; }
.text-lg { font-size: var(--font-lg) !important; }
.text-xl { font-size: var(--font-xl) !important; }
.text-2xl { font-size: var(--font-2xl) !important; }
.text-3xl { font-size: var(--font-3xl) !important; }
.text-4xl { font-size: var(--font-4xl) !important; }
.text-5xl { font-size: var(--font-5xl) !important; }

/* Pesos de fuente */
.font-normal { font-weight: var(--font-normal) !important; }
.font-medium { font-weight: var(--font-medium) !important; }
.font-semibold { font-weight: var(--font-semibold) !important; }
.font-bold { font-weight: var(--font-bold) !important; }

/* Familia de fuente */
.font-mono { font-family: var(--font-mono) !important; }

/* Colores de texto */
.text-primary { color: var(--color-text-primary) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-info { color: var(--color-info) !important; }

/* Alineación de texto */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* ============================================================================
   ESTILOS PARA MODALES - Estándar unificado
   ============================================================================ */

/* Títulos de modal */
.modal-title {
    font-size: var(--font-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.modal-subtitle {
    font-size: var(--font-md);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
}

/* Iconos en modales */
.modal-icon {
    font-size: var(--font-4xl);
    margin-bottom: var(--spacing-sm);
}

.modal-icon-lg {
    font-size: var(--font-5xl);
    margin-bottom: var(--spacing-md);
}

/* Texto en modales */
.modal-text {
    font-size: var(--font-base);
    color: var(--color-text-primary);
    line-height: var(--line-normal);
}

.modal-text-sm {
    font-size: var(--font-sm);
    color: var(--color-text-secondary);
}

/* Labels en formularios */
.form-label {
    font-size: var(--font-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

/* Tablas en modales */
.modal-table th {
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.modal-table td {
    font-size: var(--font-sm);
    color: var(--color-text-primary);
}

.modal-table .cell-meta {
    font-size: var(--font-xs);
    color: var(--color-text-muted);
}

/* Badges y etiquetas */
.badge {
    font-size: var(--font-xs);
    font-weight: var(--font-medium);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Estadísticas en cards */
.stat-value {
    font-size: var(--font-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.stat-label {
    font-size: var(--font-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.stat-icon {
    font-size: var(--font-xl);
}

/* ============================================================================
   ALMACÉN - Selector de Proyecto Inicial
   ============================================================================ */

.proyecto-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.proyecto-selector-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.proyecto-selector-header {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    color: white;
    padding: 28px;
    text-align: center;
}

.proyecto-selector-header i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.proyecto-selector-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.proyecto-selector-body {
    padding: 32px;
}

.proyecto-selector-instruccion {
    color: #4a5568;
    font-size: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.proyecto-selector-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f7fafc;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
}

.proyecto-selector-select:hover {
    border-color: #cbd5e0;
}

.proyecto-selector-select:focus {
    outline: none;
    border-color: #3182ce;
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.proyecto-selector-footer {
    padding: 20px 32px 32px;
    text-align: center;
}

.proyecto-selector-footer .btn-standard {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.proyecto-selector-footer .btn-standard:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

/* ============================================================================
   ALMACÉN - Barra de Proyecto Actual
   ============================================================================ */

.proyecto-actual-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2c5282 0%, #1a365d 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.proyecto-actual-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.proyecto-actual-info i {
    font-size: 20px;
    opacity: 0.8;
}

.proyecto-actual-label {
    font-size: 13px;
    opacity: 0.8;
}

.proyecto-actual-nombre {
    font-size: 16px;
    font-weight: 600;
}

.btn-cambiar-proyecto {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cambiar-proyecto:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}


/* ================================================================================
   AUTOCOMPLETE - ESTILOS PARA PARTIDAS Y OTROS
   ================================================================================ */

.partida-autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.autocomplete-option {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
    color: #374151;
    transition: background-color 0.15s ease;
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover,
.autocomplete-option.active {
    background-color: #eef2ff;
    color: #4f46e5;
}

.autocomplete-option strong {
    color: #1e40af;
    font-weight: 600;
}

.autocomplete-option.no-results {
    cursor: default;
    color: #6b7280;
}

.autocomplete-option.no-results:hover {
    background-color: transparent;
}

.autocomplete-info {
    color: #9ca3af;
    font-size: 11px;
    padding: 8px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Estilos para searchable select (proveedores, etc) */
.searchable-select-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.searchable-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.searchable-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 40px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
}

.searchable-dropdown .dropdown-option {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
    transition: background-color 0.15s ease;
}

.searchable-dropdown .dropdown-option:hover {
    background-color: #eef2ff;
}

.searchable-dropdown .dropdown-option .ruc {
    color: #6b7280;
    font-size: 11px;
}

.searchable-dropdown .dropdown-option .razon {
    font-weight: 500;
    color: #374151;
}

.btn-add-proveedor {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add-proveedor:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.proveedor-hint {
    color: #6b7280;
    font-size: 11px;
    margin-top: 4px;
}

/* ============================================================================
   MÓDULO SERVICIOS - Salidas SR
   ============================================================================ */

/* Header de Kardex y Salidas */
.kardex-header,
.salidas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.kardex-contrato-info,
.salidas-contrato-info {
    flex: 1;
    min-width: 200px;
}

.kardex-contrato-info h3,
.salidas-contrato-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.kardex-contrato-info p,
.salidas-contrato-info p {
    font-size: 0.85rem;
    color: #718096;
}

/* Resumen de estadísticas en kardex/salidas */
.kardex-resumen,
.salidas-resumen {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.kardex-stat,
.salidas-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kardex-stat-label,
.salidas-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #718096;
    font-weight: 600;
}

.kardex-stat-value,
.salidas-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
}

/* Placeholders */
.kardex-placeholder,
.salidas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    color: #718096;
    text-align: center;
}

.kardex-placeholder i,
.salidas-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.kardex-placeholder p,
.salidas-placeholder p {
    max-width: 400px;
}

/* Botones de salidas en tabla de contratos */
.btn-ver-salidas {
    background: #805ad5;
    color: white;
}

.btn-ver-salidas:hover {
    background: #6b46c1;
}

/* ============================================
   SERVICIOS - BARRA COMPACTA DE ESTADÍSTICAS
   ============================================ */
.servicios-stats-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.servicios-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-width: 120px;
}

.servicios-stat-item.stat-primary { border-left-color: #3b82f6; }
.servicios-stat-item.stat-success { border-left-color: #10b981; }
.servicios-stat-item.stat-warning { border-left-color: #f59e0b; }
.servicios-stat-item.stat-info { border-left-color: #6366f1; }

.servicios-stat-item .stat-icon {
    font-size: 14px;
    opacity: 0.7;
}

.servicios-stat-item.stat-primary .stat-icon { color: #3b82f6; }
.servicios-stat-item.stat-success .stat-icon { color: #10b981; }
.servicios-stat-item.stat-warning .stat-icon { color: #f59e0b; }
.servicios-stat-item.stat-info .stat-icon { color: #6366f1; }

.servicios-stat-item .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.servicios-stat-item .stat-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
}

/* ================================================================
   SIDEBAR NAVIGATION
   ================================================================ */

.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 60px;
    background: rgba(20, 20, 30, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

.app-sidebar:hover { width: 240px; }

/* Brand */
.sidebar-brand {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    letter-spacing: 0.3px;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
}

.app-sidebar:hover .sidebar-title { opacity: 1; }

/* Nav scroll */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}
.app-sidebar:hover .sidebar-nav::-webkit-scrollbar { width: 4px; }
.app-sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.30); }

/* Items */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    margin: 2px 8px;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
    white-space: nowrap;
    user-select: none;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(102,126,234,0.22);
    color: #a5b4fc;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: #a5b4fc;
    border-radius: 0 3px 3px 0;
}

.sidebar-item-icon {
    width: 20px;
    font-size: 0.95rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-item-text {
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar:hover .sidebar-item-text { opacity: 1; }

/* Submenú chevron */
.sidebar-item.has-submenu::after {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 9px;
    margin-left: auto;
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease 0.1s;
    flex-shrink: 0;
}

.app-sidebar:hover .sidebar-item.has-submenu::after { opacity: 0.5; }
.sidebar-item.has-submenu.open::after { transform: rotate(90deg); }

/* Submenú */
.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.12);
    margin: 0 8px;
    border-radius: 0 0 6px 6px;
}

.sidebar-item.has-submenu.open + .sidebar-submenu { max-height: 500px; }

.sidebar-submenu .sidebar-item {
    padding: 8px 12px 8px 46px;
    margin: 1px 0;
    border-radius: 6px;
    font-size: 0.82rem;
}

/* Divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 5px 16px;
}

/* Footer usuario */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 10px 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    border-radius: 8px;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563a8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.12);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    overflow: hidden;
}

.app-sidebar:hover .sidebar-user-info { opacity: 1; }

.sidebar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10px;
    color: rgba(255,255,255,0.38);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.sidebar-logout {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.2s ease 0.1s;
}

.app-sidebar:hover .sidebar-logout { opacity: 1; }
.sidebar-logout:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .app-sidebar {
        width: 0;
        transform: translateX(-100%);
        transition: width 0.3s ease, transform 0.3s ease;
    }

    .app-sidebar.mobile-open {
        width: 240px;
        transform: translateX(0);
    }

    .app-sidebar.mobile-open .sidebar-item-text,
    .app-sidebar.mobile-open .sidebar-title,
    .app-sidebar.mobile-open .sidebar-user-info,
    .app-sidebar.mobile-open .sidebar-logout { opacity: 1; }

    .app-sidebar.mobile-open .sidebar-item.has-submenu::after { opacity: 0.5; }

    .dashboard-main { margin-left: 0; }

    .mobile-menu-toggle { display: flex !important; }
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 36px;
    height: 36px;
    background: rgba(20,20,30,0.9);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}

.sidebar-overlay.active { display: block; }
