html {
    font-size: 14px;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: #f4f6f9;
    color: #212529;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    overflow-x: hidden;
}

/* =========================================================
   ERP LAYOUT
   ========================================================= */

.erp-wrapper {
    min-height: 100vh;
    display: flex;
}

.erp-sidebar {
    width: 245px;
    min-width: 245px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background: #172033;
    color: #fff;
    transition: transform .2s ease;
}

.erp-brand {
    height: 62px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

    .erp-brand:hover {
        color: #fff;
    }

.erp-brand-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 7px;
    background: #2563eb;
    font-size: 16px;
}

.erp-brand-title {
    font-size: 15px;
    font-weight: 700;
}

.erp-brand-subtitle {
    display: block;
    margin-top: 2px;
    color: #99a5b7;
    font-size: 10px;
}

.erp-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
}

.erp-menu-label {
    padding: 11px 11px 6px;
    color: #748199;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.erp-menu-link {
    min-height: 39px;
    margin-bottom: 3px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    color: #c7cfda;
    text-decoration: none;
    font-size: 12.5px;
    transition: all .15s ease;
}

    .erp-menu-link i {
        width: 24px;
        margin-right: 7px;
        text-align: center;
    }

    .erp-menu-link:hover {
        background: rgba(255, 255, 255, .07);
        color: #fff;
    }

    .erp-menu-link.active {
        background: #2563eb;
        color: #fff;
    }

.erp-main {
    width: calc(100% - 245px);
    min-height: 100vh;
    margin-left: 245px;
    display: flex;
    flex-direction: column;
}

.erp-topbar {
    height: 62px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e4e8ee;
}

.erp-topbar-left,
.erp-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    padding: 5px 8px;
    border: 0;
    background: transparent;
    color: #586273;
    font-size: 18px;
}

.erp-page-title {
    color: #303846;
    font-size: 13px;
    font-weight: 600;
}

.erp-user-btn {
    padding: 4px 7px;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
}

    .erp-user-btn:hover {
        background: #f5f6f8;
    }

.erp-user-avatar {
    width: 33px;
    height: 33px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #eaf1ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
}

.erp-user-name {
    max-width: 160px;
    overflow: hidden;
    color: #343a40;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-content {
    flex: 1;
    padding: 20px;
}

.erp-footer {
    padding: 10px 20px;
    background: #fff;
    border-top: 1px solid #e5e8ed;
    color: #858c97;
    font-size: 10.5px;
}

/* =========================================================
   DASHBOARD HEADER
   ========================================================= */

