@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #f0f2f5;
    --surface: #fff;
    --surface2: #f5f6f8;
    --surface3: #eaecf0;
    --border: rgba(0, 0, 0, 0.08);
    --border2: rgba(0, 0, 0, 0.14);
    --text: #1a1d23;
    --text2: #5a6074;
    --text3: #9399a8;
    --accent: #2563eb;
    --accent-dim: rgba(37, 99, 235, 0.08);
    --green: #16a34a;
    --green-dim: rgba(22, 163, 74, 0.08);
    --red: #dc2626;
    --red-dim: rgba(220, 38, 38, 0.08);
    --amber: #d97706;
    --amber-dim: rgba(217, 119, 6, 0.08);
    --tg: #0288d1;
    --vk: #3d5a99;
    --rs: 8px;
    --purple: #7c3aed;
    --purple-dim: rgba(124, 58, 237, 0.08);
}

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

ol,
ul {
    padding-left: 0;
    list-style-type: none;
}

ol,
ul,
dl {
    margin-top: 0;
    margin-bottom: 0;
}

ol ol,
ul ul,
ol ul,
ul ol {
    margin-bottom: 0;
}
a {
    text-decoration: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

/* ─── LOGIN SCREEN ─── */
.login-screen {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 40px 48px;
    width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-logo .mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.login-logo .brand-name {
    font-size: 18px;
    font-weight: 600;
}

.login-logo .brand-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text3);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-sub {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 28px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 6px;
    font-weight: 500;
}

.field input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus {
    border-color: var(--accent);
}

.login-btn {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.2s;
}

.login-btn:hover {
    opacity: 0.85;
}

.login-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 10px;
    display: none;
    text-align: center;
}

/* ─── MAIN APP ─── */
.app {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

/* HEADER */
.header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    z-index: 10;
}

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

.h-mark {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.h-brand {
    font-size: 13px;
    font-weight: 600;
}

.h-sep {
    width: 1px;
    height: 20px;
    background: var(--border2);
}

.h-page {
    font-size: 12px;
    color: var(--text2);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.h-live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--green);
    letter-spacing: 1px;
    font-weight: 600;
}

.h-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1
    }
    50% {
        opacity: 0.2
    }
}

.h-user {
    font-size: 12px;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.h-avatar {
    width: 26px;
    height: 26px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
}

.logout-btn {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 4px 10px;
    color: var(--text2);
    font-size: 11px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.logout-btn:hover {
    border-color: var(--border2);
    color: var(--text);
}

.nav-tab a {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    color: var(--text);
}

.nav-tab a:hover {
    color: var(--text);
    background: var(--surface2);
}

.nav-tab.active {
    background: var(--accent-dim);
}

.nav-tab.active a {
    color: var(--accent);
    font-weight: 600;
}

/* MAIN LAYOUT */
.main {
    display: grid;
    grid-template-columns: 220px 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    height: calc(100vh - 52px);
}

/* ─── LEFT: PROJECTS ─── */
.section-projects {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.panel-left {
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--surface);
}

.panel-left::-webkit-scrollbar {
    width: 3px;
}

.panel-left::-webkit-scrollbar-thumb {
    background: var(--text3);
    border-radius: 2px;
}

/* ─── OPERATOR ─── */
.op-select {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 11px;
    color: var(--text2);
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    width: 100%;
}

.dialog-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    border-left: 3px solid transparent;
}

.dialog-item:hover {
    background: var(--surface2);
}

.dialog-item.active-dialog {
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.dialog-item.waiting {
    border-left-color: #d97706;
}

.dialog-item.active-dialog.waiting {
    background: rgba(217, 119, 6, 0.06);
}

.di-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.di-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text3);
    min-width: 24px;
}

.di-platform {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
}

.di-platform.telegram {
    background: rgba(2, 136, 209, 0.1);
    color: var(--tg);
}

.di-platform.vkontakte {
    background: rgba(61, 90, 153, 0.1);
    color: var(--vk);
}

.di-type {
    font-size: 10px;
    color: var(--text3);
}

.di-status {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

.di-status.waiting {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

.di-status.manual {
    background: var(--accent-dim);
    color: var(--accent);
}

.di-status.auto {
    background: var(--green-dim);
    color: var(--green);
}

.di-status.pause {
    background: var(--surface3);
    color: var(--text2);
}

.di-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text3);
}

