﻿
/* =========================================================
   ERP SYSTEM - PREMIUM UI / UX
   UI ONLY - DO NOT CHANGE DATA / LOGIC
   Bootstrap 5 Compatible
   ========================================================= */

:root {
    --erp-primary: #2563eb;
    --erp-primary-dark: #1d4ed8;
    --erp-primary-soft: #eff6ff;
    --erp-dark: #111827;
    --erp-dark-2: #172033;
    --erp-sidebar-text: #cbd5e1;
    --erp-sidebar-muted: #8290a8;
    --erp-bg: #f5f7fb;
    --erp-white: #ffffff;
    --erp-border: #e5e7eb;
    --erp-text: #172033;
    --erp-muted: #64748b;
    --erp-success: #16a34a;
    --erp-warning: #d97706;
    --erp-danger: #dc2626;
    --erp-radius: 12px;
    --erp-shadow: 0 6px 24px rgba(15, 23, 42, .06);
    --erp-shadow-hover: 0 12px 32px rgba(15, 23, 42, .10);
}


/* =========================================================
   BASE
   ========================================================= */

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--erp-bg);
    color: var(--erp-text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a {
    transition: all .18s ease;
}

button,
input,
select,
textarea {
    font-family: inherit;
}


/* =========================================================
   HEADER
   ========================================================= */

.erp-header {
    height: 64px;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--erp-border);
    box-shadow: 0 2px 14px rgba(15, 23, 42, .045);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.erp-header-left,
.erp-header-right {
    display: flex;
    align-items: center;
}

.erp-header-right {
    gap: 12px;
}


/* =========================================================
   SIDEBAR TOGGLE
   ========================================================= */

.sidebar-toggle {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-size: 18px;
    margin-right: 10px;
    cursor: pointer;
    transition: all .2s ease;
}

    .sidebar-toggle:hover {
        background: #f1f5f9;
        color: var(--erp-primary);
    }


/* =========================================================
   LOGO
   ========================================================= */

.erp-logo {
    text-decoration: none;
    color: #111827;
    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -.2px;
}

    .erp-logo:hover {
        color: var(--erp-primary);
    }

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient( 135deg, #2563eb, #4f46e5 );
    color: #ffffff;
    border-radius: 9px;
    box-shadow: 0 5px 15px rgba(37, 99, 235, .22);
}


/* =========================================================
   COMPANY / FINANCIAL YEAR
   ========================================================= */

.header-company,
.header-financial-year {
    display: flex;
    align-items: center;
    gap: 9px;
}

    .header-company > i,
    .header-financial-year > i {
        color: var(--erp-primary);
        font-size: 18px;
    }

    .header-company small,
    .header-financial-year small {
        display: block;
        color: #94a3b8;
        font-size: 10px;
        line-height: 1.2;
        text-transform: uppercase;
        letter-spacing: .45px;
    }

    .header-company strong,
    .header-financial-year strong {
        display: block;
        color: #1e293b;
        font-size: 12px;
        line-height: 1.35;
    }


/* =========================================================
   SWITCHER
   ========================================================= */

.switcher-button {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    color: #334155 !important;
    padding: 5px 10px !important;
    min-width: 170px;
    min-height: 44px;
    text-align: left;
    border-radius: 10px !important;
    box-shadow: none !important;
    transition: all .2s ease;
}

    .switcher-button:hover,
    .switcher-button:focus {
        background: #f8fafc !important;
        border-color: #cbd5e1 !important;
    }

.switcher-icon {
    width: 31px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
    border-radius: 8px;
    flex: 0 0 31px;
}

.switcher-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    flex: 1;
    min-width: 0;
}

    .switcher-info small {
        color: #94a3b8;
        font-size: 9px;
        text-transform: uppercase;
        letter-spacing: .5px;
    }

    .switcher-info strong {
        color: #1e293b;
        font-size: 12px;
        max-width: 125px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.company-menu {
    min-width: 280px;
    padding: 7px;
    border: 1px solid var(--erp-border);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .13);
}

.company-item {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px !important;
    padding: 9px 10px !important;
}

