/* Estilos base existentes */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

.header-title {
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
}

/* Sidebar con submenús */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(0);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item.has-submenu .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f8f9fa;
}

.nav-item.submenu-open .submenu {
    max-height: 200px;
}

.submenu {
    list-style: none;
    padding: 0;
}

.submenu li {
    margin: 0;
}

.submenu .nav-link {
    padding: 8px 20px 8px 50px;
    font-size: 14px;
    color: #666;
}

.submenu .nav-link:hover {
    background-color: #e9ecef;
    color: #667eea;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    background-color: #f8f9fa;
    color: #667eea;
    border-left-color: #667eea;
}

.nav-link.active {
    background-color: #e3f2fd;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-icon {
    margin-right: 10px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 12px;
}

/* Container y Layout */
.container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Filtros mejorados */
.filters-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.filters-form {
    width: 100%;
}

.filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.filter-item input,
.filter-item select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.filter-actions .btn {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-actions .icon {
    font-size: 16px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background-color: #667eea;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Tablas responsivas */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Cards y Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-info p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

/* Status y Priority */
.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-disponible {
    background-color: #d4edda;
    color: #155724;
}

.status-asignado {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-mantenimiento {
    background-color: #fff3cd;
    color: #856404;
}

.status-pendiente {
    background-color: #f8d7da;
    color: #721c24;
}

.status-valid {
    color: #28a745;
    font-weight: bold;
}

.status-invalid {
    color: #dc3545;
    font-weight: bold;
    cursor: help;
}

/* Modales responsivos mejorados */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: 0 auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 1;
}

/* Modal para ver detalles de item */
.item-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-group label {
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.detail-group span {
    color: #333;
    font-size: 16px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

.login-form {
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    font-size: 18px;
    color: #6c757d;
    z-index: 1;
}

.input-group input {
    padding-left: 50px;
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
    transform: translateX(5px);
}

.login-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 25px;
}

.demo-credentials {
    margin-bottom: 20px;
}

.demo-credentials h4 {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credential-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.credential-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
}

.system-status {
    text-align: center;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-icon {
    font-size: 16px;
}

.status-link {
    color: inherit;
    text-decoration: underline;
    margin-left: 5px;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-link {
    color: inherit;
    text-decoration: underline;
}

/* Presupuesto específico */
.validation-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.plantillas-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.checkbox-item input {
    margin-right: 12px;
    transform: scale(1.2);
}

.checkbox-item small {
    color: #6c757d;
    margin-left: auto;
    font-size: 12px;
}

.plantillas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.plantilla-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.plantilla-card:hover {
    transform: translateY(-5px);
}

.plantilla-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.plantilla-meta {
    display: flex;
    justify-content: space-between;
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 15px;
}

.plantilla-actions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.plantilla-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
}

.resultados-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.resultado-plantilla {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
}

.resultado-plantilla:last-child {
    border-bottom: none;
}

.valid-row {
    background-color: #f8fff8;
}

.invalid-row {
    background-color: #fff8f8;
}

.preview-container {
    margin-top: 20px;
}

.preview-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.csv-instructions {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.csv-instructions code {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    display: block;
    margin-top: 15px;
    font-family: monospace;
    white-space: pre-line;
    border: 1px solid #e9ecef;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: #6c757d;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Responsividad para pantallas pequeñas */
@media (max-width: 600px) {
    .item-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .item-form-row .form-group-item,
    .item-form-row .form-group-cantidad {
        margin-bottom: 10px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr auto;
        gap: 15px;
    }
    
    .filter-grid .filter-item:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .plantillas-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .item-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .plantillas-grid {
        grid-template-columns: 1fr;
    }
    
    .plantillas-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .plantilla-actions {
        flex-direction: column;
    }
    
    .plantilla-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .login-card {
        padding: 30px 25px;
    }
    
    .credential-items {
        gap: 6px;
    }
    
    .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .actions .btn {
        flex: 1;
        min-width: 70px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 18px;
    }
    
    .user-info {
        display: none;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 100%;
        max-height: calc(100vh - 20px);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .checkbox-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .checkbox-item small {
        margin-left: 0;
    }
    
    .login-card {
        padding: 25px 20px;
    }
    
    .logo-icon {
        font-size: 40px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .credential-items {
        flex-direction: column;
    }
    
    .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .actions .btn {
        flex: 1;
        min-width: 70px;
        margin: 0;
    }
}

/* Utilidades adicionales */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.font-bold { font-weight: bold; }
.font-normal { font-weight: normal; }

.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }

/* Checkbox personalizado */
.item-checkbox {
    cursor: pointer;
    transform: scale(1.2);
}

#select-all {
    cursor: pointer;
    transform: scale(1.2);
}

#btn-eliminar-seleccionados {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Roles y permisos */
.role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-supervisor {
    background-color: #ffc107;
    color: #212529;
}

.role-usuario {
    background-color: #28a745;
    color: white;
}

.permisos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.permiso-grupo {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.permiso-grupo h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.permiso-grupo label {
    display: block;
    margin: 8px 0;
    font-size: 14px;
    cursor: pointer;
}

.permiso-grupo input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

/* Estilos para los select y los input de cantidad */
select,
input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px; /* Bordes redondos */
    font-size: 1rem;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Contenedor principal para los items en el modal */
#items-container-modal {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espacio entre cada fila de ítem */
}

/* Fila individual del formulario de ítem */
.item-form-row {
    display: flex;
    align-items: flex-end; /* Alinear los elementos en la parte inferior */
    gap: 10px;
}

/* Grupos de formulario dentro de la fila */
.item-form-row .form-group-item,
.item-form-row .form-group-cantidad {
    flex-grow: 1; /* Permite que crezcan para ocupar el espacio */
}

/* Botón para remover ítem */
.btn-remove-item {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 8px; /* Bordes redondos */
    padding: 10px 12px;
    cursor: pointer;
    font-size: 1rem;
    align-self: flex-end; /* Asegura que el botón se alinee con los campos */
}

/* =====================================
    Modales (sección ajustada para arreglar el footer fijo)
    ===================================== */
/* Modales responsivos mejorados */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    margin: 0 auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto; /* Permite el scroll vertical */
    scrollbar-width: none; /* Oculta el scrollbar en Firefox */
    display: flex;
    flex-direction: column;
}

.modal-content::-webkit-scrollbar {
    display: none;
}
.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto; /* Habilita el desplazamiento del cuerpo */
}

.modal-footer {
    padding: 15px 20px;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
    position: sticky; /* Usa position: sticky para fijar el footer */
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}