/* ================================================================
   Vendor Suite — Design System v2
   Dark Deep Blue × Electric Teal theme
================================================================ */
:root {
    --bg: #0a0f1e;
    --bg-panel: #0d1428;
    --surface: #111827;
    --surface2: #1a2236;
    --surface3: #1f2d45;
    --border: rgba(99, 179, 237, 0.12);
    --border2: rgba(99, 179, 237, 0.2);
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --muted: #64748b;
    --accent: #0ea5e9;
    --accent2: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.25);
    --accent-dim: rgba(14, 165, 233, 0.12);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-text: #34d399;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-text: #f87171;
    --warn: #f59e0b;
    --warn-bg: rgba(245, 158, 11, 0.12);
    --sidebar-w: 260px;
    --radius: 14px;
    --radius-sm: 8px;
    --font: 'Sora', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-accent: 0 0 40px rgba(14, 165, 233, 0.15);
}

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

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #060d1f 0%, #0a1628 60%, #0d1d38 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    gap: 4px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 20px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(14,165,233,0.35), 0 4px 12px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand strong { display: block; font-size: 0.95rem; color: var(--text); letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav-group { display: flex; flex-direction: column; flex: 1; gap: 2px; }
.nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 12px 10px 4px;
    font-weight: 600;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 13.5px;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    border: 1px solid transparent;
}
.nav-link:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.nav-link.active {
    background: var(--accent-dim);
    color: var(--accent2);
    border-color: rgba(14, 165, 233, 0.25);
    box-shadow: 0 0 12px var(--accent-glow);
}
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link.logout { color: var(--danger-text); }
.nav-link.logout:hover { background: var(--danger-bg); border-color: rgba(239,68,68,0.2); }

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 4px;
}
.sidebar-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.sidebar-user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-user-role { display: block; font-size: 11px; color: var(--muted); }

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ─── Content Area ─────────────────────────────────────── */
.content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 0 28px 48px;
    min-width: 0;
    background: var(--bg-panel);
    min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -28px 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar strong { display: block; font-size: 14px; color: var(--text); }
.topbar p { color: var(--muted); font-size: 12px; margin: 0; }

.sidebar-toggle {
    display: none;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px;
    cursor: pointer;
    color: var(--text);
}

.membership {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.membership.active { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(16,185,129,0.2); }
.membership.pending { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(245,158,11,0.2); }

/* ─── Alerts ─────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert.success { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(16,185,129,0.25); }
.alert.danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid rgba(239,68,68,0.25); }
.alert.warning { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(245,158,11,0.25); }
.alert.info { background: var(--accent-dim); color: var(--accent2); border: 1px solid rgba(14,165,233,0.25); }
.alert-close {
    background: none; border: none; cursor: pointer;
    color: inherit; opacity: 0.6; font-size: 14px; padding: 0;
    flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* ─── Page Head ─────────────────────────────────────── */
.page-head { margin-bottom: 24px; }
.page-head h1 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 6px;
}
.lead { color: var(--text-dim); font-size: 0.95rem; }

/* ─── Cards ─────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    margin-bottom: 18px;
}
.card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.notice-card { background: rgba(14, 165, 233, 0.05); border-color: rgba(14, 165, 233, 0.2); }

/* ─── Grid ─────────────────────────────────────────── */
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; }