.dropdown-item {
    border-radius: 8px;
}

    .dropdown-item:hover {
        background: #f1f5f9;
    }

    .dropdown-item.active {
        background: var(--erp-primary) !important;
        color: #ffffff !important;
    }


/* =========================================================
   USER
   ========================================================= */

.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0 !important;
    background: transparent !important;
    color: #334155 !important;
    font-weight: 600;
}

    .user-button:hover {
        color: var(--erp-primary) !important;
    }

.user-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--erp-primary-soft);
    color: var(--erp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbeafe;
}


/* =========================================================
   WRAPPER
   ========================================================= */

.erp-wrapper {
    display: flex;
    padding-top: 64px;
    min-height: calc(100vh - 104px);
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.erp-sidebar {
    width: 250px;
    background: linear-gradient( 180deg, #172033 0%, #111827 100% );
    color: #ffffff;
    position: fixed;
    top: 64px;
    bottom: 40px;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s ease, transform .25s ease;
    z-index: 900;
    border-right: 1px solid rgba(255,255,255,.035);
}

    .erp-sidebar::-webkit-scrollbar {
        width: 5px;
    }

    .erp-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .erp-sidebar::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.13);
        border-radius: 20px;
    }

.sidebar-inner {
    padding: 13px 10px 25px;
}

.sidebar-section {
    margin-top: 22px;
}

    .sidebar-section:first-child {
        margin-top: 4px;
    }

.sidebar-title {
    color: var(--erp-sidebar-muted);
    font-size: 10px;
    font-weight: 700;
    padding: 0 15px 7px;
    letter-spacing: .8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--erp-sidebar-text);
    text-decoration: none;
    padding: 10px 14px;
    min-height: 41px;
    border-radius: 8px;
    margin-bottom: 3px;
    font-weight: 500;
    position: relative;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

    .sidebar-link i {
        width: 20px;
        text-align: center;
        color: #94a3b8;
        transition: color .18s ease;
    }

    .sidebar-link:hover {
        background: rgba(255,255,255,.065);
        color: #ffffff;
        transform: translateX(1px);
    }

        .sidebar-link:hover i {
            color: #ffffff;
        }

    .sidebar-link.active {
        background: linear-gradient( 90deg, #2563eb, #315eea );
        color: #ffffff;
        box-shadow: 0 5px 15px rgba(37,99,235,.20);
    }

        .sidebar-link.active i {
            color: #ffffff;
        }

        .sidebar-link.active::before {
            content: "";
            position: absolute;
            left: -10px;
            top: 8px;
            bottom: 8px;
            width: 3px;
            border-radius: 0 4px 4px 0;
            background: #93c5fd;
        }


/* =========================================================
   CONTENT
   ========================================================= */

.erp-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: calc(100vh - 104px);
    padding: 25px;
    transition: margin-left .25s ease, width .25s ease;
}


    /* =========================================================
   CONTENT TYPOGRAPHY
   ========================================================= */

    .erp-content h1,
    .erp-content h2,
    .erp-content h3,
    .erp-content h4,
    .erp-content h5,
    .erp-content h6 {
        color: #172033;
        font-weight: 650;
    }

    .erp-content .text-muted {
        color: #64748b !important;
    }


/* =========================================================
   CARDS
   ========================================================= */

.card {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    background: #ffffff;
    box-shadow: var(--erp-shadow);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
}

    .card:hover {
        box-shadow: var(--erp-shadow-hover);
    }

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--erp-border);
    padding: 15px 18px;
    color: #172033;
    font-weight: 650;
}

.card-body {
    padding: 18px;
}


/* =========================================================
   TABLES
   ========================================================= */

.table {
    margin-bottom: 0;
    background: #ffffff;
    color: #334155;
    vertical-align: middle;
}

    .table > :not(caption) > * > * {
        padding: 11px 13px;
        border-color: #edf0f4;
    }

    .table thead th {
        background: #f8fafc;
        color: #475569;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .35px;
        white-space: nowrap;
        border-bottom: 1px solid #dfe5ec;
    }

    .table tbody tr {
        transition: background .15s ease;
    }

        .table tbody tr:hover {
            background: #f8fbff;
        }

    .table tfoot {
        background: #f8fafc;
        font-weight: 700;
    }


