/* ===== D-Mail Panel — Clean Professional Light Theme ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Design Tokens ─── */
:root {
    /* Light backgrounds */
    --bg: #f4f5f9;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-card-alt: #f8f9fc;
    --bg-input: #f8f9fc;

    --border: #e2e5ef;
    --border-hover: #9ca3af;
    --border-focus: #374151;

    /* Accent — dark charcoal for buttons (professional on white) */
    --accent: #111827;
    --accent-2: #1f2937;
    --accent-3: #374151;
    --accent-glow: rgba(17, 24, 39, 0.08);
    --accent-glow-strong: rgba(17, 24, 39, 0.18);
    --shadow-accent: 0 2px 8px rgba(0, 0, 0, 0.20);

    /* Purple — decorative only (logo, badges, plan highlights) */
    --purple: #1d4ed8;
    --purple-2: #3b82f6;
    --purple-glow: rgba(29, 78, 216, 0.10);

    /* Semantic colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: rgba(16, 185, 129, 0.3);

    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: rgba(245, 158, 11, 0.3);

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: rgba(239, 68, 68, 0.3);

    --info: #3b82f6;
    --info-bg: #eff6ff;
    --info-border: rgba(59, 130, 246, 0.3);

    /* Text */
    --text: #111827;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;

    /* Radii */
    --radius: 14px;
    --radius-sm: 9px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 36px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-accent: 0 6px 24px rgba(108, 75, 228, 0.30);

    --nav-h: 62px;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ─── Body ─── */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ─── Typography ─── */
h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

h2 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* ─── Layout ─── */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ─── Navbar ─── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Logo */
.logo {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 201;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--purple), var(--purple-2));
    border-radius: 9px;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(108, 75, 228, 0.30);
    color: white;
}

/* Nav links */
.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg);
}

.nav-links a.active {
    color: var(--text);
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

/* User chip */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px 3px 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--purple-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 301;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 17px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s, width 0.3s;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 198;
    opacity: 0;
    transition: opacity 0.25s;
}

.nav-overlay.show {
    display: block;
    opacity: 1;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: #c7d0e8;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
    outline: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

/* Primary */
.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    background: var(--accent-3);
    border-color: var(--accent-3);
    box-shadow: 0 6px 20px rgba(108, 75, 228, 0.40);
    transform: translateY(-1px);
}

/* Secondary */
.btn-secondary {
    background: var(--bg-white);
    color: var(--text-muted);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: #c7d0e8;
    background: var(--bg);
}

/* Semantic */
.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn-danger:hover {
    background: #fee2e2;
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.btn-success:hover {
    background: #d1fae5;
    border-color: rgba(16, 185, 129, 0.5);
}

.btn-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.btn-warning:hover {
    background: #fef3c7;
    border-color: rgba(245, 158, 11, 0.5);
}

.btn-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: var(--info-border);
}

.btn-info:hover {
    background: #dbeafe;
    border-color: rgba(59, 130, 246, 0.5);
}

.btn-sm {
    padding: 6px 13px;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

.btn-xs {
    padding: 4px 9px;
    font-size: 0.75rem;
    border-radius: var(--radius-xs);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--purple-glow);
    background: var(--bg-white);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

.form-group .hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Input icon wrap */
.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    pointer-events: none;
}

.input-wrap input {
    padding-left: 38px;
}

.input-wrap .input-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 4px;
    transition: color 0.15s;
}

