:root {
    --primary: #164a72;
    --primary-dark: #103653;
    --accent: #2787c1;
    --background: #f3f6fa;
    --surface: #ffffff;
    --text: #233246;
    --muted: #728096;
    --border: #e3e9f0;
    --sidebar-width: 242px;
    --sidebar-collapsed: 68px;
    --header-height: 68px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

.app-shell { min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: #fff;
    transition: width .2s ease, transform .2s ease;
    overflow-x: hidden;
    z-index: 30;
}

.app-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid #ffffff20;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.brand-icon {
    font-size: 27px;
    flex-shrink: 0;
}

.app-navigation { padding: 18px 10px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 9px;
    text-decoration: none;
    color: #d4e2ee;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s;
}

.nav-item:hover {
    background: #ffffff16;
    color: #fff;
}

.nav-item.active {
    background: #ffffff24;
    color: #fff;
    font-weight: 650;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
}

.nav-icon svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .2s ease;
}

.app-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 28px;
}

.sidebar-toggle {
    border: 0;
    background: #edf3f8;
    color: var(--primary);
    border-radius: 9px;
    width: 39px;
    height: 39px;
    cursor: pointer;
    font-size: 19px;
}

.header-title {
    font-size: 17px;
    font-weight: 700;
}

.header-user {
    margin-left: auto;
    font-size: 12px;
    font-weight: 650;
    color: var(--muted);
}

.app-content {
    padding: 28px;
    max-width: 1700px;
    margin: 0 auto;
}

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

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-text {
    display: none;
}

body.sidebar-collapsed .app-brand {
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

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

    .app-main,
    body.sidebar-collapsed .app-main {
        margin-left: 0;
    }

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

    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .nav-text {
        display: inline;
    }

    .app-header { padding: 0 16px; }
    .app-content { padding: 16px; }
    .header-title { font-size: 15px; }
}
