/* ---------- RESET Y BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background-color: #eef2f5;
    color: #1e2a3a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- HEADER ---------- */
.header {
    background: #003366;
    color: #fff;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    border-bottom: 3px solid #f39200;
    z-index: 10;
    position: relative;
}

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

.header .logo-area i {
    font-size: 32px;
    color: #f39200;
}

.header .logo-area h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header .logo-area small {
    font-size: 13px;
    font-weight: 300;
    color: #b0c4de;
    margin-left: 8px;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}

.header .user-info i {
    font-size: 20px;
    color: #f39200;
}

.header .user-info .badge {
    background: #e30613;
    color: #fff;
    border-radius: 30px;
    padding: 2px 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- MAIN WRAPPER ---------- */
.main-wrapper {
    display: flex;
    flex: 1;
    max-width: 1440px;
    margin: 20px auto 20px;
    padding: 0 20px;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 24px 0 20px 0;
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sidebar .menu-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8a9aa8;
    padding: 0 24px 14px 24px;
    border-bottom: 1px solid #eef2f5;
    font-weight: 600;
}

.sidebar .menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    border-bottom: 1px solid #f5f7fa;
}

.sidebar .menu-item i {
    width: 22px;
    font-size: 18px;
    color: #6c7a8a;
    transition: 0.2s;
}

.sidebar .menu-item:hover {
    background: #f4f7fc;
    border-left-color: #f39200;
}

.sidebar .menu-item:hover i {
    color: #f39200;
}

.sidebar .menu-item.active {
    background: #eef4fa;
    border-left-color: #003366;
    color: #003366;
    font-weight: 600;
}

.sidebar .menu-item.active i {
    color: #003366;
}

.sidebar .menu-item .menu-badge {
    margin-left: auto;
    background: #e30613;
    color: #fff;
    border-radius: 30px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
}

.sidebar .menu-divider {
    height: 1px;
    background: #eef2f5;
    margin: 6px 24px;
}

.sidebar .footer-sidebar {
    padding: 20px 24px 0 24px;
    font-size: 12px;
    color: #8a9aa8;
    border-top: 1px solid #eef2f5;
    margin-top: 12px;
}

.sidebar .footer-sidebar i {
    color: #f39200;
    margin-right: 6px;
}

/* ===== CONTENIDO ===== */
.content {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 28px 30px;
    min-height: 500px;
}