.dashboard-page {
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.dashboard-eyebrow {
    margin-bottom: 4px;
    color: #7d8795;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1px;
}

.dashboard-title {
    margin: 0;
    color: #1f2937;
    font-size: 23px;
    font-weight: 750;
}

.dashboard-subtitle {
    margin-top: 3px;
    color: #7b8491;
    font-size: 11.5px;
}

.dashboard-header-actions {
    display: flex;
    gap: 8px;
}

/* =========================================================
   KPI CARDS
   ========================================================= */

.kpi-card {
    min-height: 165px;
    padding: 16px 17px 13px;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e1e6ec;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(20, 30, 50, .02);
    transition: all .18s ease;
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(22, 34, 55, .08);
    }

    .kpi-card::before {
        content: "";
        width: 100%;
        height: 4px;
        position: absolute;
        top: 0;
        left: 0;
    }

.kpi-primary::before {
    background: #2563eb;
}

.kpi-success::before {
    background: #16a34a;
}

.kpi-info::before {
    background: #0891b2;
}

.kpi-danger::before {
    background: #dc2626;
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: #f1f4f8;
    color: #475569;
    font-size: 15px;
}

.kpi-caption {
    color: #8a94a2;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.kpi-number {
    margin-top: 15px;
    overflow: hidden;
    color: #1e293b;
    font-size: 22px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpi-description {
    margin-top: 5px;
    color: #8a94a2;
    font-size: 11px;
}

.kpi-bottom {
    margin-top: 12px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eef1f4;
    color: #7b8491;
    font-size: 10px;
}

/* =========================================================
   PANELS
   ========================================================= */

.erp-panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e1e6ec;
    border-radius: 10px;
}

.erp-panel-header {
    min-height: 65px;
    padding: 13px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8ebef;
}

.erp-panel-title {
    color: #283241;
    font-size: 13px;
    font-weight: 750;
}

.erp-panel-subtitle {
    margin-top: 2px;
    color: #929aa5;
    font-size: 10px;
}

.erp-panel-body {
    padding: 16px;
}

.erp-header-link {
    color: #2563eb;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
}

    .erp-header-link:hover {
        text-decoration: underline;
    }

/* =========================================================
   FINANCIAL POSITION
   ========================================================= */

.financial-row {
    min-height: 77px;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 42px minmax(190px, 1fr) 180px 90px;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid #edf0f3;
}

    .financial-row:last-child {
        border-bottom: 0;
    }

    .financial-row:hover {
        background: #fafbfd;
    }

.financial-icon {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.icon-primary {
    background: #edf3ff;
    color: #2563eb;
}

.icon-success {
    background: #ebf8ef;
    color: #16a34a;
}

.icon-danger {
    background: #fff0f0;
    color: #dc2626;
}

.financial-name {
    color: #303846;
    font-size: 12px;
    font-weight: 650;
}

.financial-note {
    margin-top: 3px;
    color: #929aa5;
    font-size: 10px;
}

.financial-amount {
    text-align: right;
    color: #273142;
    font-size: 13px;
    font-weight: 750;
}

.financial-status {
    text-align: right;
}

/* =========================================================
   STATUS PILLS
   ========================================================= */

.status-pill {
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
}

.status-success {
    background: #e9f8ee;
    color: #15803d;
}

.status-primary {
    background: #eaf1ff;
    color: #2563eb;
}

.status-warning {
    background: #fff5db;
    color: #a16207;
}

/* =========================================================
   APPROVAL QUEUE
   ========================================================= */

.header-icon {
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: #fff5db;
    color: #d18b00;
}

.approval-highlight {
    display: flex;
    align-items: center;
    gap: 15px;
}

.approval-count {
    width: 58px;
    height: 58px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    background: #fff5db;
    color: #a16207;
    font-size: 25px;
    font-weight: 800;
}

.approval-title {
    color: #303846;
    font-size: 12px;
    font-weight: 700;
}

.approval-subtitle {
    margin-top: 3px;
    color: #929aa5;
    font-size: 10px;
}

.approval-divider {
    height: 1px;
    margin: 17px 0;
    background: #edf0f3;
}

.approval-meta-label {
    margin-bottom: 5px;
    display: block;
    color: #929aa5;
    font-size: 9.5px;
    text-transform: uppercase;
}

/* ============================================================
   ERP CENTRAL PAGINATION
   ============================================================ */

.erp-pagination {
    min-height: 43px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafb;
    border-top: 1px solid #e3e8ec;
}


/* ============================================================
   LEFT SUMMARY
   ============================================================ */

.erp-pagination-left {
    display: flex;
    align-items: center;
}

.erp-pagination-summary {
    color: #7a858e;
    font-size: 10px;
    white-space: nowrap;
}

    .erp-pagination-summary strong {
        color: #35434d;
        font-weight: 700;
    }


/* ============================================================
   RIGHT SIDE
   ============================================================ */

.erp-pagination-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-pagination-page-info {
    color: #89939c;
    font-size: 9.5px;
    white-space: nowrap;
}

    .erp-pagination-page-info strong {
        color: #46545f;
        font-weight: 700;
    }


/* ============================================================
   PAGINATION BUTTON GROUP
   ============================================================ */

.erp-pagination-list {
    display: flex;
    gap: 3px;
}


    /* ============================================================
   PAGE BUTTON
   ============================================================ */

    .erp-pagination-list .page-link {
        width: 28px;
        height: 28px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        border: 1px solid #dce2e6;
        border-radius: 5px !important;
        color: #59656f;
        font-size: 9px;
        font-weight: 600;
        box-shadow: none;
    }


        /* ============================================================
   HOVER
   ============================================================ */

        .erp-pagination-list .page-link:hover {
            background: #eef1f3;
            border-color: #cbd3d9;
            color: #34424c;
        }


    /* ============================================================
   ACTIVE PAGE
   ============================================================ */

    .erp-pagination-list .page-item.active .page-link {
        background: #66717b;
        border-color: #66717b;
        color: #fff;
        font-weight: 700;
    }


    /* ============================================================
   DISABLED
   ============================================================ */

    .erp-pagination-list .page-item.disabled .page-link {
        background: #f5f6f7;
        border-color: #e5e8eb;
        color: #b5bbc0;
        opacity: 1;
    }


    /* ============================================================
   ICON SIZE
   ============================================================ */

    .erp-pagination-list .page-link i {
        font-size: 8px;
    }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 767.98px) {

    .erp-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .erp-pagination-left {
        justify-content: center;
    }

    .erp-pagination-right {
        justify-content: space-between;
        width: 100%;
    }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991.98px) {

    .erp-sidebar {
        transform: translateX(-100%);
    }

        .erp-sidebar.show {
            transform: translateX(0);
        }

    .erp-main {
        width: 100%;
        margin-left: 0;
    }

    .erp-user-name {
        display: none;
    }

    .financial-row {
        grid-template-columns: 42px 1fr;
    }

    .financial-amount,
    .financial-status {
        grid-column: 2;
        text-align: left;
    }
}

@media (max-width: 767.98px) {

    .erp-content {
        padding: 14px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header-actions {
        width: 100%;
    }

        .dashboard-header-actions .btn {
            flex: 1;
        }

    .kpi-number {
        font-size: 19px;
    }
}
