:root {
    --sidebar-width: 250px;
    --brand: #276F27;
    --brand-dark: #1a4d1a;
    --brand-soft: #E4E4E7;
    --ink: #1a4d1a;
    --muted: #8a94a6;
    --line: #e4e4e7;

    --bs-primary: #276F27;
    --bs-primary-rgb: 39, 111, 39;
    --bs-success: #6B8563;
    --bs-success-rgb: 107, 133, 99;
    --bs-info: #64748B;
    --bs-info-rgb: 100, 116, 139;
    --bs-danger: #A3524A;
    --bs-danger-rgb: 163, 82, 74;
    --bs-warning: #A38A4A;
    --bs-warning-rgb: 163, 138, 74;
}

.btn-primary {
    --bs-btn-bg: #276F27;
    --bs-btn-border-color: #276F27;
    --bs-btn-hover-bg: #1a4d1a;
    --bs-btn-hover-border-color: #1a4d1a;
    --bs-btn-active-bg: #1a4d1a;
    --bs-btn-active-border-color: #1a4d1a;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}

.btn-outline-secondary {
    --bs-btn-hover-bg: #E4E4E7;
    --bs-btn-hover-border-color: #a1a1aa;
    --bs-btn-hover-color: #1a4d1a;
}

.btn-outline-danger {
    --bs-btn-color: #A3524A;
    --bs-btn-border-color: #A3524A;
    --bs-btn-hover-bg: #A3524A;
    --bs-btn-hover-border-color: #A3524A;
    --bs-btn-hover-color: #fff;
}

.bg-primary-subtle {
    background-color: #E4E4E7 !important;
}

.text-primary {
    color: #3F3F46 !important;
}

.bg-success-subtle {
    background-color: #E7EDE4 !important;
}

.text-success {
    color: #4E6548 !important;
}

.bg-warning-subtle {
    background-color: #EFE8D4 !important;
}

.text-warning {
    color: #7A6535 !important;
}

.bg-info-subtle {
    background-color: #E2E8F0 !important;
}

.text-info {
    color: #475569 !important;
}

.bg-lime-subtle {
    background-color: #E9F6D9 !important;
}

.text-lime {
    color: #5D8A22 !important;
}

.bg-danger-subtle {
    background-color: #F1E1DF !important;
}

.text-danger {
    color: #A3524A !important;
}

.toast-with-progress {
    position: relative;
    overflow: hidden;
    border: none;
}

.toast.text-bg-success.toast-with-progress {
    background: linear-gradient(135deg, #00C896, #06B6D4) !important;
}

.toast.text-bg-danger.toast-with-progress {
    background: linear-gradient(135deg, #FF3B5C, #FF7A45) !important;
}

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, .7);
    transform: scaleX(1);
    transform-origin: left;
    transition: transform linear;
}

body {
    background: #f4f4f5;
    background-attachment: fixed;
    color: var(--ink);
    font-size: .9rem;
    font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Rubik', ui-sans-serif, system-ui, sans-serif;
}

.lucide {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
    flex-shrink: 0;
}

.brand .lucide {
    width: 22px;
    height: 22px;
}

.nav-icon .lucide {
    width: 18px;
    height: 18px;
}

.search-box .lucide {
    width: 16px;
    height: 16px;
}

.icon-btn .lucide {
    width: 19px;
    height: 19px;
}

.dropdown-item .lucide {
    width: 15px;
    height: 15px;
}

.user-menu-toggle .lucide {
    width: 14px;
    height: 14px;
}

.user-menu-toggle:focus {
    box-shadow: none;
}

.user-dropdown {
    width: 290px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px -12px rgba(16, 24, 40, .18);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--brand-soft);
    border-bottom: 1px solid var(--line);
    padding: .9rem .9rem;
}

.user-dropdown-avatar {
    width: 40px;
    height: 40px;
    font-size: .95rem;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--brand);
}

