@import url('/static/fonts.css?v=20260903d');

.msi {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    vertical-align: middle;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings .15s;
}

.nav-item.active .msi,
.toggle-btn.active .msi,
.msi-filled {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

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

/* Запрет "резинового" оттягивания скролла (bounce) - без него на iOS
   попытка пролистнуть дальше начала/конца страницы обнажает системный
   фон за пределами документа (жалоба пользователя 03.09.2026, "если
   потянуть вверх или вниз опять видно" - тот же класс бага, что чинили
   на betmark.ru). Только на <html>, НЕ на <body> - оба сразу ловят
   известный баг WebKit, из-за которого страница на iOS Safari переставала
   прокручиваться вверх вообще (см. globals.css у Betmark). */
html {
    overscroll-behavior-y: none;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background: #ffffff;
    color: #202124;
}

/* ===== Login page ===== */
:root {
    --brand-1: #6366f1;
    --brand-2: #a855f7;
    --brand-3: #ec4899;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f6fb;
    position: relative;
    overflow: hidden;
}

.login-wrap::before,
.login-wrap::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
    z-index: 0;
}
.login-wrap::before {
    width: 480px;
    height: 480px;
    top: -160px;
    left: -140px;
    background: radial-gradient(circle, var(--brand-1), transparent 70%);
}
.login-wrap::after {
    width: 520px;
    height: 520px;
    bottom: -200px;
    right: -160px;
    background: radial-gradient(circle, var(--brand-3), transparent 70%);
}

.server-links-row {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1;
}
.server-admin-link {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 8px rgba(17,24,39,.06);
    transition: color .15s, box-shadow .15s, transform .15s;
    white-space: nowrap;
}
.server-admin-link:hover {
    color: #1f2937;
    box-shadow: 0 4px 14px rgba(17,24,39,.1);
    transform: translateY(-1px);
}
.server-admin-link:focus { outline: none; }
.login-card {
    width: 420px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 28px;
    padding: 44px 36px 36px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(17,24,39,.12), 0 4px 14px rgba(17,24,39,.05);
    position: relative;
    z-index: 1;
    animation: login-card-in .55s cubic-bezier(.16,1,.3,1) both;
}
@keyframes login-card-in {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 20px rgba(99,102,241,.25));
    animation: login-logo-in .6s cubic-bezier(.16,1,.3,1) .1s both;
}

.login-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    font-size: 36px;
    box-shadow: 0 10px 24px rgba(99,102,241,.35);
    animation: login-logo-in .6s cubic-bezier(.16,1,.3,1) .1s both;
}
@keyframes login-logo-in {
    from { opacity: 0; transform: translateY(-10px) scale(.85); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: #5f6368;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    animation: login-fade-in .5s ease .18s both;
}

.login-card .subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    margin-bottom: 30px;
    animation: login-fade-in .5s ease .24s both;
}
@keyframes login-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Обёртка под плавающую подпись поля (чисто CSS, :placeholder-shown -
   тот же приём, что теперь на betmark.ru). placeholder=" " (пробел, не
   пусто) обязателен в разметке, иначе :placeholder-shown не сработает. */
.login-field {
    position: relative;
    text-align: left;
    margin-bottom: 14px;
    animation: login-fade-in .5s ease both;
}
#loginForm .login-field:nth-of-type(1) { animation-delay: .3s; }
#loginForm .login-field:nth-of-type(2) { animation-delay: .36s; }
.login-floating-label {
    position: absolute;
    left: 17px;
    top: 20px;
    font-size: 15px;
    color: #9ca3af;
    pointer-events: none;
    transform-origin: left top;
    transition: transform .15s ease, top .15s ease, color .15s ease;
}
.login-card input:focus + .login-floating-label,
.login-card input:not(:placeholder-shown) + .login-floating-label {
    top: 7px;
    transform: scale(.72);
    color: var(--brand-1);
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #111827;
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 5000s ease-in-out 0s;
    animation-name: login-autofill-start;
}
.login-card input:-webkit-autofill + .login-floating-label {
    top: 7px;
    transform: scale(.72);
    color: var(--brand-1);
}
/* Пустая анимация - только чтобы поймать в JS момент :-webkit-autofill
   через событие animationstart (см. login.html) РАНЬШЕ, чем сработает
   :placeholder-shown/CSS - тот not срабатывает, пока автозаполнение
   только предложено (выпадашка браузера), а не выбрано фактически. */
@keyframes login-autofill-start { from {} to {} }
.login-field input.has-value + .login-floating-label {
    top: 7px;
    transform: scale(.72);
    color: var(--brand-1);
}

.login-card input {
    width: 100%;
    padding: 20px 16px 8px;
    border: 1.5px solid transparent;
    background: #f3f4f6;
    border-radius: 14px;
    /* 16px, не 15px (03.09.2026) - на iPhone Safari сам зумит страницу при
       фокусе на поле с font-size < 16px ("неправильный масштаб" при вводе
       логина/пароля в установленном PWA). */
    font-size: 16px;
    font-family: inherit;
    color: #111827;
    margin-bottom: 14px;
    outline: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.login-field input { margin-bottom: 0; }

.login-card input::placeholder { color: #9ca3af; }
.login-field input::placeholder { color: transparent; }

.login-card input:focus {
    background: #ffffff;
    border-color: var(--brand-1);
    box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}

.login-totp-input {
    text-align: center;
    font-size: 30px !important;
    letter-spacing: 12px;
    font-weight: 600;
    padding-left: 8px !important;
    /* У этого поля нет плавающей подписи - верхний паддинг у .login-card
       input увеличен ради неё (03.09.2026), здесь возвращаем симметрию,
       иначе код 2FA сидит визуально ниже центра поля. */
    padding-top: 14px;
    padding-bottom: 14px;
    animation: login-fade-in .5s ease .3s both;
}

.login-back-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color .15s;
}
.login-back-link:hover { color: var(--brand-1); }

.login-actions {
    display: flex;
    margin-top: 8px;
}

.btn-primary {
    background: #5f6368;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

.btn-primary:hover {
    background: #3c4043;
    box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

.login-wrap .btn-primary {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(99,102,241,.3);
    transition: box-shadow .15s, transform .15s, filter .15s;
    animation: login-fade-in .5s ease .42s both;
}
.login-wrap .btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg);
    transition: left .5s ease;
}
.login-wrap .btn-primary:hover::before { left: 125%; }

.login-wrap .btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 10px 26px rgba(99,102,241,.4);
    transform: translateY(-1px);
}
.login-wrap .btn-primary:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .login-card, .login-logo, .login-logo-icon, .login-card h1, .login-card .subtitle,
    .login-field, .login-totp-input, .login-wrap .btn-primary {
        animation: none !important;
    }
}

.error-msg {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    margin-top: -4px;
    margin-bottom: 14px;
    text-align: left;
    display: none;
}

/* ===== App shell ===== */
.app {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    color: #5f6368;
    padding: 0 12px;
}

.brand .logo-dot {
    width: 32px; height: 32px;
    display: inline-block;
    object-fit: contain;
}

.side-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 0 20px 20px 0;
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    margin-bottom: 2px;
}

.side-nav .nav-item.active {
    background: #e8eaed;
    color: #5f6368;
    font-weight: 500;
}

.side-nav .nav-item:hover:not(.active) { background: #f1f3f4; }

.side-nav .nav-item .msi { font-size: 18px; }

.side-nav-sep {
    height: 1px;
    background: #ebebeb;
    margin: 12px 20px;
}

.side-nav-label {
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    padding: 0 20px;
    margin-bottom: 6px;
}

.nav-item-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding-right: 8px !important;
}

