@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-width: 252px;
    --sidebar-mini-width: 76px;
    --topbar-height: 64px;
    --navy: #10213f;
    --navy-2: #17376a;
    --blue: #2563eb;
    --cyan: #06b6d4;
    --green: #16a34a;
    --orange: #f59e0b;
    --bg: #eef3f8;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #64748b;
    --line: #dce5ee;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
}

a {
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    color: #eaf2ff;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, .18), rgba(6, 182, 212, .06)),
        linear-gradient(180deg, var(--navy) 0%, #122a50 55%, #0b1830 100%);
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 10px 0 26px rgba(16, 33, 63, .18);
    transition: width .22s ease, transform .2s ease;
}

.sidebar-brand {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 10px 22px rgba(37, 99, 235, .35);
    font-size: 20px;
}

.brand-text {
    min-width: 0;
}

.brand-text h4 {
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-text small {
    display: block;
    color: rgba(234, 242, 255, .68);
    font-size: 11px;
    line-height: 1.2;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(6, 182, 212, .5) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, .5);
    border-radius: 999px;
}

.menu-link {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 3px;
    padding: 7px 9px;
    color: rgba(234, 242, 255, .84);
    border-radius: 9px;
    font-weight: 500;
    transition: background .16s ease, color .16s ease;
}

.menu-link i {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #b9d4ff;
    background: rgba(255, 255, 255, .07);
}

.menu-link span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.menu-link.active {
    color: #fff;
    background: transparent;
    box-shadow: none;
}

.menu-link.active i {
    color: #fff;
    background: var(--blue);
}

.menu-home {
    margin-bottom: 10px;
}

.submenu-group {
    position: relative;
    margin-bottom: 7px;
}

.submenu-toggle {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 0;
    border-radius: 9px;
    color: rgba(234, 242, 255, .84);
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: background .18s ease, color .18s ease;
}

.submenu-toggle > i {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #b9d4ff;
    background: rgba(255, 255, 255, .07);
}

.submenu-toggle span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.submenu-caret {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: rgba(234, 242, 255, .58);
    font-size: 11px;
    transition: transform .2s ease;
}

.submenu-toggle:hover,
.submenu-toggle.active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.submenu-toggle.active {
    background: transparent;
    box-shadow: none;
}

.submenu-toggle.active > i {
    color: #fff;
    background: var(--blue);
}

.submenu-group.open .submenu-caret {
    transform: rotate(180deg);
}

.submenu-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-3px);
    transition: max-height .24s ease, opacity .2s ease, transform .2s ease;
}

.submenu-group.open .submenu-panel {
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
}

.submenu-title {
    display: none;
}

.submenu-link {
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 2px 28px;
    padding: 6px 8px;
    color: rgba(234, 242, 255, .74);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: background .16s ease, color .16s ease;
}

.submenu-link i {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    color: #9fc4ff;
    font-size: 13px;
}

.submenu-link:hover,
.submenu-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.submenu-link.active {
    box-shadow: none;
}

.sidebar-footer {
    min-height: 56px;
    margin: 0 10px 12px;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-footer strong,
.sidebar-footer small {
    display: block;
    line-height: 1.2;
}

.sidebar-footer strong {
    color: #fff;
    font-size: 12px;
}

.sidebar-footer small {
    color: rgba(234, 242, 255, .62);
    font-size: 10px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 99px;
    background: var(--green);
    box-shadow: 0 0 0 5px rgba(22, 163, 74, .18);
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    transition: margin-left .22s ease;
}

.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--topbar-height);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
    transition: left .22s ease;
}

.navbar-title,
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-title strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.page-kicker {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.icon-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    color: var(--navy-2);
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.icon-btn:hover {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

.user-chip {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.user-chip i {
    color: var(--blue);
    font-size: 21px;
}

.user-chip strong,
.user-chip small {
    display: block;
    line-height: 1.12;
}

.user-chip strong {
    font-size: 12px;
}

.user-chip small {
    color: var(--muted);
    font-size: 10px;
}

.content-wrapper {
    padding: 18px;
}

.card {
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.card .card-body {
    padding: 16px;
}

.btn {
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
}

.btn-success {
    background: var(--green);
    border-color: var(--green);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    color: #334155;
    background: #f8fafc;
    border-bottom-color: var(--line);
    font-size: 12px;
    font-weight: 700;
}

.table td,
.table th {
    padding: 10px 12px;
    vertical-align: middle;
}

.form-control,
.form-select {
    border-color: var(--line);
    border-radius: 9px;
    font-size: 13px;
}

.form-label {
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

.app-footer {
    min-height: 46px;
    margin-left: var(--sidebar-width);
    padding: 10px 18px;
    color: var(--muted);
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: margin-left .22s ease;
}

.app-footer span {
    color: var(--navy-2);
    font-weight: 700;
}

.app-footer small {
    font-size: 11px;
}

.sidebar-overlay {
    display: none;
}

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

body.sidebar-minimized .top-navbar {
    left: var(--sidebar-mini-width);
}

body.sidebar-minimized .main-content,
body.sidebar-minimized .app-footer {
    margin-left: var(--sidebar-mini-width);
}

body.sidebar-minimized .sidebar-brand {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-minimized .brand-text,
body.sidebar-minimized .menu-link span,
body.sidebar-minimized .submenu-toggle span,
body.sidebar-minimized .submenu-caret,
body.sidebar-minimized .sidebar-footer div {
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

body.sidebar-minimized .sidebar-menu {
    padding-left: 9px;
    padding-right: 9px;
    overflow-y: auto;
    overflow-x: hidden;
}

body.sidebar-minimized .menu-link {
    justify-content: center;
    padding: 7px;
}

body.sidebar-minimized .sidebar-footer {
    justify-content: center;
    padding: 10px 8px;
}

body.sidebar-minimized .submenu-toggle {
    justify-content: center;
    padding: 7px;
}

body.sidebar-minimized .submenu-panel {
    display: none;
}

body.sidebar-minimized .submenu-group.open .submenu-panel {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(15, 23, 42, .45);
    }

    .top-navbar {
        left: 0;
    }

    .main-content,
    .app-footer {
        margin-left: 0;
    }

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

    body.sidebar-minimized .top-navbar {
        left: 0;
    }

    body.sidebar-minimized .main-content,
    body.sidebar-minimized .app-footer {
        margin-left: 0;
    }

    body.sidebar-minimized .brand-text,
    body.sidebar-minimized .menu-link span,
    body.sidebar-minimized .submenu-toggle span,
    body.sidebar-minimized .submenu-caret,
    body.sidebar-minimized .sidebar-footer div {
        width: auto;
        opacity: 1;
        overflow: visible;
        pointer-events: auto;
    }

    body.sidebar-minimized .submenu-panel {
        position: static;
        width: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        display: block;
    }
}

@media (max-width: 575.98px) {
    .top-navbar {
        padding: 9px 12px;
    }

    .content-wrapper {
        padding: 14px 12px;
    }

    .user-chip div,
    .page-kicker {
        display: none;
    }

    .app-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}