.di-project {
    font-size: 11px;
    color: var(--text2);
    margin-bottom: 2px;
}

.di-agent {
    font-size: 11px;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 5px;
}

.agent-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.agent-status.active {
    background: var(--green);
}

.agent-status.blocked {
    background: var(--red);
}

.msg {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

.msg.agent {
    align-self: flex-end;
    align-items: flex-end;
}

.msg.user {
    align-self: flex-start;
}

.msg.system {
    align-self: center;
}

.msg-label {
    font-size: 10px;
    color: var(--text3);
    margin-bottom: 3px;
    font-weight: 500;
}

.msg-bubble {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.msg.user .msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 2px 10px 10px 10px;
}

.msg.agent .msg-bubble {
    background: var(--accent);
    color: white;
    border-radius: 10px 2px 10px 10px;
}

.msg.system .msg-bubble {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
}

.msg-time {
    font-size: 10px;
    color: var(--text3);
    margin-top: 3px;
}

.ai-option {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.ai-option:hover {
    border-color: var(--accent);
}

.ai-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.ai-text {
    font-size: 12px;
    color: var(--text2);
    flex: 1;
}

.ai-send {
    background: var(--accent);
    border: none;
    border-radius: 5px;
    padding: 4px 10px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

.op-btn {
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    background: var(--surface);
}

.pause-btn {
    color: var(--text2);
}

.pause-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
}

.manual-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.manual-btn:hover {
    opacity: 0.85;
}

.pl-section {
    padding: 16px 14px 8px;
}

.pl-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text3);
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pl-badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
}

.project-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
    border: 1px solid transparent;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-item:hover {
    background: var(--surface2);
}

.project-item.active {
    background: var(--accent-dim);
    border-color: rgba(56, 139, 253, 0.25);
}

.project-item .pi-name {
    font-size: 13px;
    font-weight: 500;
}

.project-item.active .pi-name {
    color: var(--accent);
}

.project-item .pi-meta {
    font-size: 11px;
    color: var(--text3);
    display: flex;
    gap: 8px;
}

.pi-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.pi-status-dot.active {
    background: var(--green);
}

.pi-status-dot.paused {
    background: var(--red);
}

.project-item .pi-platforms {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.platform-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.platform-tag.telegram {
    background: rgba(2, 136, 209, 0.1);
    color: var(--tg);
}

.platform-tag.vkontakte {
    background: rgba(61, 90, 153, 0.1);
    color: var(--vk);
}

/* Date filter */
.pl-filter {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}

.filter-label {
    font-size: 11px;
    color: var(--text3);
    margin-bottom: 8px;
}

.filter-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
    align-items: stretch;
}

.preset-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 8px 6px;
    color: var(--text2);
    font-size: 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: center;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.preset-btn:hover {
    border-color: var(--border2);
    color: var(--text);
}

.preset-btn.active {
    background: var(--accent-dim);
    border-color: rgba(56, 139, 253, 0.35);
    color: var(--accent);
}

.filter-custom-toggle {
    font-size: 10px;
    color: var(--text2);
    cursor: pointer;
    text-align: center;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface2);
    transition: all 0.15s;
    margin-top: 2px;
}

.filter-custom-toggle:hover {
    border-color: var(--border2);
    color: var(--text);
}

.filter-custom-toggle.open {
    background: var(--accent-dim);
    border-color: rgba(56, 139, 253, 0.35);
    color: var(--accent);
}

.filter-custom {
    display: none;
    margin-top: 6px;
    flex-direction: column;
    gap: 5px;
}

.filter-custom.open {
    display: flex;
}

.filter-custom-row {
    display: flex;
    gap: 4px;
}

.filter-custom input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 5px;
    padding: 5px 6px;
    color: var(--text2);
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.filter-ok-btn {
    background: var(--accent);
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    color: white;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.filter-ok-btn:hover {
    opacity: 0.85;
}

.filter-active-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text3);
    text-align: center;
    margin-top: 4px;
}

/* ─── CENTER: METRICS ─── */
.panel-center {
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--bg);
    height: 100%;
    min-height: 0;
}

.panel-center::-webkit-scrollbar {
    width: 3px;
}

.panel-center::-webkit-scrollbar-thumb {
    background: var(--text3);
    border-radius: 2px;
}