/* ─── Stat Pills (portal) ─────────────────────────── */
.portal-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.stat-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    flex: 1;
    min-width: 160px;
}
.stat-pill.active { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.06); }
.stat-pill.pending { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.06); }
.stat-pill-icon {
    width: 38px; height: 38px;
    background: var(--accent-dim);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.stat-pill-icon svg { width: 18px; height: 18px; }
.stat-pill-value { font-size: 1rem; font-weight: 700; color: var(--text); }
.stat-pill-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── Quick links (portal) ─────────────────────────── */
.quick-links { display: flex; flex-direction: column; gap: 8px; }
.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    background: var(--surface2);
}
.quick-link:hover { background: var(--surface3); border-color: var(--accent); transform: translateX(2px); }
.quick-link.disabled { opacity: 0.45; pointer-events: none; }
.quick-link strong { display: block; font-size: 13px; }
.quick-link span { font-size: 11px; color: var(--muted); }
.quick-link-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.quick-link-icon svg { width: 17px; height: 17px; }
.quick-link-icon.tg { background: rgba(14,165,233,0.15); color: var(--accent); }
.quick-link-icon.migration { background: rgba(168,85,247,0.15); color: #a855f7; }
.quick-link-icon.account { background: rgba(16,185,129,0.15); color: var(--success); }
.quick-link-icon.social { background: rgba(245,158,11,0.15); color: var(--warn); }

/* ─── Forms ─────────────────────────────────────────── */
label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], select, textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 13px; }

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-stack label { margin-bottom: 0; }
.form-stack input, .form-stack select, .form-stack textarea { margin-top: 4px; }

.form-inline-wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-inline-wrap input { flex: 1; min-width: 200px; }

/* ─── Buttons ─────────────────────────────────────────── */
button, .btn-primary, .btn-outline, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}
button { background: var(--accent); color: #fff; }
button:hover { box-shadow: 0 0 18px var(--accent-glow); transform: translateY(-1px); }
button:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #0ea5e9, #38bdf8); color: #fff; box-shadow: 0 4px 14px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 4px 22px rgba(14,165,233,0.4); transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text-dim);
}
.btn-outline:hover { background: var(--surface3); color: var(--text); border-color: var(--accent); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-danger-sm { padding: 6px 12px; font-size: 12px; background: var(--danger-bg); color: var(--danger-text); border: 1px solid rgba(239,68,68,0.3); border-radius: 6px; cursor: pointer; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 12px; transition: background 0.15s; }
.btn-icon.danger { color: var(--danger-text); }
.btn-icon.danger:hover { background: var(--danger-bg); }
.btn-inline {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    background: var(--accent-dim);
    color: var(--accent2) !important;
    text-decoration: none; font-size: 13px; font-weight: 600;
    border: 1px solid rgba(14,165,233,0.2);
    transition: background 0.15s;
}
.btn-inline:hover { background: rgba(14,165,233,0.2); }
.checkbox-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500; color: var(--text-dim);
    text-transform: none; letter-spacing: 0; cursor: pointer;
}
.checkbox-row.inline { margin: 0; }
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }

/* ─── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    background: var(--surface2);
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Chips ─────────────────────────────────────────── */
.chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface3);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.chip.success { background: var(--success-bg); color: var(--success-text); border-color: rgba(16,185,129,0.25); }
.chip.danger { background: var(--danger-bg); color: var(--danger-text); border-color: rgba(239,68,68,0.25); }

/* ─── Info list ─────────────────────────────────────── */
.info-list { list-style: none; }
.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}
.info-list li:last-child { border-bottom: none; }
.info-list li span { color: var(--muted); font-size: 12px; }
.info-list li strong { color: var(--text); text-align: right; }

