:root {
    --admin-bg: #e9edf3;
    --admin-shell: #f7f8fb;
    --admin-surface: #ffffff;
    --admin-surface-soft: #f1f3f7;
    --admin-text: #101827;
    --admin-muted: #6b7280;
    --admin-border: rgba(17, 24, 39, 0.08);
    --admin-primary: #0b84ff;
    --admin-primary-start: #1188ff;
    --admin-primary-end: #0a62dc;
    --admin-primary-hover-start: #0f7ff0;
    --admin-primary-hover-end: #075fd1;
    --admin-primary-dark: #075fd1;
    --admin-primary-text: #0b66d8;
    --admin-primary-soft: #eef7ff;
    --admin-primary-softer: #f7fbff;
    --admin-primary-border: rgba(11, 132, 255, 0.16);
    --admin-primary-ring: rgba(11, 132, 255, 0.09);
    --admin-gradient-primary: linear-gradient(135deg, var(--admin-primary-start) 0%, var(--admin-primary-end) 100%);
    --admin-gradient-primary-hover: linear-gradient(135deg, var(--admin-primary-hover-start) 0%, var(--admin-primary-hover-end) 100%);
    --admin-ink: #1f232b;
    --admin-graphite: #1f232b;
    --admin-graphite-start: #2d3138;
    --admin-graphite-end: #171a20;
    --admin-gradient-graphite: linear-gradient(135deg, var(--admin-graphite-start) 0%, var(--admin-graphite-end) 100%);
    --admin-text-strong: #101827;
    --admin-text-secondary: #344054;
    --admin-text-muted: #667085;
    --admin-text-soft: #98a2b3;
    --admin-neutral-25: #fbfdff;
    --admin-neutral-50: #f8fafc;
    --admin-neutral-75: #f7f9fc;
    --admin-neutral-100: #f4f7fb;
    --admin-neutral-150: #f4f6f9;
    --admin-success: #039855;
    --admin-success-soft: #e6f9ef;
    --admin-success-border: rgba(3, 152, 85, 0.18);
    --admin-warning: #b54708;
    --admin-warning-soft: #fff4df;
    --admin-warning-border: rgba(181, 71, 8, 0.16);
    --admin-danger: #b42318;
    --admin-danger-strong: #d92d20;
    --admin-danger-soft: #fff1f0;
    --admin-danger-hover: #fee4e2;
    --admin-danger-border: rgba(217, 45, 32, 0.12);
    --admin-violet: #6941c6;
    --admin-violet-soft: #f4efff;
    --admin-teal: #0e7090;
    --admin-teal-soft: #edf7f8;
    --admin-pink: #c11574;
    --admin-pink-soft: #fdf2fa;
    --admin-radius-xl: 28px;
    --admin-radius-card: 22px;
    --admin-shadow-soft: 0 20px 55px rgba(15, 23, 42, 0.08);
    --admin-shadow-card: 0 14px 35px rgba(15, 23, 42, 0.06);
    --admin-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
    --admin-fw-regular: 400;
    --admin-fw-medium: 500;
    --admin-fw-semibold: 600;
    --admin-fw-bold: 700;
    --admin-text-2xs: 0.6875rem; /* 11px */
    --admin-text-xs: 0.75rem; /* 12px */
    --admin-text-sm: 0.8125rem; /* 13px */
    --admin-text-base: 0.875rem; /* 14px */
    --admin-text-md: 0.9375rem; /* 15px */
    --admin-text-lg: 1rem; /* 16px */
    --admin-text-xl: 1.125rem; /* 18px */
    --admin-text-2xl: 1.5rem; /* 24px */
    --admin-text-3xl: 2rem; /* 32px */
    --admin-text-page: clamp(2rem, 2.45vw, 2.35rem); /* 32-38px */
    --admin-leading-tight: 1.15;
    --admin-leading-snug: 1.3;
    --admin-leading-normal: 1.45;
    --admin-leading-relaxed: 1.6;
    --admin-scroll-thumb: rgba(11, 132, 255, 0.72);
    --admin-scroll-thumb-hover: rgba(7, 95, 209, 0.86);
    --admin-scroll-track: rgba(238, 247, 255, 0.9);
    --admin-scroll-track-soft: rgba(244, 247, 251, 0.95);
    --admin-z-topbar: 80;
    --admin-z-popover: 90;
    --admin-z-modal: 400;
    --admin-z-modal-nested: 450;
    --admin-space-1: 4px;
    --admin-space-2: 6px;
    --admin-space-3: 8px;
    --admin-space-4: 10px;
    --admin-space-5: 12px;
    --admin-space-6: 14px;
    --admin-space-7: 16px;
    --admin-space-8: 18px;
    --admin-space-9: 20px;
    --admin-space-10: 24px;
    --admin-space-11: 28px;
    --admin-space-12: 32px;
    --admin-page-pad: 24px;
    --admin-card-pad: 16px;
    --admin-card-pad-lg: 20px;
    --admin-form-pad: 14px;
    --admin-modal-pad: 20px;
    --admin-field-pad-x: 12px;
    --admin-field-pad-y: 9px;
    --admin-field-gap: 12px;
    --admin-section-gap: 16px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    background: #151b24;
    --admin-bg: #151b24;
    --admin-shell: #151b24;
    --admin-surface: #1b2330;
    --admin-surface-soft: #222b3a;
    --admin-text: #e8eef7;
    --admin-muted: #9aa8bc;
    --admin-border: rgba(232, 238, 247, 0.1);
    --admin-primary-soft: rgba(11, 132, 255, 0.16);
    --admin-primary-softer: rgba(11, 132, 255, 0.1);
    --admin-primary-border: rgba(11, 132, 255, 0.28);
    --admin-primary-ring: rgba(11, 132, 255, 0.18);
    --admin-primary-text: #8ec5ff;
    --admin-ink: #e8eef7;
    --admin-graphite: #d7dee8;
    --admin-text-strong: #f5f8fc;
    --admin-text-secondary: #c4cfde;
    --admin-text-muted: #93a1b5;
    --admin-text-soft: #7d8ba0;
    --admin-neutral-25: #18202c;
    --admin-neutral-50: #1a2330;
    --admin-neutral-75: #1d2634;
    --admin-neutral-100: #202a39;
    --admin-neutral-150: #243041;
    --admin-success-soft: rgba(3, 152, 85, 0.16);
    --admin-warning-soft: rgba(181, 71, 8, 0.22);
    --admin-danger-soft: rgba(217, 45, 32, 0.18);
    --admin-danger-hover: rgba(217, 45, 32, 0.28);
    --admin-violet-soft: rgba(105, 65, 198, 0.2);
    --admin-teal-soft: rgba(14, 112, 144, 0.2);
    --admin-pink-soft: rgba(193, 21, 116, 0.18);
    --admin-shadow-soft: 0 20px 55px rgba(0, 0, 0, 0.35);
    --admin-shadow-card: 0 14px 35px rgba(0, 0, 0, 0.28);
    --admin-scroll-track: rgba(34, 43, 58, 0.95);
    --admin-scroll-track-soft: rgba(27, 35, 48, 0.95);
}

html[data-theme="dark"] .admin-page-bg,
html[data-theme="dark"] body.admin-page-bg {
    background: var(--admin-bg) !important;
    color: var(--admin-text);
}

html[data-theme="dark"] .admin-brand-text,
html[data-theme="dark"] .text-gray-950,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .aid-snapshot-value {
    color: var(--admin-text-strong) !important;
}

html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400 {
    color: var(--admin-text-muted) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white\/80 {
    background: var(--admin-surface) !important;
}

html[data-theme="dark"] .border-white,
html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200 {
    border-color: var(--admin-border) !important;
}

html[data-theme="dark"] .admin-shell .settings-btn:not(.settings-btn-primary):not(.settings-btn-warning):not(.has-direct-snapshot),
html[data-theme="dark"] .ui-pill-muted {
    background: var(--admin-surface-soft) !important;
    color: var(--admin-text) !important;
    border-color: var(--admin-border) !important;
}

.admin-switch,
.admin-theme-toggle {
    position: relative;
    width: 46px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: #d7dde7;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s ease, opacity .15s ease;
    padding: 0;
}

.admin-switch-thumb,
.admin-theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform .2s ease;
}

.admin-switch.is-on,
.admin-theme-toggle.is-on,
html[data-theme="dark"] .admin-theme-toggle {
    background: #0b84ff;
}

.admin-switch.is-on .admin-switch-thumb,
.admin-switch.is-on .admin-theme-toggle-thumb,
.admin-theme-toggle.is-on .admin-theme-toggle-thumb,
.admin-theme-toggle.is-on .admin-switch-thumb,
html[data-theme="dark"] .admin-theme-toggle .admin-theme-toggle-thumb,
html[data-theme="dark"] .admin-theme-toggle .admin-switch-thumb {
    transform: translateX(18px);
}

.admin-switch:disabled,
.admin-switch.is-busy {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-switch.is-busy {
    cursor: wait;
}

html[data-theme="dark"] .admin-switch:not(.is-on) {
    background: #3a4454;
}

.admin-switch.is-mixed {
    background: #93c5fd;
}

.admin-switch.is-mixed .admin-switch-thumb {
    transform: translateX(9px);
}

html[data-theme="dark"] .admin-switch.is-mixed {
    background: #4b7fb5;
}

.admin-switch-sm {
    width: 34px;
    height: 20px;
}

.admin-switch-sm .admin-switch-thumb {
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
}

.admin-switch-sm.is-on .admin-switch-thumb {
    transform: translateX(14px);
}

.admin-switch-sm.is-mixed .admin-switch-thumb {
    transform: translateX(7px);
}

.admin-user-chip {
    display: none;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-muted);
    padding: 0 4px;
}

@media (min-width: 1100px) {
    .admin-user-chip { display: inline-block; }
}

body {
    font-family: var(--admin-font-sans);
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-normal);
    font-weight: var(--admin-fw-regular);
    letter-spacing: -0.01em;
}

.admin-shell {
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-normal);
}

.admin-shell .text-xs {
    font-size: var(--admin-text-xs) !important;
    line-height: var(--admin-leading-snug) !important;
}

.admin-shell .text-sm {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-normal) !important;
}

.admin-shell .text-base {
    font-size: var(--admin-text-md) !important;
    line-height: var(--admin-leading-normal) !important;
}

.admin-shell .text-lg {
    font-size: var(--admin-text-xl) !important;
    line-height: var(--admin-leading-snug) !important;
}

.admin-shell .text-xl {
    font-size: var(--admin-text-2xl) !important;
    line-height: var(--admin-leading-tight) !important;
}

.admin-shell .text-2xl {
    font-size: var(--admin-text-2xl) !important;
    line-height: var(--admin-leading-tight) !important;
}

.admin-shell .text-3xl,
.admin-shell .text-4xl,
.admin-shell .md\:text-4xl {
    font-size: var(--admin-text-page) !important;
    line-height: var(--admin-leading-tight) !important;
    letter-spacing: -0.045em !important;
}

.admin-shell .font-normal {
    font-weight: var(--admin-fw-regular) !important;
}

.admin-shell .font-medium {
    font-weight: var(--admin-fw-medium) !important;
}

.admin-shell .font-semibold {
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell .font-bold {
    font-weight: var(--admin-fw-bold) !important;
}

.admin-shell h1 {
    font-size: var(--admin-text-page);
    line-height: var(--admin-leading-tight);
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.045em;
}

.admin-shell h2 {
    font-size: var(--admin-text-lg);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.02em;
}

.admin-shell h3 {
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.01em;
}

.admin-shell table {
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-normal);
}

.admin-shell th {
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    letter-spacing: .02em;
}

.admin-shell td {
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-normal);
}

.admin-shell input,
.admin-shell textarea,
.admin-shell select,
.admin-shell button {
    font-family: var(--admin-font-sans);
}

.admin-page-bg {
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--admin-surface) 88%, transparent), transparent 34rem),
        linear-gradient(135deg, var(--admin-bg) 0%, var(--admin-shell) 100%);
    color: var(--admin-text);
}

.admin-page-bg,
.admin-page-bg * {
    scrollbar-width: thin;
    scrollbar-color: var(--admin-scroll-thumb) var(--admin-scroll-track);
}

.admin-page-bg::-webkit-scrollbar,
.admin-page-bg *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.admin-page-bg::-webkit-scrollbar-track,
.admin-page-bg *::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--admin-scroll-track);
}

.admin-page-bg::-webkit-scrollbar-thumb,
.admin-page-bg *::-webkit-scrollbar-thumb {
    min-height: 34px;
    min-width: 34px;
    border: 2px solid var(--admin-scroll-track);
    border-radius: 999px;
    background: var(--admin-scroll-thumb);
}

.admin-page-bg::-webkit-scrollbar-thumb:hover,
.admin-page-bg *::-webkit-scrollbar-thumb:hover {
    background: var(--admin-scroll-thumb-hover);
}

.admin-page-bg::-webkit-scrollbar-corner,
.admin-page-bg *::-webkit-scrollbar-corner {
    background: transparent;
}

.overflow-x-auto,
.overflow-y-auto,
.overflow-auto,
.debug-event-detail,
.broadcast-bot-list,
.settings-tag-palette,
.js-autoheight-textarea,
#refChartCanvasScroll {
    scrollbar-width: thin;
    scrollbar-color: var(--admin-scroll-thumb) var(--admin-scroll-track);
}

.overflow-x-auto,
#refChartCanvasScroll {
    padding-bottom: 2px;
}

.overflow-y-auto,
.broadcast-bot-list,
.settings-tag-palette,
.js-autoheight-textarea,
.bot-ui-modal-panel,
.admin-custom-select-menu {
    scrollbar-gutter: stable;
}

.admin-shell {
    margin: 18px auto;
    width: calc(100% - 40px);
    max-width: 1760px;
    min-height: calc(100vh - 36px);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-xl);
    background: color-mix(in srgb, var(--admin-shell) 96%, transparent);
    box-shadow: var(--admin-shadow-soft);
    overflow: visible;
    color: var(--admin-text);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 18px;
    padding: 18px 22px;
    background: color-mix(in srgb, var(--admin-surface) 86%, transparent);
    border-bottom: 1px solid var(--admin-border);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: var(--admin-z-topbar);
}

.admin-brand-block {
    gap: 8px;
}

.admin-version-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface-soft);
    color: var(--admin-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.admin-version-btn:hover {
    color: var(--admin-primary-text);
    border-color: var(--admin-primary-border);
    background: var(--admin-primary-softer);
}

.admin-changelog-panel {
    width: min(640px, 100%) !important;
}

.admin-changelog-list {
    display: grid;
    gap: 12px;
    max-height: min(60vh, 520px);
    overflow: auto;
    padding-right: 4px;
}

.admin-changelog-entry {
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: var(--admin-neutral-50);
    padding: 12px 14px;
}

.admin-changelog-entry header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.admin-changelog-entry header strong {
    color: var(--admin-text-strong);
    font-size: .95rem;
}

.admin-changelog-entry header span {
    color: var(--admin-text-soft);
    font-size: .75rem;
}

.admin-changelog-entry h3 {
    margin: 0 0 8px;
    color: var(--admin-text);
    font-size: .88rem;
    font-weight: 650;
}

.admin-changelog-entry ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--admin-text-secondary);
    font-size: .82rem;
    line-height: 1.45;
}

.admin-changelog-entry li + li {
    margin-top: 4px;
}

.admin-changelog-empty {
    color: var(--admin-text-muted);
    font-size: .86rem;
}

.admin-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background:
        radial-gradient(circle at 30% 30%, #62c6ff 0 18%, transparent 19%),
        radial-gradient(circle at 72% 30%, #0b84ff 0 18%, transparent 19%),
        radial-gradient(circle at 30% 72%, #0b84ff 0 18%, transparent 19%),
        radial-gradient(circle at 72% 72%, #075fd1 0 18%, transparent 19%),
        #e8f3ff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--admin-surface-soft) 92%, transparent);
    border: 1px solid var(--admin-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    min-width: 0;
    flex: 0 1 auto;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
    display: none;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: var(--admin-fw-semibold);
    color: var(--admin-text-muted);
    transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
    white-space: nowrap;
}

.admin-nav-link-searcher,
.admin-nav-link-accounts {
    position: relative;
}

.admin-nav-badge {
    min-width: 24px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: #17a851;
    color: #fff;
    font-size: 10px;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.admin-nav-badge.hidden {
    display: none;
}

.admin-nav-link-accounts .admin-nav-badge,
.admin-nav-link-accounts.is-active .admin-nav-badge {
    background: #0f766e;
}

.admin-icon-btn.is-muted {
    opacity: 0.55;
}

.awaiting-sound-panel {
    max-width: 520px;
}

.awaiting-sound-body {
    display: grid;
    gap: 14px;
    padding: 0 4px 4px;
}

.awaiting-sound-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 10px;
    align-items: center;
    color: var(--admin-text);
    font-size: 14px;
}

.awaiting-sound-row input[type="range"] {
    width: 100%;
}

.awaiting-sound-row em {
    font-style: normal;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: right;
    color: var(--admin-text-muted);
}

.awaiting-sound-check {
    grid-template-columns: auto 1fr;
}

.awaiting-sound-check input {
    width: 16px;
    height: 16px;
}

.awaiting-sound-status {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--admin-surface-muted, rgba(127, 127, 127, 0.12));
    color: var(--admin-text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.awaiting-sound-actions {
    flex-wrap: wrap;
}

.awaiting-sound-settings-form {
    display: grid;
    gap: 14px;
    max-width: 520px;
}

.admin-nav-link.is-active .admin-nav-badge {
    background: #17a851;
    color: #fff;
    box-shadow: none;
}

.admin-nav-link:hover {
    color: var(--admin-text-strong);
    background: var(--admin-surface);
    transform: translateY(-1px);
}

.admin-nav-link.is-active {
    color: #fff;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
}

.admin-nav-link.is-active:hover {
    box-shadow: 0 8px 18px rgba(11, 132, 255, .18);
}

.admin-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    color: #667085;
    border: 1px solid rgba(17,24,39,.06);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.admin-icon-btn:hover {
    color: #0b84ff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.admin-icon-btn.is-active {
    color: #0b84ff;
    background: #eef7ff;
    border-color: rgba(11, 132, 255, .16);
}

.admin-line-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-line-icon-sm {
    width: 16px;
    height: 16px;
}

.admin-line-icon-lg {
    width: 20px;
    height: 20px;
}

.admin-shell button svg:not(.admin-line-icon),
.admin-shell a.admin-icon-btn svg:not(.admin-line-icon),
.admin-shell .ui-pill svg:not(.admin-line-icon),
.admin-shell .settings-btn svg:not(.admin-line-icon) {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-shell .admin-icon-btn svg:not(.admin-line-icon),
.admin-shell .bot-ui-modal-close svg:not(.admin-line-icon),
.admin-shell .settings-icon-btn svg:not(.admin-line-icon),
.admin-shell .broadcast-modal-close svg:not(.admin-line-icon),
.admin-shell .ref-chart-modal-close svg:not(.admin-line-icon) {
    width: 18px;
    height: 18px;
}

.admin-content {
    padding: 24px;
}

.ui-card {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-card);
    background: color-mix(in srgb, var(--admin-surface) 96%, transparent);
    box-shadow: var(--admin-shadow-card);
    color: var(--admin-text);
}

.ui-card-soft {
    border-radius: var(--admin-radius-card);
    background: var(--admin-surface-soft);
}

.ui-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: var(--admin-fw-semibold);
    transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ui-pill:hover {
    transform: translateY(-1px);
}

.ui-pill-muted {
    background: var(--admin-surface);
    color: var(--admin-text-secondary);
    border: 1px solid var(--admin-border);
}

.ui-pill-muted:hover {
    color: var(--admin-text-strong);
    background: var(--admin-surface-soft);
}

.ui-pill-active {
    color: #fff;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
}

.ui-pill-active:hover {
    box-shadow: 0 8px 18px rgba(11, 132, 255, .18);
}

.ui-pill-dark {
    color: #fff;
    background: var(--admin-ink);
}

.stat-card-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--admin-primary-softer);
    border: 1px solid var(--admin-primary-border);
    padding: 0.25rem 0.75rem;
    color: var(--admin-primary-text);
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1rem;
}

.stat-card-chip.is-ok {
    background: var(--admin-success-soft);
    border-color: rgba(3, 152, 85, 0.28);
    color: #039855;
}

html[data-theme="dark"] .stat-card-chip.is-ok {
    color: #6ee7b7;
}

.ui-chip-on-color {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .20);
    padding: 0.25rem 0.75rem;
    color: #fff;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1rem;
}

.ui-date-input {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    min-height: 38px;
    min-width: 148px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    padding: 0 0.85rem;
    color: #667085;
    font-family: inherit;
    font-size: .875rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.25rem;
    color-scheme: light;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    cursor: pointer;
}

.ui-date-input:hover {
    background: #f9fafb;
}

.ui-date-input:focus,
.ui-date-input.is-open {
    outline: none;
    border-color: rgba(11,132,255,.42);
    box-shadow: 0 0 0 4px rgba(11,132,255,.10);
}

.ui-date-input-placeholder {
    color: #667085;
}

.ui-datepicker-popover {
    position: absolute;
    z-index: var(--admin-z-popover);
    width: min(318px, calc(100vw - 32px));
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
    backdrop-filter: blur(18px);
    padding: 12px;
    animation: adminDatepickerIn .16s ease both;
}

.ui-datepicker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ui-datepicker-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 9px;
    color: #101827;
    font-size: .94rem;
    font-weight: var(--admin-fw-bold);
}

.ui-datepicker-nav {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #667085;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.ui-datepicker-nav:hover {
    color: #0b84ff;
    background: #eef7ff;
    transform: translateY(-1px);
}

.ui-datepicker-weekdays,
.ui-datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ui-datepicker-weekdays {
    margin-bottom: 3px;
    color: #667085;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
    text-align: center;
}

.ui-datepicker-weekdays div {
    padding: 5px 0;
}

.ui-datepicker-day {
    width: 34px;
    height: 34px;
    margin: 2px auto;
    border-radius: 12px;
    color: #1f2937;
    font-size: .9rem;
    font-weight: var(--admin-fw-semibold);
    transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ui-datepicker-day:hover {
    color: #0b84ff;
    background: #eef7ff;
}

.ui-datepicker-day.is-muted {
    color: #98a2b3;
}

.ui-datepicker-day.is-today {
    color: #0b84ff;
    background: rgba(11,132,255,.08);
}

.ui-datepicker-day.is-selected {
    color: #fff;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
    box-shadow: 0 8px 18px rgba(11,132,255,.18);
}

.ui-datepicker-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(17,24,39,.06);
    margin-top: 8px;
    padding-top: 9px;
}

.ui-datepicker-action {
    min-height: 31px;
    border-radius: 999px;
    padding: 0 10px;
    color: #667085;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    transition: background .18s ease, color .18s ease;
}

.ui-datepicker-action:hover {
    color: #0b84ff;
    background: #eef7ff;
}

@keyframes adminDatepickerIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 108px;
    padding: 16px;
}

.stat-card-blue {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #0b84ff 0%, #075fd1 100%);
    box-shadow: 0 22px 42px rgba(11, 132, 255, .25);
}

.stat-card-dark {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #2d3138 0%, #171a20 100%);
}

.metric-mini {
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-surface);
    padding: 14px;
    color: var(--admin-text);
}

.admin-custom-select {
    position: relative;
    display: inline-block;
    min-width: 230px;
    z-index: 5;
}

.admin-custom-select.is-open {
    z-index: 120;
}

.admin-custom-select:has(> select.w-full),
.admin-custom-select:has(> select.broadcast-input),
.admin-custom-select:has(> select.settings-input),
.admin-custom-select:has(> select.ref-program-select) {
    width: 100%;
}

.admin-custom-select:has(> select.flex-1) {
    flex: 1 1 10rem;
}

.admin-custom-select:has(> select.searcher-filter-select) {
    min-width: 128px;
    width: max-content;
}

.admin-custom-select:has(> select.searcher-filter-select-keyword) {
    min-width: 150px;
}

.admin-custom-select:has(> select.searcher-filter-select-status) {
    min-width: 210px;
}

.searcher-filter-search {
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 320px;
}

.searcher-filter-date {
    min-width: 138px;
    width: auto;
    min-height: 38px;
    padding: 0 12px;
}

.searcher-direct-snapshot-mau {
    margin: 4px 0 0;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.searcher-mau-label {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    color: #0f766e;
    background: rgba(13, 148, 136, .12);
    font-weight: var(--admin-fw-semibold);
}

.searcher-mau-label.is-empty {
    padding: 0;
    color: inherit;
    background: transparent;
    font-weight: inherit;
    opacity: .85;
}

.searcher-direct-snapshot-mau.searcher-mau-label:not(.is-empty) {
    color: #0f766e;
}

.admin-custom-select:has(> select.mb-2) {
    margin-bottom: .5rem;
}

.admin-custom-select > select.js-admin-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.admin-custom-select-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    padding: 0 12px 0 14px;
    color: #344054;
    font-size: .875rem;
    font-weight: var(--admin-fw-semibold);
    text-align: left;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .035);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.admin-custom-select-btn:hover,
.admin-custom-select.is-open .admin-custom-select-btn {
    border-color: rgba(11,132,255,.18);
    background: #fbfdff;
}

.admin-custom-select.is-disabled .admin-custom-select-btn,
.admin-custom-select-btn:disabled {
    cursor: not-allowed;
    opacity: .68;
    background: #f6f8fb;
}

.admin-custom-select-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-custom-select-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #f4f7fb;
    color: #98a2b3;
    flex-shrink: 0;
    transition: transform .18s ease, color .18s ease, background .18s ease;
}

.admin-custom-select-icon svg {
    width: 15px;
    height: 15px;
}

.admin-custom-select.is-open .admin-custom-select-icon {
    transform: rotate(180deg);
    background: #eef7ff;
    color: #0b66d8;
}

.admin-custom-select-menu {
    display: none;
    position: absolute;
    z-index: 130;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 10px 10px 10px 6px;
    opacity: 0;
    transform: translateY(-4px) scale(.985);
    pointer-events: none;
    transform-origin: top center;
    transition: opacity .16s ease, transform .16s ease;
    backdrop-filter: blur(14px);
    scrollbar-width: thin;
    scrollbar-color: var(--admin-scroll-thumb) var(--admin-scroll-track);
    scrollbar-gutter: stable;
    clip-path: inset(0 round 20px);
}

.admin-custom-select-menu::-webkit-scrollbar {
    width: 9px;
}

.admin-custom-select-menu::-webkit-scrollbar-track {
    background: var(--admin-scroll-track);
    border-radius: 999px;
    margin: 16px 3px;
}

.admin-custom-select-menu::-webkit-scrollbar-thumb {
    min-height: 38px;
    border: 2px solid var(--admin-scroll-track);
    border-radius: 999px;
    background: var(--admin-scroll-thumb);
}

.admin-custom-select-menu::-webkit-scrollbar-thumb:hover {
    background: var(--admin-scroll-thumb-hover);
}

.admin-custom-select.is-open .admin-custom-select-menu {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.admin-custom-select-option {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: calc(100% - 2px);
    min-height: 34px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    padding: 0 10px;
    color: var(--admin-text-secondary);
    font-size: .84rem;
    font-weight: var(--admin-fw-semibold);
    text-align: left;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .14s ease, color .14s ease;
}

.admin-custom-select-option:hover {
    background: var(--admin-neutral-50);
}

.admin-custom-select-option.is-selected {
    background: var(--admin-primary-softer);
    color: var(--admin-primary-text);
}

select,
.ui-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2398A2B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    padding-right: 42px !important;
}

select::-ms-expand {
    display: none;
}

.debug-filter-select {
    min-height: 38px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    padding: 0 34px 0 14px;
    color: #344054;
    font-size: .875rem;
    font-weight: var(--admin-fw-semibold);
    outline: none;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .035);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.debug-filter-select:focus {
    border-color: rgba(11,132,255,.35);
    box-shadow: 0 0 0 4px rgba(11,132,255,.09);
}

.debug-soft-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: #f4f7fb;
    padding: 0 10px;
    color: #667085;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.debug-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
}

.debug-table th {
    padding: 0 12px 10px;
    color: #98a2b3;
    font-size: .68rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.debug-table td {
    border-top: 1px solid rgba(17,24,39,.055);
    padding: 11px 12px;
    color: #344054;
    font-weight: var(--admin-fw-medium);
}

.debug-table tbody tr:first-child td {
    border-top-color: rgba(11,132,255,.12);
}

.debug-category-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.debug-category-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(15, 23, 42, .04);
    flex-shrink: 0;
}

.debug-events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.debug-event-card {
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-surface);
    overflow: hidden;
}

.debug-event-card[open] {
    border-color: var(--admin-primary-border);
    background: var(--admin-neutral-75);
}

.debug-event-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

.debug-event-summary::-webkit-details-marker {
    display: none;
}

.debug-event-summary:hover {
    background: var(--admin-neutral-50);
}

.debug-level-badge,
.debug-category-pill,
.debug-bot-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.debug-level-badge.is-warning {
    background: #fff7e6;
    color: #b54708;
}

.debug-level-badge.is-error {
    background: #fff1f0;
    color: #b42318;
}

.debug-category-pill {
    background: #eef7ff;
    color: #0b66d8;
}

.debug-bot-pill {
    gap: 4px;
    background: #f4f7fb;
    color: #667085;
}

.debug-bot-pill span {
    color: #344054;
}

.debug-event-message {
    min-width: 0;
    flex: 1;
    color: #344054;
    font-size: .875rem;
    font-weight: var(--admin-fw-medium);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.debug-event-chevron {
    width: 16px;
    height: 16px;
    color: #98a2b3;
    flex-shrink: 0;
    transition: transform .18s ease;
}

.debug-event-card[open] .debug-event-chevron {
    transform: rotate(180deg);
}

.debug-event-detail {
    border-top: 1px solid var(--admin-border);
    background: var(--admin-neutral-50);
    padding: 12px 14px 14px;
    color: var(--admin-text-muted);
    font-size: .78rem;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
}

.broadcast-soft-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: #f4f7fb;
    padding: 0 10px;
    color: #667085;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.broadcast-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.broadcast-section {
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-surface);
    padding: 14px;
}

.broadcast-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.broadcast-section-head span,
.broadcast-label {
    display: block;
    color: var(--admin-text-secondary);
    font-size: .84rem;
    font-weight: var(--admin-fw-semibold);
}

.broadcast-section-head small {
    color: var(--admin-text-soft);
    font-size: .76rem;
    font-weight: var(--admin-fw-medium);
}