.content .page-title {
    font-size: 24px;
    font-weight: 600;
    color: #003366;
    border-bottom: 2px solid #f39200;
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.content .page-title .title-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content .page-title .title-left i {
    color: #f39200;
    font-size: 26px;
}

/* Botones */
.btn-primary {
    background: #003366;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background: #002244;
}

.btn-primary i {
    color: #f39200;
}

.btn-secondary {
    background: #eef2f5;
    color: #1e2a3a;
    border: 1px solid #d0d9e6;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-danger {
    background: #e30613;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-danger:hover {
    background: #b8050f;
}

.btn-success {
    background: #0e6b2e;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success:hover {
    background: #0a5524;
}

/* Filtros */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 180px;
    min-width: 140px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #5a6b7a;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.filter-group input,
.filter-group select {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid #d0d9e6;
    font-size: 14px;
    background: #fff;
    transition: 0.2s;
    outline: none;
    width: 100%;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Tabla */
.table-responsive {
    overflow-x: auto;
    margin-top: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    background: #f0f4f9;
    color: #003366;
    font-weight: 600;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e6edf4;
}

table tbody tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-activo {
    background: #d4edda;
    color: #0e6b2e;
}

.status-inactivo {
    background: #f8d7da;
    color: #721c24;
}

.status-pendiente {
    background: #fff3cd;
    color: #856404;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.actions-cell button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.actions-cell .edit-btn {
    background: #e2eaf1;
    color: #003366;
}

.actions-cell .edit-btn:hover {
    background: #c8d6e5;
}

.actions-cell .delete-btn {
    background: #f8d7da;
    color: #721c24;
}

.actions-cell .delete-btn:hover {
    background: #f1c0c5;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: #8a9aa8;
}

.empty-state i {
    font-size: 48px;
    color: #d0d9e6;
    margin-bottom: 12px;
}

/* Paginación */
.pagination-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    gap: 12px;
    border-top: 1px solid #eef2f5;
    padding-top: 18px;
}

.pagination-info {
    font-size: 14px;
    color: #5a6b7a;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-controls button {
    padding: 6px 14px;
    border: 1px solid #d0d9e6;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
    color: #1e2a3a;
}

.pagination-controls button:hover:not(:disabled) {
    background: #eef2f5;
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-controls button.active-page {
    background: #003366;
    color: #fff;
    border-color: #003366;
}

.pagination-controls .page-size-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #d0d9e6;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    outline: none;
}

.pagination-controls .page-size-select:focus {
    border-color: #003366;
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    padding: 32px 34px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f39200;
}

.modal-header h2 {
    font-size: 22px;
    color: #003366;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: #f39200;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #8a9aa8;
    cursor: pointer;
    transition: 0.2s;
    padding: 0 6px;
}

.modal-close:hover {
    color: #e30613;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Modal más ancho y alto */
.modal-wide {
    max-width: 1300px;      /* +400px respecto a 900px */
    width: 95%;
    max-height: 95vh;       /* Ocupa casi toda la pantalla */
    height: auto;
    min-height: 80vh;       /* Aumenta la altura en ~90px respecto al anterior */
    padding: 28px 34px;     /* Más espacio interno */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group label .required {
    color: #e30613;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #d0d9e6;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #eef2f5;
}

.modal-footer .btn-cancel {
    background: #eef2f5;
    color: #1e2a3a;
    border: 1px solid #d0d9e6;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.modal-footer .btn-cancel:hover {
    background: #e2eaf1;
}

/* TOAST */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: #1e2a3a;
    color: #fff;
    padding: 14px 22px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.3s ease;
    font-size: 14px;
}

.toast.success {
    border-left: 5px solid #0e6b2e;
}

.toast.error {
    border-left: 5px solid #e30613;
}

.toast.info {
    border-left: 5px solid #f39200;
}

.toast i {
    font-size: 20px;
}

.toast.success i {
    color: #0e6b2e;
}
.toast.error i {
    color: #e30613;
}
.toast.info i {
    color: #f39200;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
    .main-wrapper {
        padding: 0 15px;
        flex-direction: column;
    }

    .content {
        width: 100%;
        padding: 20px;
    }

    .sidebar {
        position: fixed;
        top: 70px;
        left: 0;
        width: 280px;
        height: calc(100vh - 70px);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0 16px 16px 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        z-index: 1000;
        overflow-y: auto;
        padding: 20px 0 16px 0;
        border-right: 3px solid #f39200;
        top: 70px;
        position: fixed;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar .menu-item {
        border-left: 4px solid transparent;
        border-bottom: 1px solid #f5f7fa;
        padding: 14px 24px;
        justify-content: flex-start;
    }

    .sidebar .menu-label {
        padding: 0 24px 12px 24px;
    }

    .sidebar .footer-sidebar {
        display: block;
        margin-top: auto;
        border-top: 1px solid #eef2f5;
        padding-top: 16px;
    }

    .sidebar .menu-divider {
        display: block;
    }

    .menu-toggle-btn {
        display: flex !important;
        position: fixed;
        bottom: 24px;
        left: 24px;
        z-index: 1100;
        background: #003366;
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 58px;
        height: 58px;
        font-size: 26px;
        box-shadow: 0 4px 16px rgba(0, 51, 102, 0.4);
        cursor: pointer;
        transition: background 0.2s ease, transform 0.2s ease;
        align-items: center;
        justify-content: center;
    }

    .menu-toggle-btn:hover {
        background: #002244;
        transform: scale(1.05);
    }

    .menu-toggle-btn i {
        color: #f39200;
    }

    .menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

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

    .header .logo-area small {
        display: none;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .filter-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .pagination-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .pagination-controls {
        justify-content: center;
    }

    .content .page-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal {
        padding: 24px 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .content .page-title {
        font-size: 20px;
    }

    table th,
    table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .actions-cell {
        flex-direction: column;
        gap: 4px;
    }

    .actions-cell button {
        width: 100%;
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
        justify-content: center;
    }

    .menu-toggle-btn {
        width: 52px;
        height: 52px;
        font-size: 22px;
        bottom: 18px;
        left: 18px;
    }

    .sidebar {
        width: 260px;
    }

    .toast-container {
        bottom: 80px;
        right: 16px;
        left: 16px;
        max-width: 100%;
    }
}

/* Utilidades */
.hidden {
    display: none !important;
}

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

.mt-2 {
    margin-top: 18px;
}

.menu-toggle-btn {
    display: none;
}

.menu-overlay {
    display: none;
}