.pc-project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pc-project-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.pc-project-header .status-badge {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 3px 10px;
    border-radius: 20px;
}

.status-badge.running {
    background: var(--green-dim);
    color: var(--green);
}

.status-badge.paused {
    background: var(--red-dim);
    color: var(--red);
}

/* KPI row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.3;
}

.kpi-label {
    font-size: 11px;
    color: var(--text3);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
    letter-spacing: -1px;
}

.kpi-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 5px;
}

.kpi-trend {
    font-size: 11px;
    margin-top: 6px;
    font-weight: 500;
}

.kpi-trend.up {
    color: var(--green);
}

.kpi-trend.down {
    color: var(--red);
}

/* Sections grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.metrics-full {
    margin-bottom: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .ct-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.access-header .title {
    font-size: 12px;
    font-weight: 600;
}

.access-header .description {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

.access-header .add-wrap {
    position: relative;
    flex-shrink: 0;
}

.access-header .add-wrap .btn-add {
    padding: 5px 12px;
}

.access-header .access-drop {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    z-index: 50;
    min-width: 240px;
    overflow: hidden;
}

.access-header .access-drop.show {
    display: block;
}

.access-header .access-drop .empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text3);
}

.access-header .access-drop .empty.hidden {
    display: none;
}

/* Task statuses */
.status-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.status-row .sr-label {
    font-size: 12px;
    color: var(--text2);
    flex: 1;
}

.status-row .sr-bar-wrap {
    flex: 2;
    height: 5px;
    background: var(--surface3);
    border-radius: 3px;
    overflow: hidden;
}

.status-row .sr-bar {
    height: 100%;
    border-radius: 3px;
}

.status-row .sr-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text);
    min-width: 36px;
    text-align: right;
}

/* Type split donut-like */
.type-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.type-block {
    background: var(--surface2);
    border-radius: 7px;
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border);
}

.type-block .tb-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
}

.type-block .tb-label {
    font-size: 11px;
    color: var(--text2);
    margin-top: 3px;
}

.type-block .tb-pct {
    font-size: 10px;
    color: var(--text3);
    margin-top: 2px;
}

.type-block.dm .tb-num {
    color: var(--accent);
}

.type-block.comment .tb-num {
    color: var(--purple);
}

/* Response rate */
.response-ring {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ring-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.ring-wrap svg {
    transform: rotate(-90deg);
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ring-center .rc-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}

.ring-center .rc-label {
    font-size: 8px;
    color: var(--text3);
}

.response-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rs-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 3px;
}

.rs-row .rs-label {
    color: var(--text2);
}

.rs-row .rs-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* Responses feed */
.responses-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.response-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    position: relative;
    overflow: hidden;
}

.response-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
}

.response-item.telegram::before {
    background: var(--tg);
}

.response-item.vkontakte::before {
    background: var(--vk);
}

.ri-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ri-platform {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 3px;
}

.ri-platform.telegram {
    background: rgba(38, 165, 228, 0.15);
    color: var(--tg);
}

.ri-platform.vkontakte {
    background: rgba(76, 117, 163, 0.15);
    color: var(--vk);
}

.ri-agent {
    font-size: 11px;
    color: var(--text2);
    font-weight: 500;
}

.ri-time {
    font-size: 11px;
    color: var(--text3);
}

.ri-type-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

.ri-type-tag.dm {
    background: var(--accent-dim);
    color: var(--accent);
}

.ri-type-tag.comment {
    background: var(--purple-dim);
    color: var(--purple);
    border: 1px solid var(--purple, #7c3aed);
}

.ri-text {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.5;
}

.ri-reply {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text3);
    display: flex;
    gap: 6px;
}

.ri-reply .reply-icon {
    color: var(--green);
}

/* ─── RIGHT: AGENTS ─── */
.panel-right {
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 14px;
    background: var(--surface);
}

.panel-right::-webkit-scrollbar {
    width: 3px;
}

.panel-right::-webkit-scrollbar-thumb {
    background: var(--text3);
    border-radius: 2px;
}

.pr-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text3);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.agent-summary {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 14px;
    margin-bottom: 12px;
}

.as-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.as-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.as-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.as-row .as-key {
    font-size: 12px;
    color: var(--text2);
}

.as-row .as-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
}

.as-row .as-val.green {
    color: var(--green);
}

.as-row .as-val.amber {
    color: var(--amber);
}

