@import url('fonts.css');
:root {
    --stellar-blue: #3535E8;
    --stellar-blue-light: #5757FF;
    --stellar-blue-muted: rgba(53, 53, 232, 0.08);

    --bg-deep: #F5F5FA;
    --bg-panel: #FFFFFF;
    --bg-card: #F0F0F8;
    --bg-surface: #E4E4EF;

    --border-color: rgba(30, 30, 80, 0.10);
    --border-color-strong: rgba(53, 53, 232, 0.30);

    --text-primary: #0F0F2A;
    --text-secondary: rgba(15, 15, 42, 0.55);
    --text-muted: rgba(15, 15, 42, 0.35);

    --sidebar-width: 220px;
    --sidebar-collapsed-width: 56px;
    --topbar-height: 58px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-soft: 0 8px 24px rgba(53, 53, 232, 0.08);
}

html,
body {
    height: 100%;
}

body.app-body {
    margin: 0;
    overflow: hidden;
    font-family: "DM Sans", sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
}

.app-shell {
    min-height: 100vh;
    background: var(--bg-deep);
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    transition: width .22s ease, min-width .22s ease;
    overflow: hidden;
    z-index: 1030;
}

.app-sidebar.is-collapsed .app-nav__caret,
.app-sidebar.is-collapsed .dropdown-toggle::after,
.app-sidebar.is-collapsed .app-sidebar__language,
.app-sidebar.is-collapsed .sidebar-logo-img
{
    display: none;
}

.app-sidebar__header {
    padding: 18px 14px 13px;
}

.app-sidebar__body {
    padding: 8px 0;
}

.app-sidebar__footer {
    padding: 12px 10px;
}

.app-brand {
    min-width: 0;
    color: var(--stellar-blue);
}

.app-brand__logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--stellar-blue-muted);
    color: var(--stellar-blue);
    font-size: 1rem;
    flex-shrink: 0;
}

.app-brand__text {
    font-family: "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--stellar-blue);
    white-space: nowrap;
}

.app-sidebar__toggle {
    border-radius: 999px;
    font-size: .8rem;
}

.app-sidebar__section-label {
    padding: 8px 10px 4px;
    margin-top: 12px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.app-nav {
    gap: 2px;
    padding: 0 8px;
}

.app-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
}

.app-nav__link:hover,
.app-nav__link:focus {
    background: var(--bg-card);
    color: var(--text-primary);
}

.app-nav__link.active {
    background: var(--stellar-blue-muted);
    color: var(--stellar-blue);
}

.app-nav__link.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 0 2px 2px 0;
    background: var(--stellar-blue);
}

.app-nav__icon {
    width: 16px;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.app-nav__text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-user {
    padding: 8px 10px;
    border-radius: var(--radius-md);
    color: inherit;
}

.app-user:hover {
    background: var(--bg-card);
}

.app-user__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--stellar-blue-muted);
    border: 1px solid rgba(53, 53, 232, 0.25);
    color: var(--stellar-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.app-user__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.app-user__name {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.app-user__role {
    font-size: .75rem;
    color: var(--text-muted);
}

/* Sidebar collapsed */
.app-sidebar.is-collapsed {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
}

.app-sidebar.is-collapsed .app-brand__text,
.app-sidebar.is-collapsed .app-sidebar__section-label,
.app-sidebar.is-collapsed .app-nav__text,
.app-sidebar.is-collapsed .app-user__meta {
    display: none;
}

.app-sidebar.is-collapsed .app-sidebar__header .d-flex {
    justify-content: center !important;
}

.app-sidebar.is-collapsed .app-nav {
    padding-inline: 6px;
}

.app-sidebar.is-collapsed .app-nav__link {
    justify-content: center;
    padding-inline: 0;
}

.app-sidebar.is-collapsed .app-user {
    justify-content: center;
}

/* Main */
.app-main {
    min-width: 0;
    overflow: hidden;
}

.app-topbar {
    min-height: var(--topbar-height);
    height: var(--topbar-height);
    background: var(--bg-panel) !important;
}

.app-breadcrumb,
.app-breadcrumb .breadcrumb-item,
.app-breadcrumb .breadcrumb-item a {
    font-size: .8125rem;
    color: var(--text-muted);
    text-decoration: none;
}

.app-breadcrumb .breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.app-content {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-deep);
}

.app-page-title {
    font-family: "Inter", sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.app-page-subtitle {
    font-size: .875rem;
    color: var(--text-secondary);
}

/* Buttons */
.app-btn-primary.btn-primary {
    --bs-btn-bg: var(--stellar-blue);
    --bs-btn-border-color: var(--stellar-blue);
    --bs-btn-hover-bg: var(--stellar-blue-light);
    --bs-btn-hover-border-color: var(--stellar-blue-light);
    --bs-btn-active-bg: var(--stellar-blue);
    --bs-btn-active-border-color: var(--stellar-blue);
    --bs-btn-border-radius: 8px;
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-font-weight: 500;
    box-shadow: 0 4px 16px rgba(53, 53, 232, 0.18);
}

/* Offcanvas mobile */
.app-offcanvas {
    background: var(--bg-panel);
}

.app-offcanvas .offcanvas-header {
    background: var(--bg-panel);
}

/* Scrollbar */
.app-content::-webkit-scrollbar,
.app-sidebar__body::-webkit-scrollbar {
    width: 6px;
}

.app-content::-webkit-scrollbar-thumb,
.app-sidebar__body::-webkit-scrollbar-thumb {
    background: rgba(53, 53, 232, 0.15);
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 991.98px) {
    body.app-body {
        overflow: auto;
    }

    .app-sidebar {
        display: none !important;
    }

    .app-main {
        width: 100%;
    }

    .app-content {
        overflow: auto;
    }
}