.broadcast-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.broadcast-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #f8fafc;
    padding: 0 12px;
    color: #344054;
    font-size: .84rem;
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.broadcast-choice:hover,
.broadcast-choice:has(input:checked) {
    border-color: rgba(11,132,255,.22);
    background: #eef7ff;
    color: #0b66d8;
}

.broadcast-choice input,
.broadcast-bot-row input {
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex: 0 0 16px;
    accent-color: var(--admin-primary);
}

.broadcast-choice input {
    margin-top: 0;
}

.broadcast-bot-row label,
.broadcast-choice {
    min-width: 0;
}

.broadcast-bot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 190px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-50);
    padding: 10px;
    transition: opacity .18s ease, filter .18s ease;
}

.broadcast-bot-list.is-muted {
    opacity: .48;
    filter: grayscale(.15);
}

.broadcast-bot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    padding: 8px 10px;
    color: var(--admin-text-muted);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.broadcast-bot-row:hover {
    border-color: rgba(11,132,255,.16);
    background: #fbfdff;
}

.broadcast-label {
    margin-bottom: 6px;
}

.broadcast-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(17,24,39,.09);
    border-radius: 14px;
    background: #fff;
    padding: 0 12px;
    color: #344054;
    font-size: .875rem;
    font-weight: var(--admin-fw-medium);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.broadcast-input::placeholder {
    color: #98a2b3;
    font-weight: var(--admin-fw-regular);
}

.broadcast-input:focus {
    border-color: rgba(11,132,255,.38);
    box-shadow: 0 0 0 4px rgba(11,132,255,.09);
}

.broadcast-textarea {
    min-height: 132px;
    padding-top: 10px;
    padding-bottom: 10px;
    resize: vertical;
    line-height: 1.5;
}

.broadcast-delivery-box {
    background: #f8fbff;
    border-color: rgba(11,132,255,.10);
}

.broadcast-preview-card {
    align-self: start;
    position: sticky;
    top: 18px;
}

.broadcast-preview {
    min-height: 190px;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-neutral-50);
    padding: 16px;
    color: var(--admin-text-secondary);
    font-size: .9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.broadcast-preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
    padding: 0 14px;
    color: #fff;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
}

.broadcast-hint-card {
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 18px;
    background: #fff;
    padding: 12px;
    color: #667085;
    font-size: .8rem;
    line-height: 1.45;
}

.broadcast-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .86rem;
}

.broadcast-table th {
    padding: 0 12px 10px;
    color: #98a2b3;
    font-size: .68rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.broadcast-table td {
    border-top: 1px solid rgba(17,24,39,.055);
    padding: 12px;
    color: #344054;
    font-weight: var(--admin-fw-medium);
    vertical-align: top;
}

.broadcast-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    background: #f4f7fb;
    padding: 0 9px;
    color: #667085;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.broadcast-status.is-completed {
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.broadcast-status.is-running {
    background: #eef7ff;
    color: #0b66d8;
}

.broadcast-status.is-pending {
    background: #fff7e6;
    color: #b54708;
}

.broadcast-status.is-failed {
    background: #fff1f0;
    color: #b42318;
}

.broadcast-progress {
    min-width: 11rem;
}

.broadcast-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #344054;
    font-size: .76rem;
    font-weight: var(--admin-fw-semibold);
}

.broadcast-progress-track {
    overflow: hidden;
    height: 7px;
    margin-top: 6px;
    border-radius: 999px;
    background: #eaf4ff;
}

.broadcast-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
}

.broadcast-progress-meta {
    margin-top: 5px;
    color: #98a2b3;
    font-size: .72rem;
    font-weight: var(--admin-fw-medium);
    white-space: nowrap;
}

.broadcast-stats-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    color: #667085;
    box-shadow: 0 8px 20px rgba(15,23,42,.035);
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.broadcast-stats-btn:hover {
    border-color: rgba(11,132,255,.16);
    background: #f4faff;
    color: #0b66d8;
    transform: translateY(-1px);
}

.broadcast-stats-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #f04438;
    color: #fff;
    font-size: .62rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
}

.broadcast-bots-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    color: #344054;
    padding: 0 12px;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.broadcast-bots-list-btn:hover {
    border-color: rgba(11,132,255,.14);
    background: #f4faff;
    color: #0b66d8;
}

.broadcast-bots-list-btn span {
    color: #98a2b3;
    font-size: .72rem;
}

.broadcast-modal {
    position: fixed;
    inset: 0;
    z-index: var(--admin-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.broadcast-modal.hidden {
    display: none;
}

.broadcast-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.35);
    backdrop-filter: blur(8px);
}

.broadcast-modal-panel {
    position: relative;
    width: min(100%, 440px);
    border: 1px solid var(--admin-border);
    border-radius: 28px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 20px;
    color: var(--admin-text);
    animation: adminDatepickerIn .18s ease both;
}

.broadcast-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    color: #667085;
    transition: color .18s ease, background .18s ease;
}

.broadcast-modal-close:hover {
    background: #f8fafc;
    color: #111827;
}

.broadcast-stats-modal-panel {
    width: min(100%, 760px);
    max-height: min(88vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.broadcast-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.broadcast-error-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 2px;
}

.broadcast-error-summary.is-empty {
    display: block;
    border: 1px dashed rgba(17,24,39,.10);
    border-radius: 20px;
    background: #f8fafc;
    padding: 14px;
    color: #667085;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    text-align: center;
}

.broadcast-error-card {
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 18px;
    background: #fff;
    padding: 12px;
}

.broadcast-error-card span,
.broadcast-error-card small {
    display: block;
    color: #667085;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.2;
}

.broadcast-error-card strong {
    display: block;
    margin-top: 8px;
    color: #111827;
    font-size: 1.25rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
}

.broadcast-error-card small {
    margin-top: 6px;
    color: #98a2b3;
}

.broadcast-error-card.is-token {
    border-color: rgba(244,63,94,.12);
    background: #fff7f8;
}

.broadcast-error-card.is-token strong {
    color: #b42318;
}

.broadcast-error-card.is-warning {
    border-color: rgba(245,158,11,.14);
    background: #fffaf0;
}

.broadcast-error-card.is-warning strong {
    color: #b54708;
}

.broadcast-error-card.is-muted {
    background: #f8fafc;
}

.broadcast-stats-empty {
    border: 1px dashed rgba(17,24,39,.10);
    border-radius: 22px;
    background: #f8fafc;
    padding: 18px;
    color: #667085;
    font-size: .88rem;
    font-weight: var(--admin-fw-medium);
    text-align: center;
}

.broadcast-stats-row {
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    padding: 14px;
    box-shadow: 0 8px 22px rgba(15,23,42,.035);
}

.broadcast-stats-row-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.broadcast-stats-bot {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.broadcast-stats-bot strong {
    color: #111827;
    font-size: .94rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.25;
}

.broadcast-stats-bot span {
    color: #98a2b3;
    font-size: .76rem;
    font-weight: var(--admin-fw-semibold);
}

.broadcast-stats-state {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.broadcast-stats-state.is-ok {
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.broadcast-stats-state.is-running {
    background: #eef7ff;
    color: #0b66d8;
}

.broadcast-stats-state.is-warning {
    background: #fff7e6;
    color: #b54708;
}

.broadcast-stats-state.is-failed {
    background: #fff1f0;
    color: #b42318;
}

.broadcast-stats-progress {
    margin-top: 12px;
}

.broadcast-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.broadcast-stats-grid span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    border-radius: 999px;
    background: #f4f7fb;
    padding: 0 9px;
    color: #667085;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
}

.broadcast-stats-grid b {
    color: #344054;
    font-weight: var(--admin-fw-semibold);
}

.broadcast-stats-error {
    margin-top: 10px;
    border: 1px solid rgba(244,63,94,.10);
    border-radius: 16px;
    background: #fff7f8;
    padding: 9px 10px;
    color: #b42318;
    font-size: .76rem;
    font-weight: var(--admin-fw-medium);
    line-height: 1.4;
}

.broadcast-bots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.broadcast-bots-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    padding: 12px;
}

.broadcast-bots-total {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border-radius: 999px;
    background: #f4f7fb;
    padding: 0 10px;
    color: #667085;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.broadcast-modal-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    border-top: 1px solid rgba(17,24,39,.06);
    padding-top: 12px;
}

.broadcast-modal-pagination .searcher-page-btn:disabled {
    pointer-events: none;
    opacity: .45;
}

.debug-events-pagination {
    margin-top: 14px;
}

.ref-program-panel {
    overflow: visible;
}

.ref-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 24px;
}

.ref-page-title {
    min-width: 0;
}

.ref-page-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    min-width: max-content;
    min-height: 100%;
    padding-top: 0;
}

.ref-page-actions > .ui-pill {
    width: 100%;
    min-width: 168px;
}

.ref-cache-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--admin-border);
    border-radius: 24px;
    background: var(--admin-surface);
    padding: 12px 14px;
    box-shadow: var(--admin-shadow-soft);
}

.ref-cache-progress.hidden,
.ref-cache-progress-stage.hidden {
    display: none;
}

.ref-cache-progress-track {
    flex: 1 1 auto;
    min-width: 120px;
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: var(--admin-primary-soft);
}

.ref-cache-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--admin-gradient-primary);
    transition: width .3s ease;
}

.ref-cache-progress-pct {
    flex: 0 0 auto;
    min-width: 3.4ch;
    color: var(--admin-text-secondary);
    font-size: .75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ref-cache-progress-stage {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--admin-text-muted);
    font-size: .75rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ref-program-select {
    min-height: 38px;
    min-width: 230px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    padding: 0 34px 0 14px;
    color: #344054;
    font-size: .875rem;
    font-weight: var(--admin-fw-semibold);
    outline: none;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .035);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ref-program-select:focus,
.ref-program-date:focus {
    border-color: rgba(11,132,255,.38);
    box-shadow: 0 0 0 4px rgba(11,132,255,.09);
}

.ref-soft-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: #f4f7fb;
    padding: 0 10px;
    color: #667085;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.ref-kpi-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.ref-chart-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    align-self: stretch;
    flex-shrink: 0;
}

.ref-chart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc((100% - 10px) / 2);
    height: 44px;
    min-height: 44px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 14px;
    background: #fff;
    color: #667085;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.ref-chart-btn:hover {
    border-color: rgba(11,132,255,.18);
    background: #f7fbff;
    color: #0b66d8;
    transform: translateY(-1px);
}

.ref-chart-btn svg {
    width: 20px;
    height: 20px;
}

.ref-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.ref-kpi-grid .stat-card {
    min-height: 96px;
}

.ref-kpi-value {
    margin-top: 12px;
    color: inherit;
    font-size: 1.65rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.aid-snapshot-value {
    margin-top: 0.75rem;
    color: var(--admin-text-strong);
    font-size: 1.25rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.03em;
    line-height: 1.15;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ref-delta-on-color {
    color: rgba(255,255,255,.82);
    font-size: .875rem;
    font-weight: var(--admin-fw-semibold);
}

.ref-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.ref-section-head h3 {
    color: var(--admin-text-strong);
    font-size: 1rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.015em;
}

.ref-section-head p {
    margin-top: 4px;
    color: var(--admin-text-muted);
    font-size: .78rem;
}

.ref-date-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #667085;
    font-size: .8rem;
    font-weight: var(--admin-fw-semibold);
}

.ref-program-date {
    min-height: 34px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    padding: 0 12px;
    color: var(--admin-text-secondary);
    font-size: .8rem;
    font-weight: var(--admin-fw-semibold);
    outline: none;
}

.ref-program-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .86rem;
}

.ref-program-table th {
    padding: 0 12px 10px;
    color: #98a2b3;
    font-size: .68rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.ref-program-table td {
    border-top: 1px solid rgba(17,24,39,.055);
    padding: 12px;
    color: #344054;
    font-weight: var(--admin-fw-medium);
}

.ref-program-table tbody tr:hover td {
    background: color-mix(in srgb, var(--admin-surface-soft) 70%, transparent);
}

.ref-program-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ref-program-panel .js-tg-name {
    font-weight: var(--admin-fw-semibold);
    text-decoration: none;
}

.ref-program-panel .js-tg-name:hover {
    text-decoration: none;
}

.ref-chart-modal {
    position: fixed;
    inset: 0;
    z-index: var(--admin-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(10px);
}

.ref-chart-modal.hidden {
    display: none;
}

.ref-chart-modal-panel {
    position: relative;
    width: min(100%, 980px);
    max-height: min(88vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--admin-border);
    border-radius: 28px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    color: var(--admin-text);
    animation: adminDatepickerIn .18s ease both;
}

.ref-chart-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    font-size: 1.35rem;
    line-height: 1;
    transition: color .18s ease, background .18s ease;
}

.ref-chart-modal-close:hover {
    background: var(--admin-neutral-50);
    color: var(--admin-text-strong);
}

.ref-month-compare-btn {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(11, 132, 255, .12);
    border-radius: 999px;
    background: #f4faff;
    color: #0b66d8;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.ref-month-compare-btn:hover {
    border-color: rgba(11, 132, 255, .20);
    background: #eaf4ff;
    transform: translateY(-1px);
}

.ref-month-compare-modal {
    position: fixed;
    inset: 0;
    z-index: 540;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ref-month-compare-modal.hidden {
    display: none !important;
}

.ref-month-compare-backdrop {
    position: fixed;
    inset: 0;
}

.ref-month-compare-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: min(88vh, 720px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--admin-border);
    border-radius: 30px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 24px;
    color: var(--admin-text);
    animation: adminDatepickerIn .18s ease both;
}

.ref-month-compare-close {
    position: absolute;
    top: 18px;
    right: 18px;
}

.ref-month-compare-dialog h3 {
    margin: 0 48px 16px 0;
    color: var(--admin-text-strong);
    font-size: 1.35rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -.02em;
}

.ref-month-compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ref-month-compare-grid > div,
.ref-month-compare-result {
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-neutral-50);
    padding: 14px;
}

.ref-month-compare-grid span,
.ref-month-compare-result span {
    display: block;
    color: var(--admin-text-muted);
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
}

.ref-month-compare-grid strong,
.ref-month-compare-result strong {
    display: block;
    margin-top: 8px;
    color: var(--admin-text-strong);
    font-size: 1.35rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -.02em;
}

.ref-month-compare-grid small,
.ref-month-compare-result small {
    display: block;
    margin-top: 5px;
    color: #98a2b3;
    font-size: .72rem;
    font-weight: var(--admin-fw-medium);
}

.ref-month-compare-result {
    margin-top: 10px;
    background: #f8fafc;
}

.ref-month-compare-result.is-positive {
    border-color: rgba(23, 168, 81, .14);
    background: #ecfdf3;
}

.ref-month-compare-result.is-positive strong,
.ref-month-compare-result.is-positive small {
    color: #0f8c51;
}

.ref-month-compare-result.is-negative {
    border-color: rgba(244, 63, 94, .14);
    background: #fff1f4;
}

.ref-month-compare-result.is-negative strong,
.ref-month-compare-result.is-negative small {
    color: #be123c;
}

.ref-month-compare-empty {
    margin: 0;
    border: 1px dashed var(--admin-border);
    border-radius: 22px;
    background: var(--admin-neutral-50);
    padding: 18px;
    color: var(--admin-text-muted);
    font-size: .9rem;
    font-weight: var(--admin-fw-medium);
}

.ref-month-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    min-height: 0;
    max-height: min(52vh, 500px);
    overflow-y: auto;
    padding: 2px 4px 2px 0;
}

.ref-month-history-row {
    display: grid;
    grid-template-columns: minmax(130px, .9fr) minmax(170px, 1.2fr) minmax(128px, auto);
    align-items: center;
    gap: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-neutral-50);
    padding: 12px;
    box-shadow: none;
}

.ref-month-history-label,
.ref-month-history-value {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ref-month-history-label strong,
.ref-month-history-value strong {
    color: var(--admin-text-strong);
    font-size: .92rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.2;
}

.ref-month-history-label span,
.ref-month-history-value span {
    color: var(--admin-text-soft);
    font-size: .74rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.2;
}

.ref-month-history-value {
    align-items: flex-end;
    text-align: right;
}

.ref-month-history-value span.is-positive {
    color: var(--admin-success);
}

.ref-month-history-value span.is-negative {
    color: var(--admin-danger);
}

.ref-month-history-track {
    height: 10px;
    display: flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--admin-primary-border);
    background: var(--admin-primary-softer);
    overflow: hidden;
}

.ref-month-history-track span {
    display: block;
    min-width: 8px;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4aa3ff 0%, #0b84ff 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .20) inset;
}

@media (max-width: 900px) {
    .ref-month-history-row {
        grid-template-columns: 1fr;
    }

    .ref-month-history-value {
        align-items: flex-start;
        text-align: left;
    }
}

.ref-chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--admin-border);
    background: var(--admin-neutral-50);
    padding: 12px 16px;
    flex-shrink: 0;
}

.ref-chart-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    padding: 0 12px;
    color: var(--admin-text-secondary);
    font-size: .8rem;
    font-weight: var(--admin-fw-semibold);
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.ref-chart-filter-btn:hover {
    border-color: var(--admin-primary-border);
    background: var(--admin-primary-softer);
    color: var(--admin-primary-text);
}

.ref-chart-date-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
    padding-left: 12px;
    border-left: 1px solid rgba(17,24,39,.07);
}

@media (max-width: 1320px) {
    .ref-kpi-row {
        flex-direction: column;
    }
}

@media (max-width: 1180px) {
    .ref-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .ref-page-head {
        grid-template-columns: 1fr;
        row-gap: 16px;
    }

    .ref-page-actions {
        align-items: flex-start;
        width: min(100%, 220px);
    }

    .ref-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ref-section-head {
        flex-direction: column;
    }

    .ref-date-filter {
        justify-content: flex-start;
    }

    .ref-chart-date-range {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
}

.ui-search {
    min-height: 38px;
    width: 100%;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    color: var(--admin-text-secondary);
    font-size: .875rem;
    font-weight: var(--admin-fw-medium);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .035);
    padding: 0 3.75rem 0 1rem !important;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.ui-search:hover {
    background: var(--admin-surface-soft);
}

.ui-search:focus {
    outline: none;
    border-color: rgba(11,132,255,.42);
    box-shadow: 0 0 0 4px rgba(11,132,255,.10);
}

.ui-search-action {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--admin-neutral-100);
    color: var(--admin-text-muted);
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.ui-search-action:hover {
    background: var(--admin-primary-softer);
    color: var(--admin-primary-text);
    box-shadow: 0 6px 14px rgba(11,132,255,.12);
}

.ui-search-clear {
    position: absolute;
    top: 50%;
    right: 34px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--admin-text-soft);
    transition: color .2s ease, background .2s ease;
}

.ui-search-clear:hover {
    color: #667085;
}

.bot-card {
    position: relative;
    z-index: 1;
    border: 1px solid var(--admin-border);
    border-radius: 24px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-card);
}

.bot-card:hover,
.bot-card:focus-within,
.bot-card:has([data-expanded="1"]) {
    z-index: 8;
}

.bots-live-list {
    position: relative;
    z-index: 2;
}

.bots-archive-block {
    position: relative;
    z-index: 1;
}

.bot-card.is-disabled {
    border-color: rgba(245, 158, 11, .22);
    background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(255, 251, 235, .84));
}

.bot-card.is-archived {
    border-color: rgba(239, 68, 68, .18);
    background: linear-gradient(135deg, rgba(255,255,255,.97), rgba(254, 242, 242, .82));
    overflow: visible;
}

.bots-archive-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.bot-card.has-operation {
    border-color: rgba(11, 116, 241, .18);
}

.bot-operation-pill {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(11, 116, 241, .16);
    border-radius: 999px;
    background: var(--admin-primary-softer);
    padding: 0 10px;
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.bot-operation-pill:hover {
    border-color: rgba(11, 116, 241, .3);
    background: #e8f3ff;
}

.bot-operation-pill .admin-line-icon { width: 14px; height: 14px; }
.bot-operation-dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.bot-operation-pill.is-success { border-color: var(--admin-success-border); background: var(--admin-success-soft); color: var(--admin-success); }
.bot-operation-pill.is-warning { border-color: var(--admin-warning-border); background: var(--admin-warning-soft); color: var(--admin-warning); }
.bot-operation-pill.is-danger { border-color: var(--admin-danger-border); background: var(--admin-danger-soft); color: var(--admin-danger); }
.bot-operation-pill.is-info { color: var(--admin-primary); }
.bot-menu-item.is-disabled,
.bot-menu-item:disabled { color: var(--admin-text-muted) !important; cursor: not-allowed; opacity: .7; background: transparent !important; }

.bot-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
}

.bot-status-on {
    color: var(--admin-success);
    background: var(--admin-success-soft);
}

.bot-status-off {
    color: #667085;
    background: #f2f4f7;
}

.bot-status-archived {
    color: #b42318;
    background: #fee4e2;
}

.bot-health-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 28px;
    border-radius: 999px;
    padding: 0 11px;
    border: 1px solid rgba(17, 24, 39, .07);
    background: #fff;
    color: #344054;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .035);
    cursor: default;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bot-health-pill:hover,
.bot-health-pill:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
    outline: none;
}

.bot-health-pill.bot-health-active:hover,
.bot-health-pill.bot-health-active:focus-visible {
    background: #e2fbeb;
    border-color: rgba(34, 197, 94, .34);
}

.bot-health-pill.bot-health-quiet:hover,
.bot-health-pill.bot-health-quiet:focus-visible {
    background: #e4f2ff;
    border-color: rgba(47, 128, 237, .3);
}

.bot-health-pill.bot-health-warning:hover,
.bot-health-pill.bot-health-warning:focus-visible {
    background: #fff0d3;
    border-color: rgba(245, 158, 11, .34);
}

.bot-health-pill.bot-health-danger:hover,
.bot-health-pill.bot-health-danger:focus-visible {
    background: #ffe9e7;
    border-color: rgba(239, 68, 68, .3);
}

.bot-health-pill.bot-health-delete:hover,
.bot-health-pill.bot-health-delete:focus-visible {
    background: #ffe4e6;
    border-color: rgba(159, 18, 57, .38);
}

.bot-health-pill.bot-health-neutral:hover,
.bot-health-pill.bot-health-neutral:focus-visible,
.bot-health-pill.bot-health-disabled:hover,
.bot-health-pill.bot-health-disabled:focus-visible {
    background: #f1f5f9;
    border-color: rgba(102, 112, 133, .24);
}

.bot-health-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 13%, transparent);
}

.bot-health-active {
    border-color: rgba(34, 197, 94, .22);
    background: #ecfdf3;
    color: #17a851;
}

.bot-health-quiet {
    border-color: rgba(47, 128, 237, .18);
    background: #eef6ff;
    color: #1876e8;
}

.bot-health-warning {
    border-color: rgba(245, 158, 11, .22);
    background: #fff7e8;
    color: #d97706;
}

.bot-health-danger {
    border-color: rgba(239, 68, 68, .18);
    background: #fff1f0;
    color: #e03e3e;
}

.bot-health-delete {
    border-color: rgba(159, 18, 57, .28);
    background: #fff1f2;
    color: #9f1239;
}

.bot-health-neutral,
.bot-health-disabled {
    border-color: rgba(102, 112, 133, .16);
    background: #f8fafc;
    color: #667085;
}

.bot-health-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    min-width: 50px;
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0 10px;
    border: 1px solid rgba(17, 24, 39, .07);
    background: #fff;
    color: #344054;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .035);
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bot-health-counter:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
}

.bot-health-counter .bot-health-dot {
    width: 8px;
    height: 8px;
}

.bot-health-counter.bot-health-active {
    border-color: rgba(34, 197, 94, .22);
    background: #ecfdf3;
    color: #17a851;
}

.bot-health-counter.bot-health-quiet {
    border-color: rgba(47, 128, 237, .18);
    background: #eef6ff;
    color: #1876e8;
}

.bot-health-counter.bot-health-warning {
    border-color: rgba(245, 158, 11, .22);
    background: #fff7e8;
    color: #d97706;
}

.bot-health-counter.bot-health-danger {
    border-color: rgba(239, 68, 68, .18);
    background: #fff1f0;
    color: #e03e3e;
}

.bot-health-counter.bot-health-delete {
    border-color: rgba(159, 18, 57, .28);
    background: #fff1f2;
    color: #9f1239;
}

.bot-health-counter.bot-health-neutral {
    border-color: rgba(102, 112, 133, .16);
    background: #f8fafc;
    color: #667085;
}

a.bot-health-counter {
    text-decoration: none;
}

.bot-health-counter.is-active {
    box-shadow: 0 0 0 2px rgba(11, 132, 255, .28);
}

.bot-health-counter.bot-health-unmanaged {
    border-color: rgba(245, 158, 11, .22);
    background: #fff7e8;
    color: #c56c08;
}

.bot-health-unmanaged .bot-health-dot {
    background: #d97706;
}

.bot-health-counter.bot-health-invalid {
    border-color: rgba(224, 62, 62, .22);
    background: #fff1f0;
    color: #e03e3e;
}

.bot-health-invalid .bot-health-dot {
    background: #e03e3e;
}

.bot-health-tooltip {
    position: fixed;
    z-index: var(--admin-z-popover);
    width: min(330px, calc(100vw - 24px));
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, .95);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 22px 50px rgba(15, 23, 42, .14);
    padding: 12px;
    color: #111827;
    pointer-events: none;
}

.bot-health-tooltip div {
    display: grid;
    grid-template-columns: minmax(98px, .75fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 8px;
    border-radius: 14px;
}

.bot-health-tooltip div + div {
    border-top: 1px solid rgba(226, 232, 240, .7);
}

.bot-health-tooltip span {
    color: #98a2b3;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
}

.bot-health-tooltip strong {
    color: #344054;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.35;
    word-break: break-word;
}

.bot-health-group-modal-panel {
    max-height: min(82vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bot-health-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding-right: 4px;
}

.bot-health-group-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-surface);
    padding: 13px 14px;
    box-shadow: none;
}

.bot-health-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--admin-text-strong);
    font-size: .92rem;
    font-weight: var(--admin-fw-semibold);
}

.bot-health-group-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bot-health-group-title a {
    color: #1876e8;
    font-size: .8rem;
    font-weight: var(--admin-fw-semibold);
}

.bot-health-group-meta,
.bot-health-group-note {
    margin-top: 5px;
    color: var(--admin-text-soft);
    font-size: .74rem;
    font-weight: var(--admin-fw-medium);
    line-height: 1.35;
}

.bot-health-group-note {
    color: var(--admin-text-muted);
}

.bot-health-group-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    gap: 6px;
}

.bot-health-group-metrics div {
    min-width: 0;
    border-radius: 16px;
    border: 1px solid var(--admin-border);
    background: var(--admin-neutral-50);
    padding: 8px 10px;
    text-align: center;
}

.bot-health-group-metrics span {
    display: block;
    color: var(--admin-text-soft);
    font-size: .65rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.2;
    white-space: nowrap;
}

.bot-health-group-metrics strong {
    display: block;
    margin-top: 4px;
    color: var(--admin-text-strong);
    font-size: .86rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
}

.searcher-stack {
    display: grid;
    gap: 16px;
}

.searcher-keyword-add {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 420px);
}

.searcher-keyword-add .settings-input {
    flex: 1 1 auto;
    min-width: 0;
}

.searcher-keywords-table {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.searcher-keywords-list,
.searcher-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.searcher-keywords-empty {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed var(--admin-border);
    color: var(--admin-text-muted);
    font-size: 13px;
    text-align: center;
}

.searcher-head-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.searcher-last-collect {
    color: #98a2b3;
    font-size: .74rem;
    font-weight: var(--admin-fw-medium);
    line-height: 1.45;
    text-align: right;
}

.searcher-filter-card {
    position: relative;
    z-index: 70;
    overflow: visible;
}

.searcher-filter-card form {
    width: 100%;
}

.searcher-filter-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    padding-left: 8px;
    white-space: nowrap;
}

.searcher-chart-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 15px;
}

.searcher-filter-actions .settings-btn {
    flex: 0 0 auto;
}

.searcher-keyword-row,
.searcher-result-row {
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-surface);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}

.searcher-keyword-row {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 14px;
    min-width: 0;
}

.searcher-keyword-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--admin-text);
    min-width: 0;
    white-space: nowrap;
}

.searcher-keyword-status {
    display: inline-flex;
    align-items: center;
    width: auto;
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.searcher-keyword-status.is-on {
    background: var(--admin-success-soft);
    color: #047857;
}

.searcher-keyword-status.is-off {
    background: color-mix(in srgb, #6b7280 14%, var(--admin-surface));
    color: var(--admin-text-muted);
}

html[data-theme="dark"] .searcher-keyword-status.is-on {
    color: #6ee7b7;
}

.searcher-keyword-row.is-on {
    border-color: rgba(3, 152, 85, 0.22);
}

.searcher-keyword-row .admin-switch {
    width: 34px;
    height: 20px;
}

.searcher-keyword-row .admin-switch-thumb {
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
}

.searcher-keyword-row .admin-switch.is-on .admin-switch-thumb {
    transform: translateX(14px);
}

@media (max-width: 720px) {
    .searcher-keyword-add {
        width: 100%;
        min-width: 0;
    }
}

.searcher-result-row {
    position: relative;
    display: block;
    min-height: 86px;
    padding: 14px;
    padding-right: 152px;
}

.searcher-result-row.is-unread {
    border-color: color-mix(in srgb, var(--admin-border) 40%, #94a3b8);
    background: color-mix(in srgb, var(--admin-surface-soft) 55%, var(--admin-surface));
}

.searcher-result-row.is-read {
    border-color: var(--admin-border);
    background: var(--admin-surface);
}

.searcher-result-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--admin-text-strong);
    font-size: .95rem;
    font-weight: var(--admin-fw-semibold);
}

.searcher-result-title > span:not(.searcher-new-dot) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searcher-result-title a {
    color: #1876e8;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
}

.searcher-copy-username {
    color: #1876e8;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    border-radius: 999px;
    padding: 2px 7px;
    background: rgba(24, 118, 232, .08);
    transition: background .18s ease, color .18s ease;
}

.searcher-copy-username:hover {
    color: #0a62dc;
    background: rgba(24, 118, 232, .14);
}

.searcher-new-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 5px rgba(148, 163, 184, .14);
}

.searcher-result-meta {
    margin-top: 6px;
    color: #98a2b3;
    font-size: .74rem;
    font-weight: var(--admin-fw-medium);
}

.searcher-result-text {
    margin-top: 8px;
    color: var(--admin-text-secondary);
    font-size: .82rem;
    line-height: 1.45;
}

.searcher-result-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.searcher-result-actions form {
    display: inline-flex;
    flex: 0 0 auto;
}

.searcher-result-actions .ui-pill {
    width: 100%;
    min-width: 104px;
}