.as-row .as-val.red {
    color: var(--red);
}

.platform-block {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.pb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pb-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pb-name .pb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.pb-name .pb-dot.telegram {
    background: var(--tg);
}

.pb-name .pb-dot.vkontakte {
    background: var(--vk);
}

.pb-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--green);
    letter-spacing: 1px;
}

.pb-metrics {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pb-metric {
    display: flex;
    justify-content: space-between;
}

.pb-metric .pm-k {
    font-size: 11px;
    color: var(--text3);
}

.pb-metric .pm-v {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text);
}

.pb-bar {
    height: 3px;
    background: var(--surface3);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.pb-bar-fill {
    height: 100%;
    border-radius: 2px;
}

.pb-bar-fill.telegram {
    background: var(--tg);
}

.pb-bar-fill.vkontakte {
    background: var(--vk);
}

/* Timeline widget */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tl-item {
    display: flex;
    gap: 10px;
    padding-bottom: 12px;
    position: relative;
}

.tl-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 14px;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.tl-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
    margin-top: 1px;
}

.tl-dot.done {
    background: var(--green);
    border-color: var(--green);
}

.tl-dot.active {
    background: transparent;
    border-color: var(--accent);
    animation: tl-pulse 2s ease-in-out infinite;
}

.tl-dot.pending {
    background: transparent;
    border-color: var(--text3);
}

@keyframes tl-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(56, 139, 253, 0.4)
    }
    50% {
        box-shadow: 0 0 0 4px rgba(56, 139, 253, 0)
    }
}

.tl-content {
    flex: 1;
}

.tl-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text3);
}

.tl-event {
    font-size: 11px;
    color: var(--text2);
    margin-top: 1px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
    display: flex;
    flex-direction: column;
}

.header {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.h-mark {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}

.h-brand {
    font-size: 13px;
    font-weight: 600;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.h-user {
    font-size: 12px;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.h-avatar {
    width: 26px;
    height: 26px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
}

.logout-btn {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 4px 10px;
    color: var(--text2);
    font-size: 11px;
    cursor: pointer;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 5px;
    color: var(--text3);
    transition: color .15s;
    line-height: 1;
}

.list-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.u-proj-drop {
    display: none;
    position: absolute;
    top: 100%;
    left: 0px;
    right: 0px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 7px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 16px;
    z-index: 300;
    margin-top: 2px;
    overflow: hidden;
}

.proj-sugg {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text2);
}

.proj-sugg span.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.proj-sugg span.dot.active {
    background: var(--green);
}

.proj-sugg span.dot.paused {
    background: var(--red);
}

.proj-sugg:hover {
    background: var(--surface2);
}

.proj-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--accent-dim);
    border-radius: 20px;
    font-size: 11px;
    color: var(--accent);
}

.proj-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

.edit-btn:hover {
    color: var(--accent);
}

.del-btn:hover {
    color: var(--red);
}

.nav-tab {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    border-radius: 6px;
}

.nav-tab:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-tab.active {
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
}

.view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

/* LIST */
.list-header {
    padding: 24px 32px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-title {
    font-size: 20px;
    font-weight: 600;
}

.btn-primary {
    background: var(--green);
    border: none;
    border-radius: 7px;
    padding: 8px 16px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.projects-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    padding: 0 32px 32px;
}

.proj-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
}

.proj-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.proj-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.proj-dot.active {
    background: var(--green);
}

.proj-dot.paused {
    background: var(--red);
}