/* =========================================================
   FORMS
   ========================================================= */

.form-label {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-control,
.form-select {
    min-height: 40px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
    color: #334155;
    background-color: #ffffff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

    .form-control::placeholder {
        color: #a0aab8;
    }

    .form-control:hover,
    .form-select:hover {
        border-color: #cbd5e1;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #93b4f8;
        box-shadow: 0 0 0 .2rem rgba(37,99,235,.10);
    }


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.btn-primary {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    box-shadow: 0 3px 8px rgba(37,99,235,.15);
}

    .btn-primary:hover {
        background: var(--erp-primary-dark);
        border-color: var(--erp-primary-dark);
        box-shadow: 0 5px 12px rgba(37,99,235,.20);
    }

.btn-outline-secondary {
    border-color: #d6dde7;
    color: #475569;
}

.btn-light {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    border-radius: 6px;
    font-weight: 600;
    padding: 5px 8px;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    border-radius: 10px;
    border-width: 1px;
}


/* =========================================================
   DROPDOWNS
   ========================================================= */

.dropdown-menu {
    border: 1px solid var(--erp-border);
    border-radius: 11px;
    box-shadow: 0 16px 40px rgba(15,23,42,.12);
    padding: 7px;
}

.dropdown-divider {
    border-color: #eef1f5;
}


/* =========================================================
   MODALS
   ========================================================= */

.modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(15,23,42,.18);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--erp-border);
    background: #ffffff;
    padding: 16px 20px;
}

.modal-footer {
    border-top: 1px solid var(--erp-border);
    background: #fafbfc;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.page-link {
    border-color: #e2e8f0;
    color: #475569;
    border-radius: 7px !important;
    margin: 0 2px;
}

    .page-link:hover {
        color: var(--erp-primary);
        background: #eff6ff;
    }

.page-item.active .page-link {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
}


/* =========================================================
   FOOTER
   ========================================================= */

.erp-footer {
    height: 40px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--erp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: #94a3b8;
    font-size: 11px;
    z-index: 1000;
}


/* =========================================================
   DESKTOP SIDEBAR COLLAPSE
   ========================================================= */

body.sidebar-collapsed .erp-sidebar {
    width: 76px;
}

body.sidebar-collapsed .erp-content {
    margin-left: 76px;
    width: calc(100% - 76px);
}

body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .logo-text {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

    body.sidebar-collapsed .sidebar-link i {
        margin: 0;
    }

    body.sidebar-collapsed .sidebar-link.active::before {
        left: 0;
    }

body.sidebar-collapsed .erp-logo {
    gap: 0;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 991px) {

    .erp-header {
        height: 62px;
        padding: 0 14px;
    }

    .erp-wrapper {
        padding-top: 62px;
    }

    .erp-sidebar {
        top: 62px;
        bottom: 40px;
        width: 250px;
        transform: translateX(-100%);
    }

        .erp-sidebar.show {
            transform: translateX(0);
            box-shadow: 10px 0 35px rgba(0,0,0,.18);
        }

    .erp-content,
    body.sidebar-collapsed .erp-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .header-company,
    .header-financial-year {
        display: none;
    }

    .switcher-button {
        min-width: auto;
    }

    .switcher-info {
        display: none;
    }

    .erp-header-right {
        gap: 5px;
    }

    .user-name {
        display: none;
    }

    body.sidebar-collapsed .erp-sidebar {
        width: 250px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 575px) {

    .erp-logo {
        font-size: 16px;
    }

    .logo-icon {
        width: 34px;
        height: 34px;
    }

    .erp-content {
        padding: 14px;
    }

    .card-body {
        padding: 14px;
    }

    .erp-footer {
        padding: 0 12px;
    }

        .erp-footer span:last-child {
            display: none;
        }

    .btn {
        min-height: 38px;
    }
}