.searcher-icon-action {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, .06);
    background: #fff;
    color: #667085;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.searcher-icon-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .08);
}

.searcher-icon-action-seen {
    color: #15a05f;
    background: #ecfdf3;
    border-color: rgba(21, 160, 95, .16);
}

.searcher-icon-action-seen:hover {
    color: #0f8c51;
    background: #dcfce9;
    border-color: rgba(21, 160, 95, .22);
    box-shadow: 0 12px 24px rgba(21, 160, 95, .10);
}

.searcher-icon-action-open {
    color: #fff;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
    border-color: rgba(11, 132, 255, .18);
}

.searcher-icon-action-open:hover {
    color: #fff;
    box-shadow: 0 8px 18px rgba(11, 132, 255, .16);
}

.searcher-icon-action-task {
    color: #667085;
    background: #fff;
    border-color: rgba(17, 24, 39, .06);
}

.searcher-icon-action-task:hover {
    color: #0b84ff;
    background: #f8fbff;
    border-color: rgba(11, 132, 255, .12);
}

.searcher-task-modal {
    position: fixed;
    inset: 0;
    z-index: 520;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.searcher-task-modal.hidden {
    display: none;
}

.searcher-task-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .26);
    backdrop-filter: blur(12px);
}

.searcher-task-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    border: 1px solid rgba(255, 255, 255, .70);
    border-radius: 30px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 28px 80px rgba(15, 23, 42, .18);
    padding: 24px;
}

.searcher-task-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, .06);
    background: #fff;
    color: #667085;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.searcher-account-queue-panel {
    width: min(760px, 100%);
}

.searcher-task-form {
    gap: 14px;
}

.searcher-task-section {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-surface);
}

.searcher-task-section h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--admin-text);
}

.searcher-task-section.is-current-step,
.account-create-form-section.is-current-step {
    border-color: rgba(11, 132, 255, .28);
    box-shadow: 0 0 0 1px rgba(11, 132, 255, .12);
}

.create-flow-steps {
    margin: 0 0 4px;
}

.create-flow-steps ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.create-flow-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    color: var(--admin-text-soft);
    font-size: 12px;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.2;
}

.create-flow-steps li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--admin-border);
    color: var(--admin-text-muted);
    font-size: 10px;
}

.create-flow-steps li.is-current {
    border-color: rgba(11, 132, 255, .28);
    color: var(--admin-primary);
}

.create-flow-steps li.is-current span {
    background: var(--admin-primary);
    color: #fff;
}

.create-flow-steps li.is-done {
    color: var(--admin-text);
}

.create-flow-steps li.is-done span {
    background: #17a851;
    color: #fff;
}

.searcher-task-block {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: 16px;
    background: rgba(15, 23, 42, .015);
}

.searcher-task-block h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--admin-text);
}

.searcher-task-hint {
    margin: 0;
    font-size: 12px;
    color: var(--admin-text-muted);
}

.searcher-field-emphasis {
    padding: 10px;
    border: 1px solid rgba(247, 144, 9, .35);
    border-radius: 14px;
    background: rgba(247, 144, 9, .06);
}

.searcher-visual-preview.is-warn {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(180, 35, 24, .18);
    background: #fff1f0;
}

.searcher-visual-preview.is-original-hint {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px dashed rgba(247, 144, 9, .35);
    background: rgba(247, 144, 9, .04);
}

.searcher-welcome-preview {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
}

.searcher-welcome-preview-image img {
    display: block;
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
}

.searcher-welcome-preview-text {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.45;
    color: var(--admin-text);
}

.searcher-welcome-preview-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-muted);
}

#searcherTaskDescription.js-autoheight-textarea {
    min-height: 2.75rem;
    max-height: min(45vh, 22rem);
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

.searcher-visual-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.searcher-visual-preview figure {
    margin: 0;
    display: grid;
    gap: 4px;
    justify-items: start;
}

.searcher-visual-preview img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    background: #fff;
}

.searcher-visual-preview figcaption {
    font-size: 11px;
    font-weight: 600;
    color: var(--admin-muted);
}

.searcher-username-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.searcher-check-hint {
    color: var(--admin-text-muted);
    font-size: 12px;
}

.searcher-send-confirm {
    margin: 10px 0 0;
    color: var(--admin-text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.searcher-username-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 18px;
    margin-bottom: 12px;
}

.searcher-username-column h4 {
    margin: 0 0 8px;
    color: var(--admin-text-strong);
    font-size: 12px;
    font-weight: 700;
}

.searcher-username-custom-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.searcher-username-custom-row .broadcast-input {
    flex: 1;
    min-width: 0;
}

.searcher-username-column .searcher-check-hint {
    margin: 0 0 8px;
    min-height: 16px;
}

.searcher-username-pill-remove {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
}

.searcher-username-pill-remove:hover {
    opacity: 1;
}

@media (max-width: 720px) {
    .searcher-username-columns {
        grid-template-columns: 1fr;
    }
}

.searcher-username-pills {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.searcher-username-score {
    margin-left: 6px;
    font-weight: 600;
    opacity: .55;
    font-variant-numeric: tabular-nums;
}

.searcher-username-pill {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--admin-border);
    background: var(--admin-neutral-50);
    color: var(--admin-text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.searcher-username-pill.is-likely_free {
    background: var(--admin-success-soft);
    color: var(--admin-success);
    border-color: var(--admin-success-border);
}

.searcher-username-pill.is-ok_format,
.searcher-username-pill.is-candidate {
    background: var(--admin-neutral-50);
    color: var(--admin-text-secondary);
    border-color: var(--admin-border);
}

.searcher-username-pill.is-taken_local,
.searcher-username-pill.is-taken_tg,
.searcher-username-pill.is-invalid {
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    border-color: var(--admin-danger-border);
}

.searcher-username-pill.is-check_failed {
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
    border-color: var(--admin-warning-border);
}

.searcher-creation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--admin-primary-soft);
    color: var(--admin-primary-text);
}

.searcher-creation-badge.is-success {
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.searcher-creation-badge.is-warning {
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.searcher-creation-badge.is-danger {
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.searcher-creation-badge.is-accent {
    background: var(--admin-teal-soft);
    color: #0e7090;
}

.searcher-account-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--admin-primary-border);
    border-radius: 20px;
    background: var(--admin-primary-softer);
}

.searcher-account-preview.hidden {
    display: none;
}

.searcher-account-preview > div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 15px;
    background: var(--admin-surface);
}

.searcher-account-preview span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.searcher-account-preview strong {
    overflow: hidden;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="dark"] .searcher-username-pill.is-likely_free,
html[data-theme="dark"] .searcher-creation-badge.is-success {
    color: #6ce9a6;
}

html[data-theme="dark"] .searcher-username-pill.is-taken_local,
html[data-theme="dark"] .searcher-username-pill.is-taken_tg,
html[data-theme="dark"] .searcher-username-pill.is-invalid,
html[data-theme="dark"] .searcher-creation-badge.is-danger {
    color: #fda29b;
}

html[data-theme="dark"] .searcher-username-pill.is-check_failed,
html[data-theme="dark"] .searcher-creation-badge.is-warning {
    color: #fec84b;
}

html[data-theme="dark"] .searcher-creation-badge {
    color: #84caff;
}

html[data-theme="dark"] .searcher-creation-badge.is-accent {
    color: #67e3f9;
}

.searcher-task-close:hover {
    color: var(--admin-text-strong);
    background: var(--admin-surface-soft);
    transform: translateY(-1px);
}

.searcher-task-status-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: 16px;
    border: 1px solid rgba(10, 98, 220, .12);
    background: #eaf4ff;
    color: #0a62dc;
    padding: 0 13px;
    font-size: .86rem;
    font-weight: var(--admin-fw-semibold);
}

.searcher-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, .06);
    padding-top: 14px;
}

.searcher-page-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(17, 24, 39, .07);
    border-radius: 999px;
    background: #fff;
    color: #344054;
    padding: 0 14px;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.searcher-page-btn:hover {
    border-color: rgba(11, 132, 255, .16);
    background: #f4faff;
    color: #0b66d8;
}

.searcher-page-btn.is-disabled {
    pointer-events: none;
    opacity: .45;
}

.searcher-page-state {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #344054;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
}

.searcher-page-state span {
    color: #98a2b3;
    font-size: .72rem;
}

.bot-webhook-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
}

.bot-webhook-pill svg {
    width: 15px;
    height: 15px;
}

.bot-webhook-invalid {
    border: 1px solid rgba(180, 35, 24, .16);
    background: #fff1f0;
    color: #b42318;
}

.bot-webhook-error {
    border: 1px solid rgba(181, 71, 8, .16);
    background: #fff4df;
    color: #b54708;
}

.invalid-token-counter {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 50px;
    height: 38px;
    min-height: 38px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, .08);
    background: rgba(255, 255, 255, .88);
    color: #667085;
    padding: 0 10px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.invalid-token-counter:hover {
    border-color: rgba(11, 132, 255, .18);
    background: #ffffff;
    color: #0b66d8;
}

.invalid-token-counter.has-invalid {
    border-color: rgba(180, 35, 24, .18);
    background: #fff1f0;
    color: #b42318;
}

.invalid-token-counter.has-invalid:hover {
    border-color: rgba(180, 35, 24, .28);
    background: #ffeceb;
    color: #b42318;
}

.invalid-token-counter svg {
    width: 16px;
    height: 16px;
}

.invalid-token-counter span {
    font-size: .76rem;
    font-weight: var(--admin-fw-bold);
    line-height: 1;
    min-width: 1ch;
}

.bot-owner-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 50px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid rgba(102,112,133,.14);
    border-radius: 999px;
    background: #fff;
    padding: 0 10px;
    color: #667085;
    box-shadow: 0 6px 16px rgba(15,23,42,.035);
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.bot-owner-counter:hover,
.bot-owner-counter.has-items:hover { border-color: rgba(47,128,237,.25); background: #eaf4ff; color: #0b66d8; }
.bot-owner-counter.has-items { border-color: rgba(245,158,11,.22); background: #fff7e8; color: #c56c08; }
.bot-owner-counter svg { width: 16px; height: 16px; }
.bot-owner-counter span { min-width: 1ch; font-size: .76rem; font-weight: var(--admin-fw-bold); line-height: 1; }

.bot-owner-pill {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    max-width: 230px;
    border: 1px solid #dfe5ec;
    border-radius: 999px;
    background: #f8fafc;
    padding: 0 10px;
    color: #667085;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bot-owner-searcher,
.bot-owner-account,
.bot-owner-taskboard,
.bot-owner-manual_link { border-color: #cfe2ff; background: #eef6ff; color: #0b66d8; }
.bot-owner-legacy { border-color: #e2e5ea; background: #f5f6f8; color: #7b8494; }
.bot-owner-unknown { border-color: #f4d7a4; background: #fff8eb; color: #b86407; }

.invalid-token-modal-panel {
    max-height: min(82vh, 680px);
}

.invalid-token-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 24px;
    background: var(--admin-surface-soft);
    padding: 18px;
}

.invalid-token-empty.hidden {
    display: none;
}

.invalid-token-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.invalid-token-empty h3 {
    margin: 0;
    font-size: var(--admin-text-base);
    font-weight: var(--admin-fw-semibold);
    color: var(--admin-text-strong);
}

.invalid-token-empty p {
    margin: 3px 0 0;
    font-size: var(--admin-text-sm);
    color: var(--admin-text-muted);
}

.invalid-token-list {
    display: grid;
    gap: 10px;
}

.invalid-token-list.hidden {
    display: none;
}

.invalid-token-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 24px;
    background: var(--admin-surface-soft);
    padding: 14px;
}

.invalid-token-row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    font-size: var(--admin-text-base);
    font-weight: var(--admin-fw-semibold);
    color: var(--admin-text-strong);
}

.invalid-token-username {
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
    color: #0b66d8;
    text-decoration: none;
}

button.invalid-token-username {
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.invalid-token-username:hover {
    color: #075ac4;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.invalid-token-row-meta {
    margin-top: 4px;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
    color: var(--admin-text-muted);
}

.invalid-token-row-error {
    margin-top: 6px;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    color: #b42318;
}

.invalid-token-row-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.invalid-token-adopt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.invalid-token-account-select {
    min-width: 9.5rem;
    max-width: 14rem;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    color: var(--admin-text);
    font: inherit;
    font-size: var(--admin-text-xs);
}

.invalid-token-refresh-btn:disabled {
    cursor: wait;
    opacity: .7;
}

.bot-stats-line {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    color: #667085;
    font-size: .875rem;
    line-height: 1.35;
}

.bot-stats-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f4f6f9;
    padding: .25rem .55rem;
    color: #475467;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
}

.bot-action-btn,
.bot-edit-btn {
    border: 1px solid var(--admin-border);
    background: var(--admin-surface-soft);
    color: var(--admin-text-secondary);
    box-shadow: none;
}

.bot-icon-action-btn {
    justify-content: center;
    width: 38px;
    min-width: 38px;
    padding-right: 0;
    padding-left: 0;
    gap: 0;
    color: var(--admin-text-secondary);
}

.bot-icon-action-btn .admin-line-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2.75;
}

.bot-manage-compact {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 999px;
}

.bot-icon-action-btn:hover,
.js-bot-manage-toggle:hover {
    transform: none !important;
}

.bot-action-btn:hover,
.bot-edit-btn:hover {
    border-color: var(--admin-primary-border);
    background: var(--admin-primary-softer);
    color: var(--admin-primary-text);
    box-shadow: none;
}

.bot-tag-popover-shell {
    overflow: visible;
}

.bot-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--tag-bg, #d0d5dd) 38%, #ffffff);
    background: color-mix(in srgb, var(--tag-bg, #d0d5dd) 88%, #ffffff);
    box-shadow: none;
    padding: 0 5px 0 12px;
    color: var(--tag-text, #344054);
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
}

.bot-tag-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: color-mix(in srgb, var(--tag-text, #344054) 72%, #667085);
    opacity: .68;
    transition: background .18s ease, color .18s ease, opacity .18s ease;
}

.bot-tag-remove-btn:hover {
    background: rgba(15,23,42,.08);
    color: color-mix(in srgb, var(--tag-text, #344054) 88%, #101827);
    opacity: 1;
}

.bot-tag-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,.07);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,247,251,.92));
    color: #344054;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.bot-tag-add-btn:hover,
.js-bot-tag-shell[data-expanded="1"] .bot-tag-add-btn {
    border-color: rgba(11,132,255,.16);
    background: #f7fbff;
    color: #0b66d8;
    transform: none;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
}

.bot-metrics-panel {
    margin-right: 0;
    margin-left: 0;
    margin-bottom: 0;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-50);
    box-shadow: none;
    padding: 7px 9px;
}

.bot-metric-compact {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 30px;
    padding: 0 9px !important;
    border: 0;
    border-right: 1px solid var(--admin-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.bot-metric-compact:last-child {
    border-right: 0;
}

.bot-metric-label {
    overflow: hidden;
    color: var(--admin-text-muted);
    font-size: .7rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bot-metric-value {
    color: var(--admin-text);
    font-size: .88rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.bot-metric-compact .text-blue-600,
.bot-metric-compact .text-green-700 {
    color: inherit !important;
}

.bot-metric-compact .text-blue-600.bot-metric-label,
.bot-metric-compact .text-blue-600.bot-metric-value {
    color: #0b66d8 !important;
}

.bot-metric-compact .text-green-700.bot-metric-label,
.bot-metric-compact .text-green-700.bot-metric-value {
    color: var(--admin-success) !important;
}

.bot-tag-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(21rem, calc(100vw - 2rem));
    border-radius: 20px;
    border: 1px solid rgba(17,24,39,.08);
    background: rgba(255,255,255,.98);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .16);
    padding: 10px;
    z-index: 60;
}

.bot-tag-custom-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.bot-tag-custom-input {
    min-width: 0;
    flex: 1;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(152,162,179,.24);
    background: #f8fafc;
    padding: 0 12px;
    color: var(--admin-text);
    font-size: .82rem;
    font-weight: var(--admin-fw-medium);
    outline: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.bot-tag-custom-input:focus {
    border-color: rgba(11,132,255,.42);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11,132,255,.08);
}

.bot-tag-custom-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,.07);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,247,251,.92));
    color: #344054;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.bot-tag-custom-submit:hover {
    border-color: rgba(11,132,255,.16);
    background: #f7fbff;
    color: #0b66d8;
    transform: none;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
}

.bot-tag-popover-title {
    padding: 2px 3px 6px;
    color: #98a2b3;
    font-size: .68rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bot-tag-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bot-tag-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--tag-bg, #d0d5dd) 38%, #ffffff);
    background: color-mix(in srgb, var(--tag-bg, #d0d5dd) 88%, #ffffff);
    padding: 0 12px;
    color: var(--tag-text, #344054);
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    box-shadow: none;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.bot-tag-choice:hover {
    border-color: color-mix(in srgb, var(--tag-bg, #d0d5dd) 56%, #ffffff);
    background: color-mix(in srgb, var(--tag-bg, #d0d5dd) 94%, #ffffff);
    color: var(--tag-text, #344054);
}

.bot-menu-panel {
    border-radius: 20px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    overflow: hidden;
    padding: 6px;
    backdrop-filter: blur(14px);
}

.bot-menu-panel :is(a, button, summary) {
    border-radius: 13px;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1.15;
    letter-spacing: -0.01em;
    padding: .6rem .7rem !important;
    transition: background .16s ease, color .16s ease;
}

.bot-menu-item {
    color: var(--admin-text-secondary) !important;
}

.bot-menu-item:hover {
    color: var(--admin-text-strong) !important;
}

.bot-menu-panel :is(a, button, summary):hover {
    background: var(--admin-surface-soft) !important;
}

.bot-menu-danger {
    color: var(--admin-danger) !important;
}

.bot-menu-danger:hover {
    background: var(--admin-danger-soft) !important;
    color: var(--admin-danger-strong) !important;
}

.bot-menu-panel form + form,
.bot-menu-panel details + form,
.bot-menu-panel button + form,
.bot-menu-panel form + button {
    margin-top: 2px;
}

.settings-card {
    border: 1px solid var(--admin-border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--admin-surface) 96%, transparent);
    box-shadow: var(--admin-shadow-card);
    padding: 16px;
    color: var(--admin-text);
}

.settings-card h2 {
    color: var(--admin-text);
    font-size: 1rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.015em;
}

.settings-card h3 {
    color: var(--admin-text);
    font-weight: var(--admin-fw-semibold);
}

.settings-btn,
.settings-card .aid-edit,
.settings-card .ref-cancel,
.settings-card .ref-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,.07);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,247,251,.92));
    padding: 0 13px;
    color: #344054;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.settings-btn > svg,
.settings-btn > .admin-line-icon {
    margin: 0;
    flex: 0 0 auto;
}

.settings-btn:hover,
.settings-card .aid-edit:hover,
.settings-card .ref-cancel:hover,
.settings-card .ref-edit:hover {
    border-color: rgba(11,132,255,.16);
    background: #f7fbff;
    color: #0b66d8;
    transform: translateY(-1px);
}

.settings-btn-primary,
.settings-card .aid-save,
.settings-card .ref-edit,
.settings-card button[type="submit"].bg-blue-600 {
    min-height: 38px;
    border-color: transparent;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%);
    padding: 0 14px;
    color: #fff;
    font-size: .875rem;
    box-shadow: none;
}

.settings-btn-primary:hover,
.settings-card .aid-save:hover,
.settings-card .ref-edit:hover,
.settings-card button[type="submit"].bg-blue-600:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #0f7ff0 0%, #075fd1 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(11,132,255,.14);
    transform: translateY(-1px);
}

.settings-btn-primary svg,
.ui-pill-active svg {
    flex-shrink: 0;
}

.settings-btn-warning,
.settings-btn-primary.has-direct-snapshot {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
    box-shadow: none;
}

.settings-btn-warning:hover,
.settings-btn-primary.has-direct-snapshot:hover {
    border-color: rgba(181, 71, 8, 0.28);
    background: #ffeccc;
    color: var(--admin-warning);
    box-shadow: none;
    transform: translateY(-1px);
}

.settings-btn-warning svg,
.settings-btn-primary.has-direct-snapshot svg {
    color: currentColor;
}

.admin-shell .settings-btn-warning,
.admin-shell .settings-btn-primary.has-direct-snapshot {
    background: var(--admin-warning-soft) !important;
    color: var(--admin-warning) !important;
    border-color: var(--admin-warning-border) !important;
    box-shadow: none !important;
}

.admin-shell .settings-btn-warning:hover,
.admin-shell .settings-btn-primary.has-direct-snapshot:hover {
    background: #ffeccc !important;
    color: var(--admin-warning) !important;
    border-color: rgba(181, 71, 8, 0.28) !important;
}

.settings-card .aid-delete,
.settings-card button.bg-red-600,
.settings-card button.bg-red-50,
.settings-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(217,45,32,.12);
    background: #fff1f0;
    padding: 0 13px;
    color: #b42318;
    font-size: .82rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    box-shadow: none;
}

.settings-card .aid-delete:hover,
.settings-card button.bg-red-600:hover,
.settings-card button.bg-red-50:hover,
.settings-btn-danger:hover {
    background: #fee4e2;
    color: #912018;
}

.settings-input,
.settings-card input[type="text"],
.settings-card select {
    border: 1px solid rgba(17,24,39,.09);
    border-radius: 14px;
    background: #fff;
    color: #344054;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.settings-input:focus,
.settings-card input[type="text"]:focus,
.settings-card select:focus {
    border-color: rgba(11,132,255,.34);
    box-shadow: 0 0 0 4px rgba(11,132,255,.07);
}

.settings-card input[readonly] {
    background: #f7f9fc;
    color: #667085;
}

.settings-card table {
    border-collapse: separate;
    border-spacing: 0;
}

.settings-card thead tr {
    border-bottom: 0;
}

.settings-card th {
    color: #98a2b3;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.settings-card tbody tr {
    border-color: rgba(17,24,39,.055);
}

.settings-tag-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 20px;
    background: #fff;
    padding: 12px;
}

.settings-tag-swatch,
.settings-tag-preview {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--tag-bg, #d0d5dd) 38%, #ffffff);
    background: color-mix(in srgb, var(--tag-bg, #d0d5dd) 88%, #ffffff);
    padding: 0 12px;
    color: var(--tag-text, #344054);
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
}

.settings-tag-swatch {
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.settings-tag-swatch:hover {
    border-color: color-mix(in srgb, var(--tag-bg, #d0d5dd) 58%, #ffffff);
    transform: translateY(-1px);
}

.settings-tag-list {
    min-height: 3.5rem;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-neutral-50);
    padding: 6px;
}

.settings-tag-row {
    border-radius: 16px;
    background: var(--admin-surface);
    padding: 10px;
    transition: background .18s ease;
}

.settings-tag-row + .settings-tag-row {
    margin-top: 6px;
}

.settings-tag-row:hover {
    background: var(--admin-surface-soft);
}

.settings-ref-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-ref-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-surface);
    padding: 10px 12px;
}

.settings-ref-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1 1 auto;
}

.settings-ref-name {
    min-width: 0;
    color: var(--admin-primary-text);
    font-size: .86rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.settings-ref-dot {
    color: color-mix(in srgb, var(--admin-primary) 42%, transparent);
    font-size: .9rem;
    font-weight: var(--admin-fw-semibold);
}

.settings-ref-code {
    min-width: 0;
    color: var(--admin-text-secondary);
    font-size: .82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-ref-source {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: var(--admin-primary-softer);
    padding: 0 10px;
    color: var(--admin-primary-text);
    font-size: .74rem;
    font-weight: var(--admin-fw-semibold);
    box-shadow: inset 0 0 0 1px var(--admin-primary-border);
}

.settings-ref-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 34px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    padding: 0 12px;
    color: #0b66d8;
    font-family: inherit;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.settings-ref-copy:hover,
.settings-ref-copy.is-copied {
    background: #ffffff;
    border-color: rgba(11,132,255,.18);
    color: #075ec5;
    transform: translateY(-1px);
}

.settings-drag-handle,
.settings-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,.07);
    background: #fff;
    color: #98a2b3;
    font-size: .86rem;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(15,23,42,.035);
}

.settings-drag-handle {
    cursor: grab;
    user-select: none;
}

.settings-drag-handle:hover,
.settings-icon-btn:hover {
    color: #0b66d8;
    background: #f7fbff;
    border-color: rgba(11,132,255,.16);
}

.settings-icon-btn-lg {
    width: 38px;
    height: 38px;
}

.settings-session-terminate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(239,68,68,.18);
    background: #fff7f7;
    color: #d92d20;
    box-shadow: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.settings-session-terminate-btn:hover {
    background: #fff1f1;
    border-color: rgba(239,68,68,.26);
    color: #b42318;
    transform: translateY(-1px);
}

.settings-session-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
}

.settings-session-status.is-current {
    background: #ecfdf3;
    color: #17a851;
}

.settings-session-status.is-online {
    background: #eef6ff;
    color: #1876e8;
}

.settings-session-status.is-logged_out {
    background: #f2f4f7;
    color: #667085;
}

.settings-session-status.is-expired {
    background: #fff7e8;
    color: #d97706;
}

.settings-row-index {
    width: 2rem;
    flex-shrink: 0;
    color: #98a2b3;
    font-size: .75rem;
    font-weight: var(--admin-fw-semibold);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.settings-create-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 20px;
    background: #f8fafc;
    padding: 14px;
}

.settings-mini-modal {
    border: 1px solid var(--admin-border);
    border-radius: 26px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 20px;
    color: var(--admin-text);
}

.settings-mini-modal .settings-tag-palette {
    max-height: 130px;
    overflow-y: auto;
}

.bot-ui-modal {
    position: fixed;
    inset: 0;
    z-index: var(--admin-z-modal) !important;
    overflow-y: auto;
    background: rgba(15, 23, 42, .26);
    backdrop-filter: blur(12px);
}

.bot-ui-modal.hidden {
    display: none !important;
}

#materialsModal,
#botTagEditModal,
#botTagCreateModal {
    z-index: var(--admin-z-modal) !important;
}

#tplImageLightbox {
    z-index: var(--admin-z-modal-nested) !important;
}

.bot-ui-modal-backdrop {
    position: fixed;
    inset: 0;
}

.bot-ui-modal-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.bot-ui-modal-panel {
    max-height: min(90vh, 920px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    clip-path: inset(0 round 28px);
    border: 1px solid var(--admin-border);
    border-radius: 28px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 20px;
    color: var(--admin-text);
    scrollbar-width: thin;
    scrollbar-color: var(--admin-scroll-thumb) var(--admin-scroll-track);
}

.bot-ui-modal-panel::-webkit-scrollbar {
    width: 8px;
}

.bot-ui-modal-panel::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--admin-scroll-track);
    margin: 22px 0;
}

.bot-ui-modal-panel::-webkit-scrollbar-thumb {
    border: 2px solid var(--admin-scroll-track);
    border-radius: 999px;
    background: var(--admin-scroll-thumb);
}

.bot-ui-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.bot-ui-modal-head > div {
    min-width: 0;
}

.bot-ui-modal-head h2 {
    margin: 6px 0 0;
    color: var(--admin-text-strong);
    font-size: 1.35rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -.03em;
}

.bot-ui-modal-head p {
    margin-top: 6px;
    color: var(--admin-text-muted);
    font-size: .875rem;
    font-weight: var(--admin-fw-regular);
}

.bot-ui-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 999px;
    background: #fff;
    padding: 0 12px;
    color: #2563eb;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
    box-shadow: 0 8px 20px rgba(15,23,42,.04);
}

.bot-ui-eyebrow span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #3b82f6;
}

.bot-ui-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 999px;
    background: #f7f9fc;
    color: #667085;
    line-height: 1;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.bot-ui-modal-close:hover {
    border-color: rgba(11,132,255,.14);
    background: #eef7ff;
    color: #0b66d8;
}