.proj-card-name {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.proj-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.proj-badge.active {
    background: var(--green-dim);
    color: var(--green);
}

.proj-badge.paused {
    background: var(--red-dim);
    color: var(--red);
}

.plat-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.plat-tag.telegram {
    background: rgba(2, 136, 209, .1);
    color: var(--tg);
}

.plat-tag.vkontakte {
    background: rgba(61, 90, 153, .1);
    color: var(--vk);
}

.proj-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.btn-edit {
    flex: 1;
    background: var(--accent-dim);
    border: 1px solid rgba(37, 99, 235, .2);
    border-radius: 6px;
    padding: 7px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

.btn-edit:hover {
    background: var(--accent);
    color: #fff;
}

.btn-tog {
    background: var(--green);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 7px 0;
    font-size: 11px;
    color: #fff;
    cursor: pointer;
    width: 90px;
    text-align: center;
}

.btn-del-proj {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text3);
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-del-proj:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(239, 68, 68, .07);
}

/* EDIT */
.edit-topbar {
    padding: 14px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.edit-name-disp {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.btn-save {
    background: var(--green);
    border: none;
    border-radius: 7px;
    padding: 8px 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 7px;
    padding: 7px 16px;
    color: var(--text2);
    font-size: 12px;
    cursor: pointer;
}

.edit-body {
    padding: 24px 32px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 8px 18px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab a {
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
}

.tab.active {
    border-bottom-color: var(--accent);
}

.tab.active a {
    color: var(--accent);
    font-weight: 600;
}

.tc {
    display: none;
}

.tc.active {
    display: block;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.fr {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.fr.c2 {
    grid-template-columns:1fr 1fr;
}

.fr.c3 {
    grid-template-columns:1fr 1fr 1fr;
}

.fg {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fl {
    font-size: 11px;
    color: var(--text2);
    font-weight: 500;
}

.fl-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
}

.fh {
    font-size: 10px;
    color: var(--text3);
    margin-top: 2px;
}

.fi {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--text);
    outline: none;
}

.fi.ai-prompt {
    resize: vertical;
    font-family: 'Inter', sans-serif;
    width: 100%;
    box-sizing: border-box;
}

.fi:focus {
    border-color: var(--accent);
}

.fs {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--text);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239399a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

/* Platform toggles */
.plat-toggles {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.pt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border2);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}

.pt.sel.telegram {
    border-color: var(--tg);
    background: rgba(2, 136, 209, .06);
}

.pt.sel.vkontakte {
    border-color: var(--vk);
    background: rgba(61, 90, 153, .06);
}

.pt-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
}

.pt.sel.telegram .pt-check {
    background: var(--tg);
    border-color: var(--tg);
}

.pt.sel.vkontakte .pt-check {
    background: var(--vk);
    border-color: var(--vk);
}

.pt-lbl {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
}

.pt.sel.telegram .pt-lbl {
    color: var(--tg);
}

.pt.sel.vkontakte .pt-lbl {
    color: var(--vk);
}

/* Access */
.access-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface2);
}

.access-item.hidden {
    display: none;
}

.access-item.short {
    cursor: pointer;
}

.access-item.short .acc-badge {
    display: none;
}

.access-item.short .acc-rm {
    display: none;
}

.access-item.full {
    border: 1px solid var(--border);
    border-radius: 7px;
    margin-bottom: 6px;
}

.acc-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.acc-av.v {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(22, 163, 74, .3);
}

.acc-av.o {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, .3);
}

.acc-info {
    flex: 1;
}

.acc-name {
    font-size: 12px;
    font-weight: 500;
}

.acc-email {
    font-size: 11px;
    color: var(--text3);
}

.acc-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.acc-badge.v {
    background: var(--green-dim);
    color: var(--green);
}

.acc-badge.o {
    background: var(--accent-dim);
    color: var(--accent);
}

.acc-rm {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text3);
    cursor: pointer;
}

.acc-rm:hover {
    border-color: var(--red);
    color: var(--red);
}

/* Sources */
.src-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.src-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.si-url {
    font-size: 12px;
    color: var(--accent);
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
}

.si-type {
    font-size: 10px;
    color: var(--text3);
    padding: 2px 6px;
    background: var(--surface3);
    border-radius: 4px;
}

.si-rm {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.si-rm:hover {
    color: var(--red);
}

.add-row {
    display: flex;
    gap: 8px;
}

.add-row .fi {
    flex: 1;
}

.btn-add {
    background: var(--accent);
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-remove {
    background: none;
    border-width: medium;
    border-style: none;
    border-color: currentcolor;
    border-image: initial;
    color: var(--red);
    cursor: pointer;
    font-size: 16px;
}

.mode-toggle {
    display: flex;
    background: var(--surface3);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.mode-toggle-btn {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 4px 11px;
    font-size: 11px;
    cursor: pointer;
    color: var(--text3);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    white-space: nowrap;
}

.mode-toggle-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Keywords */
.kw-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.kw-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--accent-dim);
    border-radius: 20px;
    font-size: 11px;
    color: var(--accent);
}

.kw-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

/* Schedule */
.sched-wrap {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 14px 16px;
}

.sched-required {
    font-size: 10px;
    color: var(--red);
    font-weight: 600;
}

.sched-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 8px;
}

