:root {
    color-scheme: dark;
    --background: #0c1118;
    --surface: #121a24;
    --surface-raised: #17222f;
    --border: #25303d;
    --text: #ecf1f7;
    --muted: #8897a9;
    --accent: #70ddc5;
    --accent-hover: #91ecd8;
    --danger: #f09496;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    font-size: 14px;
}

html[data-theme="light"] {
    color-scheme: light;
    --background: #f3f6f9;
    --surface: #ffffff;
    --surface-raised: #edf2f7;
    --border: #d2dde6;
    --text: #1e3043;
    --muted: #566c81;
    --accent: #177860;
    --accent-hover: #105e4b;
    --danger: #a83240;
    --primary-text: #ffffff;
    --text-strong: #23374b;
    --text-secondary: #43596e;
    --text-muted: #566c81;
    --accent-text: #176b59;
    --info-text: #26697c;
    --blue-text: #2c62ac;
    --warning-text: #82580d;
    --purple-text: #6c4ba0;
    --error-text: #a83240;
    --solid-surface: #ffffff;
    --button-surface: #f6f8fb;
    --hover-surface: #eaf0f5;
    --field-surface: #ffffff;
    --field-border: #7f94a7;
    --surface-soft: #f6f8fb;
    --sidebar-surface: #ffffff;
    --raised-surface: #edf2f7;
    --accent-surface: #e6f4ef;
    --accent-surface-soft: #f2faf7;
    --accent-surface-strong: #d1ebe1;
    --blue-surface: #e8f0fd;
    --warning-surface: #fff2d9;
    --purple-surface: #f1ebfa;
    --error-surface: #fff0f1;
    --error-hover: #fce0e3;
    --info-surface: #edf6fa;
    --border-soft: #dce4eb;
    --border-control: #b3c1ce;
    --border-hover: #7f94a7;
    --border-purple: #d8c8ed;
    --border-error: #df9da6;
    --border-accent: #78b29f;
    --brand-secondary: #32977e;
    --brand-highlight: #96d9c6;
    --login-glow: #dcf0e9;
    --login-gradient: #eef5f4;
    --shadow-soft: #24425714;
    --shadow-toast: #24425726;
    --shadow-dialog: #17354b33;
    --backdrop: #152b4566;
    --chart-bar: #2d8871;
    --chart-hover: #155d4c;
    --chart-current: #176a55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.5; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
button, a, input, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
button { border: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 650; letter-spacing: .14em; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 16px; border-radius: 7px; border: 1px solid transparent; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s; }
.button-primary { background: var(--accent); color: var(--primary-text, #0b2a24); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-secondary { color: var(--text-secondary, #c5cfdb); background: var(--button-surface, #151e29); border-color: var(--border-control, #2c3949); }
.button-secondary:hover:not(:disabled) { background: var(--hover-surface, #1f2b39); border-color: var(--border-hover, #455669); }
.button-danger { background: var(--error-surface, #51292e); color: var(--error-text, #ffc1c1); border-color: var(--border-error, #76383f); }
.button-danger:hover:not(:disabled) { background: var(--error-hover, #71323a); }
.button-wide { width: 100%; }
.theme-toggle { min-height: 38px; font-size: 12px; }
.theme-toggle svg { width: 17px; height: 17px; }
.sidebar-bottom > .theme-toggle { width: 100%; }
.login-theme-toggle { position: absolute; top: 20px; right: 24px; }
.plus { font-size: 21px; line-height: 16px; font-weight: 400; }
input:not([type="checkbox"]), select { width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--field-border, #2e3c4d); color: var(--text); background: var(--field-surface, #0f1721); transition: border-color .15s; }
input::placeholder { color: var(--text-muted, #65758a); opacity: 1; }
input:not([type="checkbox"]):focus, select:focus { border-color: var(--accent); }
select { padding-right: 30px; cursor: pointer; }
label { display: block; margin: 0 0 8px; color: var(--text-strong, #d0d9e4); font-size: 13px; font-weight: 500; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }
.separator { color: var(--border-control, #344252); padding: 0 9px; }
.brand-mark { display: flex; gap: 4px; align-items: flex-end; height: 37px; margin-bottom: 28px; }
.brand-mark span { display: block; width: 10px; height: 30px; background: var(--accent); border-radius: 3px; }
.brand-mark span:nth-child(2) { height: 20px; background: var(--brand-secondary, #419a89); }
.brand-mark span:nth-child(3) { height: 37px; background: var(--brand-highlight, #a2ecdc); }
.login-view { position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 88px 24px 56px; background: radial-gradient(ellipse at 50% 28%, var(--login-glow, #152e30) 0, var(--login-gradient, #101b24) 27%, var(--background) 66%); }
.login-card { width: min(100%, 440px); border: 1px solid var(--border-control, #2a3a46); background: var(--solid-surface, #121b25); border-radius: 16px; padding: 40px; box-shadow: 0 24px 90px var(--shadow-soft, #0004); }
.login-card h1 { margin: 12px 0 16px; font-size: 33px; line-height: 1.23; letter-spacing: -.04em; font-weight: 650; }
.login-description { color: var(--text-secondary, #9aa9ba); font-size: 14px; line-height: 1.7; margin-bottom: 30px; }
.login-card input { min-height: 47px; }
.login-card .button { margin-top: 18px; min-height: 45px; justify-content: space-between; }
.login-note { font-size: 11px; color: var(--muted); margin-top: 18px; text-align: center; }
.login-footer { color: var(--text-muted, #788ba0); font-size: 11px; margin-top: 26px; display: flex; align-items: center; gap: 8px; }
.app-layout { display: flex; min-height: 100dvh; }
.sidebar { width: 234px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 30px 20px 22px; background: var(--sidebar-surface, #101720); border-right: 1px solid var(--border-soft, #212d3b); z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 4px 42px; }
.brand strong { font-size: 14px; font-weight: 650; letter-spacing: -.025em; }
.brand div > span { display: block; font-size: 10px; color: var(--text-muted, #7e8fa3); margin-top: 2px; }
.brand-mark-small { gap: 3px; height: 27px; margin: 0; flex-shrink: 0; }
.brand-mark-small span { width: 6px; height: 23px; }
.brand-mark-small span:nth-child(2) { height: 16px; }
.brand-mark-small span:nth-child(3) { height: 27px; }
.nav-label { color: var(--text-muted, #5f7186); font-size: 9px; font-weight: 650; letter-spacing: .08em; margin: 0 12px 13px; }
.navigation { display: flex; flex-direction: column; gap: 7px; }
.nav-link { display: flex; align-items: center; gap: 11px; color: var(--text-muted, #93a3b6); padding: 12px; border-radius: 7px; font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.nav-link:hover { color: var(--text-secondary, #c7d5e2); background: var(--hover-surface, #17222e); }
.nav-link.active { color: var(--accent); background: var(--accent-surface, #19312f); border-color: var(--accent-surface-strong, #25453f); }
.nav-count { margin-left: auto; font-size: 10px; font-weight: 600; padding: 1px 6px; min-width: 23px; text-align: center; border-radius: 4px; background: var(--raised-surface, #273443); color: var(--text-muted, #a4b4c7); }
.active .nav-count { background: var(--accent-surface-strong, #254f45); color: var(--accent-text, #a1e9d8); }
.sidebar-bottom { margin-top: auto; }
.workspace-info { margin: 30px 8px 19px; display: flex; align-items: flex-start; gap: 9px; color: var(--text-secondary, #a6b5c6); font-size: 11px; }
.workspace-info .status-dot { margin-top: 5px; }
.workspace-info small { display: block; color: var(--text-muted, #62768d); font-size: 10px; margin-top: 3px; }
.logout-button { display: flex; align-items: center; gap: 9px; color: var(--text-muted, #8295ac); width: 100%; background: transparent; padding: 14px 10px 0; border-top: 1px solid var(--border-soft, #25303e); font-size: 12px; text-align: left; }
.logout-button:hover { color: var(--text); }
.logout-button svg { width: 17px; height: 17px; }
.main-content { width: calc(100% - 234px); margin-left: 234px; padding: 38px 42px 26px; max-width: 1800px; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 29px; }
.page-header .eyebrow { color: var(--text-muted, #6f849d); font-size: 9px; margin-bottom: 9px; }
.page-header h1 { font-size: 30px; font-weight: 650; line-height: 1.25; letter-spacing: -.025em; }
.page-description { color: var(--text-muted, #8597ae); font-size: 12px; margin-top: 8px; }
.header-actions { display: flex; align-items: center; gap: 10px; padding-top: 13px; }
.header-actions .button svg { width: 16px; height: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { position: relative; background: linear-gradient(120deg, var(--solid-surface, #141e2a), var(--surface-soft, #111923)); border: 1px solid var(--border); border-radius: 9px; padding: 18px 20px; overflow: hidden; }
.stat-label { display: block; color: var(--text-secondary, #a3b1c2); font-size: 11px; margin-bottom: 10px; }
.stat-card strong { display: block; font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-detail { display: block; color: var(--text-muted, #6b7e95); font-size: 10px; margin-top: 11px; }
.stat-symbol { position: absolute; right: 18px; top: 18px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-surface, #1d3634); color: var(--accent-text, #7fd2bc); font-size: 21px; line-height: 1; }
.stat-symbol-blue { color: var(--blue-text, #87b7f4); background: var(--blue-surface, #1d2e46); }
.stat-symbol-gold { color: var(--warning-text, #e7c17b); background: var(--warning-surface, #352f26); }
.stat-symbol-purple { color: var(--purple-text, #b3a0e9); background: var(--purple-surface, #2c283e); }
.catalog-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 23px 24px 21px; gap: 20px; }
.panel-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel-heading p { font-size: 11px; color: var(--text-muted, #7e90a6); margin-top: 5px; }
.heading-count { display: inline-block; font-size: 10px; line-height: 1.4; min-width: 24px; padding: 2px 7px; background: var(--raised-surface, #243141); color: var(--text-secondary, #bccbdc); text-align: center; border-radius: 5px; }
.sync-status { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--text-muted, #8398ae); white-space: nowrap; }
.sync-status.is-loading .status-dot { background: var(--warning-text, #e3bf7c); }
.section-tag { font-size: 9px; color: var(--text-muted, #8ea1b7); letter-spacing: .07em; border: 1px solid var(--border-control, #2c3c4e); border-radius: 4px; padding: 4px 7px; white-space: nowrap; }
.filter-bar { display: flex; align-items: center; gap: 12px; padding: 0 24px 22px; }
.filter-bar select { width: 170px; min-height: 37px; padding: 8px 10px; font-size: 11px; color: var(--text-secondary, #b6c5d6); background: var(--field-surface, #151f2a); }
.search-field { position: relative; flex: 1; }
.search-field svg { position: absolute; color: var(--text-muted, #61758d); width: 16px; height: 16px; top: 11px; left: 12px; pointer-events: none; }
.search-field input { min-height: 37px; font-size: 11px; padding: 8px 12px 8px 36px; background: var(--field-surface, #0e1620); }
.table-scroll { position: relative; overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; text-align: left; }
.server-table { min-width: 660px; }
.data-table th { font-size: 10px; font-weight: 500; color: var(--text-muted, #8295ac); background: var(--raised-surface, #17212d); padding: 11px 16px; border-top: 1px solid var(--border-soft, #263241); border-bottom: 1px solid var(--border-soft, #263241); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { padding-left: 24px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 24px; }
.data-table td { padding: 17px 16px; border-bottom: 1px solid var(--border-soft, #212e3c); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--hover-surface, #16212d); }
.endpoint-cell { display: flex; align-items: center; gap: 12px; }
.endpoint-icon { width: 32px; height: 32px; border: 1px solid var(--border-control, #2c3b4c); border-radius: 7px; background: var(--raised-surface, #192633); color: var(--text-muted, #809bb6); display: grid; place-items: center; flex-shrink: 0; }
.endpoint-icon svg { width: 17px; height: 17px; }
.endpoint-text { font-family: "Cascadia Mono", Consolas, monospace; color: var(--text-strong, #d0dce8); font-size: 12px; white-space: nowrap; letter-spacing: -.015em; }
.endpoint-subtitle { display: block; font-size: 9px; margin-top: 3px; color: var(--text-muted, #6a7f98); }
.endpoint-subtitle.dns-warning { color: var(--warning-text, #d4b37d); max-width: 320px; }
.mod-badge { display: inline-block; color: var(--purple-text, #bdb0eb); background: var(--purple-surface, #2c2940); border: 1px solid var(--border-purple, #413857); padding: 3px 9px; border-radius: 5px; font-size: 10px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.visibility-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.visibility-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; white-space: nowrap; color: var(--accent-text, #8eccbe); }
.visibility-badge + .visibility-badge { padding-left: 8px; border-left: 1px solid var(--border-control, #304051); }
.visibility-badge.recommended { color: var(--warning-text, #d6bb83); }
.visibility-badge.hidden-badge { color: var(--text-muted, #6e829a); }
.badge-mark { font-size: 13px; line-height: 1; }
.actions-column { width: 124px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.row-action { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px; border-radius: 5px; border: 1px solid var(--border-control, #2a3b4f); color: var(--text-muted, #8198b2); background: var(--button-surface, #15212e); }
.row-action svg { width: 14px; height: 14px; }
.row-action:hover:not(:disabled) { color: var(--text-secondary, #c1dae9); border-color: var(--border-hover, #4f7289); background: var(--hover-surface, #213548); }
.row-action-delete:hover:not(:disabled) { color: var(--error-text, #f0a3a5); background: var(--error-surface, #39242d); border-color: var(--border-error, #703d48); }
.mod-title { font-weight: 500; color: var(--text-strong, #d1dbe8); overflow-wrap: anywhere; }
.mod-usage { color: var(--text-muted, #8b9fb6); font-variant-numeric: tabular-nums; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text-muted, #6d8299); font-size: 10px; border-top: 1px solid var(--border-soft, #253240); padding: 13px 24px; }
.pagination { display: flex; align-items: center; gap: 12px; }
.pagination button { display: grid; place-items: center; width: 27px; height: 25px; border: 1px solid var(--border-control, #304158); border-radius: 4px; background: var(--button-surface, #1a2735); color: var(--text-secondary, #b2c4d9); }
.pagination button:hover:not(:disabled) { background: var(--hover-surface, #2b3e50); }
.pagination span { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; color: var(--text-muted, #596d85); font-size: 10px; margin: 19px 2px 0; }
.page-footer code { color: var(--text-muted, #7c91a9); margin-left: 5px; font-size: 10px; }
.empty-state { min-height: 255px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 36px 24px; border-top: 1px solid var(--border-soft, #253240); }
.empty-icon { display: grid; place-items: center; width: 45px; height: 45px; border: 1px solid var(--border-control, #324859); background: var(--raised-surface, #1c2c38); border-radius: 11px; font-size: 28px; color: var(--accent-text, #70a4b5); margin-bottom: 16px; }
.empty-state h3 { font-size: 15px; font-weight: 500; }
.empty-state p { color: var(--text-muted, #7f93ac); font-size: 12px; margin-top: 8px; max-width: 350px; }
.empty-state .button { margin-top: 20px; font-size: 12px; min-height: 37px; }
.loader { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-control, #2e4655); border-top-color: var(--accent); animation: spin .8s linear infinite; margin-bottom: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { margin: 0 0 20px; padding: 13px 16px; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 12px; }
.notice-error { color: var(--error-text, #f2b4b5); background: var(--error-surface, #352127); border: 1px solid var(--border-error, #65404a); }
.notice button { color: inherit; background: transparent; font-size: 22px; padding: 0 3px; line-height: 1; }
.form-error { margin-top: 15px; background: var(--error-surface, #36242c); color: var(--error-text, #f1b3b4); border: 1px solid var(--border-error, #6b414b); border-radius: 6px; padding: 10px 12px; font-size: 12px; overflow-wrap: anywhere; }
.editor-dialog { width: min(100% - 32px, 520px); max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid var(--border-control, #38495b); border-radius: 12px; background: var(--solid-surface, #141e2a); color: var(--text); box-shadow: 0 30px 120px var(--shadow-dialog, #0009); }
.editor-dialog::backdrop { background: var(--backdrop, #050a12b8); backdrop-filter: blur(4px); }
.editor-dialog-small { width: min(100% - 32px, 440px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 26px 22px; border-bottom: 1px solid var(--border-soft, #293746); }
.dialog-heading .eyebrow { color: var(--text-muted, #7692a9); font-size: 9px; margin-bottom: 7px; }
.dialog-heading h2 { font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.close-button { background: var(--button-surface, #1c2937); color: var(--text-muted, #8a9eb4); width: 29px; height: 29px; font-size: 23px; border: 1px solid var(--border-control, #314154); border-radius: 5px; line-height: 1; padding-bottom: 2px; flex-shrink: 0; }
.close-button:hover:not(:disabled) { color: var(--text-strong, #dce9f5); }
.dialog-body { padding: 24px 26px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 17px 26px; background: var(--surface-soft, #111b26); border-top: 1px solid var(--border-soft, #293746); }
.field-hint { font-size: 11px; color: var(--text-muted, #8195ad); margin: 8px 0 20px; }
.field-hint:last-of-type { margin-bottom: 0; }
.field-hint-warning { color: var(--warning-text, #e8c48a); }
.required-mark { color: var(--text-muted, #647a93); }
.mono-input { font-family: "Cascadia Mono", Consolas, monospace; }
.list-options { border: 0; padding: 0; margin: 24px 0 0; }
.list-options legend { color: var(--text-strong, #d0d9e4); font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 11px; }
.check-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-control, #2c3d4f); background: var(--surface-soft, #111b26); padding: 14px; border-radius: 7px; cursor: pointer; margin: 0 0 9px; }
.check-card:has(input:checked) { border-color: var(--border-accent, #375e56); background: var(--accent-surface, #172b2b); }
.check-card input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.check-card strong { font-size: 12px; font-weight: 500; }
.check-card small { display: block; font-size: 10px; color: var(--text-muted, #8197ae); margin-top: 3px; }
.check-card-icon { margin-left: auto; font-size: 22px; color: var(--accent-text, #7dc8b5); }
.check-card-icon-gold { color: var(--warning-text, #d6ba7c); }
.confirm-description { color: var(--text-secondary, #a9b9cb); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-line; }
.toast { position: fixed; bottom: 27px; right: 30px; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 40px); background: var(--accent-surface, #19352d); border: 1px solid var(--border-accent, #386956); color: var(--accent-text, #bfedda); border-radius: 8px; padding: 14px 20px; font-size: 12px; box-shadow: 0 10px 35px var(--shadow-toast, #0006); z-index: 10; }
.toast-mark { font-weight: 700; color: var(--accent); }
.noscript-message { position: fixed; left: 20px; right: 20px; top: 20px; text-align: center; padding: 15px; color: var(--error-text, #f9c6be); background: var(--error-surface, #53282f); border: 1px solid var(--border-error, #b1636b); border-radius: 7px; }
.visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.statistics-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.statistics-scope { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.statistics-scope h2 { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.server-statistics-panel { margin-top: 24px; }
.statistics-source-note { color: var(--text-muted, #839aaf); font-size: 11px; line-height: 1.7; margin: 18px 2px; }
.statistics-server-link { color: var(--accent-text, #a6dfcf); background: transparent; padding: 0; text-align: left; font-family: "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.statistics-server-link:hover { text-decoration: underline; }
.activity-stats.server-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-stats.server-metrics .metric-card:last-child { grid-column: auto; }
.period-selector { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-soft, #121c27); border: 1px solid var(--border-control, #283748); border-radius: 8px; }
.period-selector button { padding: 8px 16px; border-radius: 5px; color: var(--text-muted, #879bb2); background: transparent; font-size: 12px; white-space: nowrap; }
.period-selector button:hover { color: var(--text-secondary, #c9e0ea); background: var(--hover-surface, #1b2a3a); }
.period-selector button.active { background: var(--accent-surface-strong, #25453f); color: var(--accent-text, #a0ead8); }
.timezone-label { font-size: 10px; color: var(--text-muted, #8298b0); }
.statistics-period-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--text-secondary, #b1c3d4); font-size: 12px; margin: 0 1px 14px; }
#statistics-updated { color: var(--text-muted, #698198); font-size: 10px; }
.statistics-persistence { display: flex; align-items: center; gap: 8px; color: var(--text-muted, #7f9baf); font-size: 10px; margin: 0 1px 19px; }
.statistics-persistence.persistence-warning { color: var(--warning-text, #d4b37d); }
.statistics-persistence.persistence-warning .status-dot { background: var(--warning-text, #d4b37d); }
.statistics-persistence.persistence-error { color: var(--error-text, #e9a3a5); }
.statistics-persistence.persistence-error .status-dot { background: var(--error-text, #e9a3a5); }
.activity-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric-card { padding: 18px 16px; text-align: left; border-color: var(--border); transition: border-color .15s, background .15s; }
.metric-card:hover { border-color: var(--border-hover, #476075); }
.metric-card.active { border-color: var(--border-accent, #538b7b); background: linear-gradient(120deg, var(--accent-surface, #1a302e), var(--accent-surface-soft, #142327)); }
.metric-card .stat-label { min-height: 32px; max-width: none; margin-bottom: 11px; line-height: 1.45; }
.metric-card strong { font-size: 28px; min-height: 31px; overflow-wrap: anywhere; }
.metric-card strong.long-value { font-size: 18px; }
.metric-card .stat-detail { min-height: 28px; line-height: 1.45; }
.metric-card.active .stat-label { color: var(--accent-text, #a3d6c9); }
.metric-card.active strong { color: var(--accent-text, #c1f1e4); }
.chart-panel { margin-bottom: 18px; }
.chart-container { padding: 0 19px 15px; position: relative; }
#activity-chart { display: block; width: 100%; height: auto; min-height: 220px; stroke: none; }
.chart-grid-line { stroke: var(--border-soft, #293847); stroke-width: 1; stroke-dasharray: 4 5; }
.chart-axis-label { fill: var(--text-muted, #7f96ac); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; }
.chart-bar { fill: var(--chart-bar, #62bda8); stroke: none; transition: fill .15s; }
.chart-bar:hover, .chart-bar:focus { fill: var(--chart-hover, #a2ebd4); outline: none; }
.chart-bar.current-bucket { fill: var(--chart-current, #9bdac6); }
.chart-empty { color: var(--text-muted, #8fa4b9); font-size: 11px; text-align: center; padding: 2px 10px 12px; }
.statistics-note { display: flex; align-items: flex-start; gap: 12px; padding: 15px 17px; margin-bottom: 24px; border: 1px solid var(--border-control, #2d4151); border-radius: 8px; color: var(--text-muted, #8da6bb); background: var(--info-surface, #11202a); font-size: 11px; line-height: 1.7; }
.statistics-note strong { color: var(--text-secondary, #b6cddd); font-weight: 500; }
.statistics-note-icon { color: var(--info-text, #83b8c8); font-size: 24px; line-height: 1; }
.statistics-table { min-width: 720px; font-variant-numeric: tabular-nums; }
.statistics-table th:not(:first-child), .statistics-table td:not(:first-child) { text-align: right; }
.statistics-table td { color: var(--text-secondary, #a5b8cb); font-size: 11px; padding-top: 13px; padding-bottom: 13px; white-space: nowrap; }
.statistics-table td:first-child { color: var(--text-strong, #d0dce8); }
.statistics-table tr.current-bucket td:first-child { color: var(--accent-text, #a4dfcf); }
.statistics-table .current-label { display: block; color: var(--accent-text, #6f9f91); font-size: 9px; margin-top: 3px; }
.statistics-definitions { margin: 22px 2px 0; color: var(--text-muted, #839aaf); font-size: 11px; }
.statistics-definitions summary { cursor: pointer; color: var(--text-secondary, #acc2d3); padding: 6px 0; }
.statistics-definitions dl { display: grid; grid-template-columns: 170px 1fr; gap: 12px 20px; margin: 16px 0 0; max-width: 900px; }
.statistics-definitions dt { color: var(--text-secondary, #afc7d7); }
.statistics-definitions dd { margin: 0; line-height: 1.7; }

@media (min-width: 1680px) {
    .main-content { padding-left: 54px; padding-right: 54px; }
    .stats-grid { gap: 20px; }
}
@media (max-width: 1200px) {
    .sidebar { width: 210px; padding-left: 14px; padding-right: 14px; }
    .main-content { margin-left: 210px; width: calc(100% - 210px); padding: 30px 26px 24px; }
    .header-actions { gap: 7px; }
    .header-actions .button { padding-left: 12px; padding-right: 12px; }
    .stats-grid { gap: 11px; }
    .stat-card { padding: 16px; }
    .stat-symbol { right: 13px; width: 25px; height: 25px; font-size: 19px; }
    .stat-label { max-width: 110px; min-height: 30px; }
    .page-description { max-width: 350px; }
    .filter-bar select { width: 150px; }
    .activity-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric-card .stat-detail { min-height: 0; }
}
@media (max-width: 950px) {
    .page-header { flex-direction: column; align-items: stretch; gap: 16px; }
    .header-actions { padding-top: 0; justify-content: flex-start; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-label { max-width: none; min-height: 0; }
    .filter-bar { flex-wrap: wrap; }
    .search-field { flex-basis: 100%; }
    .filter-bar select { flex: 1; width: auto; }
    .page-footer { flex-direction: column; gap: 5px; }
    .sync-status { display: none; }
    .panel-heading { padding: 20px; }
    .filter-bar { padding-left: 20px; padding-right: 20px; }
    .statistics-toolbar { flex-wrap: wrap; gap: 12px; }
    .statistics-period-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
    .activity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card:last-child { grid-column: 1 / -1; }
    .metric-card .stat-label { min-height: 0; }
}
@media (max-width: 680px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; inset: auto; position: static; padding: 18px 20px 0; border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 17px; }
    .brand { margin: 0; }
    .brand div > span { font-size: 9px; }
    .nav-label, .workspace-info { display: none; }
    .navigation { flex-direction: row; grid-row: 2; grid-column: 1 / -1; gap: 8px; }
    .nav-link { padding: 10px 13px; border-radius: 6px 6px 0 0; gap: 8px; }
    .nav-link svg { width: 17px; height: 17px; }
    .sidebar-bottom { grid-row: 1; grid-column: 2; margin: 0; display: flex; align-items: center; gap: 16px; }
    .sidebar-bottom > .theme-toggle { width: auto; min-height: 0; padding: 4px 0; border: 0; background: transparent; }
    .sidebar-bottom > .theme-toggle [data-theme-label] { display: none; }
    .sidebar-bottom > .theme-toggle svg { width: 22px; height: 22px; }
    .login-theme-toggle { top: 16px; right: 18px; }
    .logout-button { width: auto; border: 0; padding: 4px 0; font-size: 0; }
    .logout-button svg { width: 22px; height: 22px; }
    .main-content { margin: 0; width: 100%; padding: 26px 18px 22px; }
    .page-header { margin-bottom: 23px; gap: 17px; }
    .page-header h1 { font-size: 27px; }
    .page-description { font-size: 11px; }
    .header-actions .button-primary { flex: 1; }
    .stats-grid { margin-bottom: 22px; gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 28px; }
    .stat-symbol { top: 16px; right: 11px; width: 22px; height: 22px; font-size: 17px; }
    .stat-label { font-size: 10px; max-width: 95px; min-height: 28px; }
    .stat-detail { font-size: 9px; }
    .panel-heading { padding: 18px 16px; }
    .panel-heading h2 { font-size: 14px; }
    .panel-heading p { font-size: 10px; }
    .filter-bar { padding: 0 16px 18px; gap: 9px; }
    .filter-bar select { min-width: 0; }
    .panel-footer { padding-left: 16px; padding-right: 16px; font-size: 9px; }
    .server-table { min-width: 0; }
    .server-table thead { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .server-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 17px 16px; border-top: 1px solid var(--border-soft, #263241); }
    .server-table td { display: block; padding: 0 !important; border: 0; }
    .server-table td:nth-child(2) { grid-column: 1; grid-row: 2; }
    .server-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
    .server-table td:nth-child(4) { grid-column: 2; grid-row: 1 / 3; align-self: start; }
    .server-table .endpoint-icon { display: none; }
    .server-table .endpoint-text { font-size: 12px; }
    .server-table .endpoint-subtitle { margin-top: 2px; }
    .server-table .visibility-badges { margin-top: 4px; }
    .mod-table { min-width: 370px; }
    .section-tag { display: none; }
    .toast { bottom: 18px; right: 20px; left: 20px; }
    .dialog-heading { padding: 21px 20px 19px; }
    .dialog-body { padding: 21px 20px; }
    .dialog-actions { padding: 16px 20px; }
    .dialog-heading h2 { font-size: 20px; }
    .login-card { padding: 31px 26px; }
    .login-card h1 { font-size: 30px; }
    .navigation { gap: 3px; overflow-x: auto; min-width: 0; }
    .nav-link { padding: 10px; gap: 6px; font-size: 12px; }
    .nav-count { font-size: 9px; min-width: 18px; padding: 1px 4px; }
    .period-selector { width: 100%; }
    .period-selector button { flex: 1; padding: 8px 10px; font-size: 11px; }
    .statistics-toolbar { margin-bottom: 20px; gap: 9px; }
    .timezone-label { font-size: 9px; }
    .metric-card { padding: 15px; }
    .metric-card strong { font-size: 25px; }
    .metric-card .stat-label { font-size: 11px; min-height: 32px; }
    .metric-card:last-child .stat-label { min-height: 0; }
    .metric-card .stat-detail { font-size: 10px; }
    .activity-stats { gap: 10px; }
    .chart-container { padding: 0 8px 12px; }
    #activity-chart { min-height: 220px; }
    .chart-axis-label { font-size: 10px; }
    .statistics-note { padding: 13px; font-size: 10px; }
    .statistics-definitions dl { grid-template-columns: 1fr; gap: 5px; }
    .statistics-definitions dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
