@font-face {
    font-family: "Inter";
    src: url("/fonts/InterVariable.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Токены фирстиля. Значения — из макетов, руками hex по файлам не разносим.
   ========================================================================== */
:root {
    --c-primary: #1B5AB8;
    --c-primary-soft: #C6DCFF;
    --c-tint: #E1EDFF;
    --c-bg: #F3F8FF;
    --c-surface: #FFFFFF;
    --c-text: #232323;
    --c-muted: #707780;
    --c-line: #E4E4E4;
    --c-danger: #E74141;
    --c-danger-bg: #F9E0E0;
    --c-warn: #706510;
    --c-warn-bg: #F3F3BC;
    --c-ok: #0E6D1C;
    --c-ok-bg: #D1F4D1;

    --r-field: 12px;
    --r-card: 16px;
    --r-btn: 12px;

    --nav-collapsed: 56px;
    --nav-expanded: 210px;
    --nav-item-h: 36px;
    --nav-icon: 30px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: "Inter", "Inter Variable", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }

/* Шкала из макета */
.t-display  { font-size: 32px; font-weight: 600; line-height: 1.2; }
.t-head     { font-size: 24px; font-weight: 600; line-height: 1.25; }
.t-selfhead { font-size: 22px; font-weight: 600; line-height: 1.3; }
.t-title    { font-size: 18px; font-weight: 600; line-height: 1.35; }
.t-text     { font-size: 16px; font-weight: 400; }
.t-status   { font-size: 12px; font-weight: 400; }
.t-muted    { color: var(--c-muted); }

/* ==========================================================================
   Кнопки
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--r-btn);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 150ms ease, background-color 150ms ease;
}

.btn:hover { opacity: .9; }

.btn--primary { background: var(--c-primary); color: #fff; }
.btn--secondary { background: var(--c-primary-soft); color: var(--c-primary); }
.btn--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.btn--block { width: 100%; }

.btn:disabled,
.btn[disabled] { background: var(--c-primary-soft); color: #fff; cursor: default; opacity: 1; }

/* ==========================================================================
   Поля
   ========================================================================== */
.field { position: relative; }
.field + .field { margin-top: 12px; }

.field__input {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 16px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-field);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    font-family: inherit;
    outline: none;
    transition: border-color 150ms ease;
}

.field__input::placeholder { color: var(--c-muted); font-weight: 400; }
.field__input:focus { border-color: var(--c-primary); }

.field__icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: var(--c-muted);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.field__icon svg { width: 100%; height: 100%; display: block; }

/* ==========================================================================
   Карточки и статусы
   ========================================================================== */
.card {
    background: var(--c-surface);
    border-radius: var(--r-card);
    padding: 24px;
}

.card__inner {
    background: var(--c-tint);
    border-radius: var(--r-field);
    padding: 16px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.2;
}

.badge--ok { background: var(--c-ok-bg); color: var(--c-ok); }
.badge--warn { background: var(--c-warn-bg); color: var(--c-warn); }
.badge--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge--neutral { background: var(--c-line); color: var(--c-muted); }

.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--r-field);
    background: var(--c-danger-bg);
    color: var(--c-danger);
    font-size: 14px;
}

/* ==========================================================================
   Экран входа
   ========================================================================== */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login__box { width: 100%; max-width: 420px; }

.login__logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--c-primary);
    color: #fff;
    font-weight: 600;
    font-size: 20px;
}

.login__title { text-align: center; color: var(--c-primary); }
.login__sub { margin: 8px 0 24px; text-align: center; color: var(--c-muted); font-size: 16px; }
.login__form { margin-top: 20px; }
.login__submit { margin-top: 20px; }

/* ==========================================================================
   Боковое меню
   ========================================================================== */
.side-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: var(--nav-collapsed);
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 6px;
    background: var(--c-surface);
    border-right: 1px solid var(--c-line);
    transition: width 220ms ease;
    overflow: visible;
}

.side-nav:hover { width: var(--nav-expanded); }

.side-nav__top { flex: 0 0 auto; }
.side-nav__scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.side-nav__scroll::-webkit-scrollbar { display: none; }
.side-nav__bottom { flex: 0 0 auto; }

.side-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--nav-item-h);
    padding: 0 10px 0 6px;
    border-radius: 10px;
    color: var(--c-text);
    background: transparent;
    border: 0;
    width: 100%;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background-color 160ms ease, color 160ms ease;
}

.side-nav__item:hover { background: var(--c-bg); }
.side-nav__item.is-active { background: var(--c-primary-soft); color: var(--c-primary); }
.side-nav__item.is-active .side-nav__icon { color: var(--c-primary); }

.side-nav__icon {
    width: var(--nav-icon);
    min-width: var(--nav-icon);
    height: var(--nav-icon);
    display: grid;
    place-items: center;
    color: var(--c-muted);
    transition: color 160ms ease;
}

.side-nav__icon svg { width: 70%; height: 70%; display: block; }

.side-nav__text {
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.side-nav:hover .side-nav__text { opacity: 1; transform: translateX(0); }

.side-nav__brand { font-weight: 600; cursor: default; }
.side-nav__brand:hover { background: transparent; }

.side-nav__logo {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--c-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.side-nav__divider {
    height: 28px;
    padding-left: 8px;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.side-nav__divider .side-nav__text { font-size: 12px; font-weight: 600; color: var(--c-muted); }

/* ==========================================================================
   Рабочая область
   ========================================================================== */
.layout { padding-left: var(--nav-collapsed); }

.topbar {
    height: 64px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
}

.topbar__user { display: flex; align-items: center; gap: 10px; color: var(--c-muted); font-size: 14px; }
.topbar__user svg { width: 20px; height: 20px; }

.content { padding: 28px; }

.page-head { margin-bottom: 20px; }
.page-head__title { color: var(--c-primary); }
.page-head__sub { margin-top: 6px; color: var(--c-muted); font-size: 16px; }

.empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--c-muted);
}

.empty__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--c-tint);
    color: var(--c-primary);
}

.empty__icon svg { width: 34px; height: 34px; }

@media (max-width: 640px) {
    :root { --nav-collapsed: 48px; --nav-expanded: 180px; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
}
