/* =========================================================
   ОСНОВНЫЕ ПЕРЕМЕННЫЕ
   ========================================================= */

:root {
    --bg-page: #f3f6fd;
    --panel-bg: #f3f6fd;
    --block-bg: #ffffff;

    --text-color: #131411;
    --text-muted: #737985;

    --border-color: #e2e5ea;

    --header-height: 64px;
    --sidebar-width: 64px;

    --radius: 12px;
}


/* =========================================================
   БАЗОВЫЕ СТИЛИ
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;

    min-height: 100%;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg-page);

    color: var(--text-color);
}

body {
    min-height: 100vh;
}


/* =========================================================
   ССЫЛКИ
   ========================================================= */

a {
    color: inherit;
}


/* =========================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ========================================================= */

.top-bar {
    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;

    background: var(--block-bg);

    border-bottom: 1px solid var(--border-color);

    z-index: 1000;
}
.header-icon {

    height: 100px;
    width: 100px;
}

/* =========================================================
   ЛЕВАЯ ЧАСТЬ ШАПКИ
   ========================================================= */

.top-left {
    display: flex;
    align-items: center;
}

.site-title {
    display: inline-flex;
    align-items: center;

    text-decoration: none;

    color: var(--text-color);

    font-size: 20px;
    font-weight: 700;
}


/* =========================================================
   ПРАВАЯ ЧАСТЬ ШАПКИ
   ========================================================= */

.top-right {
    display: flex;
    align-items: center;

    gap: 10px;
}


/* =========================================================
   МЕНЮ ПОЛЬЗОВАТЕЛЯ
   ========================================================= */

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;

    gap: 8px;

    padding: 6px 8px;

    border: none;

    background: transparent;

    color: var(--text-color);

    border-radius: 8px;

    cursor: pointer;

    font-size: 13px;
}

.user-menu-trigger:hover {
    background: rgba(0, 0, 0, 0.04);
}

.user-name {
    white-space: nowrap;
}

.user-avatar-icon {
    width: 25px;
    height: 25px;

    display: block;
}


/* =========================================================
   DROPDOWN ПОЛЬЗОВАТЕЛЯ
   ========================================================= */

.user-dropdown {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    min-width: 170px;

    padding: 6px;

    background: var(--block-bg);

    border: 1px solid var(--border-color);

    border-radius: 9px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12);

    z-index: 1100;
}

.user-dropdown[hidden] {
    display: none;
}

.dropdown-item {
    width: 100%;

    display: block;

    padding: 9px 10px;

    border: none;

    background: transparent;

    color: var(--text-color);

    text-decoration: none;

    text-align: left;

    border-radius: 6px;

    font-size: 13px;

    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dropdown-divider {
    height: 1px;

    margin: 5px 0;

    background: var(--border-color);
}

.logout-button {
    font-family: inherit;
}


/* =========================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ
   ========================================================= */

.theme-toggle {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;

    background: transparent;

    border-radius: 8px;

    cursor: pointer;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.theme-icon {
    width: 21px;
    height: 21px;

    display: block;
}


/* =========================================================
   ОСНОВНОЙ LAYOUT
   ========================================================= */

.layout-container {
    display: flex;

    min-height: 100vh;

    padding-top: var(--header-height);
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;

    top: var(--header-height);
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;
    align-items: center;

    padding-top: 14px;

    background: var(--block-bg);

    border-right: 1px solid var(--border-color);

    z-index: 900;
}


/* =========================================================
   ССЫЛКИ SIDEBAR
   ========================================================= */

.nav-link-wrapper {
    width: 100%;

    display: flex;
    justify-content: center;

    text-decoration: none;
}


/* =========================================================
   ЭЛЕМЕНТ SIDEBAR
   ========================================================= */

.nav-item {
    position: relative;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.nav-item:hover {
    background: rgba(77, 124, 255, 0.08);
}

.nav-item.active {
    background: rgba(77, 124, 255, 0.12);
}


/* =========================================================
   ИКОНКИ SIDEBAR
   ========================================================= */

.nav-icon {
    width: 21px;
    height: 21px;

    display: block;
}


/* =========================================================
   TOOLTIP SIDEBAR
   ========================================================= */

.tooltip {
    position: absolute;

    left: calc(100% + 10px);
    top: 50%;

    transform:
        translateY(-50%)
        translateX(-4px);

    padding: 5px 8px;

    background: #25282e;
    color: #ffffff;

    border-radius: 5px;

    font-size: 11px;
    font-weight: 400;

    line-height: 1.2;

    white-space: nowrap;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;

    z-index: 1200;
}

.tooltip.visible {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(-50%)
        translateX(0);
}


/* =========================================================
   ОСНОВНАЯ ОБЛАСТЬ КОНТЕНТА
   ========================================================= */

.content-area {
    width: calc(100% - var(--sidebar-width));

    min-height: calc(100vh - var(--header-height));

    margin-left: var(--sidebar-width);

    padding: 24px;

    background: var(--bg-page);
}


/* =========================================================
   ОБЩАЯ CARD
   ========================================================= */

.card {
    width: 100%;

    background: var(--block-bg);

    border-radius: var(--radius);

    box-shadow:
        0 2px 8px rgba(24, 39, 75, 0.04);

    border: 1px solid rgba(226, 229, 234, 0.8);

    padding: 24px;
}


/* =========================================================
   ЗАГОЛОВКИ
   ========================================================= */

.card h1,
.card h2,
.card h3 {
    color: var(--text-color);
}


/* =========================================================
   ФОРМЫ
   ========================================================= */

input,
select,
textarea,
button {
    font-family: inherit;
}


/* =========================================================
   DARK THEME
   ========================================================= */

html[data-theme="dark"] {
    color-scheme: dark;

    --bg-page: #181a20;
    --panel-bg: #20232b;
    --block-bg: #272b35;

    --text-color: #f1f3f5;
    --text-muted: #aeb4bf;

    --border-color: #383d48;
}


/* =========================================================
   DARK — ОБЩИЕ ЭЛЕМЕНТЫ
   ========================================================= */

html[data-theme="dark"] .top-bar,
html[data-theme="dark"] .sidebar {
    border-color: var(--border-color);
}

html[data-theme="dark"] .user-menu-trigger:hover,
html[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .nav-item:hover {
    background: rgba(120, 150, 255, 0.10);
}

html[data-theme="dark"] .nav-item.active {
    background: rgba(120, 150, 255, 0.15);
}

html[data-theme="dark"] .user-dropdown {
    border-color: var(--border-color);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .card {
    border-color: var(--border-color);

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    :root {
        --sidebar-width: 56px;
    }

    .content-area {
        padding: 18px;
    }

    .card {
        padding: 18px;
    }

    .user-name {
        display: none;
    }
}


@media (max-width: 600px) {

    :root {
        --header-height: 56px;
        --sidebar-width: 52px;
    }

    .top-bar {
        padding: 0 10px;
    }

    .content-area {
        padding: 12px;
    }

    .card {
        padding: 14px;
        border-radius: 9px;
    }
}

html[data-theme="dark"] img[src$=".svg"] {
    filter: brightness(0) invert(1);
}