:root {
    --crm-sidebar: #3f4f31;
    --crm-sidebar-soft: #4f6240;
    --crm-bg: #f3f5f7;
    --crm-panel: #ffffff;
    --crm-border: #e7e9ee;
    --crm-text: #27303f;
    --crm-muted: #6f7b8f;
    --crm-accent: #5f7447;
    --crm-ok: #8ea566;
    --crm-warn: #c9a26f;
    --crm-danger: #ca7858;
}

body {
    font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
    background: var(--crm-bg);
    color: var(--crm-text);
}

#layout-wrapper {
    background: var(--crm-bg);
}

#layout-wrapper .main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding-top: 84px;
    transition: all .2s ease;
}

#layout-wrapper .page-content {
    padding: 24px 22px 90px;
}

.navbar-menu {
    width: 280px;
    background: linear-gradient(180deg, var(--crm-sidebar) 0%, #42533a 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.navbar-brand-box {
    height: auto;
    min-height: 136px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.sidebar-brand-icon {
    width: 42px;
    height: 30px;
    border-radius: 8px;
    background: #d7d5b7;
    color: #59653e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand h5 {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
    color: #f6f8f9;
}

.sidebar-brand p {
    margin: 0;
    font-size: 12px;
    color: #dbe2d5;
}

.menu-title {
    margin: 8px 14px 10px;
    padding: 0 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #adbb9f;
}

.navbar-menu .navbar-nav {
    padding: 10px 12px;
    gap: 3px;
}

.navbar-menu .navbar-nav .nav-link {
    color: #e7eee2;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
}

.navbar-menu .navbar-nav .nav-link i {
    font-size: 16px;
    margin-right: 10px;
    opacity: .95;
}

.navbar-menu .navbar-nav .nav-link.active,
.navbar-menu .navbar-nav .nav-link:hover,
.navbar-menu .navbar-nav .nav-link[data-bs-toggle=collapse][aria-expanded=true] {
    color: #fff !important;
    background: var(--crm-sidebar-soft) !important;
}

.navbar-menu .navbar-nav .nav-sm .nav-link {
    padding: 8px 14px 8px 42px;
    font-size: 13px;
    font-weight: 500;
}

.menu-dropdown {
    margin-top: 4px;
    margin-bottom: 4px;
}

.sidebar-quick-card {
    margin: 16px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    padding: 12px 14px;
}

.sidebar-quick-card h6 {
    color: #cfd8c8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}

.sidebar-quick-card p {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    color: #e7eee2;
    font-size: 13px;
}

.sidebar-quick-card p span {
    font-weight: 700;
}

#page-topbar {
    left: 280px;
    border-bottom: 1px solid var(--crm-border);
    box-shadow: none;
    background: #fff;
}

.navbar-header {
    height: 84px;
    padding: 0 24px;
}

.app-page-title h1 {
    font-size: 36px;
    line-height: 1.1;
    margin: 0;
    color: #1f2937;
    font-weight: 700;
}

.app-page-title p {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--crm-muted);
}

.topbar-search {
    min-width: 270px;
    max-width: 320px;
    position: relative;
}

.topbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #99a2b3;
}

.topbar-search input {
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--crm-border);
    background: #fafbfc;
    padding-left: 40px;
    font-size: 14px;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
}

.topbar-user .icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid #e6eaf0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5f6776;
}

.topbar-user h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #2d3646;
}

.topbar-user p {
    margin: 0;
    font-size: 12px;
    color: #8190a3;
}

.crm-alert-wrap {
    position: fixed;
    right: 24px;
    top: 98px;
    z-index: 1500;
    width: min(480px, calc(100% - 48px));
}

.crm-alert-wrap .alert {
    border-radius: 12px;
    border: 1px solid #cae6cf;
    box-shadow: 0 12px 28px rgba(31, 41, 55, .08);
}

.card {
    border-radius: 14px;
    border: 1px solid var(--crm-border);
    box-shadow: 0 8px 22px rgba(29, 37, 52, .04);
}

.metric-card {
    color: #fff;
    position: relative;
    overflow: hidden;
}

.metric-card h6 {
    opacity: .95;
    font-size: 14px;
    margin-bottom: 8px;
}

.metric-card h3 {
    font-size: 42px;
    margin-bottom: 6px;
    line-height: 1;
}

.metric-card p {
    margin: 0;
    font-size: 14px;
    opacity: .9;
}

.metric-card h6,
.metric-card h3,
.metric-card p {
    color: #fff !important;
}

.metric-card .icon-badge {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .36);
    background: rgba(255, 255, 255, .14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff !important;
}

.metric-card .icon-badge i {
    color: #fff !important;
}

.card.metric-card.bg51 {
    background: linear-gradient(135deg, #3f5f2d 0%, #5f7f42 100%) !important;
    border-color: #4d6f35 !important;
}

.card.metric-card.bg52 {
    background: linear-gradient(135deg, #7ea154 0%, #95b96a 100%) !important;
    border-color: #88ae60 !important;
}

.card.metric-card.bg54 {
    background: linear-gradient(135deg, #d39b5f 0%, #c88f56 100%) !important;
    border-color: #cf985e !important;
}

.card.metric-card.bg55 {
    background: linear-gradient(135deg, #e46b49 0%, #de5f3e 100%) !important;
    border-color: #df6746 !important;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table> :not(caption)>*>* {
    border-bottom-color: #edf0f5;
    padding: 13px 10px;
    vertical-align: middle;
    text-align: left;
}

.table>thead {
    background: #f8f9fb;
}

.table>thead th {
    color: #768298;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.table td {
    color: #374152;
    font-size: 14px;
}

.badge {
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 11px;
}

.badge.second {
    background: #eef3ff !important;
    color: #4865b3 !important;
    margin-bottom: 4px;
}

.btn-primary,
.savebtn,
.savebtn1 {
    background: var(--crm-accent) !important;
    border-color: var(--crm-accent) !important;
    color: #fff !important;
}

.btn-primary:hover,
.savebtn:hover,
.savebtn1:hover {
    background: #4f613b !important;
    border-color: #4f613b !important;
}

.btn-outline-danger {
    border-color: #e8b4b4;
    color: #b15656;
}

.btn-outline-danger:hover {
    background: #b15656;
    border-color: #b15656;
}

.footer {
    background: transparent;
    border-top: 1px solid var(--crm-border);
}

.footer .container-fluid {
    padding: 14px 24px;
}

.footer,
.footer .text-sm-end {
    color: #79839a;
    font-size: 13px;
}

.status-pill-ok {
    background: #dff0e2;
    color: #4e9b59;
}

.status-pill-warn {
    background: #f4e8d7;
    color: #bc8743;
}

.status-pill-danger {
    background: #f8dddd;
    color: #cf5d52;
}

@media (max-width: 991.98px) {
    #page-topbar {
        left: 0;
    }

    #layout-wrapper .main-content {
        margin-left: 0;
        padding-top: 74px;
    }

    .navbar-menu {
        width: 100%;
        max-width: 280px;
    }

    .navbar-header {
        height: auto;
        min-height: 74px;
        padding: 12px 14px;
    }

    .topbar-search {
        display: none;
    }

    .app-page-title h1 {
        font-size: 22px;
    }

    .metric-card h3 {
        font-size: 34px;
    }

    #layout-wrapper .page-content {
        padding: 16px 10px 90px;
    }
}