/* Glacier Circuit: a cool, high-contrast layer over the existing dashboard. */
:root {
    --ink: #153449;
    --muted: #4d6879;
    --line: #cfe1e9;
    --surface: #ffffff;
    --bg: #edf5f9;
    --green: #0a78aa;
    --green-pale: #e4f5fb;
    --amber: #93600e;
    --amber-pale: #fff2d8;
    --nav: #0a2232;
    --focus: #126f9d;
    --shadow: 0 12px 34px rgba(18, 65, 89, .075);
    --glacier-blue: #086a99;
    --glacier-cyan: #75dce9;
    --glacier-deep: #0a2232;
}

body { background: var(--bg); color: var(--ink); font-size: 16px; }
.main-area {
    background:
        radial-gradient(circle at 96% 4%, rgba(117, 220, 233, .18), transparent 28rem),
        linear-gradient(180deg, #f5fbfe 0, var(--bg) 22rem);
}
.sidebar {
    position: sticky;
    isolation: isolate;
    background:
        radial-gradient(circle at 5% 0, rgba(75, 190, 216, .22), transparent 19rem),
        linear-gradient(165deg, #092334 0%, #0a1e2d 60%, #102f42 100%);
    border-right: 1px solid #1d465a;
}
.sidebar::before,
.login-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(126, 216, 232, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(126, 216, 232, .055) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(140deg, #000, transparent 80%);
}
.brand { color: #f1fbff; }
.brand-mark {
    color: #072236;
    background: linear-gradient(145deg, #b6f2f4, #65cde3);
    border: 1px solid rgba(211, 253, 255, .65);
    box-shadow: 0 8px 22px rgba(67, 195, 222, .18);
}
.brand small { color: #a2d7e5; }
.sidebar-label { color: #a3bfce; }
.nav-item { color: #c9dce5; }
.nav-item:hover,
.nav-item.active { background: rgba(114, 217, 232, .13); color: #fff; }
.nav-item.active { box-shadow: inset 3px 0 #73deec; }
.nav-item .nav-label { display: inline; width: auto; font-size: inherit; line-height: inherit; text-align: inherit; }
.mobile-nav-logout { display: none; }
.sidebar-bottom { border-color: #315365; }
.avatar { color: #ddfbff; background: #1d5b73; }
.logout-button { color: #d1e6ec; }
.logout-button:hover { background: rgba(114, 217, 232, .13); color: #fff; }
.sidebar :where(a, button):focus-visible { outline-color: #b9f3f6; }

.topbar {
    background: rgba(248, 252, 254, .94);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9);
}
.topbar h1,
.page-heading h2,
.panel-heading h3,
.settings-heading h3 { color: #10334a; }
.eyebrow,
.section-kicker { color: #0b6d96; }
.topbar-right { color: #456879; }
.mobile-topbar { display: none; }
.page-heading p,
.settings-heading p { color: var(--muted); }

.button {
    border-radius: 11px;
    font-size: 14px;
    transition: background-color .18s ease, box-shadow .18s ease, border-color .18s ease, color .18s ease;
}
.button.primary {
    background: #086b9d;
    color: #fff;
    box-shadow: 0 8px 20px rgba(8, 107, 157, .19);
}
.button.primary:hover { background: #075b86; box-shadow: 0 10px 24px rgba(8, 107, 157, .24); }
.button.secondary { background: #f8fcfe; border-color: #b8d5e2; color: #155575; }
.button.secondary:hover { background: #e7f5fa; border-color: #8abfd2; }
.button:active { box-shadow: inset 0 2px 5px rgba(0, 32, 51, .15); }
.text-link,
.metric-action,
.back-link { color: #075e85; }
.text-link:hover,
.back-link:hover,
.code-link:hover { color: #034d71; }

.metric-card,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.metric-card { position: relative; overflow: hidden; }
.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #0c6d9f, #75dce9 65%, transparent);
}
.metric-card:hover { border-color: #a4ccda; box-shadow: 0 16px 36px rgba(18, 65, 89, .12); }
.metric-card.static-card:hover { box-shadow: var(--shadow); }
.metric-icon.green { color: #086e9e; background: #def3fa; }
.metric-icon.amber { color: #95600b; background: #fff2d8; }
.metric-icon.slate { color: #4c6c80; background: #e9f1f5; }
.metric-label,
.metric-note,
.sales-summary span,
.sales-summary small,
.chart-heading,
.panel-hint { color: var(--muted); }
.metric-label { font-size: 14px; }
.metric-value,
.sales-summary strong { color: #0c354f; font-variant-numeric: tabular-nums; }
.sales-summary { border-color: var(--line); }
.bar-track { background: #e4f0f5; }
.bar-track > div { background: linear-gradient(90deg, #73dce7, #087bab); }
.integration-row,
.run-row { border-color: #e0ebf0; }
.integration-icon,
.settings-icon { color: #0b6f99; background: #e4f3f9; }
.router-heading-copy { flex: 1; min-width: 0; }
.router-latency {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    margin-left: auto;
    padding: 8px 10px;
    border: 1px solid #cfe1e9;
    border-radius: 12px;
    background: #edf5f9;
    color: #49687b;
}
.router-latency-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #8198a6; }
.router-latency-copy { display: grid; gap: 1px; white-space: nowrap; }
.router-latency-caption { font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.router-latency strong { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.25; }
.router-latency[data-state="online"] { color: #0b624d; background: #e1f5ed; border-color: #bde7d2; }
.router-latency[data-state="online"] .router-latency-dot { background: #1c9a71; }
.router-latency[data-state="offline"] { color: #9d443c; background: #fff0ee; border-color: #f0cbc5; }
.router-latency[data-state="offline"] .router-latency-dot { background: #c65f52; }
.chip.good { color: #0b624d; background: #dff5eb; }
.chip.muted { color: #49687b; background: #eaf2f6; }
.sync-highlight { background: #eaf6fa; border: 1px solid #d2e9f0; }
.sync-highlight.is-error { background: #fff1ef; border-color: #f3c9c1; }

.data-table th { background: #edf6fa; color: #3e6275; border-color: #d7e7ee; }
.data-table td { border-color: #e0ebef; color: #35566a; }
.data-table td { font-size: 14px; }
.data-table tbody tr:hover { background: #f0f9fc; }
.code-link { color: #0b5d84; }
.row-arrow { color: #096a96; }
.row-arrow:hover { background: #e1f2f9; }
.mobile-action-label { display: none; }
.status-pill.active { color: #0d694e; background: #def6eb; }
.status-pill.used { color: #87580a; background: #fff0d0; }
.status-pill.expired { color: #455e6e; background: #e8f0f4; }
.pagination-wrap { margin-top: 18px; }
.pagination-wrap .voucher-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.page-summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: nowrap; }
.page-summary strong { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.page-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.pagination-wrap .page-control {
    box-sizing: border-box;
    height: 44px;
    padding: 0 11px;
    border: 1px solid #c8dce6;
    border-radius: 10px;
    background: #f8fcfe;
    color: #17506c;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.page-control:not(.is-current):not(:disabled):hover { border-color: #75b8d2; background: #e9f6fb; color: #075c83; }
.page-control:focus-visible { outline: 3px solid #75dce9; outline-offset: 2px; }
.page-control:disabled { color: #9cb0ba; background: #f4f8fa; border-color: #e0eaf0; cursor: default; }
.page-control.is-current { color: #fff; background: #086b9d; border-color: #086b9d; cursor: default; }
.page-step { display: inline-flex; align-items: center; gap: 7px; padding-inline: 12px; }
.page-step .icon { width: 16px; height: 16px; }
.page-number { min-width: 44px; font-variant-numeric: tabular-nums; }
.page-ellipsis { display: inline-grid; place-items: center; width: 24px; color: var(--muted); font-size: 17px; }
.segmented { background: #e5f0f5; border-color: #c7dce6; }
.segmented a { color: #365f73; }
.segmented a.selected { color: #075c83; background: #fff; }
.info-note { background: #e7f5fa; color: #245e76; border: 1px solid #cee7ee; }
.detail-item.wide { background: #eaf6fa; }
.usage-meter{border:1px solid #c9e4ec;border-radius:13px;background:#ecf8fb;padding:15px}
.usage-meter-heading,.usage-meter-foot{display:flex;justify-content:space-between;align-items:center;gap:12px}
.usage-meter-heading span{color:#4d7184;font-size:12px}
.usage-meter-heading strong{color:#0a4561;font-size:14px}
.usage-track{height:12px;overflow:hidden;background:#d1e3ea;border-radius:100px;margin:13px 0 9px}
.usage-fill{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#0088bd,#36c6d4);min-width:0}
.usage-meter-foot{color:#678798;font-size:11px}
.usage-track-unlimited .usage-fill{width:100%;background:repeating-linear-gradient(110deg,#9edbe8 0 12px,#beeaf1 12px 24px)}
.usage-meter.compact{min-width:130px;border:0;border-radius:0;background:transparent;padding:0}
.usage-meter.compact .usage-meter-heading{display:block}
.usage-meter.compact .usage-meter-heading span{display:none}
.usage-meter.compact .usage-meter-heading strong{font-size:11px;white-space:nowrap}
.usage-meter.compact .usage-track{height:6px;margin:6px 0 0}
.usage-meter.compact .usage-meter-foot{display:none}

.table-toolbar input,
.table-toolbar select,
.field input,
.field textarea,
.field select,
.stack-form input {
    background: #fbfdfe;
    border-color: #bad4df;
    color: #153449;
}
.field label,
.stack-form label,
.toolbar-field label { color: #244e63; }
.field label,
.stack-form label { font-size: 14px; }
.field input,
.field textarea,
.field select,
.stack-form input { font-size: 15px; }
.field input::placeholder,
.field textarea::placeholder,
.stack-form input::placeholder { color: #6c8491; }
.check-row input { accent-color: #086b9d; }
input:focus,
select:focus,
textarea:focus,
:where(input, select, textarea):focus-visible {
    border-color: #0b79a9 !important;
    box-shadow: 0 0 0 4px rgba(73, 188, 216, .22) !important;
}
.form-warning { color: #714b12; background: #fff5e4; border-color: #f1dfbc; }
.field-error {
    display: block;
    margin: -12px 0 14px;
    color: #a44236;
    font-size: 12px;
    font-weight: 700;
}
.stack-form [aria-invalid="true"] { border-color: #c86459; }

.login-body { background: #edf5f9; }
.login-intro {
    isolation: isolate;
    background:
        radial-gradient(circle at 78% 18%, rgba(107, 221, 234, .28), transparent 21rem),
        linear-gradient(148deg, #081d2c 0%, #0c3045 56%, #10536a 100%);
}
.login-intro::before { z-index: 0; mask-image: none; opacity: .65; }
.login-intro .eyebrow.light { color: #b5e9f1; }
.login-intro h1 em { color: #8ce9ef; }
.login-intro p { color: #c9e6ed; }
.login-orbit { border-color: rgba(125, 230, 239, .24); box-shadow: 0 0 50px rgba(65, 196, 221, .1); }
.login-panel {
    background:
        radial-gradient(circle at 100% 0, rgba(105, 215, 233, .22), transparent 22rem),
        #edf5f9;
}
.login-card {
    width: min(100%, 430px);
    padding: clamp(25px, 4vw, 42px);
    background: #fff;
    border: 1px solid #cfe3ec;
    border-radius: 22px;
    box-shadow: 0 26px 70px rgba(17, 66, 91, .12);
}
.login-kicker { color: #096e9b; }
.login-card > p { color: var(--muted); }
.login-foot { color: #506e7f !important; }

.toast-region {
    position: fixed;
    z-index: 1000;
    top: 20px;
    right: 20px;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    display: grid;
    gap: 10px;
    overflow-y: auto;
    pointer-events: none;
}
.toast {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 44px;
    gap: 12px;
    align-items: start;
    pointer-events: auto;
    padding: 14px 10px 14px 16px;
    background: #fff;
    color: #18394c;
    border: 1px solid #cde1e9;
    border-left: 4px solid #0d916c;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(8, 38, 57, .22);
    animation: toast-enter .22s ease-out both;
}
.toast-error { border-left-color: #b94f42; }
.toast-symbol {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: #0c7458;
    background: #e4f6ee;
    font-size: 20px;
    font-weight: 800;
}
.toast-error .toast-symbol { color: #a13b31; background: #fff0ed; }
.toast-symbol .icon { width: 18px; height: 18px; }
.toast-copy { min-width: 0; padding-top: 2px; }
.toast-copy strong { display: block; font-size: 14px; color: #153449; }
.toast-copy p,
.toast-copy ul { margin: 3px 0 0; color: #3f5e6e; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.toast-copy ul { padding-left: 18px; }
.toast-copy li + li { margin-top: 3px; }
.toast-close {
    width: 44px;
    height: 44px;
    margin: -6px -3px 0 0;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #4e6d7d;
    font-size: 25px;
    line-height: 1;
}
.toast-close .icon { width: 18px; height: 18px; }
.toast-close:hover { color: #0d405d; background: #edf5f9; }
.toast.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity .18s ease, transform .18s ease; }
@keyframes toast-enter {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
    .pagination-wrap .voucher-pagination { flex-direction: column; align-items: stretch; }
    .page-summary { text-align: center; }
    .page-controls { justify-content: center; }
}
@media (max-width: 780px) {
    .sidebar { position: relative; }
    .nav-item.active { box-shadow: inset 0 -3px #73deec; }
}
@media (max-width: 620px) {
    .data-table tbody tr:not(.empty-row) { background: #fff; border-color: var(--line); }
    .data-table td { border-color: #e2edf1; }
    .page-step-label, .page-number.is-distant, .page-ellipsis { display: none; }
    .page-controls { gap: 8px; }
    .page-step { padding: 0; }
    .toast-region { top: 12px; right: 12px; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
    .login-card { padding: 26px 22px; }
}
@media (max-width: 540px) {
    .nav-item { font-size: 13px; }
}

/* Phone layout: keep navigation, figures, tables, and controls within the viewport. */
@media (max-width: 620px) {
    .app-shell, .main-area, .page-content, .panel, .settings-panel { min-width: 0; }
    .sidebar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
    .brand { min-width: 0; white-space: normal; }
    .brand > span:last-child { min-width: 0; }
    .brand strong { overflow-wrap: anywhere; }
    .nav-list { gap: 8px; }
    .nav-item {
        min-width: 0;
        min-height: 58px;
        flex-direction: column;
        gap: 3px;
        padding: 7px 3px;
        font-size: 12px;
        line-height: 1.25;
        text-align: center;
        white-space: normal;
    }
    .nav-item .icon { width: 19px; height: 19px; }
    .page-heading, .panel-heading { min-width: 0; }
    .page-heading > div, .panel-heading > div { min-width: 0; }
    .page-heading h2, .panel-heading h3 { overflow-wrap: anywhere; }
    .panel-heading .text-link { min-height: 44px; }
    .metric-grid { gap: 10px; }
    .metric-card { min-height: 134px; }
    .metric-label, .metric-note, .metric-value, .metric-action { min-width: 0; }
    .sales-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .sales-summary > div { min-width: 0; }
    .sales-summary strong { font-size: clamp(16px, 4.5vw, 20px); line-height: 1.3; overflow-wrap: anywhere; }
    .bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; }
    .bar-row > span { grid-column: 1; }
    .bar-row > strong { grid-column: 2; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
    .bar-track { grid-column: 1 / -1; grid-row: 2; }
    .integration-row > div { min-width: 0; }
    .integration-row small { white-space: normal; overflow-wrap: anywhere; }
    .run-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 3px 12px; }
    .run-dot { grid-column: 1; grid-row: 1; }
    .run-row > div { grid-column: 2; grid-row: 1; }
    .run-row time { grid-column: 2; grid-row: 2; white-space: normal; }
    .data-table td { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); align-items: start; text-align: right !important; overflow-wrap: anywhere; }
    .data-table td::before { min-width: 0; }
    .data-table .primary-cell { align-items: center; }
    .data-table .action-cell { display: block; padding: 4px 0 0; }
    .data-table .action-cell .row-arrow { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 10px; font-size: 13px; font-weight: 700; }
    .mobile-action-label { display: inline; }
    .data-table .empty-row td { display: block; }
    .page-summary { white-space: normal; overflow-wrap: anywhere; }
    .page-controls { max-width: 100%; flex-wrap: wrap; }
    .pagination-wrap .page-control { min-width: 44px; min-height: 44px; }
    .settings-heading > div { min-width: 0; }
    .field, .field-grid > * { min-width: 0; }
    .field input, .field textarea, .field select, .stack-form input { font-size: 16px; }
}

@media (max-width: 420px) {
    .router-settings-heading { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; }
    .router-latency { margin-left: 0; padding: 7px; }
    .router-latency-caption { font-size: 9px; }
    .router-latency strong { font-size: 12px; }
    .page-content { padding-inline: 12px; }
    .panel { padding: 16px; }
    .page-heading { margin-bottom: 18px; }
    .sales-summary { grid-template-columns: 1fr; gap: 12px; padding-bottom: 16px; }
    .sales-summary > div + div { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
    .sales-summary strong { font-size: 21px; overflow-wrap: normal; }
    .metric-card { grid-template-columns: 42px minmax(0, 1fr); gap: 2px 10px; }
    .metric-value, .metric-note, .metric-action { grid-column: 2; }
    .integration-row { display: grid; grid-template-columns: 39px minmax(0, 1fr); gap: 4px 10px; }
    .integration-icon { grid-column: 1; grid-row: 1 / span 2; }
    .integration-row > div { grid-column: 2; }
    .integration-row .chip { grid-column: 2; justify-self: start; }
    .form-actions, .button-row, .test-form { align-items: stretch; }
    .form-actions > .button, .button-row > .button, .button-row > form, .button-row > form .button, .test-form > .button { width: 100%; }
    .form-actions .chip { white-space: normal; }
    .pagination-wrap .voucher-pagination { gap: 12px; }
    .page-controls { gap: 5px; }
    .page-number.is-distant { display: none; }
    .voucher-source { overflow-wrap: anywhere; }
}

/* The mobile sidebar becomes a floating bottom navigation. */
@media (max-width: 780px) {
    .sidebar {
        display: block;
        position: fixed;
        top: auto;
        left: 50%;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 50;
        width: min(320px, calc(100vw - 24px));
        height: auto;
        padding: 8px;
        transform: translateX(-50%);
        border: 1px solid #28576b;
        border-radius: 20px;
        box-shadow: 0 16px 40px rgba(6, 34, 50, .3);
    }
    .sidebar::before, .sidebar .brand, .sidebar .sidebar-label, .sidebar .sidebar-bottom { display: none; }
    .nav-list {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
        overflow: visible;
    }
    .nav-item {
        min-width: 0;
        display: grid;
        place-items: center;
        min-height: 52px;
        padding: 0;
        border-radius: 13px;
    }
    .nav-item .icon { display: block; width: 22px; height: 22px; }
    .nav-item.active { box-shadow: inset 0 -2px #73deec; }
    .nav-item .nav-label { display: none; }
    .mobile-nav-logout { display: block; min-width: 0; }
    .mobile-nav-logout .nav-item { width: 100%; height: 100%; border: 0; background: transparent; color: #c9dce5; font-family: inherit; font-weight: 600; cursor: pointer; }
    .mobile-nav-logout .nav-item:hover { background: rgba(114, 217, 232, .13); color: #fff; }
    .topbar { display: grid; gap: 10px; min-height: 0; padding: 12px 16px 14px; }
    .mobile-topbar { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
    .mobile-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; color: #10334a; }
    .mobile-brand .brand-mark { width: 32px; height: 32px; flex: none; font-size: 18px; }
    .mobile-brand strong { min-width: 0; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
    .topbar-heading { min-width: 0; }
    .topbar-right { display: none; }
    .page-content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
    .toast.is-leaving { transition: none; transform: none; }
}

/* Telegram access registry */
.telegram-users-heading{align-items:center}
.telegram-users-heading>div{flex:1;min-width:0}
.telegram-pending-count{flex:none;border:1px solid #f4dba5;border-radius:100px;background:#fff5df;color:#815918;padding:7px 11px;font-size:11px;font-weight:800;white-space:nowrap}
.telegram-add-form{display:grid;grid-template-columns:minmax(180px,1fr) minmax(170px,220px) auto;align-items:end;gap:12px;border:1px solid #d7e8ef;border-radius:14px;background:#f3f9fb;padding:16px;margin-bottom:24px}
.telegram-add-field{min-width:0}.telegram-add-field label{display:block;color:#315c70;font-size:11px;font-weight:800;margin-bottom:6px}
.telegram-add-field input,.telegram-add-field select,.telegram-role-form select{width:100%;min-height:44px;border:1px solid #bcd6e2;border-radius:9px;background:#fff;color:#173b50;padding:8px 11px;font-size:13px}
.telegram-add-form>.button{min-height:44px}
.telegram-filter-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,210px) auto;align-items:end;gap:9px;margin-bottom:14px}.telegram-filter-field{min-width:0}.telegram-filter-form label{display:block;margin-bottom:6px;font-size:11px;font-weight:800;color:#496d80}.telegram-filter-form input,.telegram-filter-form select{width:100%;min-height:42px;border:1px solid #c6dbe5;border-radius:9px;background:#fff;color:#173b50;padding:8px 11px;font-size:13px}.telegram-filter-form .button{min-height:42px}
.telegram-users-table{min-width:850px}.telegram-users-table td{vertical-align:middle}
.telegram-id-cell strong{font-variant-numeric:tabular-nums;color:#0a5f87}
.telegram-display-name{display:block;color:#23495e;font-weight:700}.telegram-username{display:block;color:#69899b;font-size:11px;margin-top:3px}
.telegram-role-badge{display:inline-flex;align-items:center;min-height:26px;border-radius:100px;padding:4px 9px;background:#eaf2f6;color:#315d72;font-size:11px;font-weight:800;white-space:nowrap}
.telegram-role-badge.role-unregistered{background:#fff1df;color:#865c1e}.telegram-role-badge.role-sales{background:#e4f5ed;color:#227758}.telegram-role-badge.role-operator{background:#e9efff;color:#415ca0}.telegram-role-badge.role-admin{background:#dff4fa;color:#086b91}
.telegram-user-actions{min-width:300px}.telegram-role-form{display:flex;align-items:center;gap:7px}.telegram-role-form select{min-width:0;flex:1}.telegram-role-form .button{min-height:44px;padding-inline:12px}
.telegram-delete{margin-top:5px}.telegram-delete summary{display:inline-flex;align-items:center;min-height:32px;color:#ae4d4d;font-size:11px;font-weight:800;cursor:pointer;list-style:none}.telegram-delete summary::-webkit-details-marker{display:none}.telegram-delete summary:hover{text-decoration:underline}
.telegram-delete form{display:flex;align-items:center;justify-content:space-between;gap:10px;border-radius:9px;background:#fff3f1;padding:8px 10px;color:#824d45;font-size:11px}.button.danger{background:#bd4d47;color:#fff;min-height:40px}.button.danger:hover{background:#9e3935}
.telegram-role-help{margin:18px 0 0;color:#698698;font-size:11px;line-height:1.6}
.legacy-import-guide{display:grid;gap:5px;border:1px solid #d4e7ef;border-radius:12px;background:#f3f9fc;padding:14px 16px;color:#31586d;font-size:12px;line-height:1.55;margin-bottom:18px}
.legacy-import-guide strong{color:#103d56}.legacy-import-guide code{font-size:11px;background:#e5f1f7;border-radius:4px;padding:1px 4px}
.legacy-import-form .field{min-width:0}.legacy-upload-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:12px}.legacy-import-form input[type=file]{min-width:0;min-height:46px;padding:0;line-height:44px;overflow:hidden;cursor:pointer}.legacy-import-form input[type=file]::file-selector-button{height:44px;margin-right:14px;padding:0 18px;border:0;border-right:1px solid #c9e1ec;background:#e7f5fa;color:#0b6084;font:inherit;font-weight:800;cursor:pointer}.legacy-import-form input[type=file]::file-selector-button:hover{background:#d6eef7}.legacy-upload-row .button{white-space:nowrap}.legacy-import-form .button,.legacy-import-actions .button{min-height:46px}
.legacy-field-error{display:block!important;color:#b44545!important;line-height:1.5;margin-top:6px}
.legacy-preview,.legacy-import-history{border-top:1px solid var(--line);margin-top:22px;padding-top:20px}.legacy-preview .panel-heading,.legacy-import-history .panel-heading{margin-bottom:15px}.legacy-preview h3{overflow-wrap:anywhere}
.legacy-import-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.legacy-import-stats>div{display:grid;gap:4px;border:1px solid #d7e8ef;border-radius:12px;background:#f8fcfd;padding:14px}.legacy-import-stats span{color:#648397;font-size:11px;font-weight:700}.legacy-import-stats strong{color:#123d55;font-size:18px;font-variant-numeric:tabular-nums}
.legacy-import-note{font-size:11px;color:#587789;margin:13px 0}.legacy-preview-table{min-width:550px}.legacy-import-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.legacy-import-row{display:flex;align-items:start;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid #e4edf1}.legacy-import-row:first-of-type{border-top:0}.legacy-import-row>div{min-width:0}.legacy-import-row strong,.legacy-import-row small{display:block;overflow-wrap:anywhere}.legacy-import-row strong{font-size:13px;color:#244c61}.legacy-import-row small{font-size:11px;color:#6d8999;margin-top:4px}.legacy-import-row .chip{flex:none}
.legacy-skipped-link{display:inline-flex;align-items:center;min-height:36px;margin-top:5px;color:#08749a;font-size:12px;font-weight:800;text-decoration:none}.legacy-skipped-link:hover{text-decoration:underline}.legacy-skipped-link:focus-visible,.legacy-skipped-pager a:focus-visible{outline:3px solid #69cfe4;outline-offset:2px}.legacy-skipped-heading p{overflow-wrap:anywhere}.legacy-skipped-table{min-width:710px}.legacy-skipped-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;color:#55768a;font-size:12px;font-weight:700}.legacy-skipped-pager .button{min-height:44px}
@media(max-width:700px){.legacy-skipped-heading>.button{width:100%}.legacy-skipped-table{min-width:0}.legacy-skipped-pager{flex-wrap:wrap}.legacy-skipped-pager>span:nth-child(2){order:-1;width:100%;text-align:center}}
@media (max-width:700px){.legacy-import-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.legacy-upload-row{grid-template-columns:minmax(0,1fr)}.legacy-upload-row .button{width:100%}.legacy-preview .panel-heading{align-items:flex-start;flex-wrap:wrap}}
.legacy-import-form input[type=file]:focus-visible,.legacy-upload-row .button:focus-visible{outline:3px solid #69cfe4;outline-offset:2px}
.telegram-add-form input:focus-visible,.telegram-add-form select:focus-visible,.telegram-role-form select:focus-visible,.telegram-delete summary:focus-visible,.telegram-user-actions button:focus-visible{outline:3px solid #69cfe4;outline-offset:2px}
@media (max-width:980px){.telegram-users-heading{flex-wrap:wrap}.telegram-pending-count{margin-left:52px}.telegram-add-form{grid-template-columns:minmax(0,1fr) minmax(160px,210px)}.telegram-add-form>.button{grid-column:1/-1;justify-self:start}}
@media (max-width:620px){
    .telegram-pending-count{margin-left:0}.telegram-add-form{grid-template-columns:1fr}.telegram-add-form>.button{grid-column:1;width:100%}
    .telegram-filter-form{grid-template-columns:1fr 1fr}.telegram-filter-field:first-child{grid-column:1/-1}.telegram-filter-form input,.telegram-filter-form select{font-size:16px}.telegram-filter-form .button{width:100%}
    .telegram-users-scroll{overflow:visible}.telegram-users-table,.telegram-users-table tbody,.telegram-users-table tr,.telegram-users-table td{display:block;width:100%;min-width:0}
    .telegram-users-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
    .telegram-users-table tbody tr:not(.empty-row){border:1px solid #d5e5ed;border-radius:14px;padding:13px 15px;margin-bottom:12px;box-shadow:0 5px 14px rgba(18,76,104,.04)}
    .telegram-users-table td{display:grid;grid-template-columns:minmax(0,38%) minmax(0,1fr);gap:8px;align-items:start;text-align:right!important;padding:9px 0;border:0;border-bottom:1px solid #e7eff3}
    .telegram-users-table td::before{content:attr(data-label);color:#6b8799;font-size:11px;font-weight:700;text-align:left}
    .telegram-users-table td:last-child{border-bottom:0}.telegram-users-table .telegram-user-actions{display:block;min-width:0;padding-top:13px;text-align:left!important}.telegram-users-table .telegram-user-actions::before{display:block;margin-bottom:8px}
    .telegram-role-form{width:100%}.telegram-role-form select{font-size:16px}.telegram-role-form .button{min-width:92px}
    .telegram-delete summary{min-height:44px}.telegram-delete form{flex-wrap:wrap}.telegram-delete form .button{width:100%}
    .telegram-users-table .empty-row td{display:block;text-align:center!important}
}
