html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f5f7fa;
    color: #1f2937;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(37, 140, 251, 0.35);
}

/* ========================================================================
   ESTRUCTURA GENERAL
   ======================================================================== */

.erp-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.erp-main {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: 260px;
    transition: margin-left 0.2s ease;
}

/* ========================================================================
   SIDEBAR
   ======================================================================== */

.erp-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    background: #172033;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.2s ease, width 0.2s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
}

.erp-sidebar-brand {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.erp-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

    .erp-brand-link:hover {
        color: #ffffff;
    }

.erp-brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #0d6efd;
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
}

.erp-brand-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.erp-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 24px 12px;
}

/* ========================================================================
   MENU
   ======================================================================== */

.erp-menu-group {
    margin-bottom: 6px;
}

.erp-menu-link,
.erp-menu-section,
.erp-submenu-link {
    width: 100%;
    border: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    color: #d7deea;
    border-radius: 7px;
    transition: background 0.15s ease, color 0.15s ease;
}

.erp-menu-link {
    padding: 10px 12px;
}

.erp-menu-icon {
    width: 26px;
    margin-right: 4px;
}

.erp-menu-section {
    justify-content: space-between;
    background: transparent;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #f3f6fb;
    text-align: left;
}

    .erp-menu-section:hover,
    .erp-menu-link:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

.erp-menu-arrow {
    opacity: 0.65;
    font-size: 12px;
}

.erp-submenu-link {
    padding: 8px 12px 8px 30px;
    font-size: 14px;
    color: #b8c2d3;
}

    .erp-submenu-link:hover {
        background: rgba(255, 255, 255, 0.07);
        color: #ffffff;
    }

.erp-menu-disabled {
    opacity: 0.42;
    cursor: default;
}

    .erp-menu-disabled:hover {
        background: transparent;
        color: #b8c2d3;
    }

/* ========================================================================
   TOPBAR
   ======================================================================== */

.erp-topbar {
    height: 68px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.erp-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.erp-page-title {
    font-size: 18px;
    font-weight: 600;
    color: #243044;
}

.erp-sidebar-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid #dbe1e8;
    background: #ffffff;
    color: #374151;
}

    .erp-sidebar-toggle:hover {
        background: #f3f4f6;
    }

.erp-topbar-right {
    display: flex;
    align-items: center;
}

    /* Ajuste para el _LoginPartial de Identity */

    .erp-topbar-right .navbar-nav {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .erp-topbar-right .nav-link {
        color: #374151 !important;
        padding: 6px 8px;
    }

    .erp-topbar-right form {
        margin: 0;
    }

/* ========================================================================
   CONTENIDO
   ======================================================================== */

.erp-content {
    flex: 1;
    width: 100%;
    padding: 24px;
    overflow-x: hidden;
}

    .erp-content > .container,
    .erp-content > .container-fluid {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

/* ========================================================================
   FOOTER
   ======================================================================== */

.erp-footer {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 13px;
}

/* ========================================================================
   CARDS / TABLAS
   ======================================================================== */

.card {
    border: 1px solid #e4e8ee;
    border-radius: 8px;
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 18px;
}

.table {
    color: #273244;
}

    .table thead th {
        white-space: nowrap;
        font-size: 13px;
        font-weight: 600;
        background: #f8fafc;
        border-bottom: 1px solid #e5e7eb;
    }

    .table td {
        vertical-align: middle;
    }

/* ========================================================================
   FORMS
   ======================================================================== */

.form-control,
.form-select {
    border-color: #d7dde5;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #86b7fe;
    }

/* ========================================================================
   SIDEBAR COLAPSADO - DESKTOP
   ======================================================================== */

body.erp-sidebar-collapsed
.erp-sidebar {
    transform: translateX(-260px);
}

body.erp-sidebar-collapsed
.erp-main {
    margin-left: 0;
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 991.98px) {

    .erp-sidebar {
        transform: translateX(-260px);
    }

    .erp-main {
        margin-left: 0;
    }

    body.erp-sidebar-collapsed
    .erp-sidebar {
        transform: translateX(0);
    }

    .erp-content {
        padding: 16px;
    }

    .erp-topbar {
        padding: 0 16px;
    }

    .erp-page-title {
        font-size: 16px;
    }

    .erp-topbar-right .navbar-nav {
        gap: 4px;
    }
}

/* ========================================================================
   PLACEHOLDERS
   ======================================================================== */

.form-floating >
.form-control-plaintext::placeholder,
.form-floating >
.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating >
.form-control-plaintext:focus::placeholder,
.form-floating >
.form-control:focus::placeholder {
    text-align: start;
}