.bot-lifecycle-content { display: grid; gap: 18px; }
.bot-lifecycle-summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.bot-lifecycle-card { min-width: 0; border: 1px solid var(--admin-border); border-radius: 20px; background: var(--admin-neutral-50); padding: 16px; }
.bot-lifecycle-label { display: block; margin-bottom: 10px; color: var(--admin-text-soft); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.bot-lifecycle-value { color: var(--admin-text-strong); font-size: .95rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.bot-lifecycle-note { margin-top: 5px; color: var(--admin-text-muted); font-size: .8rem; line-height: 1.45; overflow-wrap: anywhere; }
.bot-lifecycle-link { display: inline-flex; margin-top: 10px; color: var(--admin-primary-text); font-size: .8rem; font-weight: 650; }
.bot-lifecycle-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bot-lifecycle-pill { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid var(--admin-border); border-radius: 999px; background: var(--admin-surface); padding: 0 10px; color: var(--admin-text-muted); font-size: .75rem; font-weight: 650; }
.bot-lifecycle-pill.is-ok { border-color: var(--admin-success-border); background: var(--admin-success-soft); color: var(--admin-success); }
.bot-lifecycle-columns { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: 14px; }
.bot-lifecycle-columns > section { min-width: 0; border: 1px solid var(--admin-border); border-radius: 22px; background: var(--admin-surface); padding: 16px; }
.bot-lifecycle-columns h3 { margin: 0 0 12px; color: var(--admin-text-strong); font-size: .95rem; font-weight: 700; }
.bot-lifecycle-attempt { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; border-top: 1px solid var(--admin-border); padding: 12px 0; }
.bot-lifecycle-attempt:first-of-type { border-top: 0; padding-top: 0; }
.bot-lifecycle-attempt > div:first-child { display: grid; min-width: 0; }
.bot-lifecycle-attempt strong { color: var(--admin-text-secondary); font-size: .84rem; }
.bot-lifecycle-attempt span { color: var(--admin-text-muted); font-size: .78rem; overflow-wrap: anywhere; }
.bot-lifecycle-attempt time, .bot-lifecycle-event time { color: var(--admin-text-soft); font-size: .72rem; }
.bot-lifecycle-attempt p { grid-column: 1/-1; margin: 0; color: var(--admin-danger); font-size: .76rem; line-height: 1.4; }
.bot-lifecycle-timeline { display: grid; }
.bot-lifecycle-event { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 10px; border-top: 1px solid var(--admin-border); padding: 11px 0; }
.bot-lifecycle-event:first-child { border-top: 0; padding-top: 0; }
.bot-lifecycle-event-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 999px; background: #f59e0b; }
.bot-lifecycle-event-dot.is-ok { background: #12b76a; }
.bot-lifecycle-event strong { display: block; color: var(--admin-text-secondary); font-size: .82rem; line-height: 1.4; }
.bot-lifecycle-event p { margin: 3px 0 0; color: var(--admin-danger); font-size: .75rem; line-height: 1.4; }
.bot-lifecycle-loading, .bot-lifecycle-empty, .bot-lifecycle-error { border: 1px dashed var(--admin-border); border-radius: 18px; background: var(--admin-neutral-50); padding: 24px; color: var(--admin-text-muted); text-align: center; }
.bot-lifecycle-error { border-color: var(--admin-danger-border); background: var(--admin-danger-soft); color: var(--admin-danger); }
@media (max-width: 900px) { .bot-lifecycle-summary-grid, .bot-lifecycle-columns { grid-template-columns: 1fr; } }

.bots-sales-modal-panel {
    display: flex;
    flex-direction: column;
    width: max-content;
    max-width: min(calc(100vw - 48px), 52rem);
    overflow: hidden;
}
.bots-sales-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; width: 100%; flex: 0 0 auto; }
.bots-sales-meta { margin-left: auto; color: var(--admin-text-muted); font-size: .78rem; font-weight: 650; }
.bots-sales-content {
    display: flex;
    flex-direction: column;
    min-height: 180px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.bots-sales-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 0 -4px;
    padding: 0 4px 4px;
}
.bots-sales-table {
    width: max-content;
    max-width: none;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .86rem;
    text-align: left;
}
.bots-sales-table th,
.bots-sales-table td {
    padding: 9px 18px 9px 0;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}
.bots-sales-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: 2px;
    padding-bottom: 10px;
    background: var(--admin-surface);
    box-shadow: 0 1px 0 var(--admin-border);
    color: var(--admin-text-soft);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.bots-sales-table tbody td {
    border-top: 1px solid rgba(17,24,39,.055);
}
.bots-sales-table tbody tr:hover td {
    background: var(--admin-surface-soft);
}
.bots-sales-place {
    width: 2.2rem;
    min-width: 2.2rem;
    max-width: 2.4rem;
    padding-right: 8px;
    color: var(--admin-text-muted);
    font-size: .76rem;
    font-variant-numeric: tabular-nums;
}
.bots-sales-user,
.bots-sales-table th.is-revenue,
.bots-sales-table td.is-revenue,
.bots-sales-table th.is-profit,
.bots-sales-table td.is-profit {
    width: auto;
    max-width: none;
    white-space: nowrap;
}
.bots-sales-user { padding-right: 36px; }
.bots-sales-table .is-revenue,
.bots-sales-table .is-profit { padding-right: 32px; }
.bots-sales-table .bots-sales-user a {
    display: inline;
    max-width: none;
    overflow: visible;
    color: var(--admin-text-strong);
    font-weight: 650;
}
.bots-sales-metric { padding-right: 24px; }
.bots-sales-table th:last-child,
.bots-sales-table td:last-child { padding-right: 8px; }
.bots-sales-n {
    display: block;
    color: var(--admin-text-strong);
    font-size: 1.05rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
    line-height: 1.15;
}
.bots-sales-n.is-money { font-size: 1.02rem; }
.bots-sales-n.is-profit {
    color: #079455;
    font-size: 1.14rem;
    font-weight: 800;
}
.bots-sales-sub {
    display: block;
    margin-top: 2px;
    color: var(--admin-text-muted);
    font-size: .7rem;
    font-weight: 650;
}
.bots-sales-pct {
    display: inline-flex;
    min-width: 3.4rem;
    justify-content: center;
    align-items: center;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: .86rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.bots-sales-pct.is-empty {
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted);
}
.bots-sales-pct.is-ok {
    background: #eaf8f0;
    color: #079455;
}
.bots-sales-pct.is-hot {
    background: #d7f5e5;
    color: #027a48;
}
.bots-sales-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}
.bots-sales-sort:hover { color: var(--admin-text-strong); }
.bots-sales-sort.is-active { color: var(--admin-text-strong); }
.bots-sales-dir { font-size: .72rem; }
.bots-sales-zero .bots-sales-n,
.bots-sales-zero .bots-sales-user a { color: var(--admin-text-muted); }
.bots-sales-zero .bots-sales-n.is-profit { color: var(--admin-text-muted); }
@media (max-width: 700px) { .bots-sales-meta { margin-left: 0; width: 100%; } }
html[data-theme="dark"] .bots-sales-table thead th { background: #1b2330; }
html[data-theme="dark"] .bots-sales-table tbody td { border-top-color: rgba(232, 238, 247, 0.08); }
html[data-theme="dark"] .bots-sales-table tbody tr:hover td { background: #243042; }
html[data-theme="dark"] .bots-sales-n { color: #f5f8fc; }
html[data-theme="dark"] .bots-sales-n.is-profit { color: #5dcaa0; }
html[data-theme="dark"] .bots-sales-pct.is-empty { background: #243042; color: #93a1b5; }
html[data-theme="dark"] .bots-sales-pct.is-ok { background: #163528; color: #5dcaa0; }
html[data-theme="dark"] .bots-sales-pct.is-hot { background: #134b32; color: #7ee0b0; }

.bot-owner-modal-panel { max-height: min(90vh, 900px); }
.bot-owner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bot-owner-search { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; min-height: 42px; border: 1px solid var(--admin-border); border-radius: 999px; background: var(--admin-surface-soft); padding: 0 14px; color: var(--admin-text-muted); }
.bot-owner-search:focus-within { border-color: var(--admin-primary-border); background: var(--admin-surface); box-shadow: 0 0 0 4px var(--admin-primary-ring); }
.bot-owner-search input { width: 100%; min-width: 0; border: 0 !important; outline: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; color: var(--admin-text) !important; }
.bot-owner-result-count { flex: 0 0 auto; color: var(--admin-text-muted); font-size: .76rem; font-weight: 650; }
.bot-owner-list { display: grid; gap: 10px; }
.bot-owner-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(420px,.72fr); gap: 16px; align-items: center; border: 1px solid var(--admin-border); border-radius: 20px; background: var(--admin-surface); padding: 14px; }
.bot-owner-row-main { min-width: 0; }
.bot-owner-row-title { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.bot-owner-row-title strong { color: var(--admin-text-strong); font-size: .9rem; font-weight: 700; }
.bot-owner-row-title span { color: var(--admin-text-muted); font-size: .8rem; overflow-wrap: anywhere; }
.bot-owner-row-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 7px; color: #7b8494; font-size: .72rem; }
.bot-owner-health { color: #667085; font-weight: 650; }
.bot-owner-health.is-ok { color: #079455; }
.bot-owner-health.is-error { color: #c43b31; }
.bot-owner-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: #8a94a6; font-size: .7rem; }
.bot-owner-hint { display: inline-flex; min-height: 25px; align-items: center; border: 1px solid #cfe2ff; border-radius: 999px; background: #eef6ff; padding: 0 9px; color: #0b66d8; font-weight: 650; }
.bot-owner-row-actions { display: grid; grid-template-columns: minmax(280px,1.4fr) auto auto 38px; gap: 7px; align-items: center; }
.bot-owner-row-actions .admin-custom-select { min-width: 0; width: 100%; }
.bot-owner-row-actions .admin-custom-select-menu {
    left: 0;
    right: auto;
    width: max-content;
    min-width: max(100%, 360px);
    max-width: min(92vw, 560px);
}
.bot-owner-row-actions .admin-custom-select-option {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bot-owner-row-actions .settings-btn { white-space: nowrap; }
.bot-owner-archive { width: 38px; height: 38px; border-color: #f4cfcc; background: #fff5f4; color: #c43b31; }
.bot-owner-empty { border: 1px dashed #dce3eb; border-radius: 18px; background: #fafcff; padding: 30px; color: #667085; text-align: center; }
@media (max-width: 1100px) { .bot-owner-row { grid-template-columns: 1fr; } }

.bot-ui-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
    gap: 12px;
    margin-bottom: 14px;
}

.bot-ui-section {
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-neutral-50);
    padding: 14px;
}

.bot-ui-msg-block {
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-surface);
    padding: 14px;
}

.bot-ui-msg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    .bot-ui-msg-grid {
        grid-template-columns: 1fr;
    }
}

.bot-ui-msg-btns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.bot-ui-label-hint {
    color: var(--admin-text-soft);
    font-weight: var(--admin-fw-medium);
}

.bot-ui-preview {
    min-height: 6rem;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-50);
    padding: 12px;
    color: var(--admin-text);
    font-size: .875rem;
    line-height: 1.55;
}

.bot-ui-preview-placeholder {
    color: var(--admin-text-soft);
}

.bot-ui-input-soft-green {
    border-color: var(--admin-success-border) !important;
    background: var(--admin-success-soft) !important;
    color: var(--admin-success) !important;
}

.bot-ui-label,
#addModal label,
#editModal label,
#templatesModal label {
    color: var(--admin-text-muted);
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
}

.bot-ui-input,
#addModal input[type="text"],
#editModal input[type="text"],
#addModal textarea,
#editModal textarea,
#templatesModal input[type="text"],
#templatesModal textarea,
#templatesModal input[type="file"] {
    min-height: 38px;
    border: 1px solid var(--admin-border) !important;
    border-radius: 16px !important;
    background: var(--admin-surface) !important;
    color: var(--admin-text) !important;
    font-size: .875rem;
    font-weight: var(--admin-fw-medium);
    box-shadow: none !important;
    outline: none;
    transition: border-color .16s ease, background .16s ease;
}

#addModal textarea,
#editModal textarea,
#templatesModal textarea {
    min-height: 84px;
    line-height: 1.45;
}

.bot-ui-input:focus,
#addModal input[type="text"]:focus,
#editModal input[type="text"]:focus,
#addModal textarea:focus,
#editModal textarea:focus,
#templatesModal input[type="text"]:focus,
#templatesModal textarea:focus {
    border-color: var(--admin-primary-border) !important;
    background: var(--admin-surface) !important;
}

.bot-ui-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    font-weight: var(--admin-fw-semibold);
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.bot-ui-icon-action .admin-line-icon {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

.debug-filter-card {
    position: relative;
    z-index: 40;
    overflow: visible;
}

.bot-ui-icon-action:hover {
    border-color: rgba(11,132,255,.16);
    background: #eef7ff;
    color: #0b66d8;
}

.bot-ui-subtitle {
    margin: 2px 0 10px;
    color: var(--admin-text-strong);
    font-size: .95rem;
    font-weight: var(--admin-fw-semibold);
}

#addModal form > .border,
#editModal form > .border,
#addModal .bot-ui-msg-block,
#editModal .bot-ui-msg-block {
    border-color: var(--admin-border) !important;
    border-radius: 22px !important;
    background: var(--admin-surface) !important;
    padding: 14px !important;
}

#addModal form > .border #welcome_message_preview_add,
#editModal form > .border #welcome_message_preview_edit,
#addModal .bot-ui-preview,
#editModal .bot-ui-preview {
    border-color: var(--admin-border) !important;
    border-radius: 18px !important;
    background: var(--admin-neutral-50) !important;
    color: var(--admin-text) !important;
}

.bot-ui-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.bot-templates-panel {
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    padding-bottom: 18px;
}

#templatesModalList,
#templateDraftsHost {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#templatesModal .bot-template-row {
    border: 1px solid var(--admin-border) !important;
    border-radius: 22px !important;
    background: var(--admin-surface) !important;
    box-shadow: var(--admin-shadow-card) !important;
    overflow: hidden;
}

#templatesModal .bot-template-row[data-mode="edit"],
#templatesModal .bot-template-draft {
    border-color: var(--admin-primary-border) !important;
    background: var(--admin-neutral-50) !important;
}

#templatesModal .bot-template-draft {
    padding: 16px !important;
}

#templatesModal .bot-template-draft-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

#templatesModal .bot-template-draft-head h3 {
    margin: 8px 0 0;
    color: var(--admin-text-strong);
    font-size: 1rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -.02em;
}

#templatesModal .bot-template-draft-head p {
    margin-top: 4px;
    color: var(--admin-text-muted);
    font-size: .82rem;
}

#templatesModal .bot-template-row-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 62px;
    border-bottom: 1px solid var(--admin-border) !important;
    background: var(--admin-surface) !important;
    padding: 0 14px 0 16px !important;
    gap: 12px;
}

#templatesModal .js-tpl-row-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 100%;
    outline: none !important;
    box-shadow: none !important;
    text-align: left;
}

#templatesModal .js-tpl-row-toggle:focus,
#templatesModal .js-tpl-row-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

#templatesModal .bot-template-row-head:hover {
    background: var(--admin-neutral-50) !important;
}

#templatesModal .js-template-card-title {
    color: var(--admin-text-strong);
    font-size: .92rem;
    font-weight: var(--admin-fw-semibold);
}

#templatesModal .bot-template-linked-count {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid rgba(11,132,255,.12);
    border-radius: 999px;
    background: #eef7ff;
    color: #0a62dc;
    padding: 0 9px;
    font-size: .72rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

#templatesModal .bot-template-linked-count.is-empty {
    border-color: rgba(17,24,39,.06);
    background: #f6f8fb;
    color: #98a2b3;
}

#templatesModal .js-tpl-chevron {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: currentColor;
    transition: transform .18s ease;
}

#templatesModal .bot-template-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#templatesModal .bot-template-delete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(244,63,94,.12) !important;
    border-radius: 999px !important;
    background: #fff1f4 !important;
    padding: 0 !important;
    color: #be123c !important;
}

#templatesModal .bot-template-delete-icon svg {
    width: 16px;
    height: 16px;
}

#templatesModal .bot-template-delete-icon:hover {
    border-color: rgba(244,63,94,.2) !important;
    background: #ffe4ea !important;
    color: #9f1239 !important;
}

#templatesModal .bot-template-chevron-btn {
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 999px;
    background: #f4f7fb;
    color: #98a2b3;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

#templatesModal .bot-template-chevron-btn:hover {
    border-color: rgba(11,132,255,.14);
    background: #eef7ff;
    color: #0b66d8;
}

#templatesModal .js-tpl-accordion-panel > div > div {
    border-top: 0 !important;
    background: var(--admin-neutral-50) !important;
    padding: 14px !important;
}

#templatesModal .bot-template-bindings-global {
    overflow: hidden;
    border: 1px solid var(--admin-primary-border);
    border-radius: 24px;
    background: var(--admin-primary-softer);
    box-shadow: none;
}

#templatesModal .bot-template-bindings-global-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 58px;
    gap: 14px;
    padding: 14px 16px;
    color: #0b66d8;
    font-size: .92rem;
    font-weight: var(--admin-fw-semibold);
    text-align: left;
}

#templatesModal .bot-template-bindings-global-toggle > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

#templatesModal .bot-template-bindings-global-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #0b84ff;
    box-shadow: 0 0 0 5px rgba(11,132,255,.10);
}

#templatesModal .bot-template-bindings-global-meta {
    color: #667085;
    font-size: .78rem;
    white-space: nowrap;
}

#templatesModal .bot-template-bindings-global-meta .admin-line-icon {
    width: 17px;
    height: 17px;
    color: #0b66d8;
    transition: transform .18s ease;
}

#templatesModal .bot-template-bindings-global[data-expanded="1"] .js-template-bindings-chevron {
    transform: rotate(180deg);
}

#templatesModal .bot-template-bindings-global-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .24s ease;
}

#templatesModal .bot-template-bindings-global[data-expanded="1"] .bot-template-bindings-global-body {
    grid-template-rows: 1fr;
}

#templatesModal .bot-template-bindings-global-inner {
    min-height: 0;
    overflow: hidden;
    padding: 0 14px;
}

#templatesModal .bot-template-bindings-global[data-expanded="1"] .bot-template-bindings-global-inner {
    padding-bottom: 14px;
}

#templatesModal .bot-template-bindings-global-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    border-top: 1px solid rgba(11,132,255,.12);
    padding-top: 12px;
}

#templatesModal .bot-template-bindings-global-head h3 {
    margin: 0;
    color: #101827;
    font-size: .92rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -.01em;
}

#templatesModal .bot-template-bindings-global-head p {
    margin-top: 3px;
    color: #667085;
    font-size: .76rem;
    line-height: 1.35;
}

#templatesModal .bot-template-bot-list {
    display: grid;
    gap: 8px;
    max-height: 390px;
    overflow: auto;
    padding-right: 4px;
}

#templatesModal .bot-template-bot-empty,
#templatesModal .bot-template-bot-row {
    border: 1px solid rgba(17,24,39,.06);
    border-radius: 18px;
    background: #fff;
}

#templatesModal .bot-template-bot-empty {
    grid-column: 1 / -1;
    padding: 14px;
    color: #98a2b3;
    font-size: .82rem;
    font-weight: var(--admin-fw-medium);
}

#templatesModal .bot-template-bot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
}

#templatesModal .bot-template-bot-info {
    min-width: 0;
}

#templatesModal .bot-template-bot-name {
    overflow: hidden;
    color: #101827;
    font-size: .84rem;
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#templatesModal .bot-template-bot-meta {
    overflow: hidden;
    margin-top: 2px;
    color: #98a2b3;
    font-size: .72rem;
    font-weight: var(--admin-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#templatesModal .bot-template-bot-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    min-width: min(100%, 360px);
}

#templatesModal .bot-template-select {
    width: 220px;
    min-height: 36px;
    border: 1px solid rgba(11,132,255,.14);
    border-radius: 999px;
    background: #fff;
    color: #344054;
    padding: 0 13px;
    font-size: .78rem;
    font-weight: var(--admin-fw-semibold);
}

#templatesModal .bot-template-bind-btn {
    min-height: 32px;
    flex: 0 0 auto;
    border: 1px solid rgba(11,132,255,.12);
    border-radius: 999px;
    background: #eef7ff;
    color: #0a62dc;
    padding: 0 11px;
    font-size: .76rem;
    font-weight: var(--admin-fw-semibold);
    transition: background .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease;
}

#templatesModal .bot-template-bind-btn:hover {
    border-color: rgba(11,132,255,.20);
    background: #e1f0ff;
}

#templatesModal .bot-template-bind-btn.is-linked {
    border-color: rgba(244,63,94,.12);
    background: #fff1f4;
    color: #be123c;
}

#templatesModal .bot-template-bind-btn.is-linked:hover {
    border-color: rgba(244,63,94,.20);
    background: #ffe4ea;
}

#templatesModal .bot-template-bind-btn:disabled {
    cursor: wait;
    opacity: .65;
}

#templatesModal .js-tpl-accordion-panel .js-tpl-toolbar-view {
    display: none !important;
}

#templatesModal .js-tpl-toolbar-view button,
#templatesModal .js-tpl-toolbar-edit button,
#templatesModal .js-tpl-save-new,
#templatesModal .js-tpl-cancel-draft {
    min-height: 36px;
    border: 1px solid rgba(17,24,39,.07) !important;
    border-radius: 999px !important;
    background: #fff !important;
    padding: 0 13px !important;
    color: #475467 !important;
    font-size: .82rem !important;
    font-weight: var(--admin-fw-semibold) !important;
    box-shadow: none !important;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

#templatesModal .js-tpl-toolbar-view button:hover,
#templatesModal .js-tpl-toolbar-edit button:hover,
#templatesModal .js-tpl-save-new:hover,
#templatesModal .js-tpl-cancel-draft:hover {
    border-color: rgba(11,132,255,.14) !important;
    background: #eef7ff !important;
    color: #0b66d8 !important;
}

#templatesModal .js-tpl-save,
#templatesModal .js-tpl-save-new {
    border-color: transparent !important;
    background: linear-gradient(135deg, #0b84ff, #2563eb) !important;
    color: #fff !important;
}

#templatesModal .js-tpl-save:hover,
#templatesModal .js-tpl-save-new:hover {
    background: linear-gradient(135deg, #0a78ed, #1d4ed8) !important;
    color: #fff !important;
}

#templatesModal .js-tpl-delete {
    border-color: rgba(244,63,94,.12) !important;
    background: #fff1f4 !important;
    color: #be123c !important;
}

#templatesModal .js-tpl-delete:hover {
    border-color: rgba(244,63,94,.18) !important;
    background: #ffe4ea !important;
    color: #9f1239 !important;
}

#templatesModal .js-tpl-delete.bot-template-delete-icon {
    width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
}

#templatesModal .js-tpl-img-lightbox {
    border-radius: 18px !important;
    border-color: rgba(17,24,39,.07) !important;
    box-shadow: none !important;
}

@media (max-width: 760px) {
    .bot-ui-modal-shell {
        align-items: flex-start;
        padding: 14px;
    }

    .bot-ui-modal-panel {
        border-radius: 22px;
        padding: 16px;
    }

    .bot-ui-form-grid {
        grid-template-columns: 1fr;
    }
}

.settings-card .hidden {
    display: none !important;
}

.taskboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.taskboard-row {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 24px;
    background: rgba(255,255,255,.94);
    padding: 16px;
    transition: border-color .18s ease, background .18s ease;
}

.taskboard-row:has(.taskboard-status-shell.is-open) {
    z-index: 90;
}

.taskboard-row:hover {
    border-color: rgba(11,132,255,.14);
    background: #fff;
}

.taskboard-row-main {
    display: grid;
    grid-template-columns: minmax(126px, .58fr) minmax(200px, 1fr) minmax(130px, .58fr) minmax(260px, 1.35fr) auto;
    align-items: end;
    gap: 10px;
}

.taskboard-label {
    display: block;
    margin-bottom: 5px;
    color: #98a2b3;
    font-size: .68rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: .035em;
    text-transform: uppercase;
}

.taskboard-input,
.taskboard-textarea,
.taskboard-status-trigger {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 16px;
    background: #f8fafc;
    padding: 0 12px;
    color: #101827;
    font-size: .86rem;
    font-weight: 500;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.taskboard-input:focus,
.taskboard-textarea:focus {
    border-color: rgba(11,132,255,.28);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11,132,255,.07);
}

.taskboard-username-input {
    color: #101827;
    font-weight: 500;
}

.taskboard-input::placeholder,
.taskboard-textarea::placeholder {
    color: #98a2b3;
    font-weight: 500;
}

.taskboard-status-shell {
    position: relative;
    z-index: 25;
}

