:root {
    /* Colors */
    --bs-primary: #009EF7;
    --bs-primary-light: #F1FAFF;
    --bs-success: #50CD89;
    --bs-success-light: #E8FFF3;
    --bs-warning: #FFC700;
    --bs-warning-light: #FFF8DD;
    --bs-danger: #F1416C;
    --bs-danger-light: #FFF5F8;
    --bs-dark: #181C32;
    --bs-text-gray-400: #B5B5C3;
    --bs-text-gray-500: #A1A5B7;
    --bs-text-gray-600: #7E8299;
    --bs-text-gray-700: #5E6278;
    --bs-text-gray-800: #3F4254;
    --bs-body-bg: #F5F8FA;
    --bs-white: #ffffff;
    --bs-border-color: #EFF2F5;

    /* Spacing */
    --spacer: 1rem;

    /* Fonts */
    --font-family-sans-serif: 'Inter', Helvetica, "sans-serif";

    /* Sidebar */
    --sidebar-width: 265px;
    --sidebar-bg: #1e1e2d;
    --sidebar-color: #9899ac;
    --sidebar-active-bg: #2b2b40;
    --sidebar-active-color: #ffffff;

    /* Header */
    --header-height: 70px;
}

[data-theme="dark"] {
    --bs-body-bg: #151521;
    --bs-white: #1e1e2d;
    --bs-border-color: #2b2b40;
    --bs-text-gray-800: #ffffff;
    --bs-text-gray-700: #92929f;
    --bs-text-gray-600: #565674;
    --bs-text-gray-500: #4b4b64;
    --bs-primary-light: #212e48;
    --bs-success-light: #1c3238;
    --bs-warning-light: #392f28;

    /* Dark mode specific overrides */
    --sidebar-bg: #1b1b29;
    --sidebar-active-bg: #2b2b40;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-sans-serif);
    background-color: var(--bs-body-bg);
    color: var(--bs-text-gray-700);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    background-color: #1a1a27;
}

.sidebar-logo .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
}

.sidebar-logo .btn-icon {
    color: var(--sidebar-color);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.sidebar-menu {
    padding: 20px 0;
    overflow-y: auto;
    flex: 1;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-heading {
    padding: 0 25px;
    color: var(--bs-text-gray-600);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 25px;
    color: var(--sidebar-color);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item:hover,
.menu-item.active {
    color: var(--sidebar-active-color);
    background-color: var(--sidebar-active-bg);
}

.menu-icon {
    width: 30px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

/* Sidebar Minimized State (Desktop) */
body.sidebar-minimized .sidebar {
    width: 70px;
}

body.sidebar-minimized .sidebar .menu-title,
body.sidebar-minimized .sidebar .menu-heading,
body.sidebar-minimized .sidebar .brand span {
    display: none;
}

body.sidebar-minimized .sidebar .brand {
    justify-content: center;
    width: 100%;
}

body.sidebar-minimized .sidebar .menu-item {
    padding: 10px 0;
    justify-content: center;
}

body.sidebar-minimized .sidebar .menu-icon {
    margin-right: 0;
}

body.sidebar-minimized .main-wrapper {
    margin-left: 70px;
}

body.sidebar-minimized .sidebar:hover {
    width: var(--sidebar-width);
}

body.sidebar-minimized .sidebar:hover .menu-title,
body.sidebar-minimized .sidebar:hover .menu-heading,
body.sidebar-minimized .sidebar:hover .brand span {
    display: inline-block;
    /* Or block/flex depending on original */
}

body.sidebar-minimized .sidebar:hover .brand {
    justify-content: flex-start;
}

body.sidebar-minimized .sidebar:hover .menu-item {
    padding: 10px 25px;
    justify-content: flex-start;
}

/* Header */
.header {
    height: var(--header-height);
    background-color: var(--bs-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0px 10px 30px 0px rgba(82, 63, 105, 0.05);
    position: sticky;
    top: 0;
    z-index: 900;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left .page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--bs-text-gray-800);
    margin: 0;
}

.app-breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--bs-text-gray-500);
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-breadcrumb .separator {
    margin: 0 8px;
    font-size: 0.6rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right .btn-icon,
.header-left .btn-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--bs-text-gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.header-right .btn-icon:hover,
.header-left .btn-icon:hover {
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
}

.user-profile img {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
}

/* Content */
.content {
    padding: 30px;
}

/* Grid System - Using Bootstrap 5 */
/* Custom overrides if needed */
.row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-3,
.col-4,
.col-8,
.col-12 {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

/* Cards */
.card {
    background-color: var(--bs-white);
    border-radius: 0.65rem;
    box-shadow: 0px 0px 20px 0px rgba(76, 87, 125, 0.02);
    border: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-text-gray-800);
}

.card-body {
    padding: 2rem;
    flex: 1;
}

/* Stat Cards */
.card-stat .card-body {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background-color: var(--bs-body-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--bs-text-gray-600);
}

.card-stat.bg-primary .stat-icon {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-text-gray-800);
    line-height: 1.2;
}

.card-stat.bg-primary .stat-value,
.card-stat.bg-primary .stat-label {
    color: #fff;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--bs-text-gray-500);
}

/* Utilities - Using Bootstrap 5 */
/* Custom button styles to match Metronic */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.45rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-light {
    background-color: var(--bs-body-bg);
    color: var(--bs-text-gray-600);
}

.btn-light:hover {
    background-color: var(--bs-border-color);
    color: var(--bs-primary);
}

/* List Group */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--bs-border-color);
}

.list-item:last-child {
    border-bottom: none;
}

.list-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.1rem;
}

.list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-title {
    font-weight: 600;
    color: var(--bs-text-gray-800);
}

.list-desc {
    font-size: 0.85rem;
    color: var(--bs-text-gray-500);
}

.list-badge {
    font-weight: 600;
    color: var(--bs-text-gray-600);
    background-color: var(--bs-body-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Footer */
.footer {
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--bs-text-gray-600);
    font-size: 0.9rem;
}

.footer-links a {
    margin-left: 15px;
}

.footer-links a:hover {
    color: var(--bs-primary);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .col-3,
    .col-4,
    .col-8 {
        width: 100%;
        margin-bottom: 15px;
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

/* Auth Page */
.auth-bg {
    background-color: var(--bs-body-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.auth-card {
    border: none;
    box-shadow: 0px 0px 30px 0px rgba(82, 63, 105, 0.05);
}

.form-control-solid {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-body-bg);
    color: var(--bs-text-gray-700);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-control-solid:focus {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-body-bg);
    box-shadow: none;
    color: var(--bs-text-gray-700);
}

[data-theme="dark"] .form-control-solid {
    background-color: #1b1b29;
    border-color: #1b1b29;
    color: var(--bs-text-gray-600);
}

[data-theme="dark"] .form-control-solid:focus {
    background-color: #1b1b29;
    border-color: #1b1b29;
    color: var(--bs-text-gray-600);
}

[data-theme="dark"] .auth-logo .brand {
    color: #fff !important;
}