.nav-item-shortcut .remove-shortcut {
    opacity: 0;
    color: #5f6368;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    width: 20px; height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-shortcut:hover .remove-shortcut { opacity: 1; }
.nav-item-shortcut .remove-shortcut:hover { background: rgba(0,0,0,.08); }

.create-wrap {
    padding: 0 12px;
    position: relative;
}

.btn-create {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: none;
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
    padding: 12px 20px 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
}

.btn-create:hover { box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 6px 10px rgba(60,64,67,.2); }

.plus-icon { font-size: 20px; color: #5f6368; font-weight: 400; }

.create-menu {
    position: absolute;
    top: 52px;
    left: 12px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    min-width: 200px;
    display: none;
    z-index: 50;
    overflow: hidden;
}

.create-menu.open { display: block; }

.create-menu .item {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    color: #202124;
}

.create-menu .item:hover { background: #f1f3f4; }

.create-menu .item .msi { margin-right: 10px; font-size: 18px; vertical-align: middle; color: #5f6368; }

.menu-sep {
    height: 1px;
    background: #ebebeb;
    margin: 4px 0;
}

/* ===== Modal dialog ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(32,33,36,.5);
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.open { display: flex; }

.modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px 16px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15);
}

.modal-title {
    font-size: 18px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #5f6368;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
}

.modal-btn:hover { background: #f1f3f4; }
.modal-btn.primary { color: #5f6368; }
.modal-btn.danger { color: #d93025; }

.modal-message {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 24px;
    line-height: 1.5;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    color: #5f6368;
    margin-bottom: 16px;
}

.breadcrumbs .crumb {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.breadcrumbs .crumb:hover { background: #f1f3f4; }
.breadcrumbs .crumb.current { color: #202124; font-weight: 500; cursor: default; }
.breadcrumbs .crumb.current:hover { background: transparent; }
.breadcrumbs .sep { color: #dadce0; }

.storage-box {
    padding: 0 12px;
}

.storage-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.storage-fill {
    height: 100%;
    background: #5f6368;
    width: 0%;
    transition: width .3s;
}

.storage-text {
    font-size: 12px;
    color: #5f6368;
}

/* ===== Main area ===== */
.main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 24px;
}

.search-box {
    flex: 1;
    max-width: 720px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 15px;
}

.search-input-editable {
    width: 100%;
    background: #eef0f3;
    border: none;
    border-radius: 24px;
    padding: 12px 16px 12px 44px;
    font-size: 16px;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    cursor: text;
    font-family: 'Roboto', Arial, sans-serif;
    color: #202124;
}

.search-input-editable:empty:before {
    content: attr(data-placeholder);
    color: #5f6368;
}

.search-input-editable:focus {
    background: #fff;
    box-shadow: 0 1px 1px 0 rgba(65,69,73,.3), 0 1px 3px 1px rgba(65,69,73,.15);
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #5f6368;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: absolute;
    right: 0;
}

.user-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    min-width: 200px;
    display: none;
    z-index: 50;
    overflow: hidden;
}

.user-menu.open { display: block; }

.user-menu .item {
    display: block;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    color: #202124;
    text-decoration: none;
}

.user-menu .item:hover { background: #f1f3f4; }
.user-menu .item:focus { background: #f1f3f4; outline: none; }

/* ===== Filters row ===== */
.filters-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.filter-chip {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 16px;
    padding: 7px 14px;
    font-size: 13px;
    color: #5f6368;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-chip:hover { background: #f1f3f4; }
.chip-arrow { font-size: 10px; color: #5f6368; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ebebeb;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.section-title {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
}

.section-title-lg {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle { display: flex; gap: 4px; }

.toggle-btn {
    border: none;
    background: transparent;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: #5f6368;
    font-size: 14px;
}

.toggle-btn.active { background: #e8eaed; color: #5f6368; }

/* ===== Table view ===== */
.file-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    overflow: hidden;
}

.file-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    border-bottom: 1px solid #ebebeb;
}

.file-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.file-table tr:hover td { background: #f8f9fa; }

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon-sm {
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.row-actions button {
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 14px;
}

.row-actions button:hover { background: #e8eaed; }
.row-actions button.danger { color: #d93025; }
.row-actions button:disabled { color: #9aa0a6; cursor: not-allowed; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #188038;
    background: #e6f4ea;
    padding: 3px 10px;
    border-radius: 10px;
}

/* ===== Grid view (alt) ===== */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.file-card {
    border: 1px solid #dadce0;
    border-radius: 16px;
    padding: 16px;
    transition: box-shadow .15s;
}

.file-card:hover {
    box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

.file-card .icon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.file-icon {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.3;
}

.file-meta {
    font-size: 12px;
    color: #5f6368;
    display: flex;
    justify-content: space-between;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.card-actions button {
    flex: 1;
    border: 1px solid #dadce0;
    background: #fff;
    border-radius: 14px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #5f6368;
}

.card-actions button:hover { background: #f1f3f4; }
.card-actions button.danger { color: #d93025; }
.card-actions button:disabled { color: #9aa0a6; cursor: not-allowed; }

/* ===== Users view ===== */
.add-user-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    max-width: 500px;
}

.add-user-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    font-size: 14px;
}

.empty-state {
    color: #5f6368;
    font-size: 14px;
    padding: 40px 0;
    text-align: center;
}

/* ===== Drag & drop overlay ===== */
.drop-overlay {
    display: none;
    position: fixed;
    inset: 14px;
    border: 3px dashed #5f6368;
    border-radius: 20px;
    background: rgba(26, 115, 232, .06);
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: none;
}

.drop-overlay.active { display: flex; }

.drop-overlay-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 500;
    color: #5f6368;
    background: #fff;
    padding: 20px 36px;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.drop-overlay-text .msi { font-size: 32px; }

/* ===== Share dialog ===== */
.share-list {
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.share-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: #202124;
}

.share-list-item .msi { font-size: 18px; color: #5f6368; margin-right: 8px; }

.share-list-item .remove-share {
    color: #5f6368;
    cursor: pointer;
    font-size: 16px;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-list-item .remove-share:hover { background: #f1f3f4; }

.share-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-add-row .modal-input { flex: 1; }
.share-add-row .modal-btn { white-space: nowrap; }

.share-btn { color: #5f6368; }
.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #5f6368;
    background: #f1f3f4;
    padding: 3px 10px;
    border-radius: 10px;
}

/* ===== Context menu ===== */
.context-menu {
    position: fixed;
    display: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.15);
    min-width: 240px;
    padding: 6px 0;
    z-index: 300;
}

.context-menu.open { display: block; }

.context-menu .item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 16px;
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.context-menu .item:hover { background: #f1f3f4; }
.context-menu .item.danger { color: #d93025; }
.context-menu .item .msi { font-size: 18px; color: #5f6368; }
.context-menu .item.danger .msi { color: #d93025; }
.context-menu .item.disabled { color: #9aa0a6; cursor: not-allowed; pointer-events: none; }
.context-menu .item.disabled .msi { color: #c4c7c5; }

.context-menu .submenu-arrow { margin-left: auto; font-size: 16px; }

.context-menu .item.has-submenu { position: relative; }
.context-menu .submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -6px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    min-width: 220px;
    padding: 6px 0;
}
.context-menu .item.has-submenu:hover .submenu { display: block; }

.icon-toolbar {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .1s;
}
.file-card:hover .icon-toolbar,
tr:hover .icon-toolbar { opacity: 1; }

.icon-btn {
    border: none;
    background: transparent;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5f6368;
}
.icon-btn:hover { background: #f1f3f4; }
.icon-btn .msi { font-size: 18px; }
.icon-btn.starred .msi { color: #f9ab00; }

.info-rows {
    margin-bottom: 20px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
}
.info-row .label { color: #5f6368; }
.info-row .value { color: #202124; font-weight: 500; text-align: right; word-break: break-all; }

/* ===== Sort dropdown ===== */
.toolbar-row {
    margin-bottom: 20px;
    min-height: 34px;
    display: flex;
    align-items: center;
}

.sort-wrap { position: relative; }

.sort-dir-icon { font-size: 15px; }

.sort-menu {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    min-width: 260px;
    padding: 8px 0;
    z-index: 60;
}

.sortable-col {
    cursor: pointer;
    user-select: none;
}
.sortable-col:hover { color: #202124; }
.col-sort-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 15px;
    vertical-align: middle;
    color: transparent;
}
.col-sort-icon:not(:empty) {
    background: rgba(26,115,232,.12);
    color: #1a73e8;
}
.sort-menu.open { display: block; }

.sort-menu-label {
    font-size: 12px;
    color: #5f6368;
    padding: 8px 16px 4px;
}

.sort-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 14px;
    color: #202124;
    cursor: pointer;
}
.sort-menu-item:hover { background: #f1f3f4; }
.sort-menu-item .check-icon { font-size: 18px; visibility: hidden; color: #5f6368; }
.sort-menu-item.selected .check-icon { visibility: visible; }

/* ===== Selection toolbar ===== */
.selection-toolbar {
    background: #f1f3f4;
    border-radius: 24px;
    padding: 6px 16px;
    gap: 16px;
    width: fit-content;
}

.selection-count { font-size: 14px; color: #202124; font-weight: 500; }

.selection-actions {
    display: flex;
    gap: 2px;
    margin-left: 8px;
}

.select-col { width: 40px; }
.select-col input, .select-checkbox { cursor: pointer; width: 16px; height: 16px; }

.select-checkbox-wrap {
    display: none;
    margin-right: 8px;
}
tr:hover .select-checkbox-wrap,
tr.selected .select-checkbox-wrap,
.file-card:hover .select-checkbox-wrap,
.file-card.selected .select-checkbox-wrap {
    display: inline-flex;
}
tr.selected .icon-row-icon,
.file-card.selected { background: #e8eaed; }
tr.selected { background: #e8f0fe22; }

.grid-select-wrap {
    position: absolute;
    top: 8px; left: 8px;
    display: none;
}
.file-card { position: relative; }
.file-card:hover .grid-select-wrap,
.file-card.selected .grid-select-wrap {
    display: inline-flex;
}

/* ===== Move (folder picker) modal ===== */
.move-modal-box { width: 480px; }

.move-current-loc {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5f6368;
    margin-bottom: 16px;
}

.move-loc-chip {
    background: #f1f3f4;
    border-radius: 14px;
    padding: 4px 12px;
    color: #202124;
    font-weight: 500;
}

.move-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #dadce0;
    margin-bottom: 8px;
}

.move-tab {
    padding: 10px 2px;
    font-size: 14px;
    color: #5f6368;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.move-tab.active { color: #5f6368; border-bottom-color: #5f6368; font-weight: 500; }

.move-picker-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #5f6368;
    padding: 8px 0;
    flex-wrap: wrap;
}
.move-picker-breadcrumbs .crumb { cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.move-picker-breadcrumbs .crumb:hover { background: #f1f3f4; }
.move-picker-breadcrumbs .sep { color: #dadce0; }

.move-picker-list {
    height: 260px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.move-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
}
.move-picker-item:hover { background: #f1f3f4; }
.move-picker-item.current { background: #e8eaed; cursor: default; }
.move-picker-item .msi { color: #5f6368; }
.move-picker-empty { color: #5f6368; font-size: 13px; padding: 20px 8px; text-align: center; }

/* ===== Long filenames never overflow the row ===== */
.file-name-cell { min-width: 0; }
.file-name-cell > span:first-of-type {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

/* ===== Mobile menu button & sidebar backdrop ===== */
.menu-btn {
    display: none;
    border: none;
    background: transparent;
    width: 40px; height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 4px;
}
.menu-btn:hover { background: #f1f3f4; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(32,33,36,.5);
    z-index: 150;
}
.sidebar-backdrop.open { display: block; }

/* ===== Responsive: tablet & phone ===== */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: 280px;
        max-width: 82vw;
        background: #fff;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,.15);
        overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }

    .menu-btn { display: flex; }

    .main { padding: 14px 14px 28px; min-width: 0; }

    .topbar { justify-content: flex-start; gap: 4px; margin-bottom: 16px; }

    .user-avatar { position: static; margin-left: auto; }
}

@media (max-width: 640px) {
    #fileTable th:nth-child(3), #fileTable td:nth-child(3),
    #fileTable th:nth-child(5), #fileTable td:nth-child(5),
    #fileTable th:nth-child(6), #fileTable td:nth-child(6) {
        display: none;
    }

    .file-table { font-size: 13px; }
    .file-table th, .file-table td { padding: 8px 6px; }

    #fileTable { table-layout: fixed; width: 100%; }
    #fileTable th:nth-child(1), #fileTable td:nth-child(1) { width: 34px; }
    #fileTable th:nth-child(4), #fileTable td:nth-child(4) { width: 62px; }
    #fileTable th:last-child, #fileTable td:last-child { width: 40px; }

    /* Доступно мне / Пользователи: колонок меньше, чекбокса нет — просто прячем второстепенные и даём переносить текст */
    #sharedTable th:nth-child(2), #sharedTable td:nth-child(2),
    #sharedTable th:nth-child(4), #sharedTable td:nth-child(4) {
        display: none;
    }
    #sharedTable, #usersTable { table-layout: auto; width: 100%; }
    #sharedTable td, #usersTable td, #sharedTable th, #usersTable th {
        white-space: normal;
        word-break: break-word;
    }

    .add-user-form { flex-wrap: wrap; }
    .add-user-form input { min-width: 0; flex-basis: 140px; }

    .icon-toolbar { display: none; }
    .icon-btn.more-btn { width: 36px; height: 36px; }

    .section-header { flex-wrap: wrap; gap: 8px; }
    .header-actions { flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
    .sort-btn-label { display: none; }
    #sortToggleBtn { padding: 8px; }
    .sort-menu { right: -8px; max-width: calc(100vw - 24px); }
    .move-picker-list, .info-rows { max-width: 100%; }

    .modal-box { padding: 18px 16px 14px; }
    .modal-input, .search-input-editable { font-size: 16px; }

    .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .file-card { padding: 10px; }

    .login-card { padding: 32px 20px 24px; }

    .context-menu { min-width: 220px; max-width: 88vw; }

    .selection-count { font-size: 13px; }
}

body { overflow-x: hidden; }

/* ===== Панель управления сервером (TrueNAS-style, в палитре сайта) ===== */
.admin-app {
    display: flex;
    height: 100vh;
    background: #f8f9fa;
}

.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #ebebeb;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 12px;
}
.admin-logo { width: 32px; height: 32px; object-fit: contain; }
.admin-brand-title { font-size: 15px; font-weight: 500; color: #202124; }
.admin-brand-sub { font-size: 12px; color: #5f6368; }

.admin-nav { flex: 1; padding: 0 12px; }

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
    margin-bottom: 2px;
    transition: background .12s;
}
.admin-nav-item .msi { font-size: 20px; color: #5f6368; }
.admin-nav-item:hover:not(.active) { background: #f1f3f4; }
.admin-nav-item.active {
    background: #e8eaed;
    color: #202124;
    font-weight: 500;
}
.admin-nav-item.active .msi { color: #202124; }

.admin-sidebar-footer { padding: 12px 20px 0; border-top: 1px solid #ebebeb; }
.admin-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5f6368;
    text-decoration: none;
    padding-top: 12px;
}
.admin-back-link:hover { color: #202124; }
.admin-back-link .msi { font-size: 18px; }

.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-section-title {
    font-size: 20px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 24px;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.admin-card {
    background: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 18px 20px;
}
.admin-card-label { font-size: 12px; color: #5f6368; margin-bottom: 8px; }
.admin-card-value { font-size: 18px; font-weight: 500; color: #202124; }

.admin-progress {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}
.admin-progress-fill {
    height: 100%;
    width: 0%;
    background: #5f6368;
    transition: width .3s;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    overflow: hidden;
}
.admin-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    border-bottom: 1px solid #ebebeb;
    background: #fafbfc;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8f9fa; }

.admin-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}
.admin-status-badge.running { color: #188038; background: #e6f4ea; }
.admin-status-badge.stopped { color: #9aa0a6; background: #f1f3f4; }
.admin-status-badge.warning { color: #b3261e; background: #fce8e6; }

.admin-table-subtext { font-size: 11px; color: #9aa0a6; margin-top: 2px; }

/* Список контейнеров по группам (05.09.2026, замена <table> - см.
   комментарий у containerRowEl() в admin.js за причиной: 4-колоночная
   таблица на узкой ширине панели теряла колонки вместо того чтобы
   сжаться). Внешняя карточка визуально та же, что у .admin-table
   (белая, скруглённая, тонкая рамка) - меняется только раскладка
   строки внутри (flex вместо table-row), она сама переносится/сжимается
   на любой ширине без магии с колонками. */
.containers-group-list {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    overflow: hidden;
}
.containers-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid #f1f3f4;
    flex-wrap: wrap;
}
.containers-row:last-child { border-bottom: none; }
.containers-row:hover { background: #f8f9fa; }
.containers-row-name { min-width: 0; font-size: 14px; }
.containers-row-name .name-id { color: #9aa0a6; margin-right: 8px; font-variant-numeric: tabular-nums; }
.containers-row-name .name-main { color: #202124; }
.containers-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.admin-perm-summary { display: block; font-size: 11px; color: #9aa0a6; margin-bottom: 4px; white-space: nowrap; }

/* ===== Пользователи: заголовок, статистика, аватары (01.09.2026) ===== */
.accounts-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.accounts-stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.accounts-stat {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 14px;
    padding: 14px 18px;
}
.accounts-stat-value { font-size: 24px; font-weight: 600; color: #202124; line-height: 1.2; }
.accounts-stat-label { font-size: 12px; color: #5f6368; margin-top: 2px; }
.accounts-stat.accent .accounts-stat-value { color: #8430ce; }
.accounts-stat.warn .accounts-stat-value { color: #d93025; }

.acc-username-cell { display: flex; align-items: center; gap: 12px; }
.acc-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.acc-quota-wrap { min-width: 120px; }
.acc-quota-text { font-size: 12px; color: #5f6368; margin-bottom: 4px; white-space: nowrap; }
.acc-quota-bar { height: 5px; background: #eee; border-radius: 3px; overflow: hidden; }
.acc-quota-bar-fill { height: 100%; background: #1a73e8; border-radius: 3px; transition: width .3s; }
.acc-quota-bar-fill.warn { background: #f9ab00; }
.acc-quota-bar-fill.hot { background: #d93025; }

.admin-table-accounts tr:hover td { background: #f8f9fa; }

@media (max-width: 700px) {
    .accounts-stat { min-width: 45%; }
}

.admin-linkout-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 24px;
    max-width: 640px;
}
.admin-linkout-card .msi { color: #5f6368; }
.admin-linkout-title { font-size: 16px; font-weight: 500; color: #202124; }
.admin-linkout-desc { font-size: 13px; color: #5f6368; margin-top: 4px; }
.admin-linkout-card .modal-btn { margin-left: auto; background: #5f6368; color: #fff; }
.admin-linkout-card .modal-btn:hover { background: #3c4043; }

.admin-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.admin-service-card {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    transition: box-shadow .15s;
}
.admin-service-dot {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #dadce0;
}
.admin-service-dot.online { background: #34a853; }
.admin-service-dot.offline { background: #d93025; }
.admin-service-card:hover { box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); }
.admin-service-card .msi { font-size: 26px; color: #5f6368; }
.admin-service-card-static { cursor: default; }
.admin-service-card-static:hover { box-shadow: none; }
.admin-service-name { font-size: 15px; font-weight: 500; color: #202124; margin-top: 10px; }
.admin-service-desc { font-size: 12px; color: #5f6368; margin-top: 4px; }

/* Кнопка меню/закрытия и подложка - в разметке всегда, но видны/активны
   только на узких экранах (тот же паттерн выдвижной панели, что и в
   Betmark: .mobile-open переключает display, без плавной анимации). */
.admin-mobile-toolbar { display: none; margin-bottom: 16px; }
.admin-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    background: #fff;
    color: #202124;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.admin-mobile-close { display: none; }
.admin-mobile-backdrop { display: none; }

@media (max-width: 900px) {
    .admin-mobile-toolbar { display: flex; }
    .admin-mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: none;
        border: none;
        color: #5f6368;
        cursor: pointer;
        padding: 4px;
    }
    .admin-sidebar {
        display: none;
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 200;
        box-shadow: 2px 0 12px rgba(0,0,0,.15);
    }
    .admin-sidebar.mobile-open { display: flex; }
    .admin-mobile-backdrop.active {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 190;
    }
    .admin-main { padding: 20px; }
}

/* ===== Дашборд в стиле TrueNAS (серая палитра сайта) ===== */
.tn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.tn-card {
    background: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}
.tn-card-center {
    align-items: center;
    justify-content: center;
    text-align: center;
}
.tn-card-title {
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 14px;
    align-self: flex-start;
}
.tn-card-center .tn-card-title { align-self: center; }

.tn-card-sysinfo .tn-card-head {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.tn-sysinfo-logo { width: 44px; height: 44px; object-fit: contain; opacity: .85; }
.tn-sysinfo-rows { display: flex; flex-direction: column; gap: 10px; }
.tn-sysinfo-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #3c4043;
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 8px;
}
.tn-sysinfo-row:last-child { border-bottom: none; padding-bottom: 0; }
.tn-sysinfo-row span:first-child { color: #5f6368; flex-shrink: 0; margin-right: 10px; }
.tn-sysinfo-row span:last-child { font-weight: 500; color: #202124; text-align: right; overflow-wrap: anywhere; }

/* Строки с длинными подписями (название контейнера + цифры трафика) не
   влезают в space-between .tn-sysinfo-row на узкой карточке - подпись и
   значение начинали ломаться посимвольно и вылезать за карточку (жалоба
   пользователя 02.09.2026, скриншот). Тут название и значение идут одно
   под другим на всю ширину карточки, а не бок о бок. */
.tn-traffic-rows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 28px;
}
.tn-traffic-row { border-bottom: 1px solid #f1f3f4; padding-bottom: 8px; }
.tn-traffic-row:last-child { border-bottom: none; padding-bottom: 0; }
.tn-traffic-name { font-size: 13px; color: #3c4043; }
.tn-traffic-value { font-size: 12px; color: #5f6368; margin-top: 2px; }

.tn-card-span2 { grid-column: span 2; }
@media (max-width: 700px) {
    .tn-card-span2 { grid-column: span 1; }
}

/* Круговой gauge / donut через SVG stroke-dasharray */
.tn-gauge, .tn-donut {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
}
.tn-gauge svg, .tn-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tn-gauge-track {
    fill: none;
    stroke: #ebebeb;
    stroke-width: 10;
}
.tn-gauge-fill {
    fill: none;
    stroke: #5f6368;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset .5s, stroke .3s;
}
.tn-gauge-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 500;
    color: #202124;
}
.tn-gauge-sub { font-size: 12px; color: #5f6368; margin-top: 2px; }
.tn-stat-number { font-size: 32px; font-weight: 500; color: #202124; }

.tn-card-wide { grid-column: 1 / -1; }
.temp-sensor-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 8px; }
.temp-sensor-group-title { font-size: 12px; font-weight: 600; color: #5f6368; margin-bottom: 8px; }
.temp-sensor-single-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #f1f3f4;
    font-size: 13px;
    color: #3c4043;
}
.temp-sensor-single-row .admin-table-subtext { margin-top: 2px; }
.tn-quicklinks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.tn-quicklink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #ebebeb;
    background: #fff;
    color: #3c4043;
    text-decoration: none;
    font-size: 13px;
    transition: box-shadow .15s, transform .15s;
}
.tn-quicklink:hover { box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); transform: translateY(-1px); }
.tn-quicklink .msi { font-size: 18px; color: #5f6368; }
.tn-quickaction { font-family: inherit; font-size: 13px; cursor: pointer; }
.tn-quickaction:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }

.tn-cpu-model {
    font-size: 15px;
    font-weight: 500;
    color: #202124;
    line-height: 1.4;
    margin-bottom: 6px;
}

/* Тонкие столбчатые графики (ядра CPU / температура) */
.tn-bars-wrap { flex: 1; display: flex; gap: 6px; min-height: 90px; }
.tn-bars-scale {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    min-width: 22px;
    font-size: 9px;
    color: #9aa0a6;
    text-align: right;
    line-height: 1;
}
.tn-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 1px;
    overflow: hidden;
    background-image: repeating-linear-gradient(
        to top, transparent 0, transparent calc(25% - 1px), #eee calc(25% - 1px), #eee 25%
    );
}
.tn-bar {
    flex: 1;
    min-width: 0;
    border-radius: 2px 2px 0 0;
    background: #5f6368;
    transition: height .4s;
}
.tn-bar.tn-bar-warm { background: #f9ab00; }
.tn-bar.tn-bar-hot { background: #d93025; }
.tn-bars-summary { font-size: 11px; color: #9aa0a6; margin-top: 8px; }

/* Текстовый список загрузки по ядрам (03.09.2026) - заменили столбчатую
   диаграмму по просьбе пользователя ("убери график, сделай текстом") -
   на многоядерных хостах бары были мелкими и нечитаемыми, простой список
   значений компактнее и понятнее. */
/* 3 колонки, заполняется сверху вниз по каждой (column-count, не grid).
   Раз теперь на странице максимум CORE_PAGE_SIZE ядер (см. admin.js -
   постранично, "система страниц"), обратно комфортный размер шрифта/
   отступов вместо максимально плотного - 80 ядер разом больше не нужно
   втискивать в одну карточку. min-height держит высоту карточки
   одинаковой на всех страницах (на последней странице ядер меньше),
   чтобы пагинация не прыгала по высоте. */
.tn-core-list {
    column-count: 3;
    column-gap: 20px;
    min-height: 140px;
}
.tn-core-item {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 12.5px;
    color: #5f6368;
    padding: 1px 0;
    break-inside: avoid;
}
.tn-core-item .tn-core-value { font-weight: 600; color: #202124; }
.tn-core-item.tn-core-warm .tn-core-value { color: #f9ab00; }
.tn-core-item.tn-core-hot .tn-core-value { color: #d93025; }

/* Пагинация "Загрузка по ядрам" (03.09.2026, "система страниц, на
   каждой странице будут ядра"). */
.tn-core-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}
.tn-core-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #fff;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
}
.tn-core-page-btn .msi { font-size: 18px; }
.tn-core-page-btn:hover:not(:disabled) { background: #f1f3f4; }
.tn-core-page-btn:disabled { opacity: .35; cursor: default; }
.tn-core-page-label { font-size: 12px; color: #5f6368; min-width: 50px; text-align: center; }

/* ===== Гейджи спидтеста (портировано 1:1 из speedtest.html, только
   режим "Сервер" - см. тот файл для полного описания/атрибуции librespeed) ===== */
#section-network {
    --gauge-width: 172px;
    --gauge-height: 120px;
    --progress-width: 3.5px;
    --speed-width: 17px;
    --gauge-bg: #e5e7eb;
    --st-dl: #6366f1;
    --st-ul: #ec4899;
}
.st-mini-row { display: flex; gap: 10px; margin-bottom: 4px; }
.st-mini-tile { flex: 1; background: #f8f9fb; border-radius: 14px; padding: 10px 8px; text-align: center; }
.st-mini-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9aa0a6; }
.st-mini-value { font-size: 19px; font-weight: 800; color: #1f2430; margin-top: 2px; font-variant-numeric: tabular-nums; transition: color .2s ease-out; }
.st-mini-value.dim { color: #d1d5db; }
.st-mini-unit { font-size: 10px; color: #9aa0a6; font-weight: 600; }

.gauge-layout { display: flex; justify-content: center; gap: 24px; margin-top: 6px; }

div.gauge {
    position: relative;
    transform: scale(1);
    flex-shrink: 0;
    width: var(--gauge-width);
    height: var(--gauge-height);
}
div.gauge > .progress,
div.gauge > .speed {
    position: absolute;
    top: 0; left: 0;
    width: var(--gauge-width);
    height: calc(var(--gauge-width) / 2);
    overflow: hidden;
}
div.gauge > .progress::before,
div.gauge > .progress::after,
div.gauge > .speed::before,
div.gauge > .speed::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}
div.gauge > .progress::before,
div.gauge > .progress::after {
    top: 0; left: 0;
    width: var(--gauge-width);
    height: calc(var(--gauge-width) / 2);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    border: var(--progress-width) solid var(--gauge-bg);
    border-bottom: 0;
    transform-origin: bottom center;
    transform: rotate(var(--progress-rotation, 0deg));
    transition: transform .2s linear;
}
div.gauge > .progress::after {
    top: calc(var(--gauge-width) / 2);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    border-bottom: var(--progress-width) solid var(--gauge-bg);
    border-top: 0;
    transform-origin: top center;
}
div.gauge > .speed::before,
div.gauge > .speed::after {
    transform: rotate(var(--speed-rotation, 0deg));
    transition: transform .2s ease;
    transition-timing-function: cubic-bezier(.56,.04,.59,.91);
}
div.gauge > .speed::before {
    position: absolute;
    top: calc(var(--gauge-width) / 2 - var(--speed-width) / 3);
    left: var(--progress-width);
    width: 0; height: 0;
    border-top: calc(var(--speed-width) / 3) solid transparent;
    border-bottom: calc(var(--speed-width) / 3) solid transparent;
    border-right: calc(var(--speed-width) * 0.97) solid var(--gauge-bg);
    z-index: 1;
    transform-origin: calc(var(--gauge-width) / 2 - var(--progress-width)) calc(var(--speed-width) / 3);
}
div.gauge > .speed::after {
    top: calc(var(--gauge-width) / 2);
    left: calc(var(--progress-width) - 1px);
    width: calc(var(--gauge-width) - var(--progress-width) * 2 + 2px);
    height: calc(var(--gauge-width) / 2 - var(--progress-width) + 1px);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    border: var(--speed-width) solid var(--gauge-bg);
    border-top: 0;
    transform-origin: top center;
}
div.gauge > .progress::after,
div.gauge > .speed::before,
div.gauge > .speed::after {
    transition: transform .2s ease, border-color .2s ease-out;
}
div.gauge.enabled.download > .progress::after { border-color: var(--st-dl); }
div.gauge.enabled.download > .speed::before { border-right-color: var(--st-dl); }
div.gauge.enabled.download > .speed::after { border-color: var(--st-dl); }
div.gauge.enabled.upload > .progress::after { border-color: var(--st-ul); }
div.gauge.enabled.upload > .speed::before { border-right-color: var(--st-ul); }
div.gauge.enabled.upload > .speed::after { border-color: var(--st-ul); }

div.gauge > h1, div.gauge > h2 {
    display: block;
    position: absolute;
    width: 100%;
    text-align: center;
}
div.gauge > h1 {
    bottom: calc(var(--gauge-height) - var(--gauge-width) / 2);
    font-size: 13px;
    font-weight: 600;
    color: #d1d5db;
    margin: 0;
}
div.gauge > h1 > span {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #d1d5db;
    font-variant-numeric: tabular-nums;
    transition: color .2s ease-out;
}
div.gauge.enabled > h1 > span { color: #1f2430; }
div.gauge > h2 {
    bottom: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #9aa0a6;
    margin: 0;
}
.st-status { margin-top: 14px; font-size: 13px; color: #6b7280; min-height: 18px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    div.gauge > .progress::after,
    div.gauge > .speed::before,
    div.gauge > .speed::after {
        transition: border-color .2s ease-out;
    }
}

.tn-storage-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; color: #202124; margin-bottom: 10px; }
.tn-storage-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 12px; color: #5f6368; }
.tn-storage-rows span.hl { color: #202124; font-weight: 500; }

@media (max-width: 700px) {
    .tn-grid { grid-template-columns: 1fr; }
}

/* ===== Расширение панели: контейнеры/хранилище/мониторинг/сеть ===== */
.admin-subsection-title {
    font-size: 15px;
    font-weight: 500;
    color: #202124;
    margin: 28px 0 14px;
}

/* Сворачиваемые блоки (05.09.2026, по прямой просьбе "журнал хоста и
   ошибки можно должно быть свернуть чтобы не мешали") - нативный
   <details>/<summary>, без своего JS на открытие/закрытие. Свёрнуты по
   умолчанию (нет атрибута open) - это самые длинные блоки на вкладке
   "Система", раскрытые всегда мешали бы читать то, что ниже. */
.admin-collapsible { margin: 28px 0 14px; }
.admin-collapsible summary.admin-subsection-title {
    margin: 0;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}
.admin-collapsible summary::-webkit-details-marker { display: none; }
.admin-collapsible summary::before {
    content: 'chevron_right';
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
    line-height: 1;
    color: #9aa0a6;
    transition: transform .15s ease;
    flex: 0 0 auto;
}
.admin-collapsible[open] summary::before { transform: rotate(90deg); }
.admin-collapsible summary:hover { color: #1a73e8; }
.admin-collapsible summary:hover::before { color: #1a73e8; }
.admin-collapsible-hint { margin-left: auto; font-weight: 400; }
.admin-collapsible-body { padding-top: 14px; }

/* Модальное окно настроек контейнера */
.admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, .5);
    z-index: 300;
    align-items: center;
    justify-content: center;
}
.admin-modal-overlay.active { display: flex; }
.admin-modal {
    background: #fff;
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-modal-wide { width: 480px; }
.admin-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ebebeb;
}
.admin-modal-title { font-size: 15px; font-weight: 500; color: #202124; }
.admin-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }

.acc-form-section { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid #f1f3f4; }
.acc-form-section:first-child { padding-top: 0; border-top: none; }
.acc-form-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #5f6368;
    margin-bottom: 10px;
}
.acc-form-section-title .msi { font-size: 16px; }
.admin-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #ebebeb;
}

.admin-field-label { font-size: 12px; color: #5f6368; margin-top: 12px; }
.admin-field-input {
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    margin-top: 4px;
    color: #202124;
}
.admin-field-input:focus { outline: none; border-color: #5f6368; }
.admin-field-input-inline { margin-top: 0; }

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    font-size: 13px;
    color: #3c4043;
}

/* Тумблер (switch) */
.admin-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.admin-switch input { opacity: 0; width: 0; height: 0; }
.admin-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #dadce0;
    border-radius: 22px;
    transition: background .15s;
}
.admin-switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s;
}
.admin-switch input:checked + .admin-switch-slider { background: #188038; }
.admin-switch input:checked + .admin-switch-slider::before { transform: translateX(18px); }

.admin-perm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
    margin-top: 6px;
}
.admin-perm-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3c4043;
    cursor: pointer;
}
.admin-perm-grid input[type="checkbox"] { flex-shrink: 0; }

/* Снапшоты ZFS */
.admin-snapshot-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.admin-select {
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    color: #202124;
    background: #fff;
}
.admin-snapshot-toolbar .admin-field-input-inline { flex: 1; min-width: 200px; }

/* Графики истории (мониторинг) */
.admin-chart-range { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-range-btn {
    font-family: inherit;
    font-size: 13px;
    padding: 7px 16px;
    border: 1px solid #dadce0;
    border-radius: 20px;
    background: #fff;
    color: #5f6368;
    cursor: pointer;
    transition: all .12s;
}
.admin-range-btn:hover { background: #f8f9fa; }
.admin-range-btn.active { background: #202124; color: #fff; border-color: #202124; }

.tn-stats-now-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 18px 24px;
}
.tn-stats-now-label { font-size: 11px; color: #9aa0a6; margin-bottom: 4px; }
.tn-stats-now-value { font-size: 22px; font-weight: 600; color: #202124; }

.tn-card-chart { min-height: 260px; }
.tn-card-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}
.tn-card-chart-head .tn-card-title { margin-bottom: 0; }
.tn-chart-current {
    font-size: 20px;
    font-weight: 600;
    color: #202124;
    white-space: nowrap;
    flex-shrink: 0;
}
.tn-chart-current-unit { font-size: 12px; font-weight: 500; color: #9aa0a6; margin-left: 2px; }
.tn-chart { width: 100%; height: 220px; }
.tn-grid-charts { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 700px) {
    .tn-grid-charts { grid-template-columns: 1fr; }
}

/* Снапшоты контейнера внутри модалки */
.admin-subsection-title-tight { margin: 18px 0 10px; font-size: 13px; }
.admin-ct-snapshot-list { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; }
.admin-ct-snapshot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #202124;
}
.admin-ct-snapshot-empty { font-size: 12px; color: #9aa0a6; padding: 6px 0; }

/* Обновления системы */
.admin-updates-summary { font-size: 14px; margin-bottom: 12px; }
.admin-updates-ok { color: #188038; }
.admin-updates-count { color: #f9ab00; font-weight: 500; }
.admin-updates-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.admin-updates-item {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: #f1f3f4;
    color: #3c4043;
    padding: 4px 10px;
    border-radius: 8px;
}

/* Журнал хоста */
.admin-syslog-toolbar { margin-bottom: 10px; }
.admin-syslog-viewer {
    background: #202124;
    color: #e8eaed;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    padding: 14px 16px;
    border-radius: 12px;
    max-height: 360px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Терминал */
.admin-terminal-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #b93815;
    background: #fef7f0;
    border: 1px solid #fce1d0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.admin-terminal-warning .msi { font-size: 18px; }
.admin-terminal-wrap {
    background: #202124;
    border-radius: 12px;
    padding: 10px;
    height: 60vh;
    min-height: 360px;
}
#terminalContainer { width: 100%; height: 100%; }

/* Безопасность: 2FA (Google Authenticator) */
.admin-2fa-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 16px;
    padding: 20px;
    max-width: 420px;
}
.admin-2fa-status { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-2fa-status .msi { font-size: 30px; }
.admin-2fa-status-title { font-size: 15px; font-weight: 500; color: #202124; }
.admin-2fa-status-desc { font-size: 12px; color: #5f6368; margin-top: 2px; }
.admin-2fa-hint { font-size: 13px; color: #5f6368; margin: 0 0 14px; line-height: 1.5; }
.admin-2fa-qr { display: flex; justify-content: center; margin-bottom: 14px; }
.admin-2fa-secret {
    font-size: 12px;
    color: #5f6368;
    text-align: center;
    margin-bottom: 14px;
    word-break: break-all;
}
.admin-2fa-secret code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 6px;
    color: #202124;
}

@media (max-width: 700px) {
    .admin-modal { width: 92vw; }
}

/* Домашний прокси: разворачиваемая карточка с деталями ПК */
.proxy-row td { transition: background .12s; }
.proxy-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 26px; }
.proxy-chevron-icon { font-size: 24px; color: #5f6368; }
.proxy-delete-icon {
    font-size: 16px;
    color: #9aa0a6;
    border-radius: 6px;
    padding: 3px;
    cursor: pointer;
}

/* ArchiveBox: вкладка мониторинга снимков контор Betmark (04.09.2026) */
.tn-gauge-sub code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 6px;
    color: #202124;
    font-size: 12px;
}
.ab-site-card { display: flex; flex-direction: column; gap: 10px; }
.ab-site-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ab-site-label { font-size: 16px; font-weight: 500; color: #202124; }
.ab-site-domain { font-size: 12px; color: #5f6368; }
.ab-site-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #5f6368; }
.ab-site-meta b { color: #202124; }
.ab-extractor-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ab-extractor-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #f1f3f4;
    color: #5f6368;
}
.ab-extractor-pill .msi { font-size: 13px; }
.ab-extractor-pill.ok { background: #e6f4ea; color: #188038; }
.ab-extractor-pill.fail { background: #fce8e6; color: #c5221f; }
.ab-extractor-pill.partial { background: #fef7e0; color: #b06000; }
.ab-recent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}
.ab-recent-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
}
.ab-recent-item-time { color: #5f6368; white-space: nowrap; }
.ab-recent-item-title {
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.ab-log {
    background: #202124;
    color: #e8eaed;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    padding: 14px;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.proxy-delete-icon:hover { color: #d93025; background: #fce8e6; }
.proxy-detail-row td { padding: 0 16px 16px; border-bottom: 1px solid #f1f3f4; }
.proxy-detail-card {
    background: #f8f9fa;
    border: 1px solid #ebebeb;
    border-radius: 14px;
    padding: 18px 20px;
}
/* Адрес/логин/пароль - компактно, значение сразу под подписью, а не
   растянуто на всю ширину широкой таблицы (жаловался пользователь -
   "логин и пароль прокси на другой части экрана", 02.09.2026) */
.proxy-conn-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 32px;
    margin-bottom: 16px;
}
.proxy-conn-item { display: flex; flex-direction: column; gap: 3px; }
.proxy-conn-label { font-size: 11px; color: #9aa0a6; }
.proxy-conn-value-row { display: flex; align-items: center; gap: 6px; }
.proxy-conn-value {
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}
.proxy-conn-copy {
    font-size: 15px;
    color: #9aa0a6;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}
.proxy-conn-copy:hover { color: #1a73e8; }
.proxy-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}
.proxy-detail-field .admin-field-label { margin-top: 12px; }
.proxy-detail-field:nth-child(-n+2) .admin-field-label { margin-top: 0; }
.proxy-detail-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #ebebeb;
}
@media (max-width: 700px) {
    .proxy-detail-grid { grid-template-columns: 1fr; }
    .proxy-detail-field .admin-field-label { margin-top: 12px; }
    .proxy-detail-field:first-child .admin-field-label { margin-top: 0; }
    .proxy-detail-actions .modal-btn { width: 100%; justify-content: center; }
}

/* ===== Свой диалог подтверждения вместо системного confirm() (02.09.2026) ===== */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, .5);
    backdrop-filter: blur(2px);
    z-index: 400;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: confirm-overlay-in .15s ease both;
}
.confirm-overlay.active { display: flex; }
.confirm-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 18px;
    padding: 24px 24px 20px;
    box-shadow: 0 20px 50px rgba(32, 33, 36, .25);
    animation: confirm-card-in .2s cubic-bezier(.16,1,.3,1) both;
}
@keyframes confirm-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirm-card-in {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.confirm-title { font-size: 16px; font-weight: 500; color: #202124; margin-bottom: 10px; }
.confirm-message { font-size: 13.5px; color: #5f6368; line-height: 1.5; margin-bottom: 22px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-btn-cancel {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: #5f6368;
    background: none;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    cursor: pointer;
    transition: background .12s;
}
.confirm-btn-cancel:hover { background: #f1f3f4; }
.confirm-btn-danger {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    background: #d93025;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    cursor: pointer;
    transition: background .12s, box-shadow .15s;
}
.confirm-btn-danger:hover { background: #b0261d; box-shadow: 0 4px 12px rgba(217,48,37,.3); }
@media (prefers-reduced-motion: reduce) {
    .confirm-overlay, .confirm-card { animation: none; }
}

/* ===== PWA: safe-area отступы под вырез/чёлку и полосу Home Indicator на
   iPhone (03.09.2026). Только когда сайт открыт как установленное на
   домашний экран приложение (display-mode: standalone) - в обычном Safari
   под этим уже есть адресная строка, дублировать отступ не нужно.
   ⚠️ Было на body (белый фон, --bg аналог) - паддинг padding-top на body
   означает, что зона под вырезом/статус-баром закрашивается ФОНОМ BODY,
   а не фоном самой страницы (.login-wrap - светло-сиреневый градиент,
   .admin-app - #f8f9fa) - на почти белых страницах разница едва заметна,
   но именно она и была видна как полоса (жалоба пользователя 03.09.2026,
   со скриншотом - белая полоса поверх сиреневого градиента). Теперь
   паддинг на каждой обёртке страницы отдельно - её СОБСТВЕННЫЙ фон
   заходит под вырез, а не белый фон body позади неё. .app/.admin-app
   имеют фиксированную height: 100vh, но у * стоит box-sizing: border-box
   (см. выше по файлу) - паддинг просто ужимает контентную область, а не
   переполняет высоту. */
@media (display-mode: standalone) {
    .login-wrap,
    .app,
    .admin-app {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .server-links-row { bottom: calc(24px + env(safe-area-inset-bottom)); }
    .sidebar { padding-top: env(safe-area-inset-top); }
    .admin-sidebar { padding-top: env(safe-area-inset-top); }
}

/* ===== "Нагрузка в моменте" - горизонтальный слайдер + навигация по
   дням (03.09.2026, Мониторинг, по прямой просьбе пользователя
   "горизонтальный тип и стрелочки сверху... дни менять до 10 дней").
   Независимо от диапазона 1ч/6ч/24ч выше - см. /api/admin/history/day,
   loadTimeDialDay/updateTimeDial в admin.js. ===== */
.tn-time-day-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}
.tn-time-day-label {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    min-width: 100px;
    text-align: center;
}
.tn-time-slider-wrap {
    /* touch-action: none - без этого перетаскивание пальцем на телефоне
       скроллит страницу вместо движения ползунка. */
    touch-action: none;
    user-select: none;
    padding: 0 6px;
    max-width: 560px;
    margin: 0 auto;
}
.tn-time-slider-track {
    position: relative;
    height: 8px;
    border-radius: 4px;
    background: #e8eaed;
    cursor: grab;
}
.tn-time-slider-track:active { cursor: grabbing; }
.tn-time-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    border-radius: 4px;
    background: var(--brand-1, #6366f1);
}
.tn-time-slider-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    margin-top: -11px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--brand-1, #6366f1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.tn-time-slider-time {
    text-align: center;
    margin-top: 18px;
    font-size: 15px;
    font-weight: 600;
    color: #202124;
}
/* 2 блока по горизонтали (03.09.2026, по прямой просьбе пользователя) -
   CPU/RAM/Питание/Сеть парами в ряд, вместо одной строки через запятую. */
.tn-time-slider-values {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 24px;
    max-width: 360px;
    margin: 14px auto 0;
}
.tn-time-slider-value-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 13px;
    color: #5f6368;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
}
.tn-time-slider-value-item b { color: #202124; font-size: 15px; }

/* Покрытие топ-лиг Betmark (04.09.2026) - подсветка ячеек контор,
   у которых заметный пробел по конкретной топ-лиге (см. betmarkCoverage*
   в admin.js). */
.bm-gap { color: #c5221f; font-weight: 600; }

/* "Сеть и процессы" (04.09.2026) - компактный текстовый список вместо
   широких таблиц (пользователь: "эта таблица неудобна") - тот же
   принцип, что уже применялся к "Загрузка по ядрам" (.tn-core-list),
   просто 2 колонки вместо 3 (строки тут длиннее - имя контейнера/IP +
   значение). */
.netmon-list { column-count: 2; min-height: 0; }
.netmon-list .tn-core-item { justify-content: space-between; gap: 10px; }
.netmon-list .tn-core-item .tn-core-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.netmon-list .tn-core-item .tn-core-value { white-space: nowrap; }
@media (max-width: 700px) {
    .netmon-list { column-count: 1; }
}

/* ===== Аналитика: резкие скачки + топ процессов (05.09.2026) =====
   По прямой просьбе "заморочься с дизайном чтобы отслеживать резкие
   повышения было очень удобно" - лента "инцидентов" вместо голого
   графика: каждый скачок - отдельная карточка с цветной полосой слева
   (цвет = какая метрика, те же цвета, что и у графиков CPU/памяти/
   питания в "Мониторинг" - green/blue/amber), время, "было X - стало Y",
   и ниже - цветные плашки виновников (процесс + контейнер), кликабельные
   по цвету контейнера через containerColor() в admin.js. */
/* 3 колонки - по метрике на колонку (05.09.2026, по прямой просьбе
   "сделай столбики для cpu ram энергии и в каждой колонке будет писаться
   аномалия по своей сфере") - раньше все скачки шли одной лентой вперемешку,
   приходилось выискивать нужную метрику среди чужих. */
.spike-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.spike-column-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #5f6368;
    text-transform: uppercase; letter-spacing: .03em;
    margin-bottom: 10px;
}
.spike-column-title.spike-cpu { color: #188038; }
.spike-column-title.spike-mem { color: #1a73e8; }
.spike-column-title.spike-power { color: #b06000; }
@media (max-width: 900px) {
    .spike-columns { grid-template-columns: 1fr; }
}
.spike-feed { display: flex; flex-direction: column; gap: 10px; }
/* Карточка упрощена под колонку (было - широкая строка с кружком-иконкой
   и значением в правом углу; при разбивке на 3 узкие колонки, 05.09.2026,
   иконка+название метрики стали не нужны - это уже заголовок колонки,
   см. .spike-column-title выше). */
.spike-event {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-left: 4px solid #9aa0a6;
    border-radius: 8px;
}
.spike-event.spike-cpu { border-left-color: #188038; }
.spike-event.spike-mem { border-left-color: #1a73e8; }
.spike-event.spike-power { border-left-color: #f9ab00; }
.spike-event-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.spike-event-time { font-weight: 600; color: #202124; font-size: 12px; }
.spike-event-value { font-size: 14px; font-weight: 700; color: #202124; white-space: nowrap; }
.spike-event-value .baseline { display: block; text-align: right; font-size: 11px; font-weight: 400; color: #9aa0a6; }
.spike-event-offenders { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.spike-event-offenders .proc-badge { justify-content: space-between; }
.spike-empty { padding: 20px 12px; text-align: center; color: #9aa0a6; background: #fff; border: 1px dashed #ddd; border-radius: 8px; font-size: 13px; }

/* Плашка процесса+контейнера - переиспользуется и в скачках, и в "Топ
   процессов сейчас". Цвет фона зависит от контейнера (containerColor() в
   admin.js, палитра из 10 цветов по остатку от ID) - один контейнер
   ВСЕГДА одного цвета по всей странице, чтобы глаз быстро выхватывал
   "опять этот" при повторных скачках от одного и того же сервиса. */
.proc-badge {
    display: flex; /* было inline-flex - блочная ширина нужна, чтобы
       max-width/overflow ниже реально ограничивали плашку, а не давали
       ей раздуваться по контенту бесконечно */
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    max-width: 100%;
    background: #f1f3f4;
    color: #3c4043;
}
.proc-badge-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.proc-badge b { font-weight: 700; }
/* На узкой ширине длинное "имя процесса · длинное название контейнера"
   раньше просто вылезало за карточку и обрезалось окном (жалоба
   пользователя 05.09.2026, скриншот с телефона - "next-server ·
   Betmark - агрегатор коэффициентов" срезало прямо посреди значения).
   Имя процесса и подпись контейнера теперь могут сжиматься с многоточием
   первыми - а вот САМО ЗНАЧЕНИЕ (проц-badge-value, ради которого вся
   строка) - НИКОГДА, ему принудительно оставлено место (flex-shrink:0). */
.proc-badge-comm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-badge .proc-badge-container { flex: 1 1 auto; min-width: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5f6368; }
.proc-badge-value { flex: 0 0 auto; white-space: nowrap; margin-left: auto; }

/* Палитра переделана (05.09.2026, "не используй похожие цвета, их не
   отличить") - старая была пастельным разбавлением 10 цветов, из-за
   чего несколько пар почти слились (два зелёных 1/9, синий и лавандовый
   0/8, красный и розовый 3/6). Новая - на основе Tableau10, набора,
   специально спроектированного для МАКСИМАЛЬНОЙ различимости соседних
   категорий (разнесены по кругу через жёлтый/бирюзу/коричневый, а не
   только через "стандартные" красный/зелёный/синий/фиолетовый). */
.container-color-0 { background: #e3ecf4; } .container-color-0-dot { background: #4e79a7; } /* синий */
.container-color-1 { background: #fdecd9; } .container-color-1-dot { background: #f28e2b; } /* оранжевый */
.container-color-2 { background: #fbe2e2; } .container-color-2-dot { background: #e15759; } /* красный */
.container-color-3 { background: #e6f3f2; } .container-color-3-dot { background: #109a91; } /* бирюзовый */
.container-color-4 { background: #e5f2e4; } .container-color-4-dot { background: #59a14f; } /* зелёный */
.container-color-5 { background: #fdf6d3; } .container-color-5-dot { background: #cbb400; } /* жёлтый (затемнён для контраста) */
.container-color-6 { background: #f1e7ee; } .container-color-6-dot { background: #b07aa1; } /* фиолетовый */
.container-color-7 { background: #ffe3e7; } .container-color-7-dot { background: #e85b76; } /* розовый */
.container-color-8 { background: #efe8e4; } .container-color-8-dot { background: #9c6b4f; } /* коричневый */
.container-color-9 { background: #efebe8; } .container-color-9-dot { background: #a3928a; } /* тёплый серо-бежевый */
.container-color-host { background: #eceef0; } .container-color-host-dot { background: #5f6368; } /* тёмно-серый - хост, специально темнее и холоднее слота 9 */

/* "Топ процессов сейчас" - тот же .tn-core-list/.netmon-list, что и везде
   (по устоявшемуся правилу "списки имя+значение - не таблица"), значение
   справа заменено на плашку процесса вместо голого числа. */
#topCpuList .tn-core-item, #topMemList .tn-core-item { justify-content: flex-start; }

/* Легенда цветов контейнеров (05.09.2026, по прямой просьбе "добавь
   расшифровку какой цвет что делает") - собирается на лету из реально
   показанных сейчас контейнеров (см. renderContainerLegend в admin.js),
   не статичный список всех контейнеров сразу - было бы лишним шумом. */
.proc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: #f8f9fa;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    font-size: 12px;
    color: #5f6368;
}
.proc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.proc-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