.taskboard-status-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    border-color: color-mix(in srgb, var(--task-status-bg, #f3f4f6) 70%, #ffffff);
    background: color-mix(in srgb, var(--task-status-bg, #f3f4f6) 86%, #ffffff);
    color: var(--task-status-fg, #374151);
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
}

.taskboard-status-trigger::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 10px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    opacity: .72;
}

.taskboard-status-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 180;
    width: max-content;
    min-width: 180px;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 8px;
}

.taskboard-status-choice {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    padding: 0 12px;
    color: var(--admin-text-secondary);
    font-size: .8rem;
    font-weight: var(--admin-fw-semibold);
    text-align: left;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.taskboard-status-choice:hover,
.taskboard-status-choice.is-active {
    border-color: color-mix(in srgb, var(--task-status-bg, #f3f4f6) 55%, var(--admin-border));
    background: color-mix(in srgb, var(--task-status-bg, #f3f4f6) 72%, var(--admin-surface));
    color: var(--task-status-fg, var(--admin-text));
}

.taskboard-field-note {
    display: block;
}

.taskboard-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.taskboard-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 999px;
    background: #fff;
    color: #667085;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.taskboard-action-btn:hover,
.taskboard-action-btn.is-copied {
    border-color: rgba(11,132,255,.18);
    background: #f7fbff;
    color: #0b66d8;
    transform: translateY(-1px);
}

.taskboard-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    min-height: 38px;
    border: 1px solid rgba(239,68,68,.18);
    border-radius: 999px;
    background: #fff7f7;
    padding: 0;
    color: #d92d20;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.taskboard-delete-btn:hover {
    border-color: rgba(239,68,68,.26);
    background: #fff1f1;
    color: #b42318;
    transform: translateY(-1px);
}

.taskboard-empty {
    border: 1px dashed rgba(17,24,39,.10);
    border-radius: 22px;
    background: rgba(255,255,255,.72);
    padding: 28px;
    text-align: center;
    color: #98a2b3;
    font-size: .9rem;
}

@keyframes adminFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-animate-in {
    animation: adminFadeUp .42s cubic-bezier(.2, .8, .2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .admin-nav-link,
    .admin-icon-btn,
    .ui-card,
    .ui-pill,
    .metric-mini,
    .admin-animate-in {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

@media (max-width: 980px) {
    .taskboard-row-main {
        grid-template-columns: 1fr;
    }
    .taskboard-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1024px) {
    .admin-shell {
        width: calc(100% - 20px);
        margin: 10px auto;
        border-radius: 22px;
    }
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .admin-nav {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .admin-content {
        padding: 18px;
    }
}

/* Unified admin button sizing to keep controls visually consistent. */
.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.btn-admin-primary {
    background: #2563eb;
    color: #fff;
}
.btn-admin-primary:hover {
    background: #1d4ed8;
}

.btn-admin-muted {
    background: #f3f4f6;
    color: #4b5563;
}
.btn-admin-muted:hover {
    background: #e5e7eb;
}

.btn-admin-danger {
    background: #dc2626;
    color: #fff;
}
.btn-admin-danger:hover {
    background: #b91c1c;
}

/* Final unified select skin: keep native behavior, but normalize closed control UI. */
select,
.ui-select,
.ref-program-select,
.debug-filter-select,
.settings-card select,
.settings-input:is(select),
.broadcast-input:is(select) {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2398A2B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    padding-right: 42px !important;
}

/* Admin typography system v1: final component normalization. */
.admin-shell .admin-nav-link,
.admin-shell .ui-pill,
.admin-shell .settings-btn,
.admin-shell .bot-action-btn,
.admin-shell .bot-icon-action-btn,
.admin-shell .admin-custom-select-btn,
.admin-shell .broadcast-modal-close,
.admin-shell .ref-chart-modal-close {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell .ui-pill[aria-label],
.admin-shell .admin-icon-btn,
.admin-shell .settings-icon-btn,
.admin-shell .bot-ui-modal-close,
.admin-shell .bot-template-delete-icon,
.admin-shell .bot-template-chevron-btn,
.admin-shell .taskboard-action-btn,
.admin-shell .taskboard-delete-btn,
.admin-shell .bot-tag-remove-btn {
    line-height: 1 !important;
}

.admin-shell .inline-flex.rounded-full,
.admin-shell .bot-tag-chip,
.admin-shell .bot-tag-choice,
.admin-shell .bot-template-chip,
.admin-shell .debug-level-pill,
.admin-shell .debug-category-pill,
.admin-shell .broadcast-soft-badge {
    font-size: var(--admin-text-xs) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell input[type="text"],
.admin-shell input[type="number"],
.admin-shell input[type="password"],
.admin-shell input[type="search"],
.admin-shell input[type="datetime-local"],
.admin-shell input[type="date"],
.admin-shell textarea,
.admin-shell select,
.admin-shell .broadcast-input,
.admin-shell .settings-input,
.admin-shell .debug-filter-select,
.admin-shell .ref-program-select {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-normal) !important;
    font-weight: var(--admin-fw-medium) !important;
}

.admin-shell input::placeholder,
.admin-shell textarea::placeholder {
    font-size: var(--admin-text-base) !important;
    font-weight: var(--admin-fw-regular) !important;
    color: #98a2b3 !important;
}

.admin-shell .stat-card > div:first-child,
.admin-shell .metric-mini-label,
.admin-shell .broadcast-label,
.admin-shell .bot-ui-label,
.admin-shell .taskboard-label {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell .stat-card .text-3xl,
.admin-shell .stat-card .text-2xl {
    font-size: var(--admin-text-3xl) !important;
    line-height: var(--admin-leading-tight) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell .metric-mini-value,
.admin-shell .bot-metric-value {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell .settings-card h2,
.admin-shell .ui-card h2,
.admin-shell .broadcast-card-title,
.admin-shell .debug-card-title,
.admin-shell .bot-ui-modal-head h2,
.admin-shell .ref-chart-modal-panel h3 {
    font-size: var(--admin-text-xl) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
    letter-spacing: -0.025em !important;
}

.admin-shell .settings-card h3,
.admin-shell .bot-ui-subtitle,
.admin-shell .js-template-card-title {
    font-size: var(--admin-text-lg) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell .admin-custom-select-option {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell table {
    font-size: var(--admin-text-base) !important;
}

.admin-shell th {
    font-size: var(--admin-text-xs) !important;
    line-height: var(--admin-leading-snug) !important;
    font-weight: var(--admin-fw-semibold) !important;
    color: #667085;
}

.admin-shell th.font-medium {
    font-weight: var(--admin-fw-semibold) !important;
}

.admin-shell td {
    font-size: var(--admin-text-base) !important;
    line-height: var(--admin-leading-normal) !important;
}

/* Admin spacing system v1: shared rhythm for pages, cards, forms, modals and fields. */
.admin-shell .admin-content {
    padding: var(--admin-page-pad);
}

.admin-shell .ui-card,
.admin-shell .stat-card,
.admin-shell .taskboard-row,
.admin-shell .ref-program-panel {
    padding: var(--admin-card-pad);
}

.admin-shell .settings-card,
.admin-shell .bot-card {
    padding: var(--admin-card-pad-lg);
}

.admin-shell .broadcast-section,
.admin-shell .bot-ui-section,
.admin-shell .settings-create-row,
.admin-shell .debug-category-card,
.admin-shell .debug-event-card {
    padding: var(--admin-form-pad);
}

.admin-shell .settings-mini-modal,
.admin-shell .bot-ui-modal-panel,
.admin-shell .ref-chart-modal-panel,
.admin-shell .broadcast-modal-panel {
    padding: var(--admin-modal-pad);
}

.admin-shell .bot-ui-modal-head,
.admin-shell .broadcast-section-head {
    gap: var(--admin-space-8);
    margin-bottom: var(--admin-space-8);
}

.admin-shell .bot-ui-form-grid,
.admin-shell .broadcast-form,
.admin-shell .settings-create-row,
.admin-shell .taskboard-row-main,
.admin-shell .ref-kpi-row,
.admin-shell .ref-kpi-grid,
.admin-shell .ref-chart-actions {
    gap: var(--admin-field-gap);
}

.admin-shell .taskboard-list,
.admin-shell .debug-events-list {
    gap: var(--admin-space-4);
}

.admin-shell input[type="text"]:not([type="file"]),
.admin-shell input[type="number"],
.admin-shell input[type="password"],
.admin-shell input[type="search"],
.admin-shell input[type="datetime-local"],
.admin-shell input[type="date"],
.admin-shell textarea,
.admin-shell select,
.admin-shell .bot-ui-input,
.admin-shell .broadcast-input,
.admin-shell .settings-input,
.admin-shell .debug-filter-select,
.admin-shell .ref-program-select,
.admin-shell .ref-program-date {
    padding-top: var(--admin-field-pad-y);
    padding-bottom: var(--admin-field-pad-y);
}

.admin-shell input[type="text"]:not([type="file"]),
.admin-shell input[type="number"],
.admin-shell input[type="password"],
.admin-shell input[type="search"],
.admin-shell input[type="datetime-local"],
.admin-shell input[type="date"],
.admin-shell textarea,
.admin-shell .bot-ui-input,
.admin-shell .broadcast-input,
.admin-shell .settings-input,
.admin-shell .debug-filter-select,
.admin-shell .ref-program-date {
    padding-left: var(--admin-field-pad-x);
    padding-right: var(--admin-field-pad-x);
}

.admin-shell select,
.admin-shell .ref-program-select {
    padding-left: var(--admin-field-pad-x);
}

.admin-shell table th {
    padding-top: var(--admin-space-2);
    padding-bottom: var(--admin-space-4);
}

.admin-shell table td {
    padding-top: var(--admin-space-5);
    padding-bottom: var(--admin-space-5);
}

@media (max-width: 1024px) {
    :root {
        --admin-page-pad: 18px;
        --admin-card-pad-lg: 16px;
        --admin-modal-pad: 18px;
    }
}

/* Admin color system v1: normalize old Tailwind/helper colors to the shared palette. */
.admin-shell .admin-nav-link.is-active,
.admin-shell .ui-pill-active,
.admin-shell .stat-card-blue,
.admin-shell .settings-btn-primary,
.admin-shell .settings-card .aid-save,
.admin-shell .settings-card .ref-edit,
.admin-shell .settings-card button[type="submit"].bg-blue-600,
.admin-shell .btn-admin-primary,
.admin-shell .bg-blue-600,
.admin-shell .hover\:bg-blue-700:hover {
    background: var(--admin-gradient-primary) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.admin-shell .admin-nav-link.is-active:hover,
.admin-shell .ui-pill-active:hover,
.admin-shell .settings-btn-primary:hover,
.admin-shell .settings-card .aid-save:hover,
.admin-shell .settings-card .ref-edit:hover,
.admin-shell .settings-card button[type="submit"].bg-blue-600:hover,
.admin-shell .btn-admin-primary:hover {
    background: var(--admin-gradient-primary-hover) !important;
    color: #fff !important;
}

.admin-shell .stat-card-dark {
    background: var(--admin-gradient-graphite) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.admin-shell .text-gray-950,
.admin-shell .text-gray-900,
.admin-shell .text-gray-800,
.admin-shell .text-slate-950,
.admin-shell .text-slate-900 {
    color: var(--admin-text-strong) !important;
}

.admin-shell .text-gray-700,
.admin-shell .text-gray-600,
.admin-shell .text-slate-700,
.admin-shell .text-slate-600 {
    color: var(--admin-text-secondary) !important;
}

.admin-shell .text-gray-500,
.admin-shell .text-slate-500 {
    color: var(--admin-text-muted) !important;
}

.admin-shell .text-gray-400,
.admin-shell .text-gray-300,
.admin-shell .text-slate-400,
.admin-shell .text-slate-300 {
    color: var(--admin-text-soft) !important;
}

.admin-shell .text-blue-600,
.admin-shell .text-blue-700,
.admin-shell .hover\:text-blue-800:hover {
    color: var(--admin-primary-text) !important;
}

.admin-shell .bg-blue-50,
.admin-shell .hover\:bg-blue-50:hover {
    background: var(--admin-primary-soft) !important;
}

.admin-shell .bg-blue-500 {
    background: var(--admin-primary) !important;
}

.admin-shell .border-blue-200,
.admin-shell .border-blue-300,
.admin-shell .decoration-blue-400,
.admin-shell .hover\:decoration-blue-600:hover {
    border-color: var(--admin-primary-border) !important;
    text-decoration-color: color-mix(in srgb, var(--admin-primary) 45%, #ffffff) !important;
}

.admin-shell .ring-blue-200,
.admin-shell .ring-blue-300,
.admin-shell .focus\:ring-blue-500:focus {
    --tw-ring-color: var(--admin-primary-ring) !important;
}

.admin-shell .bg-gray-50,
.admin-shell .bg-slate-50 {
    background: var(--admin-neutral-50) !important;
}

.admin-shell .bg-gray-100,
.admin-shell .bg-slate-100,
.admin-shell .hover\:bg-gray-100:hover,
.admin-shell .hover\:bg-gray-200:hover {
    background: var(--admin-neutral-100) !important;
}

.admin-shell .border-gray-100,
.admin-shell .border-gray-200,
.admin-shell .border-gray-300,
.admin-shell .border-slate-100,
.admin-shell .border-slate-200,
.admin-shell .border-slate-300 {
    border-color: var(--admin-border) !important;
}

.admin-shell .text-green-600,
.admin-shell .text-green-700,
.admin-shell .text-green-800,
.admin-shell .text-emerald-600,
.admin-shell .text-emerald-700,
.admin-shell .text-emerald-800 {
    color: var(--admin-success) !important;
}

.admin-shell .bg-green-50,
.admin-shell .bg-green-100,
.admin-shell .bg-emerald-50,
.admin-shell .bg-emerald-100 {
    background: var(--admin-success-soft) !important;
}

.admin-shell .border-green-200,
.admin-shell .border-green-300,
.admin-shell .border-emerald-200,
.admin-shell .border-emerald-300 {
    border-color: var(--admin-success-border) !important;
}

.admin-shell .text-amber-700,
.admin-shell .text-amber-800,
.admin-shell .text-amber-900,
.admin-shell .text-orange-600,
.admin-shell .text-orange-700 {
    color: var(--admin-warning) !important;
}

.admin-shell .bg-amber-50,
.admin-shell .bg-amber-100,
.admin-shell .bg-orange-50,
.admin-shell .bg-orange-100 {
    background: var(--admin-warning-soft) !important;
}

.admin-shell .border-amber-200,
.admin-shell .border-orange-200 {
    border-color: var(--admin-warning-border) !important;
}

.admin-shell .text-red-600,
.admin-shell .text-red-700,
.admin-shell .text-red-800,
.admin-shell .text-rose-600,
.admin-shell .text-rose-700,
.admin-shell .text-rose-800 {
    color: var(--admin-danger) !important;
}

.admin-shell .bg-red-50,
.admin-shell .bg-red-100,
.admin-shell .bg-rose-50,
.admin-shell .bg-rose-100 {
    background: var(--admin-danger-soft) !important;
}

.admin-shell .border-red-200,
.admin-shell .border-red-300,
.admin-shell .border-rose-200,
.admin-shell .border-rose-300 {
    border-color: var(--admin-danger-border) !important;
}

.admin-shell .bg-red-600,
.admin-shell .hover\:bg-red-700:hover,
.admin-shell .btn-admin-danger {
    background: var(--admin-danger-soft) !important;
    color: var(--admin-danger) !important;
    border-color: var(--admin-danger-border) !important;
}

/* Login screen */
.login-page {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    font-family: var(--admin-font-sans);
    color: var(--admin-text);
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.96), transparent 28rem),
        linear-gradient(135deg, #eef2f7 0%, #dfe6f0 100%);
}

.login-screen {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 48px);
    isolation: isolate;
}

.login-screen::before {
    content: "";
    position: absolute;
    inset: -24%;
    z-index: -3;
    background:
        linear-gradient(120deg, rgba(11, 132, 255, 0.14), transparent 30%),
        radial-gradient(circle at 72% 24%, rgba(11, 132, 255, 0.16), transparent 24rem),
        radial-gradient(circle at 24% 82%, rgba(31, 35, 43, 0.11), transparent 26rem);
    filter: blur(2px);
}

.login-shell {
    width: min(900px, 100%);
    min-height: 500px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 36px;
    background: rgba(255, 255, 255, .56);
    box-shadow: 0 34px 90px rgba(15, 23, 42, .14);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
}

.login-hero,
.login-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
}

.login-hero {
    min-height: 0;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(11, 132, 255, .04), rgba(10, 98, 220, .04)),
        url("/static/login-business-processes-bg.webp"),
        linear-gradient(135deg, var(--admin-primary-start) 0%, var(--admin-primary-end) 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
}

.login-hero::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -160px;
    bottom: -170px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
}

.login-brand-pill,
.login-feature-row span,
.login-preview-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-brand-pill {
    gap: 9px;
    padding: 8px 13px;
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.login-brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .16);
}

.login-brand-mark {
    width: 31px;
    height: 31px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.login-brand-mark span {
    display: block;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(3, 42, 112, .12);
}

.login-hero-simple {
    justify-content: flex-start;
    gap: 0;
}

.login-hero h1 {
    max-width: 420px;
    margin: 56px 0 12px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: .96;
    letter-spacing: -0.06em;
    font-weight: var(--admin-fw-semibold);
}

.login-hero-simple h1 {
    margin: 0;
    max-width: 360px;
}

.login-hero-illustration {
    position: relative;
    z-index: 1;
    display: block;
    width: min(118%, 620px);
    max-width: none;
    align-self: center;
    margin: auto -58px -34px;
    object-fit: contain;
    filter: drop-shadow(0 28px 54px rgba(3, 42, 112, .2));
    pointer-events: none;
    user-select: none;
}

.login-hero p {
    max-width: 430px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: var(--admin-text-lg);
    line-height: var(--admin-leading-relaxed);
    font-weight: var(--admin-fw-medium);
}

.login-preview-card {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    margin-top: 40px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 24px 60px rgba(3, 42, 112, .2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.login-preview-top,
.login-preview-grid,
.login-feature-row {
    display: flex;
    align-items: center;
}

.login-preview-top {
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, .78);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.login-preview-status {
    padding: 5px 10px;
    font-size: var(--admin-text-xs);
}

.login-preview-grid {
    gap: 10px;
    margin-top: 18px;
}

.login-preview-grid div {
    flex: 1;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    color: var(--admin-text-secondary);
}

.login-preview-grid span {
    display: block;
    font-size: var(--admin-text-xs);
    color: var(--admin-text-muted);
    font-weight: var(--admin-fw-semibold);
}

.login-preview-grid strong {
    display: block;
    margin-top: 7px;
    color: var(--admin-text-strong);
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.login-wave {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 8px;
    height: 82px;
    margin-top: 18px;
}

.login-wave span {
    display: block;
    border-radius: 999px 999px 12px 12px;
    background: rgba(255, 255, 255, .82);
}

.login-wave span:nth-child(1) { height: 34%; animation-delay: -.8s; }
.login-wave span:nth-child(2) { height: 58%; animation-delay: -1.8s; }
.login-wave span:nth-child(3) { height: 84%; animation-delay: -2.7s; }
.login-wave span:nth-child(4) { height: 66%; animation-delay: -1.1s; }
.login-wave span:nth-child(5) { height: 42%; animation-delay: -2.2s; }

.login-feature-row {
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.login-feature-row span {
    padding: 7px 11px;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 3vw, 30px);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(17, 24, 39, .06);
    box-shadow: 0 20px 55px rgba(15, 23, 42, .08);
}

.login-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-logo {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 18px;
    color: #fff;
    background: var(--admin-gradient-primary);
    box-shadow: 0 16px 34px rgba(11, 132, 255, .22);
}

.login-logo svg,
.login-submit svg {
    width: 22px;
    height: 22px;
}

.login-logo-mark {
    width: 28px;
    height: 28px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.login-logo-mark span {
    display: block;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(3, 42, 112, .12);
}

.login-eyebrow {
    margin: 0 0 4px;
    color: var(--admin-primary-text);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-bold);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.login-card h2 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-3xl);
    line-height: var(--admin-leading-tight);
    letter-spacing: -0.045em;
    font-weight: var(--admin-fw-semibold);
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-normal);
    font-weight: var(--admin-fw-semibold);
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.login-field input {
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    padding: 0 15px;
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 16px;
    outline: none;
    background: var(--admin-neutral-25);
    color: var(--admin-text-strong);
    font-family: var(--admin-font-sans);
    font-size: var(--admin-text-base);
    font-weight: var(--admin-fw-medium);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-field input::placeholder {
    color: var(--admin-text-soft);
    font-weight: var(--admin-fw-medium);
}

.login-field input:focus {
    border-color: rgba(11, 132, 255, .34);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(11, 132, 255, .08);
}

.login-submit {
    height: 46px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 17px;
    cursor: pointer;
    color: #fff;
    background: var(--admin-gradient-primary);
    box-shadow: 0 16px 34px rgba(11, 132, 255, .2);
    font-family: var(--admin-font-sans);
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    background: var(--admin-gradient-primary-hover);
    box-shadow: 0 12px 24px rgba(11, 132, 255, .16);
}

.login-submit:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(11, 132, 255, .12);
}

@media (max-width: 820px) {
    .login-page {
        overflow: auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .login-hero {
        min-height: 360px;
    }

    .login-hero-illustration {
        width: min(104%, 560px);
        margin: 0 -26px -28px;
    }
}

@media (max-width: 520px) {
    .login-screen {
        padding: 14px;
    }

    .login-shell {
        padding: 10px;
        border-radius: 28px;
    }

    .login-hero,
    .login-card {
        border-radius: 22px;
    }

    .login-hero {
        padding: 22px;
    }

    .login-hero h1 {
        margin-top: 0;
    }

    .login-hero-illustration {
        width: 116%;
        margin: 0 -34px -26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit {
        transition: none !important;
    }
}

/* Accounts */
.accounts-page {
    display: grid;
    gap: var(--admin-section-gap);
}

.accounts-page > .admin-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.accounts-page > .admin-page-head > div:first-child {
    min-width: 0;
}

.ui-section-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    flex: 0 0 auto;
    align-self: flex-start;
    min-height: 26px;
    border: 1px solid #fff;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    padding: 4px 12px;
    color: var(--admin-primary-text);
    font-size: 0.75rem;
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    white-space: nowrap;
}

.ui-section-chip > span {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #3b82f6;
}

.accounts-page .admin-page-title {
    margin: 13px 0 0;
}

.accounts-page .admin-page-subtitle {
    margin: 7px 0 0;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-base);
    line-height: var(--admin-leading-normal);
    font-weight: var(--admin-fw-medium);
}

.accounts-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.accounts-head-actions .settings-btn {
    min-height: 38px;
    gap: 8px;
    padding-inline: 14px;
}

.accounts-head-actions .settings-btn .admin-line-icon,
.accounts-head-actions .settings-btn svg {
    flex: 0 0 auto;
}

.accounts-top-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.accounts-top-row > .accounts-stat-card:not(.accounts-cycle-card) {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    min-height: 78px;
    padding: 12px 14px;
    box-sizing: border-box;
}

.accounts-top-row > .accounts-cycle-card {
    flex: 0 0 auto;
    width: max-content;
    min-width: max-content;
    min-height: 78px;
    padding: 12px 14px;
    box-sizing: border-box;
}

.accounts-top-row .accounts-stat-card .text-sm {
    white-space: nowrap;
}

.accounts-top-row .accounts-stat-card .ref-kpi-value {
    margin-top: 8px;
    font-size: 1.65rem;
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.accounts-list-card {
    padding: var(--admin-card-pad-lg);
}

.accounts-queue-strip {
    position: sticky;
    top: 10px;
    z-index: 8;
    margin: 12px 0 14px;
    padding: 6px;
    border: 1px solid var(--admin-warning-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--admin-warning-soft) 70%, #fff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.accounts-queue-strip-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.accounts-queue-strip-row {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #fff;
    color: var(--admin-text-strong);
    font: inherit;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
}

.accounts-queue-strip-row em,
.accounts-queue-strip-row time {
    font-style: normal;
    color: var(--admin-text-muted);
    font-variant-numeric: tabular-nums;
}

.accounts-queue-strip-row.is-warn {
    border-color: var(--admin-warning-border);
    color: var(--admin-warning);
}

.accounts-queue-strip-row.is-ok {
    border-color: var(--admin-success-border);
    color: var(--admin-success);
}

.accounts-queue-strip-row.is-run {
    border-color: rgba(11, 132, 255, .18);
    color: var(--admin-primary);
}

.accounts-queue-strip-row.is-bad {
    border-color: var(--admin-danger-border);
    color: var(--admin-danger);
}

.accounts-queue-strip-row.is-idle {
    cursor: default;
    color: var(--admin-text-muted);
}

.accounts-queue-strip-row:hover:not(.is-idle) {
    transform: translateY(-1px);
}

.accounts-technical-card {
    margin-top: 16px;
}

.account-tag-pill {
    display: inline-flex;
    align-items: center;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--admin-neutral-50);
    color: var(--admin-text-secondary);
}

.account-role-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: #eef2ff;
    color: #3730a3;
}

.account-role-pill.is-technical {
    background: #111827;
    color: #f9fafb;
}

.account-card.is-technical {
    border-color: rgba(17, 24, 39, 0.18);
}

.bot-health-black,
.bot-health-counter.bot-health-black {
    background: #111827;
    color: #f9fafb;
    border-color: #111827;
}

.bot-health-black .bot-health-dot {
    background: #fbbf24;
}

.accounts-cycle-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
}

.accounts-cycles-toolbar-head,
.accounts-cycles-toolbar-list,
.accounts-cycle-item {
    display: none;
}

.accounts-cycle-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: max-content;
    flex: 0 0 auto;
}

.accounts-cycle-kicker {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-base);
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
}

.accounts-cycle-title {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
    line-height: 1.25;
    white-space: nowrap;
    overflow: visible;
}

.accounts-cycle-copy .js-cycle-status {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-style: normal;
    font-weight: var(--admin-fw-medium);
    line-height: 1.2;
    white-space: nowrap;
}

.accounts-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.accounts-section-head h2 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-2xl);
    line-height: var(--admin-leading-tight);
    letter-spacing: -0.035em;
    font-weight: var(--admin-fw-semibold);
}

.accounts-section-head p {
    margin: 6px 0 0;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-md);
    line-height: var(--admin-leading-normal);
    font-weight: var(--admin-fw-medium);
}

.accounts-form {
    display: grid;
    gap: 14px;
}

.accounts-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.accounts-form-grid label {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.accounts-form-grid label > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.accounts-form-grid textarea.broadcast-input {
    min-height: 88px;
    resize: vertical;
    padding-top: 11px;
}

.accounts-notes-field {
    grid-column: span 2;
}

.accounts-file-field input[type="file"] {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 16px;
    border: 1px solid var(--admin-border);
    background: var(--admin-neutral-25);
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
}

.accounts-file-field small {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
}

.account-tdata-dropzone {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 2px;
    min-height: 56px;
    height: 56px;
    padding: 8px 12px;
    text-align: center;
    border: 1px dashed rgba(25, 117, 244, .34);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(240, 247, 255, .92), rgba(255, 255, 255, .98));
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
    cursor: pointer;
}

.account-tdata-dropzone.is-dragover {
    border-color: var(--admin-primary);
    background: rgba(232, 243, 255, .96);
    box-shadow: inset 0 0 0 1px rgba(25, 117, 244, .08);
}

.account-tdata-dropzone.has-file {
    border-style: solid;
    border-color: rgba(25, 117, 244, .28);
    background: rgba(246, 250, 255, .98);
}

.account-tdata-dropzone-icon {
    display: none;
}

.account-tdata-dropzone-icon .admin-line-icon {
    width: 23px;
    height: 23px;
}

.account-tdata-dropzone-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    width: 100%;
    justify-items: center;
    text-align: center;
}

.account-tdata-dropzone-copy strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-tdata-dropzone-copy span,
.account-tdata-dropzone-copy small {
    overflow: hidden;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-tdata-dropzone.has-file .account-tdata-dropzone-copy span {
    color: var(--admin-primary-text);
}

.account-tdata-dropzone-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
}

.account-tdata-dropzone-actions .settings-btn {
    min-height: 36px;
    padding-inline: 12px;
    white-space: nowrap;
}

.accounts-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.account-diagnostic-panel.account-create-panel,
.account-diagnostic-panel.account-edit-panel,
.account-diagnostic-panel.account-form-panel {
    width: min(720px, 100%);
    height: auto;
    max-height: min(860px, calc(100vh - 40px));
    padding: 18px 18px 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    clip-path: inset(0 round 28px);
}

.account-create-form,
.account-edit-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    min-height: 0;
    flex: 0 1 auto;
    overflow: visible;
}

.account-form-section,
.account-create-section {
    display: grid;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-25);
}

.account-form-section-head,
.account-create-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.account-form-section-head strong,
.account-create-section-head strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-form-section-head span,
.account-create-section-head span {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
    text-align: right;
}

.account-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.account-form-grid label {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
}

.account-form-grid label > span,
.accounts-file-field > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-form-grid .account-field-span-2,
.account-form-grid .account-field-wide {
    grid-column: span 2;
}

.account-form-grid textarea.broadcast-input {
    min-height: 64px;
    resize: vertical;
}

.account-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--admin-border);
    position: static;
    background: transparent;
    z-index: 1;
}

.account-form-footer-main {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.account-connection-entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.account-session-field,
.account-proxy-command {
    display: grid;
    grid-template-rows: auto auto;
    gap: 8px;
    min-width: 0;
}

.account-connection-field-title,
.account-proxy-command > span,
.account-proxy-inline-grid label > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-session-upload {
    min-width: 0;
    cursor: pointer;
}

.account-session-upload-body {
    display: contents;
}

.account-session-upload .account-tdata-dropzone,
.account-tdata-dropzone {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 2px;
    min-height: 56px;
    height: 56px;
    padding: 8px 12px;
    text-align: center;
    border: 1px dashed rgba(25, 117, 244, .34);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(240, 247, 255, .92), rgba(255, 255, 255, .98));
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
    cursor: pointer;
}

.account-tdata-dropzone-icon {
    display: none;
}

.account-session-upload .account-tdata-dropzone-copy,
.account-tdata-dropzone-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    width: 100%;
    justify-items: center;
    text-align: center;
}

.account-session-upload.is-dragover .account-tdata-dropzone,
.account-tdata-dropzone.is-dragover {
    border-color: var(--admin-primary);
    background: rgba(232, 243, 255, .96);
    box-shadow: inset 0 0 0 1px rgba(25, 117, 244, .08);
}

.account-session-upload.has-file .account-tdata-dropzone,
.account-tdata-dropzone.has-file {
    border-style: solid;
    border-color: rgba(25, 117, 244, .28);
    background: rgba(246, 250, 255, .98);
}

.account-proxy-command .account-proxy-data,
.account-create-form .account-proxy-command .account-proxy-data,
.account-edit-form .account-proxy-data,
.account-proxy-command .account-proxy-data.is-compact,
.account-edit-form .account-proxy-data.is-compact {
    min-height: 56px;
    height: 56px;
    max-height: 56px;
    padding-top: 8px;
    padding-bottom: 8px;
    resize: none;
    overflow-y: auto;
    line-height: 1.3;
    white-space: pre-wrap;
}

.account-session-upload.has-file .account-tdata-dropzone-copy span {
    color: var(--admin-primary-text);
}

.account-session-upload .account-tdata-dropzone-actions {
    justify-content: center;
}

.account-proxy-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.account-proxy-inline-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.accounts-global-queue {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 18px;
}

.accounts-global-queue .accounts-section-head {
    margin-bottom: 0;
}

.accounts-global-queue-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(11, 132, 255, .16);
    border-radius: 999px;
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.accounts-global-queue-list {
    display: grid;
    gap: 10px;
}

.accounts-global-queue-empty {
    min-height: 80px;
}

.account-create-panel .accounts-form-grid,
.account-edit-panel .accounts-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-create-panel .account-field-wide,
.account-edit-panel .account-field-wide {
    grid-column: span 2;
}

.accounts-form-grid .admin-custom-select {
    width: 100%;
    min-width: 0;
}

.accounts-form-grid .admin-custom-select-menu {
    z-index: 120;
}

.accounts-form-grid .admin-custom-select:has(> select.account-proxy-type-select) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.js-device-profile-field[readonly],
.account-profile-edit-form input[readonly] {
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    cursor: default;
}

.account-create-notes {
    display: grid;
    gap: 7px;
    padding: 0 2px;
}

.account-create-notes > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-create-notes textarea {
    min-height: 78px;
    resize: vertical;
    padding-top: 11px;
}

.account-create-actions {
    padding-top: 2px;
}

.account-diagnostic-panel.account-profiles-panel {
    width: min(1080px, 100%);
    max-height: min(880px, calc(100vh - 48px));
    padding: 22px;
    scrollbar-gutter: stable;
    clip-path: inset(0 round 30px);
}

.account-profile-create-form {
    display: grid;
    gap: 13px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid rgba(11, 132, 255, .12);
    border-radius: 22px;
    background: var(--admin-primary-softer);
}

.account-profile-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.account-profile-row {
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, .96);
    overflow: hidden;
}

.account-profile-row > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 12px 14px;
    list-style: none;
    cursor: pointer;
}

.account-profile-row > summary::-webkit-details-marker {
    display: none;
}

.account-profile-row[open] > summary {
    border-bottom: 1px solid var(--admin-border);
    background: var(--admin-neutral-25);
}

.account-profile-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.account-profile-main strong {
    overflow: hidden;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-md);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-profile-main small {
    overflow: hidden;
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-profile-edit-form {
    padding: 14px;
}

.account-profile-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.account-profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.accounts-empty {
    padding: 18px;
    border-radius: 20px;
    border: 1px dashed rgba(11, 132, 255, .28);
    background: var(--admin-primary-softer);
    color: var(--admin-text-muted);
    font-size: var(--admin-text-md);
    line-height: var(--admin-leading-normal);
    font-weight: var(--admin-fw-medium);
}

.accounts-list {
    display: grid;
    gap: 12px;
}

.account-card {
    padding: 16px;
    border-radius: 24px;
    border: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}

.account-card.is-archived {
    opacity: .72;
    background: var(--admin-neutral-50);
}

.account-card.is-flash {
    outline: 2px solid rgba(11, 132, 255, .35);
    outline-offset: 2px;
}

.account-health-info {
    position: relative;
    flex: 0 0 auto;
}

.account-health-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--admin-border);
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    font-size: 13px;
    font-weight: var(--admin-fw-semibold);
    font-style: normal;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
}

.account-health-info.is-ok .account-health-dot {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-health-info.is-wait .account-health-dot {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-health-info.is-bad .account-health-dot {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-health-info.is-open {
    z-index: 30;
}

.account-card:has(.account-health-info.is-open) {
    position: relative;
    z-index: 26;
}

.account-health-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 12;
    display: none;
    gap: 8px;
    min-width: 280px;
    padding: 10px;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
}

.account-health-info.is-open .account-health-popover {
    display: grid;
}

.account-health-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.account-health-row-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-health-row-copy strong {
    font-size: var(--admin-text-xs);
    color: var(--admin-text-strong);
}

.account-health-row-copy span {
    font-size: 11px;
    color: var(--admin-text-muted);
}

.account-health-row.is-ok strong { color: var(--admin-success); }
.account-health-row.is-wait strong { color: var(--admin-warning); }
.account-health-row.is-bad strong { color: var(--admin-danger); }

.account-health-check {
    appearance: none;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: #fff;
    color: var(--admin-text-soft);
    font: inherit;
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
}

.account-health-check:disabled {
    opacity: .45;
    cursor: default;
}

.account-card-pipeline {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(11, 132, 255, .14);
    border-radius: 18px;
    background: var(--admin-primary-softer);
}

.account-card-pipeline.hidden {
    display: none;
}

.account-card-pipeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
}

.account-card-pipeline-head strong {
    color: var(--admin-text-secondary);
}

.account-card-pipeline-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.account-card-pipeline-steps span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--admin-text-soft);
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
}

.account-card-pipeline-steps i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--admin-border);
}

.account-card-pipeline-steps span.is-ok { color: var(--admin-success); }
.account-card-pipeline-steps span.is-ok i { background: var(--admin-success); }
.account-card-pipeline-steps span.is-run { color: var(--admin-primary); }
.account-card-pipeline-steps span.is-run i { background: var(--admin-primary); }
.account-card-pipeline-steps span.is-wait { color: var(--admin-warning); }
.account-card-pipeline-steps span.is-wait i { background: var(--admin-warning); }
.account-card-pipeline-steps span.is-bad { color: var(--admin-danger); }
.account-card-pipeline-steps span.is-bad i { background: var(--admin-danger); }

.account-card-error {
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid var(--admin-danger-border);
    border-radius: 12px;
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    font-size: var(--admin-text-xs);
}

.account-card-error.hidden {
    display: none;
}

.account-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.account-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.account-title-block h3 {
    margin: 0;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-xl);
    line-height: var(--admin-leading-tight);
    letter-spacing: -0.025em;
    font-weight: var(--admin-fw-semibold);
}

.account-title-block p {
    margin: 5px 0 0;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
}

.account-identity-meta-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 5px;
}

.account-identity-meta-line p,
.account-identity-meta-line .account-route-meta {
    display: inline;
    margin: 0;
}

.account-route-meta {
    display: block;
    margin-top: 4px;
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
}

.account-status-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.account-card-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.account-automation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: 4px;
}