.schip {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 16px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--text);
    cursor: pointer;
}

.schip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.schip.t {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.sched-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text3);
}

/* Agents */
.plat-sel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: var(--surface2);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
}

.plat-sel-btn.active-plat.telegram {
    border-color: var(--tg);
    background: rgba(2, 136, 209, .06);
    color: var(--tg);
}

.plat-sel-btn.active-plat.vkontakte {
    border-color: var(--vk);
    background: rgba(61, 90, 153, .06);
    color: var(--vk);
}

/* Multiselect dropdown */
.msd-wrap {
    position: relative;
}

.msd-wrap .msd-label, .msd-wrap .control-label {
    font-size: 11px;
    color: var(--text3);
    margin-bottom: 4px;
    font-weight: 500;
}

.msd-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border2);
    cursor: pointer;
    min-height: 32px;
}

.msd-field:hover {
    border-bottom-color: var(--accent);
}

.msd-val {
    font-size: 12px;
    color: var(--text);
    flex: 1;
    line-height: 1.4;
}

.msd-val.empty {
    color: var(--text3);
}

.msd-arrow {
    font-size: 10px;
    color: var(--text3);
    margin-left: 6px;
}

.msd-wrap.open .msd-arrow {
    transform: rotate(180deg);
}

.msd-drop {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
    z-index: 100;
    padding: 6px;
    min-width: 140px;
}

.msd-wrap.open .msd-drop {
    display: block;
}

.msd-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text2);
}

.msd-opt:hover {
    background: var(--surface2);
}

.msd-opt input {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Tag input */
.tag-field {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border2);
    padding: 4px 0;
}

.tag-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 12px;
    color: var(--text);
    background: transparent;
}

.tag-input::placeholder {
    color: var(--text3);
}

.tag-clear {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--accent-dim);
    border-radius: 12px;
    font-size: 11px;
    color: var(--accent);
}

.tag-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 12px;
    line-height: 1;
    padding: 0;
}

/* Stats mini */
.stats-mini {
    display: grid;
    grid-template-columns:repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.sm {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px 14px;
}

.sm-lbl {
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}

.sm-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 600;
}

/* Table */
.at {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.at th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.at td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text2);
}

.at td.username {
    font-weight: 500;
    color: var(--text);
}

.at td.status {
    font-size: 12px;
}

.at td.status span.active {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    background: var(--green);
}

.at td.status span.inactive {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    background: var(--text3);
}

.at td.role span.admin {
    font-size: 11px;
    font-weight: 600;
    color: var(--amber);
}

.at td.role span.operator {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

.at td.role span.viewer {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
}

.at tr:last-child td {
    border-bottom: none;
}

.at tr:hover td {
    background: var(--surface2);
}

.ad {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.ad.active {
    background: var(--green);
}

.ad.idle {
    background: var(--amber);
}

.ad.blocked {
    background: var(--red);
}

.proj-badge.new {
    background: var(--surface3);
    color: var(--text3);
}

.proj-badge.ready {
    background: rgba(37, 99, 235, .1);
    color: var(--accent);
}

.proj-missing-banner {
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .3);
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 11px;
    color: #b45309;
    margin-bottom: 10px;
}

.tmpl-list {
    margin-bottom: 12px;
    min-height: 24px;
}

.tmpl-edit {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 13px;
    padding: 2px 5px;
    border-radius: 4px;
}

.tmpl-edit:hover {
    color: var(--accent);
}

.tmpl-rm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 13px;
    padding: 2px 5px;
    border-radius: 4px;
}

.tmpl-rm:hover {
    color: var(--red);
}

.tmpl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.tmpl-table th {
    text-align: center;
    padding: 7px 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.tmpl-table td {
    text-align: center;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text2);
    vertical-align: middle;
}

.tmpl-table tbody tr:last-child td {
    border-bottom: none;
}

.tmpl-table tbody tr:hover td {
    background: var(--surface2);
}

.tmpl-table .td-text {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.tmpl-table .td-actions {
    white-space: nowrap;
}

.tmpl-toolbar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--accent-dim);
    border-radius: 6px;
    margin-bottom: 8px;
}

.tmpl-toolbar span {
    font-size: 11px;
    color: var(--accent);
    flex: 1;
}

