/* ================================
   BASE
   ================================ */

body {
    background-color: #f5f6fa;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* NAVBAR SUPERIOR */
.top-navbar {
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
    z-index: 1030;
}

.navbar-brand-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.navbar-brand-subtitle {
    display: block;
    font-size: 0.75rem;
    color: #cbd5f5;
}

/* ================================
   LAYOUT ERP
   ================================ */

.erp-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 56px); /* restando navbar */
    background: #f4f5f7;
}

.erp-sidebar {
    background: #020617;
    color: #e5e7eb;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.erp-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: radial-gradient(circle at top left, #1d4ed8, #020617);
    margin-bottom: 8px;
}

.erp-brand-logo {
    font-size: 1.3rem;
}

.erp-brand-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.erp-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.erp-menu .menu-section {
    margin-top: 10px;
    margin-bottom: 4px;
    padding: 0 8px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: #64748b;
}

.erp-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    color: #e5e7eb;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, transform 0.05s;
}

.erp-menu .menu-item:hover {
    background: rgba(148, 163, 184, 0.15);
    color: #ffffff;
    transform: translateX(1px);
}

.erp-menu .menu-item.active {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
    color: #ffffff;
    font-weight: 600;
}

.erp-main {
    padding: 24px 32px 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
}

/* TOPBAR INTERNA (títulos y botón + Nuevo) */
.erp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.erp-topbar-title h1,
.erp-topbar-title h2 {
    margin: 0 0 4px 0;
}

.erp-topbar-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

.erp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ================================
   CARDS / TABLAS / BOTONES
   ================================ */

.filter-card,
.table-card,
.form-card,
.import-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

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

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
}

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

/* Tablas */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead tr {
    background: #e5edff;
}

.table th,
.table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    text-align: left;
    font-weight: 600;
    color: #374151;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn.primary,
.btn.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.btn.secondary,
.btn.btn-outline-secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.btn.danger,
.btn.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn.btn-outline-primary {
    border-radius: 999px;
}

.btn.btn-outline-success {
    border-radius: 999px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Inputs */
.input,
.input-file,
select.input,
textarea.input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 6px 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #ffffff;
}

.input:focus,
.input-file:focus,
select.input:focus,
textarea.input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.badge.bg-success {
    background: #dcfce7;
    color: #166534;
}

.badge.bg-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Alerts */
.alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ================================
   FORMULARIOS EMPLEADOS
   ================================ */

.form-card {
    padding: 20px 22px 26px;
}

.form-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.form-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.form-section h2 {
    font-size: 16px;
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #111827;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 16px;
}

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

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.form-group small {
    font-size: 11px;
    color: #6b7280;
}

.checkbox-group {
    margin-top: 20px;
    align-items: center;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
}

textarea.input {
    resize: vertical;
    min-height: 60px;
}

/* Acciones del formulario */
.form-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 900px) {
    .erp-layout {
        grid-template-columns: 1fr;
    }

    .erp-sidebar {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 8px 10px;
        overflow-x: auto;
    }

    .erp-main {
        padding: 16px 12px 32px;
    }

    .erp-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .erp-menu {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .erp-menu .menu-section {
        display: none;
    }
}