.account-automation-toggle-state {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.account-card.is-automation-paused .account-automation-toggle-state {
    color: #b45309;
}

.account-automation-toggle .admin-switch {
    width: 34px;
    height: 20px;
}

.account-automation-toggle .admin-switch-thumb {
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
}

.account-automation-toggle .admin-switch.is-on .admin-switch-thumb {
    transform: translateX(14px);
}

html[data-theme="dark"] .account-card.is-automation-paused .account-automation-toggle-state {
    color: #fbbf24;
}

.account-quick-checks {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-right: 2px;
}

.account-status-pills {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.account-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .2);
    background: var(--admin-neutral-100);
    color: var(--admin-text-muted);
    font: inherit;
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

button.account-status-pill {
    cursor: pointer;
    transition: filter .15s ease, box-shadow .15s ease, opacity .15s ease;
}

button.account-status-pill:hover:not(:disabled) {
    filter: brightness(0.97);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

button.account-status-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

html[data-theme="dark"] button.account-status-pill:hover:not(:disabled) {
    filter: brightness(1.08);
    box-shadow: 0 0 0 1px rgba(232, 238, 247, 0.12);
}

.account-status-pill.is-ok {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-status-pill.is-warning {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-status-pill.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-status-pill.is-muted {
    border-color: rgba(148, 163, 184, .18);
    background: var(--admin-neutral-100);
    color: var(--admin-text-soft);
}

.account-botfather-pause-pill {
    gap: 6px;
}

.account-botfather-pause {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid var(--admin-warning-border);
    border-radius: 18px;
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-botfather-pause.hidden {
    display: none;
}

.account-botfather-pause .admin-line-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.account-botfather-pause > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.account-botfather-pause strong {
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
}

.account-botfather-pause span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
}

.account-queue-state-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    font-style: normal;
    white-space: nowrap;
}

.account-queue-state-pill em,
.account-connection-pill em,
.account-readiness-pill em {
    font-style: normal;
    font-weight: inherit;
}

.account-queue-state-pill.is-running,
.account-queue-state-pill.is-ready {
    border-color: rgba(11, 132, 255, .16);
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-queue-state-pill.is-scheduled {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-queue-state-pill.is-awaiting {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-queue-state-pill.is-paused,
.account-queue-state-pill.is-blocked,
.account-queue-state-pill.is-attention {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-autosearch-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    max-width: min(420px, 100%);
    padding: 0 11px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    font-family: inherit;
}

.account-autosearch-pill:hover {
    filter: brightness(0.98);
}

.account-autosearch-pill.hidden {
    display: none;
}

.account-autosearch-pill.is-ok {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-autosearch-pill.is-run,
.account-autosearch-pill.is-wait {
    border-color: rgba(11, 132, 255, .16);
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-autosearch-pill.is-bad {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-botfather-delete-pill {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}
}

.account-queue-control {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
    padding: 12px 13px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-25);
}

.account-queue-control-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--admin-text-muted);
    box-shadow: 0 0 0 5px rgba(148, 163, 184, .10);
}

.account-queue-control-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-queue-control-copy strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-queue-control-copy span,
.account-queue-control-copy small {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-queue-control-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
}

.account-queue-control.is-running,
.account-queue-control.is-ready,
.account-queue-control.is-scheduled {
    border-color: rgba(11, 132, 255, .16);
    background: var(--admin-primary-softer);
}

.account-queue-control.is-running .account-queue-control-dot,
.account-queue-control.is-ready .account-queue-control-dot,
.account-queue-control.is-scheduled .account-queue-control-dot {
    background: var(--admin-primary);
    box-shadow: 0 0 0 5px rgba(11, 132, 255, .10);
}

.account-queue-control.is-awaiting {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-queue-control.is-awaiting .account-queue-control-dot {
    background: var(--admin-success);
    box-shadow: 0 0 0 5px rgba(22, 163, 74, .10);
}

.account-queue-control.is-paused,
.account-queue-control.is-blocked,
.account-queue-control.is-attention {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
}

.account-queue-control.is-paused .account-queue-control-dot,
.account-queue-control.is-blocked .account-queue-control-dot,
.account-queue-control.is-attention .account-queue-control-dot {
    background: var(--admin-warning);
    box-shadow: 0 0 0 5px rgba(217, 119, 6, .10);
}

.account-readiness-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .2);
    background: var(--admin-neutral-100);
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    line-height: 1;
    white-space: nowrap;
}

.account-readiness-pill > span:first-child {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.account-readiness-pill.is-ok {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-readiness-pill.is-warning {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-readiness-pill.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-readiness-pill.is-checking {
    border-color: rgba(11, 132, 255, .18);
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-readiness-pill.is-checking > span {
    animation: account-status-pulse 1.2s ease-in-out infinite;
}

.account-connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
    font-style: normal;
    white-space: nowrap;
}

.account-connection-pill > span:first-child {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.account-connection-pill [data-account-connection-label],
.account-queue-state-pill [data-account-queue-state-label] {
    font-style: normal !important;
    font-weight: inherit;
}

.account-connection-pill.is-online {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-connection-pill.is-connecting {
    border-color: rgba(11, 132, 255, .18);
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-connection-pill.is-connecting > span {
    animation: account-status-pulse 1.2s ease-in-out infinite;
}

@keyframes account-status-pulse {
    0%, 100% { opacity: .35; transform: scale(.82); }
    50% { opacity: 1; transform: scale(1); }
}

.account-signal-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
}

.account-metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 999px;
    background: #fff;
    color: var(--admin-text-strong);
    font-family: inherit;
    font-size: var(--admin-text-xs);
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
    font-style: normal;
    white-space: nowrap;
    box-shadow: none;
}

button.account-metric-chip {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease, color .15s ease;
}

button.account-metric-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(11, 132, 255, .28);
    color: var(--admin-primary);
    background: #fff;
}

.account-metric-chip.is-static {
    cursor: default;
}

.account-metric-chip.has-items {
    border-color: rgba(11, 132, 255, .28);
    color: var(--admin-primary);
}

.account-metric-chip.is-awaiting.has-items {
    border-color: var(--admin-success-border);
    background: #fff;
    color: var(--admin-success);
}

.account-metric-chip.is-queue.has-items {
    border-color: var(--admin-warning-border);
    background: #fff;
    color: var(--admin-warning);
}

.account-metric-chip.is-queue.has-items em {
    color: inherit;
}

.account-metric-chip-label {
    color: var(--admin-text-muted);
    font-weight: var(--admin-fw-semibold);
}

.account-metric-chip-value,
.account-metric-chip-value b,
.account-metric-chip-value em {
    color: inherit;
    font-size: inherit;
    font-weight: var(--admin-fw-semibold);
    font-style: normal;
    line-height: 1;
}

.account-metric-chip-value em {
    margin-left: 2px;
    color: var(--admin-primary);
}

.account-signal-card,
.account-preflight-plaque,
.account-status-plaque {
    display: none;
}

.account-meta-grid {
    display: grid;
    grid-template-columns: max-content max-content max-content minmax(210px, 1fr) minmax(180px, .8fr) max-content;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
}

.account-meta-grid > div,
.account-meta-grid > button {
    min-width: 0;
    padding: 12px 13px;
    border-radius: 18px;
    border: 1px solid rgba(11, 132, 255, .12);
    background: var(--admin-primary-softer);
}

.account-meta-grid > button {
    appearance: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.account-meta-grid > button:hover {
    border-color: rgba(11, 132, 255, .28);
    background: rgba(235, 245, 255, .98);
    transform: translateY(-1px);
}

.account-meta-grid > button:focus-visible {
    outline: 3px solid rgba(11, 132, 255, .14);
    outline-offset: 2px;
}

.account-meta-grid > button.has-items {
    border-color: rgba(11, 132, 255, .30);
    background: #edf6ff;
    box-shadow: inset 0 0 0 1px rgba(11, 132, 255, .05);
}

.account-meta-grid > button.has-items span::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--admin-primary);
    vertical-align: 1px;
}

.account-meta-grid > button.is-awaiting.has-items {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-meta-grid > button.is-awaiting.has-items span::after {
    background: var(--admin-success);
}

.account-card.has-awaiting-action {
    border-color: rgba(3, 152, 85, .20);
}

.account-card.has-queue-action {
    border-color: rgba(181, 71, 8, .22);
}

.accounts-head-actions .has-account-alerts {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
}

.account-discrepancy-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--admin-warning);
    color: #fff;
    font-size: 11px;
    font-weight: var(--admin-fw-bold);
}

.account-card.has-new-discrepancy {
    border-color: var(--admin-warning-border);
}

.account-discrepancy-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--admin-warning-border);
    border-radius: 999px;
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-discrepancy-pill strong {
    color: inherit;
}

.account-discrepancies-panel {
    width: min(980px, calc(100vw - 48px));
}

.account-discrepancy-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.account-discrepancy-list {
    display: grid;
    gap: 10px;
}

.account-discrepancy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-surface);
}

.account-discrepancy-row.is-new {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
}

.account-discrepancy-row > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.account-discrepancy-row strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
}

.account-discrepancy-row span,
.account-discrepancy-row small {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
}

.account-meta-grid .is-compact {
    width: max-content;
}

.account-meta-grid span {
    display: block;
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    margin-bottom: 4px;
}

.account-meta-grid strong {
    display: block;
    overflow: hidden;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-meta-grid strong em {
    margin-left: 4px;
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-style: normal;
    font-weight: var(--admin-fw-semibold);
}

.account-preflight-title {
    flex: 0 0 auto;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, .06);
    background: #fff;
    color: var(--admin-text-muted);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
    cursor: pointer;
    appearance: none;
    font: inherit;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.account-icon-btn:hover {
    color: var(--admin-primary);
    background: #eef7ff;
    border-color: rgba(11, 132, 255, .16);
    transform: translateY(-1px);
}

.account-icon-btn .admin-line-icon {
    width: 18px;
    height: 18px;
}

.account-card-actions .account-log-details > summary.account-icon-btn {
    list-style: none;
}

.account-preflight-checks {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex-wrap: wrap;
}

.account-preflight-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    font-family: inherit;
    font-size: var(--admin-text-xs);
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
    box-shadow: none;
    text-decoration: none;
}

.account-preflight-check .admin-line-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.account-preflight-check.is-ok {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-preflight-check.is-warning {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-preflight-check.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-preflight-check.is-pending,
.account-preflight-check.is-muted {
    border-color: rgba(148, 163, 184, .16);
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
}

button.account-preflight-check {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease, color .15s ease;
}

button.account-preflight-check:hover:not(:disabled) {
    transform: translateY(-1px);
}

button.account-preflight-check.is-ok:hover:not(:disabled) {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

button.account-preflight-check.is-warning:hover:not(:disabled) {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

button.account-preflight-check.is-error:hover:not(:disabled) {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

button.account-preflight-check.is-pending:hover:not(:disabled),
button.account-preflight-check.is-muted:hover:not(:disabled) {
    border-color: rgba(11, 132, 255, .28);
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
}

button.account-preflight-check:disabled {
    cursor: default;
    opacity: 1;
}

.account-readiness-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 13px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: var(--admin-neutral-50);
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
}

.account-readiness-note small {
    flex: 0 0 auto;
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-readiness-note.is-ok {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-readiness-note.is-warning,
.account-readiness-note.is-checking {
    border-color: rgba(11, 132, 255, .12);
    background: var(--admin-primary-softer);
}

.account-readiness-note.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-notes {
    margin-top: 12px;
    padding: 12px 13px;
    border-radius: 18px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-normal);
    font-weight: var(--admin-fw-medium);
    white-space: pre-wrap;
}

.account-job-progress {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 17px;
    border: 1px solid rgba(11, 132, 255, .11);
    background: var(--admin-primary-softer);
}

.account-job-progress > div:first-child,
.account-diagnostic-live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-job-progress-track {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(11, 132, 255, .1);
}

.account-job-progress-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--admin-gradient-primary);
    transition: width .28s ease;
}

.account-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 0 auto;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.account-signal-row .account-card-actions .settings-btn {
    min-height: 32px;
    padding-inline: 12px;
}

.account-card-actions .js-account-start-create {
    margin-left: 0;
}

.account-history-text-button {
    margin-left: auto;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-style: normal;
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
    transition: color .18s ease;
}

.account-history-text-button:hover {
    color: var(--admin-primary-hover-start);
}

.account-log-details {
    position: relative;
    z-index: 1;
}

.account-log-details > summary {
    list-style: none;
    cursor: pointer;
}

.account-log-details > summary::-webkit-details-marker {
    display: none;
}

.account-log-details[open] .account-event-list {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    top: auto;
    z-index: 90;
    width: min(420px, calc(100vw - 40px));
    max-height: 310px;
    overflow: auto;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .13);
    padding: 9px;
}

.account-card:has(.account-log-details[open]) {
    position: relative;
    z-index: 25;
}

.account-event-list {
    display: grid;
    gap: 6px;
}

.account-event {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 9px 10px;
    border-radius: 14px;
    background: var(--admin-neutral-50);
}

.account-event-dot {
    width: 7px;
    height: 7px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--admin-text-soft);
}

.account-event > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.account-event strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    line-height: var(--admin-leading-snug);
}

.account-event small {
    color: var(--admin-text-soft);
    font-size: .68rem;
}

.account-event.is-success .account-event-dot {
    background: var(--admin-success);
}

.account-event.is-warning .account-event-dot {
    background: var(--admin-warning);
}

.account-event.is-error {
    background: var(--admin-danger-soft);
}

.account-event.is-error .account-event-dot {
    background: var(--admin-danger);
}

.account-edit-form {
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.js-account-edit-open:hover {
    transform: none;
    box-shadow: none;
}

.account-archive-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    margin-left: 2px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
}

.account-diagnostic-panel.account-archive-panel {
    width: min(980px, 100%);
    max-height: min(860px, calc(100vh - 48px));
    padding: 22px;
    scrollbar-gutter: stable;
    clip-path: inset(0 round 30px);
}

.account-archive-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.account-archive-row {
    display: grid;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 21px;
    background: var(--admin-neutral-25);
}

.account-archive-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.account-archive-main > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.account-archive-main strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-md);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-archive-main > div > span,
.account-archive-meta {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
}

.account-archive-meta {
    display: flex;
    align-items: center;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.account-archive-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.account-edit-modal-body {
    margin-top: 4px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 0 1 auto;
    max-height: calc(100vh - 160px);
}

.account-form-panel .account-create-form {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 160px);
    margin-top: 10px;
    padding-right: 2px;
}

.account-form-panel .account-diagnostic-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.account-form-panel .account-diagnostic-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.account-form-panel .account-diagnostic-head p,
.account-form-panel .account-form-lead {
    margin: 6px 0 0;
    max-width: none;
    width: 100%;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-create-form .account-create-notes,
.account-edit-form .account-create-notes {
    display: block;
    margin: 0;
}

.account-create-form .account-create-notes textarea,
.account-edit-form .account-create-notes textarea {
    min-height: 56px;
}

.account-diagnostic-modal {
    position: fixed;
    inset: 0;
    z-index: var(--admin-z-modal);
    display: grid;
    place-items: center;
    padding: 24px;
}

.account-diagnostic-modal.hidden {
    display: none;
}

#adminPasswordField.hidden,
#adminPasswordField[hidden] {
    display: none !important;
}

.account-diagnostic-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .32);
    backdrop-filter: blur(10px);
}

.account-diagnostic-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    border: 1px solid var(--admin-border);
    border-radius: 30px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-soft);
    padding: 20px;
    color: var(--admin-text);
}

.account-diagnostic-panel.admin-password-panel {
    width: min(470px, 100%);
}

.account-diagnostic-panel.account-control-panel {
    width: min(900px, 100%);
    max-height: min(820px, calc(100vh - 48px));
    padding: 22px;
    scrollbar-gutter: stable;
    clip-path: inset(0 round 30px);
}

.account-diagnostic-panel.account-history-panel {
    width: min(920px, 100%);
    scrollbar-gutter: stable;
    clip-path: inset(0 round 30px);
}

.account-history-content {
    display: grid;
    gap: 12px;
}

.account-history-loading,
.account-history-empty {
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
    text-align: center;
}

.account-history-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.account-history-metric {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-25);
}

.account-history-metric strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-xl);
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
    font-variant-numeric: tabular-nums;
}

.account-history-metric span,
.account-history-sync span,
.account-history-sync small {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
}

.account-history-metric.is-success strong { color: var(--admin-success); }
.account-history-metric.is-primary strong { color: var(--admin-primary); }
.account-history-metric.is-danger strong { color: var(--admin-danger); }

.account-history-sync,
.account-history-timeline {
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid rgba(11, 132, 255, .13);
    border-radius: 20px;
    background: var(--admin-primary-softer);
}

.account-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-history-filters {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    padding: 2px;
}

.account-history-filter,
.account-history-page-button,
.account-history-retry {
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: #fff;
    color: var(--admin-text-secondary);
    font: inherit;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.account-history-filter:hover,
.account-history-page-button:hover:not(:disabled),
.account-history-retry:hover {
    border-color: rgba(11, 132, 255, .22);
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-history-filter.is-active {
    border-color: transparent;
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-history-sync strong,
.account-history-timeline > strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-history-sync small {
    color: var(--admin-warning);
}

.account-history-timeline {
    border-color: var(--admin-border);
    background: var(--admin-neutral-25);
}

.account-history-list {
    display: grid;
    gap: 6px;
    max-height: 400px;
    overflow: auto;
    padding-right: 3px;
}

.account-history-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 11px;
    border-radius: 15px;
    background: var(--admin-surface);
}

.account-history-row-identity {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.account-history-row-identity a {
    overflow: hidden;
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-history-row > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-history-row strong {
    overflow: hidden;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-history-row small,
.account-history-row-side time {
    overflow: hidden;
    color: var(--admin-text-soft);
    font-size: .69rem;
    font-weight: var(--admin-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-history-row > .account-history-row-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.account-history-status {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-soft);
    font-size: .69rem;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.account-history-status.is-success { background: var(--admin-success-soft); color: var(--admin-success); }
.account-history-status.is-error { background: var(--admin-danger-soft); color: var(--admin-danger); }
.account-history-status.is-warning { background: var(--admin-warning-soft); color: var(--admin-warning); }
.account-history-status.is-running,
.account-history-status.is-pending { background: var(--admin-primary-softer); color: var(--admin-primary); }

.account-history-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-history-link {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    text-decoration: none;
}

.account-history-link:hover { color: var(--admin-primary); }

.account-history-retry {
    min-height: 28px;
    padding-inline: 9px;
    color: var(--admin-primary);
}

.account-history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 5px;
}

.account-history-pagination > span {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-history-page-button:disabled {
    opacity: .45;
    cursor: default;
}

.account-history-row.is-error { background: var(--admin-danger-soft); }
.account-history-row.is-warning { background: var(--admin-warning-soft); }
.account-history-row.is-success { background: var(--admin-success-soft); }

.account-control-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.account-control-status-grid > div {
    display: grid;
    align-content: start;
    gap: 5px;
    min-height: 88px;
    padding: 12px 13px;
    border: 1px solid rgba(11, 132, 255, .12);
    border-radius: 20px;
    background: var(--admin-primary-softer);
}

.account-control-status-grid span,
.account-control-profile span {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-control-status-grid strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-lg);
    line-height: var(--admin-leading-tight);
    font-weight: var(--admin-fw-semibold);
}

.account-control-status-grid small {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
    white-space: nowrap;
}

.account-control-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.account-control-profile > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-25);
}

.account-control-profile strong {
    overflow: hidden;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-action-password {
    -webkit-text-security: disc;
    text-security: disc;
}

[data-admin-flash] {
    transition: opacity .24s ease, transform .24s ease, margin .24s ease, padding .24s ease, max-height .24s ease;
    max-height: 120px;
    overflow: hidden;
}

[data-admin-flash].is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0;
}

.account-control-preflight {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 11px 13px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
}

.account-control-preflight > span {
    flex: 0 0 auto;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-control-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.account-control-actions .settings-btn {
    min-height: 38px;
}

.account-control-actions .settings-btn:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.account-control-cancel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px auto;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--admin-danger-border);
    border-radius: 18px;
    background: var(--admin-danger-soft);
}

.account-control-cancel > div {
    display: grid;
    gap: 3px;
}

.account-control-cancel strong {
    color: var(--admin-danger);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-control-cancel span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-control-cancel .broadcast-input {
    min-height: 38px;
}

.account-control-journal {
    margin-top: 14px;
    padding: 13px;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-neutral-25);
}

.account-control-journal-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.account-control-journal-head strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-control-journal-head span,
.account-control-events-empty {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-control-journal .account-event-list {
    max-height: 220px;
    overflow: auto;
    padding-right: 3px;
}

.account-control-events-empty {
    padding: 12px;
    text-align: center;
}

.account-botfather-section {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-neutral-25);
}

.account-botfather-head,
.account-botfather-head > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.account-botfather-head > div:first-child {
    display: grid;
    gap: 3px;
}

.account-botfather-head strong,
.account-bot-drafts-title {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-botfather-head span,
.account-botfather-empty {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-bot-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--admin-border);
    border-radius: 17px;
    background: var(--admin-surface);
}

.account-bot-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--admin-text-muted);
    font: inherit;
    font-size: var(--admin-text-xs);
    line-height: 1;
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.account-bot-tab:hover,
.account-bot-tab.is-active {
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-bot-tab > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(11, 132, 255, .1);
    color: inherit;
    font-size: 11px;
}

.account-bot-tab.is-active > span {
    background: rgba(11, 132, 255, .16);
}

.account-bot-tab > small {
    color: var(--admin-primary);
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
    white-space: nowrap;
}

.account-bot-panels,
.account-bot-panel {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.account-bot-panel.hidden {
    display: none;
}

.account-botfather-list,
.account-bot-drafts {
    display: grid;
    gap: 7px;
}

.account-botfather-row,
.account-bot-draft-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: var(--admin-surface);
}

.account-botfather-row > div,
.account-bot-draft-row > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-botfather-row .account-botfather-row-actions,
.account-bot-draft-row .account-botfather-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.account-botfather-row-actions .account-botfather-state {
    display: inline-flex;
    align-items: center;
    line-height: 26px;
    white-space: nowrap;
}

.account-botfather-row-actions .settings-btn {
    min-height: 34px;
    padding-inline: 11px;
}

.account-botfather-row strong,
.account-bot-draft-row strong {
    overflow: hidden;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-botfather-row > div span,
.account-bot-draft-row > div span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-botfather-state {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: 26px;
    font-weight: var(--admin-fw-semibold);
}

.account-botfather-state.is-linked,
.account-bot-draft-row.is-confirmed {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-botfather-state.is-warning {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-botfather-state.is-danger {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-bot-drafts {
    padding-top: 8px;
    border-top: 1px solid var(--admin-border);
}

.account-bot-draft-row.is-waiting_confirmation {
    border-color: rgba(11, 132, 255, .2);
    background: var(--admin-primary-softer);
}

.account-bot-draft-row.is-recovery_required {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-bot-draft-row.is-finalization_required {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
}

.account-bot-draft-row.is-finalizing {
    border-color: rgba(11, 132, 255, .24);
    background: var(--admin-primary-softer);
}

.account-bot-recovery-state {
    color: var(--admin-danger) !important;
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-bot-finalization-state {
    color: var(--admin-warning) !important;
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-semibold);
}

.account-bot-draft-row.is-finalizing .account-bot-finalization-state {
    color: var(--admin-primary) !important;
}

.account-bot-verification {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted) !important;
    font-size: 11px !important;
    line-height: 22px;
    font-weight: var(--admin-fw-semibold) !important;
}

.account-bot-verification.is-monitoring {
    border-color: rgba(11, 132, 255, .22);
    background: var(--admin-primary-softer);
    color: var(--admin-primary) !important;
}

.account-bot-verification.is-verified,
.account-bot-verification.is-ready {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success) !important;
}

.account-bot-verification.is-pending {
    border-color: var(--admin-border);
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted) !important;
}

.account-bot-verification.is-attention,
.account-bot-verification.is-recovery_required {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger) !important;
}

.account-bot-recreation-history {
    overflow: hidden;
    max-width: min(720px, 70vw);
    color: var(--admin-text-muted);
    font-size: 11px;
    line-height: var(--admin-leading-snug);
    font-weight: var(--admin-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-bot-draft-row.has-checkpoints,
.account-botfather-row.has-checkpoints {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.account-botfather-row > .account-bot-row-layout,
.account-bot-draft-row > .account-bot-row-layout {
    display: grid;
    gap: 10px;
    width: 100%;
}

.account-bot-row-top {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px !important;
    min-width: 0;
}

.account-bot-row-top > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-bot-row-top > .account-botfather-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    max-width: min(760px, 62%);
}

.account-checkpoints {
    position: relative;
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px !important;
    padding-top: 9px;
    border-top: 1px solid rgba(11, 132, 255, .12);
}

.account-finalization-steps {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px !important;
    padding-top: 9px;
    border-top: 1px solid rgba(11, 132, 255, .12);
}

.account-readiness-checklist {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: var(--admin-neutral-50);
}

.account-bot-row-layout > .account-readiness-checklist {
    width: 100%;
}

.account-readiness-checklist.is-ready {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-readiness-checklist.has-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-readiness-checklist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.account-readiness-checklist-head strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
}

.account-readiness-checklist-head span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
}

.account-readiness-checklist-items {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.account-readiness-check {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-readiness-check.is-success {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-readiness-check.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-created-readiness {
    width: fit-content;
    margin-top: 4px;
    font-weight: var(--admin-fw-semibold) !important;
}

.account-created-readiness.is-ready { color: var(--admin-success) !important; }
.account-created-readiness.is-error { color: var(--admin-danger) !important; }
.account-created-readiness.is-pending { color: var(--admin-primary) !important; }

.account-created-readiness-details {
    display: block !important;
    width: 100%;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    overflow: hidden;
}

.account-created-readiness-details.is-ready {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-created-readiness-details.has-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-created-readiness-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 40px;
    padding: 7px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.account-created-readiness-toggle strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-created-readiness-details.is-ready .account-created-readiness-toggle strong {
    color: var(--admin-success);
}

.account-created-readiness-toggle span {
    margin-left: auto;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-created-readiness-toggle::after {
    content: '';
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: var(--admin-text-muted);
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.account-created-readiness-details.is-open .account-created-readiness-toggle::after {
    transform: rotate(225deg);
}

.account-created-readiness-details .is-created-checklist {
    border: 0;
    border-top: 1px solid var(--admin-border);
    border-radius: 0;
    background: var(--admin-neutral-50);
}

.account-finalization-step {
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    min-width: 0;
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid var(--admin-border);
    border-radius: 11px;
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
}

.account-finalization-marker {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border: 2px solid #b8c4d5;
    border-radius: 50%;
    background: var(--admin-surface);
}

.account-finalization-step.is-running {
    border-color: rgba(11, 132, 255, .22);
    color: var(--admin-primary);
}

.account-finalization-step.is-running .account-finalization-marker {
    border-color: var(--admin-primary);
    background: var(--admin-primary);
}

.account-finalization-step.is-success {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-finalization-step.is-success .account-finalization-marker {
    border-color: var(--admin-success);
    background: var(--admin-success);
}

.account-finalization-step.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-finalization-step.is-error .account-finalization-marker {
    border-color: var(--admin-danger);
    background: var(--admin-danger);
}

.account-checkpoint {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px 8px !important;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--admin-border);
    border-radius: 13px;
    background: rgba(255, 255, 255, .82);
}

.account-checkpoint-marker {
    grid-row: 1 / 3;
    width: 9px;
    height: 9px;
    margin-top: 4px;
    border: 2px solid #b8c4d5;
    border-radius: 50%;
    background: #fff;
}

.account-checkpoint > div {
    display: grid;
    gap: 1px;
}

.account-checkpoint strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-checkpoint small {
    color: var(--admin-text-muted);
    font-size: 11px;
    font-weight: var(--admin-fw-medium);
}

.account-checkpoint .account-checkpoint-result {
    color: var(--admin-text-subtle);
    line-height: var(--admin-leading-snug);
}

.account-checkpoint.is-passed {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-checkpoint.is-passed .account-checkpoint-marker {
    border-color: var(--admin-success);
    background: var(--admin-success);
}

.account-checkpoint.is-failed {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-checkpoint.is-failed .account-checkpoint-marker {
    border-color: var(--admin-danger);
    background: var(--admin-danger);
}

.account-checkpoint-actions {
    grid-column: 1 / -1;
    display: flex !important;
    gap: 5px !important;
    margin-top: 5px;
}

.account-checkpoint-button {
    min-height: 27px;
    padding: 0 9px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: #fff;
    color: var(--admin-text-muted);
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.account-checkpoint-button.is-found:hover:not(:disabled) {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-checkpoint-button.is-missing:hover:not(:disabled) {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
}

.account-checkpoint-button:disabled {
    cursor: default;
    opacity: .45;
}

.account-bot-draft-row.is-priority {
    border-color: rgba(11, 132, 255, .28);
    background: linear-gradient(135deg, rgba(11, 132, 255, .08), rgba(255, 255, 255, .96));
}

.account-manual-priority {
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-source-description-picture {
    width: min(280px, 100%);
    max-height: 158px;
    margin-top: 8px;
    object-fit: cover;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
}

.account-bot-countdown {
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-bot-countdown.is-search-ok {
    color: var(--admin-success);
}

.account-bot-countdown.is-search-partial {
    color: var(--admin-warning);
}

.account-bot-countdown.is-search-bad {
    color: var(--admin-danger);
}

.account-bot-countdown.is-search-run {
    color: var(--admin-primary);
}

.account-bot-search-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.account-bot-search-query {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--admin-border);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.account-bot-search-query.is-hit {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-bot-search-query.is-miss {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-bot-draft-row.is-failed {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-bot-draft-error {
    max-width: 42%;
    color: var(--admin-danger);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-snug);
}

.account-bot-create-panel {
    width: min(760px, 100%);
}

.account-bot-attach-panel {
    width: min(560px, 100%);
}

.account-bot-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.account-create-form-section {
    display: grid;
    gap: 13px;
    padding: 15px;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-surface);
}

.account-create-form-section-head > div {
    display: grid;
    gap: 3px;
}

.account-create-form-section-head strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-base);
    font-weight: var(--admin-fw-semibold);
}

.account-create-form-section-head span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-bot-create-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.account-bot-create-grid label > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-bot-create-grid .account-field-wide {
    grid-column: 1 / -1;
}

.account-direct-snapshot-block {
    display: grid;
    gap: 8px;
    margin: 0 0 4px;
    padding: 12px 14px;
    border: 1px dashed rgba(247, 144, 9, .4);
    border-radius: 14px;
    background: rgba(247, 144, 9, .05);
}

.account-direct-snapshot-block.hidden {
    display: none;
}

.account-direct-snapshot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.account-direct-snapshot-field {
    flex: 1 1 180px;
    display: grid;
    gap: 7px;
    min-width: 0;
}

.account-direct-snapshot-field > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-direct-snapshot-hint,
.account-direct-snapshot-status {
    margin: 0;
}

.account-direct-snapshot-status.is-error {
    color: #b42318;
}

.account-template-grid,
.account-material-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.account-template-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-template-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.account-template-grid label > small {
    display: block;
    margin-top: -2px;
    font-size: 11px;
    line-height: 1.3;
}

.account-material-card {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--admin-border);
    border-radius: 19px;
    background: var(--admin-surface);
}

.account-material-preview {
    display: block;
    width: 100%;
    max-height: 220px;
    border: 1px solid rgba(11, 132, 255, .12);
    border-radius: 15px;
    object-fit: contain;
    background: var(--admin-primary-softer);
}

.account-material-preview.is-avatar {
    width: 116px;
    height: 116px;
    object-fit: cover;
}

.account-material-plan-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
}

.account-materials-plan {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px dashed rgba(247, 144, 9, .4);
    border-radius: 14px;
    background: rgba(247, 144, 9, .05);
    font-size: 13px;
    color: var(--admin-text);
}

.account-materials-plan strong {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--admin-text-muted);
}

.account-materials-plan b {
    font-weight: 650;
}

.account-profile-template-preview {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: #fff;
}

.account-profile-template-preview strong {
    font-size: 12px;
    color: var(--admin-text-muted);
}

.account-profile-template-preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-profile-template-preview-row figure {
    margin: 0;
    display: grid;
    gap: 6px;
}

.account-profile-template-preview-row img {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    background: var(--admin-primary-softer);
}

.account-profile-template-preview-row figcaption {
    font-size: 11px;
    color: var(--admin-text-muted);
}

.account-botname-preview {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

#accountCreateDescription.js-autoheight-textarea {
    min-height: 2.75rem;
    max-height: min(45vh, 22rem);
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

.account-material-preview.hidden {
    display: none;
}

.account-creation-queue {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    background: var(--admin-surface);
}

.account-creation-request-list {
    display: grid;
    gap: 10px;
}

.account-creation-request {
    display: grid;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-neutral-50);
}

.account-creation-request.is-awaiting_content_approval {
    border-color: rgba(11, 132, 255, .2);
    background: var(--admin-primary-softer);
}

.account-creation-request.is-snapshot_ready {
    border-color: rgba(11, 132, 255, .2);
    background: var(--admin-primary-softer);
}

.account-creation-request.is-failed {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-creation-request-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-creation-request-head > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-creation-request-head .account-creation-request-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.account-request-return-panel {
    width: min(520px, 100%);
}

.account-creation-request-head strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-creation-request-head span,
.account-creation-request-about {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-creation-request-about {
    margin: 0;
    line-height: var(--admin-leading-normal);
}

.account-queue-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.account-queue-metrics span,
.account-queue-metrics strong {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
    line-height: 1.2;
}

.account-queue-metrics span + span::before {
    content: '·';
    margin-right: 7px;
    color: var(--admin-text-soft);
}

.account-queue-metrics strong {
    margin-left: auto;
    color: var(--admin-primary);
}

.account-creation-candidates {
    display: grid;
    gap: 8px;
}

.account-creation-candidate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    padding: 8px 10px 8px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: var(--admin-surface);
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-candidate-identity {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-candidate-identity > span {
    overflow: hidden;
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-candidate-identity > small {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-candidate-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.account-candidate-error {
    max-width: 300px;
    overflow: hidden;
    color: var(--admin-danger);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-operation-summary,
.account-sync-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(11, 132, 255, .18);
    border-radius: 17px;
    background: var(--admin-primary-softer);
}

.account-operation-status,
.account-sync-summary {
    min-width: 0;
}

.account-operation-status,
.account-sync-summary > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-operation-status > div,
.account-sync-summary > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.account-operation-status strong,
.account-sync-summary strong {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-operation-status span:not(.account-operation-dot),
.account-sync-summary span,
.account-sync-summary small {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-operation-dot,
.account-sync-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--admin-primary);
    box-shadow: 0 0 0 5px rgba(11, 132, 255, .10);
}

.account-operation-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.account-sync-summary {
    justify-content: flex-start;
    border-color: var(--admin-border);
    background: var(--admin-neutral-50);
}

.account-sync-summary.is-ok {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
}

.account-sync-summary.is-ok .account-sync-dot { background: var(--admin-success); }
.account-sync-summary.is-running .account-sync-dot { background: var(--admin-primary); }
.account-sync-summary.is-warning .account-sync-dot { background: var(--admin-warning); }
.account-sync-summary.is-error .account-sync-dot { background: var(--admin-danger); }
.account-sync-summary.is-unknown .account-sync-dot { background: var(--admin-text-muted); }

.account-creation-candidate .settings-btn {
    min-height: 28px;
    padding-inline: 10px;
    font-size: var(--admin-text-xs);
}

.account-candidate-mini-action {
    min-height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted);
    font: inherit;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.account-candidate-mini-action:hover {
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-candidate-more {
    position: relative;
}

.account-candidate-more > summary {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--admin-border);
    border-radius: 50%;
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    cursor: pointer;
    list-style: none;
}

.account-candidate-more > summary::-webkit-details-marker { display: none; }

.account-candidate-more > summary .admin-line-icon {
    width: 18px;
    height: 18px;
}

.account-candidate-more[open] > summary,
.account-candidate-more > summary:hover {
    border-color: var(--admin-primary-border);
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-candidate-more-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    min-width: 172px;
    padding: 6px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-surface);
    box-shadow: var(--admin-shadow-card);
}

.account-candidate-more:not([open]) > .account-candidate-more-menu {
    display: none;
}

.account-candidate-more-menu button {
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--admin-text-secondary);
    font: inherit;
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
    text-align: left;
    cursor: pointer;
}

.account-candidate-more-menu button:hover {
    background: var(--admin-neutral-50);
    color: var(--admin-primary);
}

.account-creation-candidate.is-failed,
.account-creation-candidate.is-taken {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.account-creation-candidate.is-skipped,
.account-creation-candidate.is-cancelled,
.account-creation-candidate.is-replaced {
    opacity: .72;
    background: var(--admin-neutral-50);
}

.account-creation-candidate.is-confirmed {
    border-color: var(--admin-success-border);
    background: var(--admin-success-soft);
    color: var(--admin-success);
}

.account-request-source-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px;
    border: 1px solid rgba(11, 132, 255, .16);
    border-radius: 20px;
    background: var(--admin-primary-softer);
}

.account-request-source-preview.has-avatar {
    grid-template-columns: 58px minmax(0, 1fr);
}

.account-request-source-preview > img {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    object-fit: cover;
}

.account-request-source-preview > div {
    display: grid;
    gap: 3px;
}

.account-request-source-preview strong {
    color: var(--admin-text-strong);
    font-size: var(--admin-text-base);
    font-weight: var(--admin-fw-semibold);
}

.account-request-source-preview span,
.account-request-source-preview p {
    margin: 0;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    line-height: var(--admin-leading-normal);
}

.account-request-check {
    display: flex !important;
    align-items: center;
    gap: 9px !important;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--admin-border);
    border-radius: 15px;
    background: var(--admin-neutral-50);
}

.account-request-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--admin-primary);
}

.settings-btn-confirm {
    border-color: rgba(19, 171, 104, .24);
    background: #eafaf2;
    color: #0b8f55;
}

.settings-btn-confirm:hover {
    border-color: rgba(19, 171, 104, .34);
    background: #ddf7e9;
    color: #087a48;
    box-shadow: none;
}

.account-profile-templates-panel {
    width: min(920px, 100%);
}

.account-profile-templates-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.account-profile-tpl-drafts {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.account-profile-template-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.account-profile-tpl-row {
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: var(--admin-surface);
    overflow: hidden;
}

.account-profile-tpl-row.is-draft {
    border-style: dashed;
    border-color: rgba(19, 171, 104, .34);
    background: var(--admin-surface-soft);
    padding: 14px;
}

.account-profile-tpl-draft-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.account-profile-tpl-draft-head strong {
    display: block;
    margin-top: 6px;
    color: var(--admin-text);
}

.account-profile-tpl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.account-profile-tpl-toggle {
    display: grid;
    gap: 2px;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    min-width: 0;
    flex: 1;
}

.account-profile-tpl-toggle strong {
    font-size: 14px;
    color: var(--admin-text);
}

.account-profile-tpl-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.account-profile-tpl-actions .js-profile-tpl-toolbar-view,
.account-profile-tpl-actions .js-profile-tpl-toolbar-edit {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.account-profile-tpl-actions .js-profile-tpl-toolbar-view.hidden,
.account-profile-tpl-actions .js-profile-tpl-toolbar-edit.hidden {
    display: none;
}

.account-profile-tpl-row[data-mode="view"] .js-profile-tpl-toolbar-edit,
.account-profile-tpl-row:not([data-mode="edit"]) .js-profile-tpl-toolbar-edit {
    display: none;
}

.account-profile-tpl-row[data-mode="edit"] .js-profile-tpl-toolbar-view {
    display: none;
}

.account-profile-tpl-row[data-mode="edit"] .js-profile-tpl-toolbar-edit {
    display: flex;
}

.account-profile-tpl-panel {
    border-top: 1px solid var(--admin-border);
    padding: 12px 14px 14px;
    background: rgba(15, 23, 42, .02);
}

.account-profile-tpl-fields {
    display: grid;
    gap: 12px;
}

.account-profile-tpl-field {
    display: grid;
    gap: 6px;
}

.account-profile-tpl-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-muted);
}

.account-profile-tpl-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.account-profile-tpl-label-row .settings-btn-compact {
    flex: 0 0 auto;
    width: auto;
    align-self: center;
}

.settings-btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    width: auto;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.account-profile-tpl-fields .js-autoheight-textarea {
    min-height: 2.75rem;
    max-height: min(45vh, 22rem);
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
}

.account-profile-tpl-draft-actions {
    display: flex;
    gap: 8px;
}

.account-profile-template-media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.account-profile-media-card {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px dashed rgba(11, 132, 255, .28);
    border-radius: 16px;
    background: var(--admin-primary-softer);
}

.account-profile-media-card-preview {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
    display: grid;
    place-items: center;
}

.account-profile-media-card-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-profile-media-card-preview.is-empty {
    background: var(--admin-surface-soft);
}

.account-profile-media-card-placeholder {
    display: block;
    padding: 6px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--admin-muted);
    line-height: 1.25;
}

.account-profile-media-card-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.account-profile-media-card-body strong {
    font-size: 13px;
    color: var(--admin-text);
}

.account-profile-media-card-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--admin-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-profile-media-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.account-profile-media-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-muted);
    cursor: pointer;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 720px) {
    .account-profile-template-media {
        grid-template-columns: 1fr;
    }
}

.account-create-kind-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--admin-border);
    border-radius: 17px;
    background: var(--admin-neutral-50);
}

.account-create-kind-tabs button {
    min-height: 40px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--admin-text-muted);
    font: inherit;
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.account-create-kind-tabs button.is-active {
    background: var(--admin-surface);
    color: var(--admin-primary);
    box-shadow: 0 8px 24px rgba(29, 50, 79, .07);
}

.account-create-kind-tabs small {
    margin-left: 5px;
    color: var(--admin-text-soft);
    font-size: 10px;
}

#accountCreateBotPanel {
    display: grid;
    gap: 12px;
}

#accountCreateBotPanel.hidden {
    display: none;
}

.account-create-account-summary {
    display: grid;
    grid-template-columns: 1.15fr .8fr 1.4fr .75fr;
    gap: 8px;
}

.account-create-account-summary > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: var(--admin-surface);
}

.account-create-account-summary span {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-create-account-summary strong {
    overflow: hidden;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-adopt-account-field {
    display: block;
    min-width: 0;
}

.account-adopt-account-field.hidden {
    display: none;
}

.account-adopt-account-hint {
    margin: 8px 0 0;
}

.account-adopt-account-hint.hidden {
    display: none;
}

.account-avatar-upload {
    padding: 12px;
    border: 1px dashed rgba(11, 132, 255, .28);
    border-radius: 17px;
    background: var(--admin-primary-softer);
}

.account-avatar-upload input[type="file"] {
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
}

.account-avatar-upload small {
    color: var(--admin-text-soft);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-medium);
}

.account-create-future {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 230px;
    place-content: center;
    padding: 28px;
    border: 1px dashed rgba(11, 132, 255, .22);
    border-radius: 22px;
    background: var(--admin-primary-softer);
    text-align: center;
}

.account-create-future.hidden {
    display: none;
}

.account-create-future svg {
    width: 34px;
    height: 34px;
    color: var(--admin-primary);
}

.account-create-future span {
    max-width: 520px;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-sm);
    line-height: var(--admin-leading-normal);
}

.account-control-actions-compact {
    justify-content: flex-start;
    margin: 2px 0 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

.account-create-progress {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 13px 14px;
    border: 1px solid rgba(11, 132, 255, .15);
    border-radius: 18px;
    background: var(--admin-primary-softer);
}

.account-create-progress.hidden {
    display: none;
}

.account-cycle-rows {
    display: grid;
    gap: 6px;
}

.account-cycle-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.account-cycle-row > span {
    color: var(--admin-text-soft);
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.account-cycle-row > strong {
    color: var(--admin-text-secondary);
    font-size: 13px;
    font-weight: var(--admin-fw-semibold);
    min-width: 0;
}

.account-create-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-xs);
}

.account-create-progress-head strong {
    color: var(--admin-text-secondary);
    font-weight: var(--admin-fw-semibold);
}

.account-create-progress-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.account-create-progress-steps span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--admin-text-soft);
    font-size: 11px;
    font-weight: var(--admin-fw-semibold);
}

.account-create-progress-steps i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--admin-border);
}