/* ─── Announcements ─────────────────────────────────── */
.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce-item {
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
}
.announce-item h4 { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.announce-meta { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.announce-item p { font-size: 13.5px; color: var(--text-dim); }

/* ─── Mode tabs (migration) ─────────────────────────── */
.mode-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-tab {
    flex: 1; min-width: 180px;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    text-decoration: none; color: var(--text-dim);
    transition: border-color 0.15s, background 0.15s;
}
.mode-tab:hover { border-color: var(--accent); background: var(--surface3); }
.mode-tab.active { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.mode-tab svg { width: 22px; height: 22px; flex-shrink: 0; }
.mode-tab span { font-weight: 600; font-size: 14px; display: block; }
.mode-tab small { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.mode-warn { margin-top: 14px; }

/* ─── Step cards (migration) ─────────────────────────── */
.step-card .step-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.step-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.step-header h3 { margin-bottom: 2px; }

/* ─── Progress bar ─────────────────────────────────── */
.progress-bar-wrap { margin: 14px 0; }
.progress-bar-track {
    background: var(--surface2);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-bar-fill {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(14,165,233,0.4);
}
.progress-stats {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--muted); margin-top: 8px;
}
.ok-count { color: var(--success-text); font-weight: 600; }
.fail-count { color: var(--danger-text); font-weight: 600; }

/* ─── Job header ─────────────────────────────────────── */
.job-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.job-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }

/* ─── Preview badge ─────────────────────────────────── */
.preview-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 8px;
    font-size: 13px;
}

/* ─── Delay row ─────────────────────────────────────── */
.delay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Legal notice ─────────────────────────────────── */
.legal-notice { background: rgba(14, 165, 233, 0.05); border-color: rgba(14, 165, 233, 0.2); }
.legal-row { display: flex; gap: 14px; }
.legal-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.legal-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.legal-list li { font-size: 13px; color: var(--text-dim); position: relative; padding-left: 14px; }
.legal-list li::before { content: '·'; position: absolute; left: 0; color: var(--accent); }

/* ─── Tool cards ─────────────────────────────────────── */
.tool-card { position: relative; }
.tool-badge {
    position: absolute; top: 18px; right: 18px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-dim); color: var(--accent2);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(14,165,233,0.25);
}

/* ─── Bot status row ─────────────────────────────────── */
.bot-status-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.bot-token-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bot-token-form input { width: 280px; }

/* ─── Link truncate ─────────────────────────────────── */
.link-truncate { max-width: 220px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent2); font-size: 12px; vertical-align: bottom; }

/* ─── Admin tiles ─────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.admin-tile {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 18px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.admin-tile:hover { border-color: var(--accent); background: var(--surface2); transform: translateY(-2px); }
.admin-tile h3 { font-size: 0.95rem; margin-bottom: 6px; }
.admin-tile p { font-size: 12px; color: var(--muted); }

/* ─── Stat card (admin) ─────────────────────────────── */
.stat-card { text-align: center; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value {
    font-size: 2.5rem; font-weight: 800; letter-spacing: -0.04em;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Profile form ─────────────────────────────────── */
.narrow-panel { max-width: 540px; }

/* ─── Social / Chat ─────────────────────────────────── */
.chat-box { display: flex; flex-direction: column; gap: 16px; }
.chat-messages {
    max-height: 440px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 10px; padding: 8px;
    background: var(--surface2); border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.chat-bubble { max-width: 75%; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; }
.chat-bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #0ea5e9, #38bdf8); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--surface3); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-time { font-size: 10px; opacity: 0.65; display: block; margin-top: 4px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; margin: 0; }
.chat-form button { width: auto; margin: 0; }

/* ─── Social hub / friends ─────────────────────────── */
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.friend-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.friend-card strong { display: block; margin-bottom: 4px; }
.friend-card small { color: var(--muted); font-size: 12px; }

/* ─── Users management ─────────────────────────────── */
.user-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.user-tag.admin { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.25); }
.user-tag.premium { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(16,185,129,0.25); }
.user-tag.free { background: var(--surface3); color: var(--muted); border: 1px solid var(--border); }

/* ─── Announcements admin ─────────────────────────── */
.announce-admin-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border);
}
.announce-admin-row:last-child { border-bottom: none; }

/* ─── Site content ─────────────────────────────────── */
.content-edit-card { margin-bottom: 16px; }
.content-preview img { max-width: 240px; border-radius: 10px; margin-top: 10px; border: 1px solid var(--border); }
.mono-key code { font-size: 11px; }

/* ─── Logs ─────────────────────────────────────────── */
.log-entry td { font-family: var(--mono); font-size: 12px; }

/* ─── Code ─────────────────────────────────────────── */
code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--surface2);
    color: var(--accent2);
    padding: 2px 6px;
    border-radius: 5px;
    border: 1px solid var(--border);
}