.input-wrap .input-toggle:hover {
    color: var(--text);
}

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-connected {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.badge-connecting,
.badge-starting {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge-stopped {
    background: var(--bg);
    color: var(--text-muted);
    border-color: var(--border);
}

.badge-free {
    background: var(--bg);
    color: var(--text-muted);
    border-color: var(--border);
}

.badge-basic {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning-border);
}

.badge-pro {
    background: var(--purple-glow);
    color: var(--accent);
    border-color: rgba(108, 75, 228, 0.25);
}

.badge-super {
    background: #fdf4ff;
    color: #9333ea;
    border-color: rgba(147, 51, 234, 0.25);
}

/* Status dot */
.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.connected {
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

.status-dot.connecting {
    background: var(--warning);
}

.status-dot.stopped {
    background: #d1d5db;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
}

.pulse {
    animation: pulse-alpha 2s infinite;
}

@keyframes pulse-alpha {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ─── Alerts ─── */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid transparent;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.alert-error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: #dc2626;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #059669;
}

.alert-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: #2563eb;
}

/* ─── Modals ─── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 16px;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.18s ease;
}

.modal {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px;
    width: 100%;
    max-width: 460px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    flex-shrink: 0;
    margin: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 12px;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.1rem;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-card-alt);
    border-color: #c7d0e8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px) scale(0.97);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ─── Terminal ─── */
.terminal {
    background: #1a1b26;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    height: 65vh;
    overflow-y: auto;
    color: #acb0c8;
    line-height: 1.7;
}

.terminal::-webkit-scrollbar {
    width: 4px;
}

.terminal::-webkit-scrollbar-track {
    background: transparent;
}

.terminal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.log-ts {
    color: #555877;
}

.log-err {
    color: #f38ba8;
}

.log-info {
    color: #89b4fa;
}

.log-warn {
    color: #f9e2af;
}

.log-ok {
    color: #a6e3a1;
}

/* ─── Section Header ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* ─── Grid ─── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ─── Page ─── */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-content {
    padding: 36px 0 80px;
    animation: fadeInUp 0.35s ease both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ─── Footer ─── */
footer {
    text-align: center;
    padding: 28px 0;
    color: var(--text-dim);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}

/* ─── Spinner ─── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(108, 75, 228, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Step Indicator ─── */
.step-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    flex: 1;
}

.step-indicator .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.25s;
}

.step-indicator .step.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.step-indicator .step.active {
    color: var(--text);
}

.step-indicator .step.done .step-num {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.step-indicator .divider-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: 0 8px;
}

/* ─── QR ─── */
.qr-container {
    text-align: center;
    padding: 14px 0;
}