.tmpl-del-sel {
    background: var(--red-dim);
    border: none;
    border-radius: 5px;
    color: var(--red);
    font-size: 11px;
    padding: 4px 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.tmpl-del-sel:hover {
    background: var(--red);
    color: #fff;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
    transition: border-color .15s;
}

.file-upload-label:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tmpl-preview-wrap {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.tmpl-preview-wrap img, .tmpl-preview-wrap video {
    max-width: 100%;
    max-height: 150px;
    border-radius: 6px;
    display: block;
}

.tmpl-preview-rm {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-grid-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.user-grid-container .summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.user-grid-container .summary .details {
    font-size: 11px;
    color: var(--text3);
}

/* ── PANEL SWITCHING ── */
.panel-dashboard, .panel-operator, .panel-admin {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.panels-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── UNIFIED HEADER NAV ── */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.main-nav ul {
    list-style-type: none;
    display: flex;
}

.main-nav-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
}

.main-nav-btn a {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    color: var(--text2);
}

.main-nav-btn a:hover {
    color: var(--text);
    background: var(--surface2);
}

.main-nav-btn.active {
    background: var(--accent-dim);
}

.main-nav-btn.active a {
    color: var(--accent);
    font-weight: 600;
}

/* ── ADMIN SUB-NAV ── */
.admin-subnav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.admin-subnav ul {
    list-style-type: none;
    display: flex;
}

/* ── REPLIES FEED PAGINATION ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    margin-bottom: 8px;
    list-style-type: none;
}

.pagination li {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 5px;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--text2);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.pagination li:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination li.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.feed-pg-info {
    font-size: 11px;
    color: var(--text3);
}

/* ── CLICKABLE AGENT/USER LINKS ── */
.ri-agent-link, .ri-user-link {
    cursor: pointer;
    color: var(--accent);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
}

.ri-agent-link:hover, .ri-user-link:hover {
    text-decoration: underline;
}

/* ── OPEN IN OPERATOR BTN ── */
.ri-open-op {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 10px;
    color: var(--text3);
    cursor: pointer;
    margin-left: auto;
    font-family: 'Inter', sans-serif;
}

.ri-open-op:hover {
    border-color: var(--accent);
    color: var(--accent);
}


.h-live {
    display: none !important;
}

.di-row-agent {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.di-agent-normal {
    font-size: 11px;
    color: var(--text2);
}

/* ── COMMENT THREAD IN OPERATOR ── */
.comment-post {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.comment-post-label {
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-bottom: 6px;
}

.comment-post-author {
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 6px;
}

.comment-post-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.55;
}

.comment-thread {
    border-left: 3px solid var(--surface3);
    padding-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.comment-thread-label {
    font-size: 10px;
    color: var(--text3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.comment-reply {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
}

.comment-reply-author {
    font-size: 10px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 3px;
}

.comment-reply-text {
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
}

.comment-time {
    font-size: 10px;
    color: var(--text3);
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.mb-14 {
    margin-bottom: 14px;
}

.sched-grid {
    gap: 8px;
    margin-bottom: 12px;
}

a.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.4;
}
.wrapSelectLanguage {
    display: flex;
    vertical-align: middle;
    float: right;
    margin-right: 20px;
}
.wrapSelectLanguage .language-container {
    vertical-align: middle;
    position: relative;
}
.wrapSelectLanguage .language-container .item {
    line-height: 35px;
    font-size: 12px;
    color: var(--accent);
    margin-right: 10px;
    cursor: pointer;
}

.wrapSelectLanguage .language-container .item.active {
    font-weight: 600;
    cursor: default;
}

.has-error .help-block,
.has-error .control-label,
.has-error .radio,
.has-error .checkbox,
.has-error .radio-inline,
.has-error .checkbox-inline {
    color: #b94a48;
}
.has-error .form-control {
    border-color: #b94a48;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .form-control:focus {
    border-color: #953b39;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.has-error .input-group-addon {
    color: #b94a48;
    border-color: #b94a48;
    background-color: #f2dede;
}
.has-error .form-control-feedback {
    color: #b94a48;
}
.gallery-block-list li .img {
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    width: calc(100% / 3 - 60px);
    height: 80px;
    margin: 0 12px;
}
.gallery-block-list li .wrapDeleteBtn {
    position: relative;
    left: 80px;
}