/* ─── Misc ─────────────────────────────────────────── */
.muted { color: var(--muted); }
.small-hint { font-size: 12.5px; line-height: 1.5; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Home / Landing Page ─────────────────────────── */
.home-page {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(14,165,233,0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99,102,241,0.1), transparent),
        var(--bg);
    min-height: 100vh;
    color: var(--text);
}
.home-bg { display: none; }
.home-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.home-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0;
}
.home-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.home-nav-links { display: flex; align-items: center; gap: 20px; }
.home-nav-links a { color: var(--text-dim); font-size: 14px; text-decoration: none; }
.home-nav-links a:hover { color: var(--text); }

.home-stats {
    display: flex; gap: 20px; justify-content: center;
    padding: 28px 0;
}
.home-stat { text-align: center; }
.home-stat-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent2); }
.home-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.home-grid { display: grid; grid-template-columns: 1fr 480px; gap: 48px; align-items: start; padding: 32px 0 60px; }
.home-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; margin-bottom: 16px; }
.home-copy h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; margin-bottom: 16px; }
.home-lead { color: var(--text-dim); font-size: 1rem; line-height: 1.65; margin-bottom: 24px; }
.home-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.home-list li { font-size: 14px; color: var(--text-dim); padding-left: 20px; position: relative; }
.home-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.home-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.card-glass {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 28px;
}
.home-auth { }
.home-auth-tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.home-tab {
    flex: 1; text-align: center; padding: 8px;
    border-radius: 7px; text-decoration: none; font-size: 14px;
    font-weight: 600; color: var(--muted); transition: all 0.15s;
}
.home-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.home-auth h2 { font-size: 1.2rem; margin-bottom: 6px; }
.home-alerts { padding: 16px 0 0; }
.home-alert { border-radius: var(--radius-sm); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    .content { margin-left: 0; }
    .grid-two { grid-template-columns: 1fr; }
    .home-grid { grid-template-columns: 1fr; }
    .mode-tabs { flex-direction: column; }
    .bot-token-form input { width: 100%; }
    .bot-status-row { flex-direction: column; }
    .portal-stats { flex-direction: column; }
}

/* ================================================================
   Vendor Suite — UPGRADE v3 Additions
   Themes, social features, notifications, global chat, online users
================================================================ */

/* ─── THEME SYSTEM ─────────────────────────────────────────── */
[data-theme="light"] {
    --bg: #f0f4f8;
    --bg-panel: #e8edf3;
    --surface: #ffffff;
    --surface2: #f5f7fa;
    --surface3: #ebeef3;
    --border: rgba(0,0,0,0.1);
    --border2: rgba(0,0,0,0.18);
    --text: #1a202c;
    --text-dim: #4a5568;
    --muted: #718096;
    --accent: #0284c7;
    --accent2: #0ea5e9;
    --accent-glow: rgba(2,132,199,0.2);
    --accent-dim: rgba(2,132,199,0.1);
    --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

[data-theme="purple"] {
    --bg: #0d0720;
    --bg-panel: #110a28;
    --surface: #1a1035;
    --surface2: #231845;
    --surface3: #2c2050;
    --border: rgba(168,85,247,0.15);
    --border2: rgba(168,85,247,0.25);
    --text: #ede9fe;
    --text-dim: #a78bfa;
    --muted: #6d28d9;
    --accent: #a855f7;
    --accent2: #c084fc;
    --accent-glow: rgba(168,85,247,0.3);
    --accent-dim: rgba(168,85,247,0.12);
    --success: #34d399;
    --danger: #f87171;
}

[data-theme="ocean"] {
    --bg: #021825;
    --bg-panel: #032133;
    --surface: #052e44;
    --surface2: #073a56;
    --surface3: #094868;
    --border: rgba(34,211,238,0.15);
    --border2: rgba(34,211,238,0.25);
    --text: #cffafe;
    --text-dim: #67e8f9;
    --muted: #06b6d4;
    --accent: #22d3ee;
    --accent2: #67e8f9;
    --accent-glow: rgba(34,211,238,0.3);
    --accent-dim: rgba(34,211,238,0.12);
}

/* ─── THEME SWITCHER ─────────────────────────────────────────── */
.theme-switcher {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    margin-bottom: 4px;
}
.theme-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px; height: 32px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { background: var(--surface3); transform: scale(1.1); }

/* ─── NAV BADGE ─────────────────────────────────────────── */
.nav-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto;
    padding: 0 5px;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ─── TILE BADGE ─────────────────────────────────────────── */
.tile-badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

/* ─── ONLINE WIDGET ─────────────────────────────────────────── */
.online-widget {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    margin: 8px 0;
}
.online-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--success-text);
    margin-bottom: 6px;
}
.online-list { display: flex; flex-direction: column; gap: 3px; }
.online-user {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-dim);
}
.online-dot {
    width: 7px; height: 7px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    animation: blink-dot 2s infinite;
}
@keyframes blink-dot {
    0%,100% { opacity:1; } 50% { opacity:0.4; }
}
.muted-sm { font-size: 11px; color: var(--muted); }