.user-dropdown-name {
    font-weight: 700;
    font-size: .95rem;
}

.user-dropdown-email {
    font-size: .78rem;
    color: var(--muted);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .9rem;
    font-size: .83rem;
    font-weight: 500;
    color: var(--ink);
}

.user-dropdown-item:hover {
    background: #f6f8fb;
}

.user-dropdown-icon {
    width: 30px;
    height: 30px;
    border-radius: .6rem;
    background: #f1f4f8;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-dropdown-icon .lucide {
    width: 16px;
    height: 16px;
}

.user-dropdown-signout {
    width: 100%;
    border: none;
    background: #fde2e4;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: .87rem;
    padding: .6rem;
    border-radius: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.user-dropdown-signout:hover {
    background: #fbd0d3;
}

.user-dropdown-signout .lucide {
    width: 15px;
    height: 15px;
}

.topbar-user-avatar,
.sidebar-user .avatar {
    line-height: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-right: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 4px 0 30px rgba(31, 41, 55, .06);
    display: flex;
    flex-direction: column;
    z-index: 1030;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
}

.sidebar .brand i {
    color: var(--brand);
    font-size: 1.3rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .25rem .75rem 1rem;
}

.sidebar .nav-section {
    padding: 1rem .5rem .4rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--ink);
    font-weight: 600;
    padding: .45rem .55rem;
    font-size: .87rem;
    border-radius: .9rem;
    margin-bottom: .3rem;
    transition: background .15s ease, box-shadow .15s ease, color .15s ease;
}

.sidebar .nav-link .nav-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: .65rem;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.sidebar .nav-link .nav-icon [data-lucide] {
    width: 1.05em;
    height: 1.05em;
}

.sidebar .nav-link:hover:not(.active) {
    background: #f4f6f9;
}

.sidebar .nav-link.active {
    background: #f0f0f2;
    color: var(--ink);
    border-left: 3px solid #8ECA3C;
    border-radius: 0;
    padding-left: calc(.55rem - 3px);
}

.sidebar .nav-link.active .nav-icon {
    background: #fff;
    color: #8ECA3C;
}

.sidebar-user {
    border-top: 1px solid var(--line);
    padding: .85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.sidebar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}

.sidebar-user .name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.1;
}

.sidebar-user .role {
    font-size: .72rem;
    color: var(--muted);
}

/* Main */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 65px;
}

.topbar {
    background: rgba(255, 255, 255, .5);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, .6);
    padding: .65rem 1.5rem;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar .search-box {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.topbar .search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.topbar .search-box input {
    border-radius: 2rem;
    padding-left: 2.4rem;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .7);
}

.topbar-icons {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin-left: auto;
}

.topbar-icons .icon-btn {
    position: relative;
    color: #4b5563;
    font-size: 1.1rem;
}

.topbar-icons .icon-btn .badge {
    position: absolute;
    top: -6px;
    right: -8px;
    font-size: .6rem;
    padding: .2em .4em;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
}

.content {
    padding: 1.5rem;
    flex: 1;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .15rem;
}

.page-header p {
    color: var(--muted);
    margin-bottom: 0;
}

.card-soft {
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: .9rem;
    box-shadow: 0 8px 32px rgba(31, 41, 55, .08);
    overflow: hidden;
}

.card-soft .table-responsive {
    border-radius: 0 0 .9rem .9rem;
}

.card-soft .card-header {
    background: rgba(255, 255, 255, .35);
    border-bottom: 1px solid rgba(255, 255, 255, .6);
    border-radius: .9rem .9rem 0 0;
}

.card-soft .table {
    background: transparent;
}

.stat-card .icon-box {
    width: 46px;
    height: 46px;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card .label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    font-weight: 600;
}

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
}

.table thead tr {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

@media (max-width: 991.98px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
        transition: left .2s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .topbar {
        left: 0;
    }

    .topbar .search-box {
        display: none;
    }
}