.account-create-progress-steps span.is-active {
    color: var(--admin-primary);
}

.account-create-progress-steps span.is-active i {
    background: var(--admin-primary);
}

.account-create-progress.is-error {
    border-color: var(--admin-danger-border);
    background: var(--admin-danger-soft);
}

.taskboard-creation-line {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 12px;
    align-items: end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border);
}

.taskboard-source-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(11, 132, 255, .16);
    border-radius: 14px;
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
    font-size: var(--admin-text-xs);
    font-weight: var(--admin-fw-semibold);
}

.taskboard-row.is-locked {
    border-color: rgba(109, 75, 209, .18);
    background: linear-gradient(135deg, rgba(249, 247, 255, .98), rgba(255, 255, 255, .98));
}

.taskboard-row.is-locked .taskboard-input[readonly] {
    cursor: default;
    background: rgba(248, 247, 252, .9);
    color: var(--admin-text-muted);
}

.taskboard-row.is-locked button:disabled {
    cursor: default;
    box-shadow: none;
}

.taskboard-row.is-locked .js-taskboard-send:disabled {
    border-color: rgba(109, 75, 209, .16);
    background: #ede9fe;
    color: #6d4bd1;
    opacity: 1;
}

.account-bot-avatar-input {
    padding: 8px 10px;
}

.account-diagnostic-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.account-diagnostic-head h2 {
    margin: 12px 0 0;
    color: var(--admin-text-strong);
    font-size: var(--admin-text-2xl);
    font-weight: var(--admin-fw-semibold);
    letter-spacing: -.035em;
}

.account-diagnostic-head p {
    margin: 6px 0 0;
    color: var(--admin-text-muted);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
}

.account-diagnostic-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--admin-border);
    border-radius: 50%;
    background: var(--admin-neutral-50);
    color: var(--admin-text-muted);
}

.account-diagnostic-close:hover {
    background: var(--admin-primary-softer);
    color: var(--admin-primary);
}

.account-diagnostic-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.account-diagnostic-form > label {
    display: grid;
    gap: 7px;
}

.account-diagnostic-form > label > span {
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-diagnostic-warning {
    padding: 12px 13px;
    border: 1px solid rgba(11, 132, 255, .12);
    border-radius: 18px;
    background: var(--admin-primary-softer);
    color: var(--admin-text-secondary);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-medium);
    line-height: var(--admin-leading-normal);
}

.account-diagnostic-warning.is-destructive {
    border-color: var(--admin-warning-border);
    background: var(--admin-warning-soft);
    color: var(--admin-warning);
}

.account-diagnostic-error {
    padding: 11px 13px;
    border: 1px solid var(--admin-danger-border);
    border-radius: 16px;
    background: var(--admin-danger-soft);
    color: var(--admin-danger);
    font-size: var(--admin-text-sm);
    font-weight: var(--admin-fw-semibold);
}

.account-diagnostic-live {
    display: grid;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    background: var(--admin-neutral-25);
}

.account-diagnostic-live .account-event-list {
    max-height: 235px;
    overflow: auto;
    padding-right: 3px;
}