/* ─── STATS GRID ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card.online { border-color: rgba(16,185,129,0.3); }
.stat-card.online .stat-value { color: var(--success-text); }
.stat-card.premium { border-color: rgba(245,158,11,0.3); }
.stat-card.premium .stat-value { color: var(--warn); }

/* ─── ONLINE STATUS ─────────────────────────────────────────── */
.online-chip {
    font-size: 11px;
    color: var(--success-text);
    margin-left: 6px;
}
.mini-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent2);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    border: 2px solid var(--border);
    flex-shrink: 0;
}
.mini-avatar.online {
    border-color: var(--success);
    box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

/* ─── GLOBAL CHAT ─────────────────────────────────────────── */
.chat-container.global-chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-height: 680px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
.chat-msg { display: flex; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble {
    max-width: 70%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
}
.chat-msg.mine .chat-bubble {
    background: var(--accent-dim);
    border-color: var(--border2);
}
.chat-sender {
    display: block;
    font-size: 11px;
    color: var(--accent2);
    font-weight: 600;
    margin-bottom: 2px;
}
.chat-time {
    display: block;
    font-size: 10px;
    color: var(--muted);
    text-align: right;
    margin-top: 2px;
}
.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--surface2);
}
.chat-input-row input {
    flex: 1;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }

/* ─── PUSH TOAST ─────────────────────────────────────────── */
.push-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    max-width: 320px;
    z-index: 9999;
    animation: slide-in-toast 0.3s ease;
}
.push-toast strong { display: block; margin-bottom: 4px; color: var(--accent2); }
.push-toast p { font-size: 13px; color: var(--text-dim); }
.push-toast button {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; color: var(--muted);
    cursor: pointer; font-size: 16px;
}
@keyframes slide-in-toast {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── TOPBAR RIGHT ─────────────────────────────────────────── */
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ─── PROFILE CARD ─────────────────────────────────────────── */
.profile-hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.profile-avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ─── CHIP IMPROVEMENTS ─────────────────────────────────────────── */
.chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--surface2); border: 1px solid var(--border); }
.chip.success { background: var(--success-bg); color: var(--success-text); border-color: rgba(16,185,129,0.3); }

/* ─── EXTRA BUTTON STYLES ─────────────────────────────────────────── */
.btn-small { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); cursor: pointer; font-size: 12px; font-family: var(--font); transition: all 0.15s; text-decoration: none; display: inline-block; }
.btn-small:hover { background: var(--surface3); }
.btn-small.ghost { background: transparent; }

/* ─── HOME PAGE IMPROVEMENTS ─────────────────────────────────────────── */
[data-theme="light"] .home-page { background: #f0f4f8; }
[data-theme="light"] .home-bg { background: radial-gradient(circle at 30% 20%, rgba(2,132,199,0.12), transparent 60%); }
[data-theme="light"] .card-glass { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .home-copy h1, [data-theme="light"] .home-copy { color: #1a202c; }
[data-theme="light"] .home-nav { background: rgba(240,244,248,0.9); border-color: rgba(0,0,0,0.1); }

