:root {
    color-scheme: light;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-color: #fafaf9;
    color: #1c1c1c;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
a, button { -webkit-tap-highlight-color: transparent; }
.site-header {
    height: 82px;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #eaeae8;
}
.header-inner {
    height: 100%;
    max-width: 1504px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}
.brand-mark {
    display: grid;
    place-items: center;
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: #232323;
    color: #fff;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -2.2px;
}
.brand-dot { color: #dce98c; }
.brand-copy { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font-weight: 740; font-size: 14px; letter-spacing: .065em; white-space: nowrap; }
.brand-caption { color: #8a8a89; font-weight: 600; font-size: 10px; letter-spacing: .13em; white-space: nowrap; }
.header-actions { display: flex; gap: 16px; align-items: center; justify-content: flex-end; }
.login-button {
    text-decoration: none;
    color: #fff;
    background: #242424;
    border: 1px solid #242424;
    border-radius: 10px;
    padding: 12px 17px;
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: 650;
    line-height: 20px;
    transition: background .15s ease, transform .15s ease;
}
.login-button:hover { background: #444; }
.login-button:active { transform: translateY(1px); }
.login-button:focus-visible, .quiet-button:focus-visible, .brand:focus-visible {
    outline: 3px solid #a9b4fc;
    outline-offset: 3px;
}
.profile { display: inline-flex; align-items: center; gap: 10px; }
.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #2c302a;
    background: #e9ede0;
    display: inline-grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
}
.profile-name { color: #383838; font-size: 13px; font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-divider { width: 1px; height: 24px; background: #e8e8e5; }
.quiet-button {
    background: #fff;
    border: 1px solid #e5e5e2;
    color: #474747;
    padding: 10px 15px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.quiet-button:hover { background: #f7f7f6; }
.configuration-status { font-size: 12px; color: #888; }
.auth-error { font-size: 12px; color: #a13b3b; }
.empty-workspace { min-height: calc(100vh - 82px); }

@media (max-width: 680px) {
    .site-header { height: 73px; }
    .header-inner { padding: 0 19px; gap: 9px; }
    .brand { gap: 9px; }
    .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; font-size: 21px; }
    .brand-name { font-size: 12px; letter-spacing: .025em; }
    .brand-caption { font-size: 9px; letter-spacing: .075em; }
    .header-actions { gap: 7px; }
    .login-button { padding: 10px; font-size: 12px; gap: 6px; }
    .login-button svg { display: none; }
    .profile-name { display: none; }
    .header-divider { height: 20px; }
    .quiet-button { padding: 9px 11px; }
    .configuration-status { max-width: 115px; text-align: right; }
    .auth-error { max-width: 90px; text-align: right; }
    .empty-workspace { min-height: calc(100vh - 73px); }
}
@media (prefers-reduced-motion: reduce) {
    .login-button { transition: none; }
}

/* Кабинет управляющего: навигация и список пользователей. */
.app-shell {
    min-height: calc(100vh - 82px);
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr);
    max-width: 1504px;
    margin: 0 auto;
}
.app-shell:has(.workspace-content:first-child) { grid-template-columns: 1fr; }
.side-navigation {
    background: #fff;
    border-right: 1px solid #eaeae8;
    padding: 35px 18px;
}
.navigation-caption {
    color: #9b9b96;
    letter-spacing: .13em;
    font-size: 10px;
    font-weight: 750;
    padding: 0 15px;
    margin: 0 0 14px;
}
.main-navigation { display: grid; gap: 5px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666762;
    font-size: 13px;
    font-weight: 600;
    padding: 13px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .12s ease;
}
.nav-item:hover { color: #20201f; background: #f5f5f2; }
.nav-active, .nav-active:hover { color: #20221b; background: #eef1e4; }
.nav-symbol {
    width: 20px;
    display: inline-block;
    text-align: center;
    font-size: 20px;
    line-height: 18px;
    font-weight: 500;
}
.workspace-content {
    width: 100%;
    min-width: 0;
    max-width: 1262px;
    padding: 49px 57px 80px;
}
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}
.eyebrow {
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .14em;
    color: #878b7c;
    margin: 0 0 11px;
}
.page-header h1 {
    font-size: clamp(26px, 3vw, 35px);
    letter-spacing: -.038em;
    margin: 0;
    font-weight: 725;
    line-height: 1.2;
}
.page-description { color: #85857f; font-size: 13px; margin: 12px 0 0; }
.count-indicator {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #282a25;
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -.045em;
    white-space: nowrap;
}
.count-indicator span { font-size: 12px; letter-spacing: 0; color: #94948e; font-weight: 500; }
.panel {
    background: #fff;
    border: 1px solid #e8e9e4;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgb(0 0 0 / 2%);
    overflow: hidden;
}
.table-scroll { width: 100%; overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; text-align: left; }
.users-table th {
    background: #fafaf9;
    border-bottom: 1px solid #eaeae7;
    color: #969690;
    font-weight: 650;
    font-size: 10px;
    letter-spacing: .055em;
    text-transform: uppercase;
    padding: 18px 23px;
    white-space: nowrap;
}
.users-table td {
    padding: 20px 23px;
    border-bottom: 1px solid #f0f0ed;
    color: #575751;
    font-size: 12px;
    vertical-align: middle;
}
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: #fdfdfa; }
.users-table .user-name { font-weight: 700; color: #292a26; font-size: 13px; }
.users-table .telegram-id { color: #777b73; font-variant-numeric: tabular-nums; white-space: nowrap; }
.users-table .date-cell { color: #888a83; white-space: nowrap; font-variant-numeric: tabular-nums; }
.role-list { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.role {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e8e8e3;
    border-radius: 6px;
    padding: 5px 9px;
    background: #f7f7f5;
    color: #696b64;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}
.role-manager { background: #eef1e2; border-color: #e2e8d0; color: #626d41; }
.role-none { background: #fafaf9; color: #9d9d98; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; white-space: nowrap; }
.status-dot { border-radius: 50%; width: 6px; height: 6px; background: #81a57a; }
.status-active { color: #587752; }
.status-disabled { color: #a19a94; }
.status-disabled .status-dot { background: #c5bfb8; }
.table-footer {
    min-height: 72px;
    padding: 15px 22px;
    border-top: 1px solid #ecece9;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    color: #94948d;
    font-size: 12px;
}
.pagination { display: flex; gap: 9px; }
.page-link {
    text-decoration: none;
    color: #494b44;
    border: 1px solid #e5e5e0;
    border-radius: 8px;
    padding: 9px 15px;
    font-size: 12px;
    font-weight: 650;
}
.page-link:hover { background: #f7f8f3; }
.notice {
    padding: 20px 23px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}
.notice-error { border: 1px solid #e9cece; background: #fff9f9; color: #914343; }
.empty-list { text-align: center; padding: 72px 24px; }
.empty-list h2 { margin: 8px 0; font-size: 18px; }
.empty-list p { font-size: 13px; color: #888; }
.empty-icon { font-size: 34px; color: #b5b8aa; }
.subtle-link { font-size: 13px; color: #66754e; }
.overview-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 30px;
}
.overview-panel h2 { margin: 0 0 7px; font-size: 16px; }
.overview-panel p { margin: 0; color: #96968f; font-size: 13px; }
.overview-symbol {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 11px;
    background: #eef1e4;
    color: #667452;
    font-size: 26px;
}
.overview-link { margin-left: auto; text-decoration: none; font-size: 13px; font-weight: 700; color: #5d7045; }
.overview-link:hover { text-decoration: underline; }
.nav-item:focus-visible, .page-link:focus-visible, .overview-link:focus-visible {
    outline: 3px solid #a9b4fc;
    outline-offset: 3px;
}
@media (max-width: 880px) {
    .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
    .workspace-content { padding: 34px 25px 65px; }
    .users-table th, .users-table td { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 680px) {
    .app-shell { display: block; min-height: calc(100vh - 73px); }
    .side-navigation { padding: 10px 17px; border-right: 0; border-bottom: 1px solid #eaeae8; }
    .navigation-caption { display: none; }
    .main-navigation { display: flex; flex-wrap: wrap; gap: 8px; }
    .nav-item { padding: 10px 13px; }
    .workspace-content { padding: 27px 18px 60px; }
    .page-header { align-items: flex-start; }
    .count-indicator { font-size: 22px; }
    .overview-panel { padding: 24px; }
    .overview-link { margin-left: 0; }
}