.account-diagnostic-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 1180px) {
    .accounts-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accounts-top-row {
        flex-wrap: wrap;
    }

    .accounts-top-row > .accounts-stat-card:not(.accounts-cycle-card) {
        flex: 1 1 calc(25% - 12px);
        width: auto;
        min-width: 140px;
    }

    .accounts-top-row > .accounts-cycle-card {
        flex: 0 0 auto;
        width: max-content;
        min-width: max-content;
    }

    .account-create-panel .accounts-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-profile-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {
    .account-card-main {
        flex-direction: column;
    }

    .account-status-row {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .account-status-pills {
        margin-left: 0;
    }

    .accounts-page > .admin-page-head {
        flex-direction: column;
    }

    .accounts-head-actions {
        justify-content: flex-start;
    }

    .accounts-form-grid,
    .account-meta-grid,
    .account-create-panel .accounts-form-grid,
    .account-profile-form-grid {
        grid-template-columns: 1fr;
    }

    .accounts-top-row {
        flex-wrap: wrap;
        width: 100%;
    }

    .accounts-top-row > .accounts-stat-card:not(.accounts-cycle-card) {
        flex: 1 1 calc(50% - 12px);
        width: auto;
        min-width: 148px;
    }

    .accounts-top-row > .accounts-cycle-card {
        flex: 0 0 auto;
        width: max-content;
        min-width: max-content;
        max-width: 100%;
    }

    .account-signal-row {
        gap: 5px;
    }

    .account-signal-row .account-card-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    .account-card-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .account-card-actions .js-account-start-create,
    .account-card-actions .js-account-control-open {
        width: auto;
        margin-left: 0;
    }

    .account-form-panel .account-diagnostic-head p,
    .account-form-panel .account-form-lead {
        white-space: normal;
    }

    .account-form-grid,
    .account-proxy-inline-grid,
    .account-connection-entry-grid {
        grid-template-columns: 1fr;
    }

    .account-form-grid .account-field-span-2,
    .account-form-grid .account-field-wide {
        grid-column: auto;
    }

    .account-form-footer {
        flex-wrap: wrap;
    }

    .accounts-notes-field,
    .account-create-panel .account-field-wide {
        grid-column: auto;
    }

    .account-diagnostic-panel.account-create-panel {
        padding: 17px;
    }

    .account-diagnostic-panel.account-profiles-panel {
        padding: 17px;
    }

    .account-diagnostic-panel.account-archive-panel,
    .account-diagnostic-panel.account-edit-panel {
        padding: 17px;
    }

    .account-diagnostic-panel.account-control-panel {
        padding: 17px;
    }

    .account-control-status-grid,
    .account-control-profile {
        grid-template-columns: 1fr;
    }

    .account-botfather-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-botfather-head > div:last-child {
        width: 100%;
        flex-wrap: wrap;
    }

    .account-bot-create-grid {
        grid-template-columns: 1fr;
    }

    .account-bot-create-grid .account-field-wide {
        grid-column: auto;
    }

    .account-template-grid,
    .account-material-grid {
        grid-template-columns: 1fr;
    }

    .account-control-cancel {
        grid-template-columns: 1fr;
    }

    .account-control-preflight {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-create-section-head {
        display: grid;
        gap: 4px;
    }

    .account-create-section-head span {
        text-align: left;
    }

    .account-tdata-dropzone {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .account-tdata-dropzone-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* ---- ACL visibility ---- */
body.acl-no-mutate [data-acl="mutate"],
body.acl-no-sensitive [data-acl="sensitive"],
body.acl-no-admin [data-acl="admin"] {
    display: none !important;
}

body.acl-no-mutate .js-acl-mutate-only,
body.acl-no-sensitive .js-acl-sensitive-only {
    display: none !important;
}

/* ---- Feedback ---- */
.feedback-badge-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, #f59e0b 16%, var(--admin-surface));
    border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--admin-border));
    color: #b45309;
    font-size: 12px;
    font-weight: 700;
}

html[data-theme="dark"] .feedback-badge-new {
    color: #fbbf24;
}

.feedback-compose textarea {
    min-height: 110px;
    resize: vertical;
}

.feedback-type-pill {
    display: inline-flex;
    cursor: pointer;
}

.feedback-type-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feedback-type-pill span {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.feedback-type-pill input:checked + span {
    border-color: color-mix(in srgb, #2563eb 45%, var(--admin-border));
    background: color-mix(in srgb, #2563eb 12%, var(--admin-surface));
    color: var(--admin-text);
}

.feedback-dropzone {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px dashed var(--admin-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--admin-bg) 65%, var(--admin-surface));
}

.feedback-dropzone.is-drag {
    border-color: #2563eb;
    background: color-mix(in srgb, #2563eb 10%, var(--admin-surface));
}

.feedback-dropzone-copy {
    display: grid;
    gap: 2px;
    font-size: 13px;
    color: var(--admin-text-muted);
}

.feedback-dropzone-copy strong {
    color: var(--admin-text);
}

.feedback-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feedback-preview-chip {
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    font-size: 12px;
}

.feedback-filters {
    display: grid;
    gap: 8px;
}

.feedback-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feedback-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
    color: var(--admin-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.feedback-filter-pill.is-active {
    color: var(--admin-text);
    border-color: color-mix(in srgb, #2563eb 40%, var(--admin-border));
    background: color-mix(in srgb, #2563eb 12%, var(--admin-surface));
}

.feedback-list {
    display: grid;
    gap: 14px;
}

.feedback-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.feedback-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.feedback-chip-bug {
    background: color-mix(in srgb, #ef4444 14%, var(--admin-surface));
    color: #b91c1c;
}

.feedback-chip-idea {
    background: color-mix(in srgb, #2563eb 14%, var(--admin-surface));
    color: #1d4ed8;
}

.feedback-chip-status-new { background: #fff7ed; color: #c2410c; }
.feedback-chip-status-in_progress { background: #eff6ff; color: #1d4ed8; }
.feedback-chip-status-done { background: #ecfdf5; color: #047857; }
.feedback-chip-status-rejected { background: #f3f4f6; color: #6b7280; }

html[data-theme="dark"] .feedback-chip-status-new { background: rgba(194,65,12,.2); color: #fdba74; }
html[data-theme="dark"] .feedback-chip-status-in_progress { background: rgba(29,78,216,.2); color: #93c5fd; }
html[data-theme="dark"] .feedback-chip-status-done { background: rgba(4,120,87,.2); color: #6ee7b7; }
html[data-theme="dark"] .feedback-chip-status-rejected { background: rgba(107,114,128,.2); color: #d1d5db; }

.feedback-card-body {
    white-space: pre-wrap;
    color: var(--admin-text);
    font-size: 14px;
    line-height: 1.5;
}

.feedback-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.feedback-attachments a {
    display: block;
    width: 96px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.feedback-attachments img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feedback-comments {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border);
    display: grid;
    gap: 10px;
}

.feedback-comment {
    font-size: 13px;
    color: var(--admin-text);
}

.feedback-comment-meta {
    font-size: 11px;
    color: var(--admin-text-muted);
    margin-bottom: 2px;
}

.feedback-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.feedback-status-form select {
    min-width: 140px;
}

/* ---- Admin users (settings) ---- */
.admin-users-head {
    margin-bottom: 18px;
}

.admin-users-create {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--admin-border);
    background: color-mix(in srgb, var(--admin-bg) 55%, var(--admin-surface));
}

.admin-users-create-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
}

.admin-users-field {
    display: grid;
    gap: 6px;
}

.admin-users-field > span {
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-muted);
}

.admin-users-create-btn {
    height: 42px;
    white-space: nowrap;
}

.admin-users-list {
    display: grid;
    gap: 12px;
}

.admin-user-card {
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--admin-border);
    background: var(--admin-surface);
}

.admin-user-card.is-bootstrap {
    background: color-mix(in srgb, var(--admin-bg) 70%, var(--admin-surface));
}

.admin-user-card.is-highlight {
    border-color: color-mix(in srgb, #2563eb 45%, var(--admin-border));
    box-shadow: 0 0 0 3px color-mix(in srgb, #2563eb 14%, transparent);
}

.admin-user-row,
.admin-user-line,
.admin-user-password-inline,
.admin-user-edit-fields,
.admin-user-edit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.admin-user-row {
    flex-wrap: nowrap;
    gap: 10px;
}

.admin-user-line {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.admin-user-row .js-admin-user-edit {
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 13px;
    color: #1d4ed8;
    background: color-mix(in srgb, #2563eb 14%, var(--admin-surface));
    border: 1px solid color-mix(in srgb, #2563eb 22%, var(--admin-border));
}

.admin-user-name {
    font-weight: 700;
    color: var(--admin-text);
    white-space: nowrap;
}

.admin-user-note {
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-text-muted);
    white-space: nowrap;
}

.admin-user-role-pill,
.admin-user-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.admin-user-role-pill.is-admin {
    background: color-mix(in srgb, #7c3aed 14%, var(--admin-surface));
    color: #6d28d9;
}

.admin-user-role-pill.is-moderator {
    background: color-mix(in srgb, #2563eb 14%, var(--admin-surface));
    color: #1d4ed8;
}

.admin-user-role-pill.is-executor {
    background: color-mix(in srgb, #0f766e 14%, var(--admin-surface));
    color: #0f766e;
}

.admin-user-status.is-on {
    background: color-mix(in srgb, #059669 12%, var(--admin-surface));
    color: #047857;
}

.admin-user-status.is-off {
    background: color-mix(in srgb, #6b7280 12%, var(--admin-surface));
    color: #6b7280;
}

.admin-user-edit-panel {
    width: min(520px, 100%);
}

.admin-user-edit-fields {
    align-items: end;
}

.admin-user-edit-fields .admin-users-field {
    flex: 1 1 180px;
}

.admin-user-edit-fields .admin-user-active {
    padding-bottom: 10px;
}

.admin-user-edit-actions {
    justify-content: flex-end;
    width: 100%;
}

.admin-user-password-inline {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--admin-border);
    background: color-mix(in srgb, var(--admin-bg) 55%, var(--admin-surface));
}

.admin-user-password-inline.is-revealed {
    width: min(100%, 420px);
    justify-content: flex-start;
    flex-wrap: wrap;
}

.admin-user-password-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--admin-text);
    word-break: break-all;
    max-width: 12ch;
    line-height: 1.2;
}

.admin-user-password-inline.is-revealed .admin-user-password-value {
    max-width: min(100%, 280px);
    flex: 1 1 auto;
}

.admin-user-active {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--admin-text);
    white-space: nowrap;
}

.admin-user-delete-btn {
    color: #b91c1c !important;
}

.admin-users-empty {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed var(--admin-border);
    color: var(--admin-text-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 900px) {
    .admin-users-create-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-row,
    .admin-user-line,
    .admin-user-password-inline,
    .admin-user-edit-actions {
        flex-wrap: wrap;
    }

    .admin-user-row .js-admin-user-edit,
    .admin-users-create-btn,
    .admin-user-edit-actions .settings-btn {
        width: 100%;
    }
}

/* ---- Dark theme surfaces & contrast ---- */
html[data-theme="dark"] .admin-page-bg,
html[data-theme="dark"] body.admin-page-bg {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 34rem),
        #151b24 !important;
    color: var(--admin-text);
}

html[data-theme="dark"] .admin-topbar,
html[data-theme="dark"] .ui-card,
html[data-theme="dark"] .ui-card-soft,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .metric-mini,
html[data-theme="dark"] .admin-user-card,
html[data-theme="dark"] .taskboard-row,
html[data-theme="dark"] .bot-card,
html[data-theme="dark"] .searcher-card,
html[data-theme="dark"] .ref-program-panel,
html[data-theme="dark"] .debug-category-card,
html[data-theme="dark"] .debug-event-card,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .feedback-card,
html[data-theme="dark"] .feedback-compose {
    background: var(--admin-surface) !important;
    border-color: var(--admin-border) !important;
    color: var(--admin-text);
    box-shadow: var(--admin-shadow-card);
}

html[data-theme="dark"] .bot-card.is-archived {
    border-color: rgba(248, 113, 113, 0.22) !important;
}

html[data-theme="dark"] .stat-card:not(.stat-card-blue):not(.stat-card-dark) {
    background: var(--admin-surface) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .stat-card:not(.stat-card-blue):not(.stat-card-dark) .text-3xl,
html[data-theme="dark"] .stat-card:not(.stat-card-blue):not(.stat-card-dark) .text-2xl,
html[data-theme="dark"] .ui-card .text-3xl,
html[data-theme="dark"] .ui-card .text-2xl {
    color: var(--admin-text-strong) !important;
}

html[data-theme="dark"] .broadcast-input,
html[data-theme="dark"] .settings-input,
html[data-theme="dark"] .ui-date-input,
html[data-theme="dark"] .admin-custom-select-trigger,
html[data-theme="dark"] select.broadcast-input,
html[data-theme="dark"] input.broadcast-input,
html[data-theme="dark"] textarea.broadcast-input {
    background: var(--admin-surface-soft) !important;
    color: var(--admin-text) !important;
    border-color: var(--admin-border) !important;
}

html[data-theme="dark"] .admin-shell th {
    color: var(--admin-text-muted) !important;
}

html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-amber-50,
html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-green-50 {
    background: var(--admin-surface-soft) !important;
}

html[data-theme="dark"] .settings-btn:not(.settings-btn-primary):not(.settings-btn-warning):not(.has-direct-snapshot),
html[data-theme="dark"] .admin-user-password-inline,
html[data-theme="dark"] .admin-users-create {
    background: var(--admin-surface-soft) !important;
    border-color: var(--admin-border) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .admin-user-role-pill.is-admin { color: #c4b5fd; }
html[data-theme="dark"] .admin-user-role-pill.is-moderator { color: #93c5fd; }
html[data-theme="dark"] .admin-user-role-pill.is-executor { color: #5eead4; }
html[data-theme="dark"] .admin-user-status.is-on { color: #6ee7b7; }
html[data-theme="dark"] .admin-user-status.is-off { color: #cbd5e1; }
html[data-theme="dark"] .admin-user-delete-btn { color: #fca5a5 !important; }


/* ---- Dark theme: full page shell + readable tables/forms ---- */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background: #151b24 !important;
    color: var(--admin-text) !important;
    overscroll-behavior-y: none;
}

html[data-theme="dark"] .admin-page-bg,
html[data-theme="dark"] body.admin-page-bg {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 36rem),
        #151b24 !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .admin-shell {
    background: #151b24 !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45) !important;
    color: var(--admin-text) !important;
    margin-top: 0;
    min-height: 100vh;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

html[data-theme="dark"] .admin-content {
    color: var(--admin-text);
}

html[data-theme="dark"] .admin-topbar {
    background: rgba(21, 27, 36, 0.96) !important;
    border-bottom-color: rgba(232, 238, 247, 0.08) !important;
}

html[data-theme="dark"] table {
    color: var(--admin-text);
}

html[data-theme="dark"] thead th,
html[data-theme="dark"] .admin-shell th {
    color: #a9b6c9 !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
}

html[data-theme="dark"] tbody td,
html[data-theme="dark"] .admin-shell td {
    color: #e7eef8 !important;
    border-color: rgba(232, 238, 247, 0.06) !important;
}

html[data-theme="dark"] tbody tr {
    background: transparent;
    transition: background-color .15s ease;
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .admin-shell tbody tr:hover {
    background: rgba(232, 238, 247, 0.045) !important;
}

html[data-theme="dark"] .broadcast-input,
html[data-theme="dark"] .settings-input,
html[data-theme="dark"] .taskboard-input,
html[data-theme="dark"] .ui-date-input,
html[data-theme="dark"] .admin-custom-select-trigger,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .searcher-filter-date {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color-scheme: dark;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #8b98ab !important;
}

html[data-theme="dark"] .searcher-keyword-row,
html[data-theme="dark"] .searcher-result-row,
html[data-theme="dark"] .taskboard-row,
html[data-theme="dark"] .ref-program-table tr,
html[data-theme="dark"] .account-card,
html[data-theme="dark"] .bot-card {
    transition: background-color .15s ease, border-color .15s ease, filter .15s ease;
}

html[data-theme="dark"] .searcher-keyword-row,
html[data-theme="dark"] .searcher-result-row {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .searcher-result-row.is-unread {
    background: #212a38 !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

html[data-theme="dark"] .searcher-keyword-row:hover,
html[data-theme="dark"] .searcher-result-row:hover,
html[data-theme="dark"] .taskboard-row:hover {
    background: #222c3b !important;
    filter: brightness(1.04);
}

html[data-theme="dark"] .taskboard-input {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

/* Keep status color from CSS vars — use accent (fg), not pastel bg */
html[data-theme="dark"] .taskboard-status-trigger {
    border-color: color-mix(in srgb, var(--task-status-fg, #93c5fd) 45%, #1e2836) !important;
    background: color-mix(in srgb, var(--task-status-fg, #93c5fd) 18%, #1a2330) !important;
    color: color-mix(in srgb, var(--task-status-fg, #93c5fd) 72%, #ffffff) !important;
}

html[data-theme="dark"] .taskboard-status-popover {
    background: #1b2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .taskboard-status-choice {
    background: transparent !important;
    border-color: transparent !important;
    color: color-mix(in srgb, var(--task-status-fg, #93c5fd) 78%, #ffffff) !important;
}

html[data-theme="dark"] .taskboard-status-choice:hover,
html[data-theme="dark"] .taskboard-status-choice.is-active {
    border-color: color-mix(in srgb, var(--task-status-fg, #93c5fd) 40%, #1e2836) !important;
    background: color-mix(in srgb, var(--task-status-fg, #93c5fd) 16%, #1a2330) !important;
    color: color-mix(in srgb, var(--task-status-fg, #93c5fd) 85%, #ffffff) !important;
}

html[data-theme="dark"] .account-preflight,
html[data-theme="dark"] .account-signal-card,
html[data-theme="dark"] .account-preflight-plaque,
html[data-theme="dark"] .account-status-plaque,
html[data-theme="dark"] .account-metric-chip {
    background: #243041 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .account-metric-chip {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .account-metric-chip-label {
    color: #9aa8bc !important;
}

html[data-theme="dark"] .account-metric-chip-value em,
html[data-theme="dark"] .account-metric-chip.has-items {
    color: #93c5fd !important;
}

html[data-theme="dark"] .account-metric-chip.is-awaiting.has-items {
    background: #243041 !important;
    border-color: color-mix(in srgb, var(--admin-success) 40%, #1e2836) !important;
    color: #86efac !important;
}

html[data-theme="dark"] .account-metric-chip.is-queue.has-items,
html[data-theme="dark"] .account-queue-state-pill.is-scheduled {
    background: #2a261c !important;
    border-color: color-mix(in srgb, var(--admin-warning) 42%, #1e2836) !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .accounts-queue-strip {
    background: #2a261c !important;
    border-color: color-mix(in srgb, var(--admin-warning) 36%, #1e2836) !important;
}

html[data-theme="dark"] .accounts-queue-strip-row {
    background: #243041 !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .accounts-queue-strip-row.is-idle {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .account-health-popover {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .bot-tag-popover {
    background: #1b2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45) !important;
    color: var(--admin-text);
}

html[data-theme="dark"] .bot-tag-popover-title {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .bot-tag-custom-input {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .bot-tag-custom-input:focus {
    background: #222c3b !important;
}

html[data-theme="dark"] .bot-tag-custom-submit {
    background: #243041 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #e8eef7 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .bot-tag-custom-submit:hover {
    background: #2a3546 !important;
    border-color: rgba(232, 238, 247, 0.18) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .bot-health-tooltip {
    background: rgba(27, 35, 48, 0.96) !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: var(--admin-text) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .bot-health-tooltip div + div {
    border-top-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .bot-health-tooltip span {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .bot-health-tooltip strong {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .account-health-check {
    background: #243041 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #d7e0ec !important;
}

html[data-theme="dark"] .account-log-details[open] .account-event-list {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .account-event {
    background: #243041 !important;
}

html[data-theme="dark"] .account-event strong {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .account-event small {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .account-history-filter,
html[data-theme="dark"] .account-history-page-button,
html[data-theme="dark"] .account-history-retry {
    background: #243041 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #d7e0ec !important;
}

html[data-theme="dark"] .account-history-filter:hover,
html[data-theme="dark"] .account-history-page-button:hover:not(:disabled),
html[data-theme="dark"] .account-history-retry:hover {
    background: #1e2836 !important;
    border-color: rgba(11, 132, 255, .28) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .account-history-filter.is-active {
    background: var(--admin-primary-softer) !important;
    border-color: transparent !important;
    color: var(--admin-primary) !important;
}

html[data-theme="dark"] .account-card-pipeline {
    background: #1e2836 !important;
    border-color: rgba(11, 132, 255, .22) !important;
}

html[data-theme="dark"] .account-form-section,
html[data-theme="dark"] .account-create-section {
    background: #243041 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .account-form-footer {
    background: transparent !important;
}

html[data-theme="dark"] .account-icon-btn {
    background: #243041 !important;
    color: #d7e0ec !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .account-icon-btn:hover {
    background: #2c3a4e !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] .account-card-actions,
html[data-theme="dark"] .account-control-bar {
    background: transparent !important;
    border-color: transparent !important;
}

html[data-theme="dark"] .ui-pill-dark {
    background: #2a3545 !important;
    color: #f3f6fb !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .ui-pill:not(.ui-pill-active):not(.ui-pill-dark),
html[data-theme="dark"] .bot-edit-btn,
html[data-theme="dark"] .bot-action-btn,
html[data-theme="dark"] .bot-icon-action-btn,
html[data-theme="dark"] .bot-tag-add-btn {
    background: var(--admin-surface-soft) !important;
    color: var(--admin-text) !important;
    border-color: var(--admin-border) !important;
}

/* Keep bot tags as light pastel pills (same as Settings previews). */
html[data-theme="dark"] .bot-tag-pill {
    border-color: color-mix(in srgb, var(--tag-bg, #d0d5dd) 38%, #ffffff) !important;
    background: color-mix(in srgb, var(--tag-bg, #d0d5dd) 88%, #ffffff) !important;
    color: var(--tag-text, #344054) !important;
}

html[data-theme="dark"] .bot-tag-remove-btn {
    color: color-mix(in srgb, var(--tag-text, #344054) 72%, #667085) !important;
}

html[data-theme="dark"] .bot-tag-remove-btn:hover {
    background: rgba(15, 23, 42, 0.08) !important;
    color: color-mix(in srgb, var(--tag-text, #344054) 88%, #101827) !important;
}

html[data-theme="dark"] .bot-status-pill.bot-status-off,
html[data-theme="dark"] .bot-health-pill,
html[data-theme="dark"] .bot-lifecycle-pill {
    background: var(--admin-surface-soft) !important;
    border-color: var(--admin-border) !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-active,
html[data-theme="dark"] .bot-lifecycle-pill.is-ok {
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .ui-search,
html[data-theme="dark"] .ui-search-action {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .ui-search-action {
    background: #2a3545 !important;
}

html[data-theme="dark"] .ui-search-clear {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .account-diagnostic-panel,
html[data-theme="dark"] .settings-mini-modal,
html[data-theme="dark"] .bot-ui-modal-panel,
html[data-theme="dark"] .broadcast-modal-panel,
html[data-theme="dark"] .ref-chart-modal-panel,
html[data-theme="dark"] .admin-password-panel {
    background: #1b2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: var(--admin-text) !important;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .account-diagnostic-head h2,
html[data-theme="dark"] .bot-ui-modal-head h2,
html[data-theme="dark"] .settings-mini-modal h2,
html[data-theme="dark"] .admin-password-panel h2 {
    color: #f5f8fc !important;
}

html[data-theme="dark"] .account-diagnostic-head p,
html[data-theme="dark"] .bot-ui-modal-head p,
html[data-theme="dark"] .settings-mini-modal p {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .broadcast-section,
html[data-theme="dark"] .broadcast-bots-list,
html[data-theme="dark"] .broadcast-preview-box,
html[data-theme="dark"] .broadcast-bot-chip,
html[data-theme="dark"] .broadcast-bot-list,
html[data-theme="dark"] .broadcast-preview,
html[data-theme="dark"] .bot-ui-section {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .broadcast-bot-row {
    background: #222c3b !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .broadcast-bot-chip {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .debug-event-card {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
}

html[data-theme="dark"] .debug-event-card[open] {
    background: #222c3b !important;
    border-color: rgba(11, 132, 255, 0.22) !important;
}

html[data-theme="dark"] .debug-event-summary:hover {
    background: rgba(232, 238, 247, 0.04) !important;
}

html[data-theme="dark"] .debug-event-message,
html[data-theme="dark"] .debug-event-detail {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .ref-program-table tbody tr:hover td,
html[data-theme="dark"] .ref-program-table tbody tr:hover {
    background: rgba(232, 238, 247, 0.045) !important;
}

html[data-theme="dark"] .bot-health-counter,
html[data-theme="dark"] .bot-owner-counter,
html[data-theme="dark"] .invalid-token-counter {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .invalid-token-row,
html[data-theme="dark"] .invalid-token-empty {
    background: #222c3b !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
}

html[data-theme="dark"] .invalid-token-row-title,
html[data-theme="dark"] .invalid-token-empty h3 {
    color: #f5f8fc !important;
}

html[data-theme="dark"] .invalid-token-row-meta,
html[data-theme="dark"] .invalid-token-empty p {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .invalid-token-username,
html[data-theme="dark"] button.invalid-token-username {
    color: #7eb6ff !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-active {
    background: color-mix(in srgb, #17a851 18%, #1e2836) !important;
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-quiet {
    background: color-mix(in srgb, #1876e8 18%, #1e2836) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-warning {
    background: color-mix(in srgb, #d97706 18%, #1e2836) !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-danger {
    background: color-mix(in srgb, #e03e3e 18%, #1e2836) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-delete {
    background: color-mix(in srgb, #9f1239 22%, #1e2836) !important;
    color: #fb7185 !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-neutral {
    background: color-mix(in srgb, #94a3b8 14%, #1e2836) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-unmanaged {
    background: color-mix(in srgb, #d97706 18%, #1e2836) !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .bot-health-counter.bot-health-invalid {
    background: color-mix(in srgb, #e03e3e 18%, #1e2836) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .bot-health-pill {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: #e8eef7 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-active {
    background: color-mix(in srgb, #17a851 16%, #1e2836) !important;
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-quiet {
    background: color-mix(in srgb, #1876e8 16%, #1e2836) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-warning {
    background: color-mix(in srgb, #d97706 16%, #1e2836) !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-danger {
    background: color-mix(in srgb, #e03e3e 16%, #1e2836) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-delete {
    background: color-mix(in srgb, #9f1239 20%, #1e2836) !important;
    color: #fb7185 !important;
}

html[data-theme="dark"] .bot-health-pill.bot-health-neutral {
    background: color-mix(in srgb, #94a3b8 12%, #1e2836) !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .bot-owner-counter.has-items {
    background: color-mix(in srgb, #f59e0b 16%, #1e2836) !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .admin-custom-select-menu,
html[data-theme="dark"] .admin-custom-select-option {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] .admin-custom-select-option:hover,
html[data-theme="dark"] .admin-custom-select-option.is-active {
    background: #2a3545 !important;
}

html[data-theme="dark"] .js-bot-manage-shell {
    background: transparent !important;
    border-color: transparent !important;
}

html[data-theme="dark"] .js-bot-manage-shell:not(.bot-manage-compact) {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

/* ---- Dark polish batch 2: remaining white surfaces & contrast ---- */
html[data-theme="dark"] .searcher-result-title,
html[data-theme="dark"] .searcher-result-title > span:not(.searcher-new-dot) {
    color: #f3f6fb !important;
}

html[data-theme="dark"] .searcher-result-text {
    color: #c4cfde !important;
}

html[data-theme="dark"] .searcher-result-meta {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .searcher-mau-label {
    color: #5eead4 !important;
    background: rgba(45, 212, 191, .16);
}

html[data-theme="dark"] .searcher-mau-label.is-empty {
    color: inherit !important;
    background: transparent;
}

html[data-theme="dark"] .searcher-result-actions .ui-pill,
html[data-theme="dark"] .searcher-result-actions button,
html[data-theme="dark"] .searcher-result-actions .bot-icon-action-btn,
html[data-theme="dark"] .searcher-result-actions .bot-action-btn {
    background: #2a3545 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .bot-metrics-panel {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .bot-metric-label {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .bot-metric-value {
    color: #f3f6fb !important;
}

html[data-theme="dark"] .bot-metric-compact .text-blue-600.bot-metric-label,
html[data-theme="dark"] .bot-metric-compact .text-blue-600.bot-metric-value {
    color: #93c5fd !important;
}

html[data-theme="dark"] .bot-metric-compact .text-green-700.bot-metric-label,
html[data-theme="dark"] .bot-metric-compact .text-green-700.bot-metric-value {
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .account-bot-tabs,
html[data-theme="dark"] .account-botfather-row,
html[data-theme="dark"] .account-bot-draft-row,
html[data-theme="dark"] .account-discrepancy-row,
html[data-theme="dark"] .account-history-row,
html[data-theme="dark"] .account-material-card,
html[data-theme="dark"] .settings-tag-list,
html[data-theme="dark"] .settings-tag-row,
html[data-theme="dark"] .settings-ref-item,
html[data-theme="dark"] .bot-owner-row,
html[data-theme="dark"] .bot-lifecycle-card,
html[data-theme="dark"] .bot-lifecycle-columns > section {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .account-botfather-row strong,
html[data-theme="dark"] .account-bot-draft-row strong,
html[data-theme="dark"] .account-discrepancy-row strong,
html[data-theme="dark"] .account-history-row strong,
html[data-theme="dark"] .bot-owner-row-title strong,
html[data-theme="dark"] .bot-lifecycle-value,
html[data-theme="dark"] .bot-lifecycle-columns h3,
html[data-theme="dark"] .bot-lifecycle-attempt strong,
html[data-theme="dark"] .bot-lifecycle-event strong {
    color: #f3f6fb !important;
}

html[data-theme="dark"] .account-botfather-row > div span,
html[data-theme="dark"] .account-bot-draft-row > div span,
html[data-theme="dark"] .account-discrepancy-row span,
html[data-theme="dark"] .account-discrepancy-row small,
html[data-theme="dark"] .account-history-row small,
html[data-theme="dark"] .bot-owner-row-title span,
html[data-theme="dark"] .bot-lifecycle-note,
html[data-theme="dark"] .bot-lifecycle-attempt span {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .account-bot-tab.is-active {
    background: rgba(11, 132, 255, 0.18) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .account-material-plan-hint,
html[data-theme="dark"] .account-material-card small,
html[data-theme="dark"] .account-material-card .text-gray-400,
html[data-theme="dark"] .account-material-card .text-gray-500,
html[data-theme="dark"] .account-material-card .text-gray-600 {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .account-tdata-dropzone,
html[data-theme="dark"] .account-session-upload .account-tdata-dropzone,
html[data-theme="dark"] .account-material-preview {
    background: #1e2836 !important;
    border-color: rgba(11, 132, 255, 0.28) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .account-tdata-dropzone-copy strong,
html[data-theme="dark"] .account-tdata-dropzone-copy span,
html[data-theme="dark"] .account-tdata-dropzone-copy small {
    color: #c4cfde !important;
}

html[data-theme="dark"] #templatesModal .bot-template-row,
html[data-theme="dark"] #templatesModal .bot-template-row-head,
html[data-theme="dark"] #templatesModal .bot-template-draft,
html[data-theme="dark"] #templatesModal .bot-template-bindings-global,
html[data-theme="dark"] #templatesModal .bot-template-bot-row,
html[data-theme="dark"] #templatesModal .bot-template-bot-empty,
html[data-theme="dark"] #templatesModal .js-tpl-accordion-panel > div > div {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] #templatesModal .bot-template-row[data-mode="edit"],
html[data-theme="dark"] #templatesModal .bot-template-draft {
    background: #1e2836 !important;
}

html[data-theme="dark"] #templatesModal .js-template-card-title,
html[data-theme="dark"] #templatesModal .bot-template-draft-head h3,
html[data-theme="dark"] #templatesModal .bot-template-bot-name,
html[data-theme="dark"] #templatesModal .bot-template-bindings-global-head h3 {
    color: #f3f6fb !important;
}

html[data-theme="dark"] #templatesModal .bot-template-draft-head p,
html[data-theme="dark"] #templatesModal .bot-template-bot-meta,
html[data-theme="dark"] #templatesModal .bot-template-bindings-global-head p,
html[data-theme="dark"] #templatesModal .bot-template-linked-count {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] #templatesModal .bot-template-bindings-global-toggle {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .debug-event-detail {
    background: #1a2330 !important;
    border-top-color: rgba(232, 238, 247, 0.08) !important;
    color: #c4cfde !important;
}

html[data-theme="dark"] .debug-bot-pill,
html[data-theme="dark"] .debug-category-pill {
    background: #2a3545 !important;
    color: #e8eef7 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .debug-bot-pill span {
    color: #9ec5ff !important;
}

html[data-theme="dark"] .settings-tag-row .text-gray-500,
html[data-theme="dark"] .settings-tag-row .text-gray-600,
html[data-theme="dark"] .settings-tag-row .text-gray-700,
html[data-theme="dark"] .settings-tag-row code {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .account-diagnostic-form input::placeholder,
html[data-theme="dark"] .account-diagnostic-panel input::placeholder,
html[data-theme="dark"] .account-diagnostic-panel textarea::placeholder,
html[data-theme="dark"] .account-direct-snapshot-field input,
html[data-theme="dark"] .account-direct-snapshot-field input::placeholder {
    color: #9aa8bc !important;
}

html[data-theme="dark"] .account-direct-snapshot-field input {
    color: #eef3fa !important;
}

html[data-theme="dark"] .inline-flex.items-center.gap-2.rounded-full.bg-white\/80,
html[data-theme="dark"] .account-diagnostic-panel .rounded-full.bg-white\/80,
html[data-theme="dark"] .bot-ui-modal-panel .rounded-full.bg-white\/80,
html[data-theme="dark"] .ui-section-chip {
    background: rgba(42, 53, 69, 0.92) !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: var(--admin-primary-text) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .ui-section-chip > span {
    background: #60a5fa;
}

html[data-theme="dark"] .account-created-readiness-details {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .account-created-readiness-details.is-ready {
    background: color-mix(in srgb, #17a851 12%, #1a2330) !important;
    border-color: rgba(23, 168, 81, 0.28) !important;
}

html[data-theme="dark"] .account-created-readiness-details .is-created-checklist,
html[data-theme="dark"] .account-finalization-step {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .account-created-readiness-toggle strong {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .account-created-readiness-toggle span,
html[data-theme="dark"] .account-created-readiness-toggle::after {
    color: #93a1b5 !important;
}

/* Light pastel status chips on dark surfaces (readable like Settings tags). */
html[data-theme="dark"] .account-botfather-state,
html[data-theme="dark"] .account-readiness-check:not(.is-success):not(.is-error) {
    background: #f4f7fb !important;
    border-color: rgba(17, 24, 39, 0.08) !important;
    color: #667085 !important;
}

html[data-theme="dark"] .account-botfather-state.is-linked,
html[data-theme="dark"] .account-readiness-check.is-success {
    background: #e6f9ef !important;
    border-color: rgba(3, 152, 85, 0.18) !important;
    color: #039855 !important;
}

html[data-theme="dark"] .account-botfather-state.is-warning {
    background: #fff4df !important;
    border-color: rgba(181, 71, 8, 0.16) !important;
    color: #b54708 !important;
}

html[data-theme="dark"] .account-botfather-state.is-danger,
html[data-theme="dark"] .account-readiness-check.is-error {
    background: #fff1f0 !important;
    border-color: rgba(217, 45, 32, 0.12) !important;
    color: #b42318 !important;
}

html[data-theme="dark"] .account-bot-tab.is-active {
    background: rgba(11, 132, 255, 0.18) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] .account-finalization-marker {
    background: #1e2836 !important;
    border-color: #64748b !important;
}

html[data-theme="dark"] .searcher-welcome-preview {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .searcher-welcome-preview-text {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .searcher-welcome-preview-btn {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .bot-menu-panel {
    background: #1b2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .bot-menu-item,
html[data-theme="dark"] .bot-menu-panel .bot-menu-item,
html[data-theme="dark"] .bot-menu-panel .text-gray-700 {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .bot-menu-panel :is(a, button, summary):hover {
    background: #2a3545 !important;
}

html[data-theme="dark"] .bot-menu-danger {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .bot-menu-danger:hover {
    background: color-mix(in srgb, #e03e3e 18%, #1b2330) !important;
    color: #fecaca !important;
}

html[data-theme="dark"] .settings-ref-item {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .settings-ref-code {
    color: #c4cfde !important;
}

html[data-theme="dark"] .settings-ref-name {
    color: #93c5fd !important;
}

html[data-theme="dark"] .settings-ref-source {
    background: rgba(11, 132, 255, 0.16) !important;
    color: #93c5fd !important;
}

/* Mouse clicks should not leave a persistent focus ring */
.admin-shell :is(button, a, summary, .ui-pill):focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.admin-shell :is(button, a, .ui-pill):focus-visible {
    outline: 2px solid rgba(11, 132, 255, 0.45);
    outline-offset: 2px;
}


html[data-theme="dark"] .searcher-welcome-preview {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .searcher-welcome-preview-text {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .searcher-welcome-preview-btn {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .bot-menu-panel {
    background: #1b2330 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] .bot-menu-item,
html[data-theme="dark"] .bot-menu-panel .bot-menu-item,
html[data-theme="dark"] .bot-menu-panel .text-gray-700,
html[data-theme="dark"] .bot-menu-panel a,
html[data-theme="dark"] .bot-menu-panel button:not(.bot-menu-danger) {
    color: #e8eef7 !important;
}

html[data-theme="dark"] .bot-menu-panel :is(a, button, summary):hover {
    background: #2a3545 !important;
}

html[data-theme="dark"] .bot-menu-danger {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .bot-menu-danger:hover {
    background: color-mix(in srgb, #e03e3e 18%, #1a2330) !important;
    color: #fecaca !important;
}

html[data-theme="dark"] .settings-ref-item {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .settings-ref-code {
    color: #c4cfde !important;
}

html[data-theme="dark"] .settings-ref-name {
    color: #93c5fd !important;
}

html[data-theme="dark"] .settings-ref-source {
    background: rgba(11, 132, 255, 0.16) !important;
    color: #93c5fd !important;
}

/* Mouse click: no sticky focus ring after opening modals/menus */
.admin-shell button:focus:not(:focus-visible),
.admin-shell a:focus:not(:focus-visible),
.admin-shell summary:focus:not(:focus-visible),
.admin-shell .ui-pill:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

.admin-shell button:focus-visible,
.admin-shell a:focus-visible,
.admin-shell .ui-pill:focus-visible {
    outline: 2px solid rgba(11, 132, 255, 0.45);
    outline-offset: 2px;
}

/* ---- Dark polish batch 3 ---- */
html[data-theme="dark"] .admin-nav {
    background: rgba(26, 35, 48, 0.94) !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .admin-nav-link {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .admin-nav-link:hover {
    background: #243041 !important;
    color: #f3f6fb !important;
}

html[data-theme="dark"] .admin-nav-link.is-active {
    color: #fff !important;
    background: linear-gradient(135deg, #1188ff 0%, #0a62dc 100%) !important;
    box-shadow: 0 8px 18px rgba(11, 132, 255, 0.22);
}

html[data-theme="dark"] .admin-version-btn {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #93a1b5 !important;
}

html[data-theme="dark"] .admin-changelog-entry {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .bot-ui-section,
html[data-theme="dark"] .bot-ui-msg-block,
html[data-theme="dark"] #addModal form > .border,
html[data-theme="dark"] #editModal form > .border,
html[data-theme="dark"] #welcome_message_preview_add,
html[data-theme="dark"] #welcome_message_preview_edit,
html[data-theme="dark"] .bot-ui-preview {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .bot-ui-label,
html[data-theme="dark"] .bot-ui-label-hint,
html[data-theme="dark"] #addModal label,
html[data-theme="dark"] #editModal label {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .bot-ui-subtitle {
    color: #f3f6fb !important;
}

html[data-theme="dark"] .bot-health-group-row,
html[data-theme="dark"] .bot-health-group-metrics div {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
}

html[data-theme="dark"] .bot-health-group-title,
html[data-theme="dark"] .bot-health-group-metrics strong {
    color: #f3f6fb !important;
}

html[data-theme="dark"] .bot-health-group-meta,
html[data-theme="dark"] .bot-health-group-note,
html[data-theme="dark"] .bot-health-group-metrics span {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .bot-owner-search {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #a9b6c9 !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .bot-owner-search input {
    color: #eef3fa !important;
}

html[data-theme="dark"] .bot-owner-result-count {
    color: #93a1b5 !important;
}

html[data-theme="dark"] .ref-chart-toolbar,
html[data-theme="dark"] .ref-chart-modal-panel,
html[data-theme="dark"] .ref-month-compare-dialog,
html[data-theme="dark"] .ref-month-history-row,
html[data-theme="dark"] .ref-month-compare-grid > div,
html[data-theme="dark"] .ref-month-compare-result,
html[data-theme="dark"] .ref-month-compare-empty {
    background: #1a2330 !important;
    border-color: rgba(232, 238, 247, 0.1) !important;
    color: var(--admin-text) !important;
}

html[data-theme="dark"] .ref-cache-progress {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: none;
}

html[data-theme="dark"] .ref-cache-progress-track {
    background: rgba(11, 132, 255, 0.18);
}

html[data-theme="dark"] .ref-cache-progress-pct,
html[data-theme="dark"] .ref-cache-progress-stage {
    color: #e8eef7;
}

html[data-theme="dark"] .ref-chart-filter-btn,
html[data-theme="dark"] .ref-program-date,
html[data-theme="dark"] .ref-chart-modal-close {
    background: #1e2836 !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    color: #e8eef7 !important;
}

html[data-theme="dark"] .ref-section-head h3,
html[data-theme="dark"] .ref-month-compare-dialog h3,
html[data-theme="dark"] .ref-month-history-label strong,
html[data-theme="dark"] .ref-month-history-value strong {
    color: #f3f6fb !important;
}

html[data-theme="dark"] .ref-section-head p,
html[data-theme="dark"] .ref-month-history-label span,
html[data-theme="dark"] .ref-month-history-value span {
    color: #a9b6c9 !important;
}

html[data-theme="dark"] .ref-month-history-track {
    background: #1e2836 !important;
    border-color: rgba(11, 132, 255, 0.22) !important;
}

html[data-theme="dark"] .ui-search {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    padding-right: 3.75rem !important;
}

html[data-theme="dark"] .ui-search-action {
    background: #2a3545 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

/* ---- Dark polish batch 4: nav, contrast, templates ---- */
html[data-theme="dark"] .bot-username-link,
html[data-theme="dark"] .js-copy-tme,
html[data-theme="dark"] .admin-shell .bot-username-link,
html[data-theme="dark"] .admin-shell .js-copy-tme.text-blue-600 {
    color: #8ec5ff !important;
    text-decoration-color: rgba(142, 197, 255, 0.55) !important;
}

html[data-theme="dark"] .bot-username-link:hover,
html[data-theme="dark"] .js-copy-tme:hover {
    color: #b7dbff !important;
    text-decoration-color: rgba(183, 219, 255, 0.8) !important;
}

html[data-theme="dark"] .admin-custom-select-btn,
html[data-theme="dark"] .admin-custom-select-btn:hover,
html[data-theme="dark"] .admin-custom-select.is-open .admin-custom-select-btn {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .admin-custom-select.is-disabled .admin-custom-select-btn,
html[data-theme="dark"] .admin-custom-select-btn:disabled {
    background: #1e2836 !important;
    color: #eef3fa !important;
    opacity: 1;
}

html[data-theme="dark"] #templatesModal label,
html[data-theme="dark"] #templatesModal .text-xs.font-medium,
html[data-theme="dark"] #templatesModal .text-gray-600,
html[data-theme="dark"] #templatesModal .text-gray-500 {
    color: #c4cfde !important;
}

html[data-theme="dark"] #templatesModal input[type="text"],
html[data-theme="dark"] #templatesModal textarea,
html[data-theme="dark"] #templatesModal input[type="file"],
html[data-theme="dark"] #templatesModal select,
html[data-theme="dark"] #templatesModal .js-tpl-name,
html[data-theme="dark"] #templatesModal .js-tpl-image {
    background: #1e2836 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

html[data-theme="dark"] #templatesModal input[type="file"]::file-selector-button,
html[data-theme="dark"] #templatesModal input[type="file"]::-webkit-file-upload-button {
    background: #2a3545;
    color: #eef3fa;
    border: 0;
    border-radius: 10px;
    padding: 6px 12px;
    margin-right: 10px;
    font-weight: 600;
}

html[data-theme="dark"] #templatesModal .js-tpl-accordion-panel > div > div {
    background: #18212d !important;
    border-color: rgba(232, 238, 247, 0.08) !important;
}

html[data-theme="dark"] #templatesModal .js-tpl-edit,
html[data-theme="dark"] #templatesModal .js-tpl-cancel-edit,
html[data-theme="dark"] #templatesModal .js-tpl-cancel-draft {
    background: #2a3545 !important;
    color: #eef3fa !important;
    border-color: rgba(232, 238, 247, 0.12) !important;
}

.bots-page-head {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
}

.bots-page-head-copy {
    min-width: 0;
    flex: 0 1 auto;
}

.bots-page-head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.bots-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.bots-head-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.bots-head-status .admin-switch {
    flex: 0 0 auto;
}

@media (max-width: 1023px) {
    .bots-page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .bots-page-head-side {
        align-items: flex-start;
        gap: 12px;
    }

    .bots-head-actions,
    .bots-head-status {
        justify-content: flex-start;
    }
}

.bot-card-switch {
    display: inline-flex;
    align-items: center;
    margin-right: 2px;
}

#botsSearchForm {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
}

/* Telegram username: до 32 символов. padding поля уже в width (border-box). */
#botsSearchForm .ui-search {
    width: calc(32ch + 1rem + 3.75rem);
    max-width: 100%;
    min-width: 0;
}