.qr-container img {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.qr-placeholder {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 12px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.82rem;
    flex-direction: column;
    gap: 10px;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 64px 20px;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.empty-state p {
    margin-bottom: 24px;
    max-width: 300px;
    margin-inline: auto;
}

/* ─── Stats Bar ─── */
.stats-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
    flex: 1;
    min-width: 120px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-chip:hover {
    border-color: #c7d0e8;
    box-shadow: var(--shadow-sm);
}

.stat-chip .stat-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-chip .stat-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-chip .stat-lbl {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ─── Bot Card ─── */
.bot-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.bot-card-top {
    padding: 18px 18px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.bot-card-info {
    flex: 1;
    min-width: 0;
}

.bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--purple), var(--purple-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--purple-glow);
}

.bot-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.bot-card-phone {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.bot-status-area {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.bot-card-mid {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card-alt);
}

.bot-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    flex-wrap: wrap;
}

.bot-card-actions .btn {
    font-size: 0.78rem;
    padding: 6px 11px;
    gap: 5px;
}

/* ─── Console ─── */
.console-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.console-select-wrap {
    flex: 1;
    min-width: 200px;
}

.console-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.terminal-wrap {
    position: relative;
}

.terminal-tag {
    position: absolute;
    top: 10px;
    right: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 31, 46, 0.9);
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.log-line {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
    font-size: 0.78rem;
}

.log-num {
    color: #555877;
    user-select: none;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.log-text {
    flex: 1;
    word-break: break-word;
}

/* ─── Plans ─── */
.plans-hero {
    text-align: center;
    padding: 52px 0 44px;
}

.plans-hero h1 {
    font-size: 2.4rem;
    margin-bottom: 14px;
}

.plans-hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plans-hero p {
    font-size: 1rem;
    max-width: 440px;
    margin: 0 auto;
}

.plan-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0;
    overflow: hidden;
}

.plan-top-band {
    height: 3px;
}

.plan-card.plan-basic .plan-top-band {
    background: linear-gradient(90deg, var(--warning), #f59e0b);
}

.plan-card.plan-pro .plan-top-band {
    background: linear-gradient(90deg, var(--purple), var(--purple-2));
}

.plan-card.plan-super .plan-top-band {
    background: linear-gradient(90deg, #9333ea, #e879f9);
}

.plan-header {
    padding: 26px 22px 18px;
}

.plan-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: block;
}

.plan-name {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.plan-price {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
}

.plan-price .currency {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    vertical-align: super;
}

.plan-price .period {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-period {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 3px;
}

.plan-body {
    flex: 1;
    padding: 0 22px 18px;
}

.plan-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

.plan-features {
    list-style: none;
    text-align: left;
}

.plan-features li {
    padding: 8px 0;
    font-size: 0.87rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--border);
}

.plan-features li:last-child {
    border: none;
}

.plan-features .feat-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.plan-features .yes {
    color: var(--success);
}

.plan-features .no {
    color: var(--text-dim);
    text-decoration: line-through;
    opacity: 0.6;
}

.plan-footer {
    padding: 0 22px 26px;
}

.plan-pro {
    border-color: rgba(108, 75, 228, 0.35) !important;
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-sm) !important;
}

.popular-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 0 0 10px 10px;
    letter-spacing: 0.5px;
}

.popular-header {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.coupon-section {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.coupon-section.show {
    display: block;
    animation: fadeInDown 0.18s ease;
}

.coupon-row {
    display: flex;
    gap: 7px;
}

.coupon-row input {
    flex: 1;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.coupon-row input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.coupon-row input::placeholder {
    color: var(--text-dim);
}

.plan-banner {
    text-align: center;
    padding: 14px 20px;
    background: var(--purple-glow);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(108, 75, 228, 0.20);
    margin-bottom: 32px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--accent);
}

/* Console select matches light theme */
.console-select {
    width: 100%;
    padding: 10px 34px 10px 13px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.console-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.console-select option {
    background: white;
    color: var(--text);
}

/* Live dot in console tag */
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
    transition: background 0.3s;
}

.live-dot.live {
    background: var(--success);
    animation: pulse-dot 2s infinite;
}

.live-dot.reconnecting {
    background: var(--warning);
}

/* ─── Mobile ─── */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        gap: 10px;
    }

    .stat-chip {
        min-width: calc(50% - 5px);
        flex: none;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(290px, 80vw);
        height: 100dvh;
        background: var(--bg-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: calc(var(--nav-h) + 20px) 16px 28px;
        border-left: 1px solid var(--border);
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.10);
        transition: right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 200;
        gap: 3px;
        overflow-y: auto;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        padding: 12px 14px;
        font-size: 0.95rem;
        border-radius: var(--radius-sm);
    }

    .nav-links a.active {
        background: var(--purple-glow);
    }

    .nav-links .user-info {
        margin: 10px 0;
        align-self: flex-start;
    }

    .nav-links .btn {
        width: 100%;
        justify-content: center;
        margin-top: auto;
    }

    /* ─── MODAL MOBILE FIX ─── */
    .modal-overlay {
        align-items: flex-start;
        padding: 12px;
        overflow-y: auto;
    }

    .modal {
        max-height: none;
        overflow-y: visible;
        padding: 22px 18px;
        border-radius: var(--radius-sm);
        margin: 0 auto;
        width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions>* {
        width: 100%;
    }

    /* Grids */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Section header */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header>.btn {
        width: 100%;
    }

    /* Console */
    .terminal {
        height: 50vh;
        font-size: 0.75rem;
    }

    .console-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .console-select-wrap {
        width: 100%;
    }

    .console-controls {
        justify-content: flex-end;
    }

    /* Plans */
    .plans-hero {
        padding: 32px 0 28px;
    }

    .plans-hero h1 {
        font-size: 1.75rem;
    }

    .plan-pro {
        box-shadow: var(--shadow-sm) !important;
    }

    /* Stats */
    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }

    .stat-chip {
        width: 100%;
        flex: none;
    }

    /* Bot card actions */
    .bot-card-actions {
        gap: 6px;
    }

    .bot-card-actions .btn {
        flex: 1;
        min-width: calc(33% - 8px);
        justify-content: center;
    }

    h1 {
        font-size: 1.65rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .container {
        padding: 0 18px;
    }

    .page-content {
        padding: 22px 0 60px;
    }
}

@media (max-width: 480px) {
    .bot-card-actions .btn {
        min-width: calc(50% - 4px);
    }

    .plans-hero h1 {
        font-size: 1.55rem;
    }

    .plan-price {
        font-size: 2.2rem;
    }

    .modal {
        padding: 24px 20px;
        width: calc(100% - 24px);
    }

    .console-controls {
        flex-wrap: wrap;
    }

    .console-controls .btn {
        flex: 1;
    }

    .stat-chip {
        min-width: 100%;
    }
}