body {
    font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.custom-navbar {
    background: #ffffff !important;
    height: 60px;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #ece8f4 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 28px !important;
    padding-right: 28px !important;
}

.nav-brand-group {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 0 1 auto;
}

.clini-brand {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    height: 30px;
    width: auto;
}

.nav-menu-toggle {
    width: 40px;
    height: 40px;
    border: 0;
    padding: 0;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    color: #5A4596;
    border-radius: 10px;
    flex: 0 0 auto;
}

.nav-menu-toggle span {
    display: block;
    width: 30px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.nav-menu-toggle:hover {
    background: rgba(90, 69, 150, 0.08);
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #5A4596;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    min-width: 0;
}

.nav-user-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: right;
    color: #6c6980;
}

.nav-user-copy strong {
    color: #2e2c38;
    font-size: 12px;
    line-height: 14px;
    font-weight: 700;
}

.nav-user-copy span {
    font-size: 11px;
    line-height: 13px;
}

.nav-logout-form {
    margin: 0;
    flex: 0 0 auto;
}

.nav-logout {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #ddd6ed;
    border-radius: 12px;
    background: #ffffff;
    color: #5A4596;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    line-height: 16px;
    font-weight: 700;
}

.nav-logout svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-logout:hover {
    background: rgba(90, 69, 150, 0.08);
}

.nav-logout-mobile {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
}

.nav-logout-mobile span {
    display: none;
}

.nav-menu-toggle-mobile {
    display: none;
}

.nav-mobile-controls {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.sidebar {

    background: #ffffff;
    border-right: 1px solid #ece8f4;
    box-shadow: none;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 1030;
    overflow: hidden;
}

.sidebar.expanded {
    width: 248px;
}

.sidebar-header {
    display: none;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border: 0;
    padding: 0;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    color: #5A4596;
    border-radius: 10px;
    flex: 0 0 auto;
}

.sidebar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.sidebar-toggle:hover {
    background: rgba(90, 69, 150, 0.08);
}

.sidebar-brand {
    display: none;
    align-items: center;
    min-width: 0;
}

.sidebar.expanded .sidebar-brand {
    display: inline-flex;
    flex: 1 1 auto;
}

.sidebar-brand-logo {
    display: block;
    height: 30px;
    width: auto;
    max-width: 132px;
}

.sidebar-menu {
    height: 100%;
    background: #ffffff;
    padding: 12px 10px 16px;
    overflow-y: auto;
}

.sidebar-menu li {
    width: 52px;
    min-height: 52px;
    margin: 0 auto 8px;
    padding: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: transparent;
}

.sidebar.expanded .sidebar-menu li {
    width: 100%;
    min-height: 48px;
    margin: 0 0 6px;
    padding: 10px 14px;
    justify-content: flex-start;
    gap: 12px;
}

.sidebar-menu li:hover {
    background: rgba(90, 69, 150, 0.10);
}

.sidebar-menu li img {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    filter: brightness(0) saturate(100%) invert(28%) sepia(14%) saturate(1810%) hue-rotate(221deg) brightness(95%) contrast(91%);
}

.sidebar-menu li a {
    color: #5A4596;
    font-size: 14px;
    font-weight: 600;
    margin-left: 0;
    text-decoration: none;
}

.sidebar:not(.expanded) .sidebar-menu li a {
    display: none;
}

.sidebar-menu li.active {
    background: #5A4596;
}

.sidebar-menu li.active img {
    filter: brightness(0) invert(1);
}

.sidebar-menu li.active a {
    color: #ffffff;
}

.sidebar-mobile-actions {
    display: none;
}

.sidebar-mobile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #ddd6ed;
    background: #ffffff;
    color: #5A4596;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-mobile-button {
    appearance: none;
}

.sidebar-overlay {
    display: none;
}

.custom-navbar .navbar-brand {
    margin-left: 0 !important;
}

.custom-footer {
    background: #ffffff;
    border-top-color: #ece8f4 !important;
    border-top-style: solid;
    border-top-width: 1px;
    padding: 0;
}

.custom-footer-inner {
    min-height: 64px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.custom-footer-copy,
.custom-footer-credit {
    margin: 0;
    color: #a2a0b3;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
}

.custom-footer-copy {
    text-align: left;
}

.custom-footer-credit {
    text-align: right;
    white-space: nowrap;
}

.custom-footer-heart {
    color: #e46da9;
    font-size: 11px;
    margin: 0 3px;
    vertical-align: 1px;
}

.app-shell-content {
    min-width: 0;
    flex: 1 1 auto;
    margin-left: 76px;
    padding-top: 60px;
    transition: margin-left .22s ease;
}

.sidebar.expanded ~ .app-shell-content {
    margin-left: 248px;
}

@media (max-width: 991.98px) {
    body.mobile-sidebar-open {
        overflow: hidden;
    }

    .app-shell-content,
    .sidebar.expanded ~ .app-shell-content {
        margin-left: 0;
    }

    .nav-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .custom-navbar {
        top: 0;
    }

    .custom-footer-inner {
        min-height: auto;
        padding: 14px 16px;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .custom-footer-copy,
    .custom-footer-credit {
        text-align: center;
        white-space: normal;
    }

    .nav-user {
        display: none;
    }

    .nav-logout-form-mobile {
        display: inline-flex;
    }

    .nav-menu-toggle-desktop {
        display: none;
    }

    .nav-mobile-controls {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-menu-toggle-mobile {
        display: inline-flex;
    }

    .nav-brand-group {
        gap: 0;
        flex: 1 1 auto;
    }

    .sidebar {
        position: fixed;
        top: 60px;
        bottom: 0;
        right: 0;
        left: auto;
        width: min(300px, calc(100vw - 24px));
        border-right: 0;
        border-left: 1px solid #ece8f4;
        box-shadow: -16px 0 40px rgba(15, 23, 42, 0.14);
        transform: translateX(100%);
        transition: transform .22s ease;
        z-index: 1045;
    }

    .sidebar.expanded {
        width: min(300px, calc(100vw - 24px));
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-header,
    .sidebar.expanded .sidebar-header {
        display: none;
    }

    .sidebar-menu {
        height: 100%;
        padding: 14px 14px 10px;
    }

    .sidebar-menu li,
    .sidebar.expanded .sidebar-menu li {
        width: 100%;
        min-height: 48px;
        margin: 0 0 8px;
        padding: 10px 14px;
        justify-content: flex-start;
        gap: 12px;
    }

    .sidebar:not(.expanded) .sidebar-menu li a,
    .sidebar .sidebar-menu li a {
        display: inline-flex;
        align-items: center;
        opacity: 1;
        width: auto;
        min-width: 0;
    }

    .sidebar-mobile-actions {
        display: grid;
        gap: 10px;
        padding: 12px 14px 16px;
        border-top: 1px solid #ece8f4;
        background: #ffffff;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 60px 0 0 0;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(17, 24, 39, 0.28);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 1040;
    }

    body.mobile-sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (min-width: 992px) {
    .nav-logout-form-mobile {
        display: none;
    }
}
