/* ═══════════════════════════════════════════════════════════════════════════
   WP Agent — Stylesheet
   Clean, modern design for WordPress AI content assistant
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Color System ─────────────────────────────────────────────── */
    --primary: #4647d3;
    --primary-hover: #3a3bb8;
    --primary-light: rgba(70, 71, 211, 0.08);
    --secondary: #b00d6a;
    --tertiary: #963776;
    --bg: #f5f6f7;
    --bg-card: #ffffff;
    --bg-dark: #1a1b1e;
    --surface-low: #eff1f2;
    --text: #1a1b1e;
    --text-muted: #94a3b8;
    --on-surface-variant: #64748b;
    --border: #e2e8f0;
    --border-ghost: rgba(171, 173, 174, 0.15);
    --success: #10b981;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --user-bubble: #4647d3;
    --ai-bubble: #ffffff;

    /* ── Radii ────────────────────────────────────────────────────── */
    --radius: 16px;
    --radius-lg: 24px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-btn: 12px;
    --radius-pill: 9999px;

    /* ── Shadows ──────────────────────────────────────────────────── */
    --shadow: 0px 12px 32px rgba(44, 47, 48, 0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0px 16px 40px rgba(44, 47, 48, 0.10);

    /* ── Fonts ────────────────────────────────────────────────────── */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-headline: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); font-weight: 400; }

/* ─── Headline Font ──────────────────────────────────────────────────────── */
h1, h2, h3, .font-headline { font-family: var(--font-headline); }

/* ─── Section Label Utility ──────────────────────────────────────────────── */
.section-label {
    font-size: 12px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 4px;
}

/* ─── Top Bar ─────────────────────────────────────────────────────────────── */

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 56px;
    background: rgba(255,255,255,0.8); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
    overflow: visible;
}
.topbar-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-right: 16px; border-right: 1px solid var(--border); margin-right: 4px; }
.topbar-center { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-sm {
    width: 34px; height: 34px; border-radius: 10px; background: var(--primary);
    color: white; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.brand { font-family: var(--font-headline); font-weight: 700; font-size: 15px; white-space: nowrap; line-height: 1.2; }
.brand span { display: block; font-family: var(--font); font-size: 10px; font-weight: 400; opacity: 0.55; margin-top: 1px; line-height: 1; letter-spacing: 0.2px; }
.version-badge {
    font-size: 10px; font-weight: 700; color: var(--primary);
    background: rgba(70, 71, 211, 0.1); padding: 3px 8px; border-radius: var(--radius-pill);
    letter-spacing: 0.3px; line-height: 1; align-self: center; text-transform: uppercase;
}
.stage-badge {
    font-size: 9px; font-weight: 700; color: #fff;
    background: #f59e0b; padding: 2px 7px; border-radius: 6px;
    letter-spacing: 0.5px; line-height: 1; align-self: center;
    text-transform: uppercase;
}
.user-name {
    font-size: 13px; color: var(--text-muted); padding: 0 4px;
    border-left: 1px solid var(--border); margin-left: 4px; padding-left: 14px;
}

.site-select {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    font-size: 13px; font-family: var(--font); background: white; min-width: 200px; max-width: 320px;
    transition: border-color 0.15s;
}
.site-select:focus { outline: none; border-color: var(--primary); }
.conn-status { font-size: 12px; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: var(--radius-btn);
    font-size: 14px; font-family: var(--font); font-weight: 500;
    cursor: pointer; border: none; text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.95); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(70, 71, 211, 0.25); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(70, 71, 211, 0.3); }
.btn-secondary { background: var(--surface-low); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-low); border-color: #cbd5e1; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-low); }

/* Navigation buttons in topbar */
.btn-nav {
    background: transparent; border: none; color: var(--on-surface-variant);
    font-weight: 500; padding: 6px 14px; border-radius: 8px;
    transition: color 0.15s, background 0.15s; position: relative;
}
.btn-nav:hover {
    color: var(--primary); background: rgba(70, 71, 211, 0.06);
}
.btn-nav:active { transform: scale(0.95); }
.btn-nav.active {
    color: var(--primary); background: transparent;
    font-weight: 600;
}
.btn-nav.active::after {
    content: ''; position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 12px); height: 2px; background: var(--primary); border-radius: 2px;
}
.btn-nav.active:hover {
    background: rgba(70, 71, 211, 0.06); color: var(--primary);
}

/* Navigation icon button (gear icon for Admin) */
.btn-nav-icon {
    padding: 5px 8px; display: inline-flex; align-items: center; justify-content: center;
    line-height: 0;
}
.btn-nav-icon svg { display: block; }

/* Navigation Dropdown */
.nav-dropdown {
    position: relative; display: inline-flex; align-items: center;
}
.nav-dropdown > .btn-nav { cursor: pointer; }
.nav-dropdown-menu {
    visibility: hidden; opacity: 0; pointer-events: none;
    position: absolute; top: calc(100% - 4px); left: -8px;
    min-width: 160px; background: var(--bg-card);
    outline: 1px solid var(--border-ghost);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    padding: 6px; padding-top: 10px; z-index: 200; border: none;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu:hover { visibility: visible; opacity: 1; pointer-events: auto; }
.nav-dropdown-item {
    display: block; padding: 8px 14px; font-size: 13px; font-weight: 500;
    color: var(--on-surface-variant); text-decoration: none; white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease; border-radius: 8px;
}
.nav-dropdown-item:hover {
    background: rgba(70, 71, 211, 0.06); color: var(--primary);
}
.nav-dropdown-item.active {
    color: var(--primary); font-weight: 600; background: rgba(70, 71, 211, 0.08);
}

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Login Page ──────────────────────────────────────────────────────────── */

.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--bg);
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: white; border-radius: var(--radius-lg); padding: 40px 44px;
    box-shadow: var(--shadow); outline: 1px solid var(--border-ghost);
    border-top: none;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-icon {
    width: 52px; height: 52px; border-radius: 14px; background: var(--primary);
    color: white; font-weight: 700; font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.login-logo h1 { font-family: var(--font-headline); font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--text-muted); }
.login-footer {
    text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted);
}
.login-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-xs); font-size: 14px; font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s; background: var(--bg-card);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(70, 71, 211, 0.1);
}
.form-row {
    display: flex; gap: 10px; align-items: end; flex-wrap: wrap;
}
.form-row input, .form-row select { flex: 1; min-width: 140px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 13px; font-family: var(--font); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Flash Messages ──────────────────────────────────────────────────────── */

.flash {
    padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: 13px; font-weight: 500; border-left: 3px solid;
}
.flash-error { background: #fef2f2; color: var(--danger); border-color: var(--danger); }
.flash-success { background: #f0fdf4; color: #15803d; border-color: var(--success); }

/* ─── Chat Layout ─────────────────────────────────────────────────────────── */

.chat-page {
    display: flex; flex-direction: column; height: 100vh;
}
.chat-main {
    flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 10px;
    display: flex; flex-direction: column;
}

/* ─── Welcome Screen ──────────────────────────────────────────────────────── */

.welcome {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; padding: 40px;
}
.welcome-icon { font-size: 36px; margin-bottom: 14px; opacity: 0.5; }
.welcome h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; font-family: var(--font-headline); }
.welcome p { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.welcome-examples {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 600px; width: 100%;
}
.example {
    padding: 14px 16px; background: var(--bg-card); outline: 1px solid var(--border-ghost);
    border: none; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
    transition: all 0.2s; text-align: left;
    color: var(--on-surface-variant); line-height: 1.4;
    box-shadow: var(--shadow-sm);
}
.example:hover { outline-color: var(--primary); background: rgba(70, 71, 211, 0.04); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow); }

/* ─── Messages ────────────────────────────────────────────────────────────── */

.messages {
    flex: 1; display: flex; flex-direction: column; gap: 16px;
    max-width: 800px; width: 100%; margin: 0 auto;
}
.message {
    display: flex; gap: 12px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.message-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
}
.message-user .message-avatar { background: var(--primary); color: white; }
.message-ai .message-avatar { background: #e5e7eb; color: var(--text); }

.message-body {
    flex: 1; padding: 14px 18px; border-radius: var(--radius);
    font-size: 14px; line-height: 1.6; overflow-wrap: break-word;
}
.message-user .message-body {
    background: var(--user-bubble); color: white; border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(70, 71, 211, 0.2);
}
.message-ai .message-body {
    background: var(--ai-bubble); outline: 1px solid var(--border-ghost); border: none;
    border-bottom-left-radius: 6px; box-shadow: var(--shadow-sm);
}
.ai-content {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
}
.message-body h1, .message-body h2, .message-body h3 { margin-top: 16px; margin-bottom: 8px; }
.message-body p { margin-bottom: 8px; }
.message-body ul, .message-body ol { margin-left: 20px; margin-bottom: 8px; }
.message-body code {
    background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px;
}
.message-body pre {
    background: #1e1e2e; color: #cdd6f4; padding: 14px; border-radius: var(--radius-sm);
    overflow-x: auto; margin: 8px 0; font-size: 13px;
}
.message-body pre code { background: none; padding: 0; color: inherit; }
.message-body a {
    color: var(--primary); text-decoration: underline;
    word-break: break-all;
}
.message-body a:hover { opacity: 0.8; }

/* ─── Response Timer ──────────────────────────────────────────────────────── */

.response-timer {
    display: inline-flex; align-items: center; gap: 4px;
    width: fit-content;
    font-size: 11px; font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    color: var(--primary); background: rgba(70, 71, 211, 0.08);
    padding: 4px 10px; border-radius: var(--radius-pill); margin-top: 6px;
    white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.response-timer .timer-icon {
    font-size: 12px; animation: timerPulse 2s ease-in-out infinite;
}
.response-timer.done {
    color: var(--text-muted); background: rgba(0,0,0,0.04);
    font-weight: 400;
}
.response-timer.done .timer-icon { animation: none; }
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─── Sticky Timer Bar ───────────────────────────────────────────────────── */

.sticky-timer {
    position: fixed; bottom: 90px; left: 0; right: 0; z-index: 90;
    display: flex; justify-content: center; pointer-events: none;
}
.sticky-timer-inner {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary);
    color: white; padding: 8px 20px; border-radius: 24px;
    font-size: 13px; font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    pointer-events: auto;
}
.sticky-timer-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #34d399; animation: stickyPulse 1.5s ease-in-out infinite;
}
.sticky-timer-label {
    font-family: var(--font); font-weight: 500; font-size: 13px;
}
.sticky-timer-value {
    font-weight: 600; font-size: 14px; min-width: 42px; text-align: right;
}
@keyframes stickyPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* ─── Tool Indicator ──────────────────────────────────────────────────────── */

.tool-indicator {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; background: #fef3c7; border-radius: 20px;
    font-size: 12px; color: #92400e; margin: 4px 0;
}
.tool-indicator.done { background: #d1fae5; color: #065f46; }

/* ─── Typing Indicator ────────────────────────────────────────────────────── */

.typing-indicator {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 20px; max-width: 800px; margin: 0 auto; width: 100%;
}
.typing-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
    animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
#typing-text { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

/* ─── Input Area ──────────────────────────────────────────────────────────── */

.chat-input-area {
    padding: 12px 20px 16px; background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.input-container {
    display: flex; align-items: end; gap: 8px;
    max-width: 800px; margin: 0 auto;
    background: white; outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius); padding: 10px 14px;
    transition: outline-color 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-sm);
}
.input-container:focus-within { outline-color: var(--primary); box-shadow: 0 0 0 3px rgba(70, 71, 211, 0.1); }

#message-input {
    flex: 1; border: none; outline: none; resize: none;
    font-size: 14px; font-family: var(--font); line-height: 1.5;
    max-height: 40vh; min-height: 24px; background: transparent;
    overflow-y: auto;
}
#send-btn {
    width: 38px; height: 38px; border-radius: 12px; border: none;
    background: var(--primary); color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(70, 71, 211, 0.25);
}
#send-btn:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(70, 71, 211, 0.3); }
#send-btn:active { transform: scale(0.95); }
#send-btn:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; }
#stop-btn {
    width: 40px; height: 40px; border-radius: 8px;
    background: #ef4444; color: white; border: none;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
    transition: background 0.2s;
}
#stop-btn:hover { background: #dc2626; }

.input-footer {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 800px; margin: 6px auto 0; padding: 0 4px;
}
.powered-by { font-size: 11px; color: var(--text-muted); }

/* ─── Admin Page ──────────────────────────────────────────────────────────── */

.admin-container {
    max-width: 960px; margin: 0 auto; padding: 24px 20px;
}
/* Admin sub-navigation tabs */
.admin-subnav {
    display: flex; gap: 0; margin-bottom: 24px;
    border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.admin-subnav-item {
    padding: 10px 20px; font-size: 14px; font-weight: 500;
    color: var(--text-muted); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.admin-subnav-item:hover {
    color: var(--primary); border-bottom-color: rgba(70, 71, 211, 0.3);
}
.admin-subnav-item.active {
    color: var(--primary); border-bottom-color: var(--primary); font-weight: 700;
}

.admin-section { margin-bottom: 40px; }
.admin-section h2 { font-size: 20px; margin-bottom: 16px; }

.card {
    background: var(--bg-card); border: none; outline: 1px solid var(--border-ghost);
    border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.card h3 { font-family: var(--font-headline); font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.card h4 { font-size: 14px; margin: 20px 0 8px; color: var(--primary); }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.card-actions { display: flex; gap: 6px; }
.edit-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.text-muted { color: var(--text-muted); font-size: 13px; }
.bridge-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
}
@media (max-width: 768px) { .bridge-header { flex-direction: column; } }

/* ─── Table ───────────────────────────────────────────────────────────────── */

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-muted); background: var(--surface-low); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover td { background: rgba(70, 71, 211, 0.03); }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-writer { background: #f3e8ff; color: #7c3aed; }

.user-admin-shell {
    padding: 18px 18px 16px;
}
.user-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}
.user-admin-head .text-muted {
    max-width: 440px;
    line-height: 1.5;
}
.user-add-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
}
.user-add-sites {
    grid-column: span 3;
}
.user-add-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}
.multi-select {
    min-height: 116px;
    padding: 8px 10px;
    background: #fbfcfd;
}
.user-admin-list {
    display: grid;
    gap: 14px;
}
.user-admin-card {
    padding: 16px 16px 14px;
}
.user-admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.user-admin-name {
    font-family: var(--font-headline);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.user-admin-handle {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-muted);
}
.user-admin-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 0 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.user-meta-item {
    min-width: 120px;
}
.user-meta-label,
.action-label,
.user-access-copy {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.user-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.user-access-panel {
    padding: 12px 0 10px;
}
.user-site-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.user-site-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 12px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 600;
}
.user-site-pill.is-empty {
    background: #f8fafc;
    color: var(--text-muted);
    border: 1px dashed var(--border);
}
.user-admin-actions {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 14px;
    align-items: start;
}
.inline-form-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inline-form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.input-compact {
    min-width: 180px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font);
    background: #fbfcfd;
}
.input-compact:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(70, 71, 211, 0.1);
}
.user-action-row form {
    display: inline-flex;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .topbar { flex-wrap: wrap; height: auto; padding: 10px; gap: 8px; }
    .topbar-center { order: 3; width: 100%; }
    .topbar-right { gap: 6px; }
    .site-select { width: 100%; min-width: auto; }
    .welcome-examples { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .btn-nav { padding: 4px 8px; font-size: 11px; }
    .user-name { display: none; }
    .user-admin-head { flex-direction: column; }
    .user-add-grid { grid-template-columns: 1fr; }
    .user-add-sites { grid-column: span 1; }
    .user-add-actions { justify-content: flex-start; }
    .user-admin-actions { grid-template-columns: 1fr; }
    .inline-form-inline { align-items: stretch; }
    .input-compact { width: 100%; }
}

.stop-notice {
    color: #f59e0b; font-style: italic; font-size: 0.85em;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid rgba(245,158,11,0.3);
}
.retry-btn {
    display: inline-block; margin-left: 4px; padding: 4px 12px;
    background: var(--primary, #6366f1); color: #fff; border: none;
    border-radius: 6px; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.retry-btn:hover { background: var(--primary-dark, #4f46e5); }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed; left: 0; top: 56px; bottom: 0; width: 260px;
    background: var(--bg-card); border-right: 1px solid var(--border);
    z-index: 50; transform: translateX(-100%); transition: transform 0.25s ease;
    display: flex; flex-direction: column; overflow: hidden;
}
.sidebar.open { transform: translateX(0); }
body.sidebar-open .chat-main,
body.sidebar-open .chat-input-area {
    margin-left: 260px; transition: margin-left 0.25s ease;
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-title { font-size: 14px; font-weight: 600; flex: 1; }
.clear-all-btn {
    font-size: 11px; font-weight: 500; color: var(--text-muted); background: none;
    border: 1px solid var(--border); padding: 3px 10px; border-radius: 4px;
    cursor: pointer; margin-right: 8px;
}
.clear-all-btn:hover { color: #dc2626; border-color: #dc2626; }
.sidebar-close {
    width: 28px; height: 28px; border: none; background: transparent;
    font-size: 18px; cursor: pointer; color: var(--text-muted);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.sidebar-close:hover { background: var(--bg); color: var(--text); }
.session-list { flex: 1; overflow-y: auto; padding: 8px; }
.session-group-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    color: var(--text-muted); padding: 12px 8px 4px; letter-spacing: 0.5px;
}
.session-item {
    display: flex; align-items: center; padding: 8px 10px;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
    transition: background 0.15s; gap: 6px;
}
.session-item:hover { background: var(--bg); }
.session-item.active { background: var(--primary-light); color: var(--primary); border-left: 2px solid var(--primary); padding-left: 8px; }
.session-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-delete {
    width: 22px; height: 22px; border: none; background: transparent;
    font-size: 16px; cursor: pointer; color: var(--text-muted);
    border-radius: 4px; display: flex; align-items: center;
    justify-content: center; opacity: 0; flex-shrink: 0; transition: opacity 0.15s;
}
.session-item:hover .session-delete { opacity: 1; }
.session-delete:hover { background: #fee2e2; color: var(--danger); }
.session-empty { padding: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }
.sidebar-toggle {
    width: 32px; height: 32px; border: none; background: transparent;
    cursor: pointer; border-radius: 6px; display: flex; align-items: center;
    justify-content: center; color: var(--text-muted); transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
@media (max-width: 768px) {
    .sidebar { width: 100%; }
    body.sidebar-open .chat-main,
    body.sidebar-open .chat-input-area { margin-left: 0; }
}

/* --- File Upload --- */
.upload-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.15s;
}
.upload-btn:hover { background: var(--bg); color: var(--primary); }
.file-preview-area {
    max-width: 800px; margin: 0 auto 8px; width: 100%;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.file-preview {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
}
.file-icon { font-size: 16px; }
.file-name {
    max-width: 150px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; color: var(--text);
}
.file-status { font-size: 11px; color: var(--text-muted); }
.file-status.uploading { color: var(--warning); }
.file-status.error { color: var(--danger); }
.file-status.ready { color: var(--success); }
.file-remove {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 16px; padding: 0 2px;
}
.file-remove:hover { color: var(--danger); }

/* ─── Academia Page ──────────────────────────────────────────────────────── */

.academia-page { display: flex; flex-direction: column; height: 100vh; }
.academia-layout {
    display: flex; flex: 1; overflow: hidden;
}
.academia-nav {
    width: 280px; flex-shrink: 0; background: var(--bg-card);
    border-right: 1px solid var(--border); overflow-y: auto;
    display: flex; flex-direction: column;
}
.academia-nav-header {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 18px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid var(--border); color: var(--text);
}
.academia-nav-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 18px; text-decoration: none; color: var(--text);
    border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.academia-nav-item:hover { background: var(--bg); }
.academia-nav-item.active {
    background: var(--primary-light); border-left: 3px solid var(--primary); color: var(--primary);
}
.academia-nav-item.active .academia-nav-title { color: var(--primary); }
.academia-nav-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.academia-nav-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.academia-nav-title { font-size: 13px; font-weight: 600; }
.academia-nav-summary { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.academia-nav-empty { padding: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }

.academia-content {
    flex: 1; overflow-y: auto; padding: 24px 32px; background: var(--bg);
}
.academia-article { max-width: 800px; margin: 0 auto; }
.academia-article-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 28px; padding-bottom: 20px; border-bottom: 2px solid var(--border);
}
.academia-article-icon { font-size: 36px; }
.academia-article-header h1 { font-size: 26px; line-height: 1.2; }
.academia-article-meta { font-size: 12px; color: var(--text-muted); }

.academia-article-body {
    background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius); padding: 28px 32px;
    font-size: 14px; line-height: 1.75; box-shadow: var(--shadow);
}
.academia-article-body h2 {
    font-size: 20px; margin-top: 28px; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.academia-article-body h2:first-child { margin-top: 0; }
.academia-article-body h3 { font-size: 16px; margin-top: 22px; margin-bottom: 10px; color: var(--primary); }
.academia-article-body p { margin-bottom: 12px; }
.academia-article-body ul, .academia-article-body ol {
    margin-left: 24px; margin-bottom: 14px;
}
.academia-article-body li { margin-bottom: 6px; }
.academia-article-body code {
    background: #f3f4f6; padding: 2px 6px; border-radius: 4px;
    font-size: 13px; font-family: 'Courier New', monospace;
}

.academia-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; text-align: center; color: var(--text-muted);
}
.academia-empty h2 { margin: 16px 0 8px; color: var(--text); }
.academia-empty p { font-size: 14px; }

/* Guide-specific elements */
.tip-box {
    background: rgba(70, 71, 211, 0.06); border: 1px solid rgba(70, 71, 211, 0.3); border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: 18px 0;
    font-size: 13px; line-height: 1.6;
}
.example-box {
    background: #f9fafb; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: 12px 0;
}
.example-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--primary); margin-bottom: 6px;
}
.guide-table {
    width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px;
}
.guide-table th {
    text-align: left; padding: 8px 12px; background: #f3f4f6;
    border-bottom: 2px solid var(--border); font-weight: 600;
}
.guide-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.guide-table tr:hover td { background: #f9fafb; }

@media (max-width: 768px) {
    .academia-layout { flex-direction: column; }
    .academia-nav { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
    .academia-content { padding: 20px 16px; }
    .academia-article-body { padding: 20px; }
}

/* ─── Prompts Page ──────────────────────────────────────────────────────── */

.prompt-category-label {
    padding: 10px 18px 4px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
}
.prompt-action-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; background: var(--primary-light);
    border: 1px solid rgba(70, 71, 211, 0.2);
    border-radius: var(--radius-sm); margin-bottom: 24px;
}
.prompt-section { margin-bottom: 24px; }
.prompt-section h3 {
    font-size: 16px; margin-bottom: 12px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.prompt-questions-preview {
    display: flex; flex-direction: column; gap: 10px;
}
.prompt-question-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 14px; background: var(--bg); border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.prompt-q-number {
    width: 26px; height: 26px; border-radius: 50%; background: var(--primary);
    color: white; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.prompt-template-box {
    background: #1e1e2e; border-radius: var(--radius-sm);
    overflow: hidden; border: 1px solid #313244;
}
.prompt-template-code {
    padding: 20px; color: #cdd6f4; font-size: 13px;
    line-height: 1.7; font-family: 'Courier New', monospace;
    white-space: pre-wrap; word-wrap: break-word; margin: 0;
}

/* ─── Prompt Modal (Chat Page) ──────────────────────────────────────────── */

.prompt-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.prompt-modal-backdrop {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
}
.prompt-modal-content {
    position: relative; background: var(--bg-card);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    outline: 1px solid var(--border-ghost);
    width: 90%; max-width: 580px; max-height: 80vh;
    display: flex; flex-direction: column; overflow: hidden;
    animation: modalSlideIn 0.15s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.prompt-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.prompt-modal-header h3 { font-size: 16px; margin: 0; }
.prompt-modal-close {
    width: 32px; height: 32px; border: none; background: transparent;
    font-size: 20px; cursor: pointer; color: var(--text-muted);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.prompt-modal-close:hover { background: var(--bg); color: var(--text); }
.prompt-modal-body {
    flex: 1; overflow-y: auto; padding: 16px 20px;
}

/* Prompt Filter Bar */
.prompt-filter-bar {
    display: flex; gap: 6px; margin-bottom: 16px;
}
.prompt-filter {
    padding: 6px 16px; border-radius: var(--radius-pill); border: 1px solid var(--border);
    background: transparent; font-size: 12px; font-weight: 500;
    font-family: var(--font); cursor: pointer; color: var(--text-muted);
    transition: all 0.15s;
}
.prompt-filter:hover { border-color: var(--primary); color: var(--primary); }
.prompt-filter:active { transform: scale(0.95); }
.prompt-filter.active {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(70, 71, 211, 0.2);
}

/* Prompt Grid */
.prompt-grid { display: flex; flex-direction: column; gap: 6px; }
.prompt-grid-category {
    padding: 8px 12px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);
    border-left: 3px solid var(--primary); margin-top: 8px;
}
.prompt-grid-category:first-child { margin-top: 0; }

/* Prompt Card */
.prompt-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all 0.2s; background: var(--bg-card);
}
.prompt-card:hover {
    outline-color: rgba(70, 71, 211, 0.3); background: rgba(70, 71, 211, 0.04);
    transform: translateX(2px);
}
.prompt-card-icon { font-size: 24px; flex-shrink: 0; }
.prompt-card-info { flex: 1; min-width: 0; }
.prompt-card-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.prompt-card-desc {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prompt-card-arrow {
    flex-shrink: 0; color: var(--text-muted); transition: color 0.15s;
}
.prompt-card:hover .prompt-card-arrow { color: var(--primary); }

@media (max-width: 768px) {
    .prompt-modal-content { width: 95%; max-height: 90vh; }
    .prompt-action-bar { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard Page
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-page { display: flex; flex-direction: column; height: 100vh; }

.dashboard-container {
    flex: 1; overflow-y: auto; padding: 20px 24px;
    max-width: 1200px; margin: 0 auto; width: 100%;
}

/* ── Progress Header ─────────────────────────────────────────────────────── */

.dashboard-header {
    background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius-lg); padding: 24px 28px 18px;
    margin-bottom: 24px; box-shadow: var(--shadow);
}
.dashboard-header-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px;
}
.dashboard-title {
    font-size: 20px; font-weight: 800; margin-bottom: 3px; color: var(--text); font-family: var(--font-headline);
}
.dashboard-subtitle {
    font-size: 13px; color: var(--text-muted);
}
.dashboard-progress-number {
    font-size: 44px; font-weight: 800; color: var(--primary); font-family: var(--font-headline);
    line-height: 1; letter-spacing: -1px;
}
.dashboard-progress-bar {
    width: 100%; height: 10px; background: #e5e7eb;
    border-radius: 6px; overflow: hidden; margin-bottom: 10px;
}
.dashboard-progress-fill {
    height: 100%; border-radius: 6px;
    background: var(--primary);
    transition: width 0.6s ease;
    min-width: 2px;
}
.dashboard-progress-labels {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-muted); font-weight: 500;
    padding: 0 2px;
}

/* ── Cards Grid ──────────────────────────────────────────────────────────── */

.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.dashboard-card {
    background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: all 0.2s;
}
.dashboard-card:hover {
    box-shadow: var(--shadow-lg); transform: translateY(-2px);
}
.dashboard-card-full {
    grid-column: 1 / -1;
}
.dashboard-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    background: var(--surface-low);
}
.dashboard-card-icon { font-size: 16px; }
.dashboard-card-title {
    flex: 1; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.2em; color: var(--text-muted);
}
.dashboard-card-badge {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 3px 10px; border-radius: 10px;
    background: #fef3c7; color: #92400e;
}
.dashboard-card-body {
    padding: 20px;
}

/* ── Placeholder Content ─────────────────────────────────────────────────── */

.dashboard-placeholder {
    display: flex; flex-direction: column; align-items: center;
    gap: 16px;
}
.dashboard-placeholder-text {
    font-size: 13px; color: var(--text-muted); text-align: center;
    font-style: italic;
}

/* Task Board placeholder — 3 Kanban columns */
.dashboard-placeholder-columns {
    display: flex; gap: 12px; width: 100%;
}
.dashboard-placeholder-col {
    flex: 1; display: flex; flex-direction: column; gap: 8px;
}
.dashboard-placeholder-col-header {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 6px 10px; border-radius: 6px;
    text-align: center;
}
.dashboard-placeholder-col-header.todo { background: #fef3c7; color: #92400e; }
.dashboard-placeholder-col-header.progress { background: #dbeafe; color: #1e40af; }
.dashboard-placeholder-col-header.done { background: #d1fae5; color: #065f46; }
.dashboard-placeholder-item {
    height: 32px; background: var(--bg); border: 1px dashed #d1d5db;
    border-radius: 6px;
}
.dashboard-placeholder-item.short { width: 70%; }

/* Site Map placeholder — tree structure */
.dashboard-placeholder-tree {
    width: 100%; padding: 8px 0;
}
.tree-node {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
}
.tree-children {
    padding-left: 28px;
    border-left: 2px solid #e5e7eb;
    margin-left: 7px;
}
.tree-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: #e5e7eb; flex-shrink: 0;
}
.tree-node.root .tree-dot { background: var(--primary); opacity: 0.4; width: 16px; height: 16px; }
.tree-line {
    height: 10px; width: 120px; background: #e5e7eb;
    border-radius: 5px;
}
.tree-line.short { width: 80px; }

/* SEO Health placeholder — gauge */
.dashboard-placeholder-gauge {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 0;
}
.gauge-svg { width: 120px; height: 80px; }
.gauge-label {
    font-size: 24px; font-weight: 700; color: #d1d5db;
    margin-top: -8px;
}

/* Content Calendar placeholder */
.dashboard-placeholder-calendar {
    width: 100%;
}
.cal-row {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 4px; margin-bottom: 4px;
}
.cal-row.cal-header {
    margin-bottom: 8px;
}
.cal-row.cal-header span {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    text-align: center; text-transform: uppercase; letter-spacing: 0.3px;
}
.cal-day {
    height: 28px; background: var(--bg); border: 1px solid #e5e7eb;
    border-radius: 4px;
}
.cal-day.dim { opacity: 0.3; }

/* Quick Actions placeholder */
.dashboard-placeholder-actions {
    display: flex; flex-wrap: wrap; gap: 12px;
    justify-content: center; width: 100%;
}
.action-btn-placeholder {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 18px; background: var(--bg);
    border: 1px dashed #d1d5db; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    cursor: default;
}
.action-icon { font-size: 16px; }

/* ── Task Board (Real Tasks) ─────────────────────────────────────────────── */

.dashboard-card-count {
    font-size: 11px; font-weight: 600; padding: 3px 10px;
    border-radius: 10px; background: #dbeafe; color: #1e40af;
}

/* Filter Bar */
.task-filter-bar {
    display: flex; gap: 6px; margin-bottom: 14px;
}
.task-filter-btn {
    padding: 4px 14px; font-size: 12px; font-weight: 500;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-card); color: var(--text-muted);
    cursor: pointer; transition: all 0.15s;
}
.task-filter-btn:hover {
    border-color: var(--primary); color: var(--primary);
}
.task-filter-btn.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

.task-board-columns {
    display: flex; gap: 14px; width: 100%;
}
.task-column {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.task-column-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 7px 12px; border-radius: 6px;
    margin-bottom: 10px;
}
.task-column-header.todo { background: #fef3c7; color: #92400e; }
.task-column-header.in-progress { background: #dbeafe; color: #1e40af; }
.task-column-header.done { background: #d1fae5; color: #065f46; }
.task-column-count {
    background: rgba(0,0,0,0.1); padding: 1px 7px;
    border-radius: 8px; font-size: 10px;
}
.task-column-body {
    display: flex; flex-direction: column; gap: 8px;
    min-height: 60px;
}

/* Task Cards */
.task-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: default;
}
.task-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-color: #c7cad0;
}
.task-card.task-done {
    opacity: 0.5; background: var(--bg);
}
.task-card.task-done .task-card-title {
    text-decoration: line-through;
}
.task-card-top {
    display: flex; align-items: flex-start; gap: 8px;
    justify-content: space-between;
}
.task-card-title {
    font-size: 13px; font-weight: 500; line-height: 1.4;
    word-break: break-word; flex: 1;
}

/* Priority Badges */
.task-priority-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 3px 10px; border-radius: var(--radius-pill);
    flex-shrink: 0; white-space: nowrap;
}
.task-priority-badge.high { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.task-priority-badge.medium { background: #fffbeb; color: #d97706; border: 1px solid #fcd34d; }
.task-priority-badge.low { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }

/* Info Row — post ref + date */
.task-card-info {
    display: flex; align-items: center; justify-content: space-between;
    gap: 6px; margin-top: 6px;
}
.task-card-meta {
    font-size: 10px; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.task-card-date {
    font-size: 10px; color: var(--text-muted);
    white-space: nowrap; flex-shrink: 0;
}

/* Action Buttons */
.task-card-actions {
    display: flex; gap: 4px; margin-top: 8px;
    justify-content: flex-end;
}
.task-action-btn {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 4px; padding: 3px 8px; font-size: 11px;
    cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
    color: var(--text-muted); font-weight: 500;
}
.task-action-btn:hover {
    background: #e5e7eb; border-color: #c7cad0;
}
.task-action-btn.done-btn:hover {
    background: #d1fae5; border-color: #6ee7b7; color: #065f46;
}
.task-action-btn.ai-btn:hover {
    background: rgba(70, 71, 211, 0.06); border-color: rgba(70, 71, 211, 0.4); color: var(--primary);
}
.task-action-btn.del-btn:hover {
    background: #fef2f2; border-color: #fca5a5; color: #dc2626;
}

/* ── Site Map ─────────────────────────────────────────────────────────── */

.sitemap-header-stats {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
    margin-left: auto; margin-right: 8px;
}
.sitemap-refresh-btn {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; width: 30px; height: 30px;
    font-size: 16px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s, border-color 0.15s; color: var(--text-muted);
}
.sitemap-refresh-btn:hover {
    background: var(--primary-light); border-color: var(--primary);
    color: var(--primary);
}

.sitemap-loading {
    display: flex; align-items: center; gap: 10px;
    justify-content: center; padding: 32px 0;
    color: var(--text-muted); font-size: 13px;
}
.sitemap-spinner {
    width: 18px; height: 18px; border: 2px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sitemap-empty {
    text-align: center; padding: 32px 0;
    color: var(--text-muted); font-size: 13px;
}

.sitemap-section {
    margin-bottom: 14px;
}
.sitemap-section:last-child { margin-bottom: 0; }

.sitemap-section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: var(--surface-low);
    border-radius: var(--radius-xs); margin-bottom: 6px;
}
.sitemap-section-icon { font-size: 14px; }
.sitemap-section-title {
    font-size: 13px; font-weight: 600; flex: 1;
}
.sitemap-section-count {
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    background: rgba(0,0,0,0.06); padding: 1px 7px;
    border-radius: 8px;
}
.sitemap-optimize-btn {
    background: transparent; border: 1px solid var(--border);
    border-radius: 4px; padding: 3px 8px; font-size: 10px;
    cursor: pointer; transition: all 0.15s;
    color: var(--text-muted); font-weight: 500;
    white-space: nowrap;
}
.sitemap-optimize-btn:hover {
    background: rgba(70, 71, 211, 0.06); border-color: rgba(70, 71, 211, 0.4); color: var(--primary);
}

.sitemap-items {
    padding-left: 8px;
}
.sitemap-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 12px; border-radius: 4px;
    transition: background 0.1s;
}
.sitemap-item:hover { background: var(--bg); }

.sitemap-item-child {
    padding-left: 30px;
}

.sitemap-dot {
    font-size: 10px; flex-shrink: 0; line-height: 1;
}

.sitemap-item-title {
    font-size: 12px; color: var(--text); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.sitemap-item-title:hover {
    color: var(--primary); text-decoration: underline;
}

.sitemap-item-status {
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    color: var(--text-muted); background: var(--bg);
    padding: 1px 6px; border-radius: 4px; flex-shrink: 0;
    border: 1px solid var(--border);
}

/* ── SEO Health ───────────────────────────────────────────────────────── */

.seo-last-audit {
    font-size: 11px; color: var(--text-muted); margin-left: auto; margin-right: 8px;
}

.seo-top-row {
    display: flex; align-items: center; gap: 18px;
    margin-bottom: 16px;
}
.seo-score-circle {
    width: 72px; height: 72px; border-radius: 50%;
    border: 4px solid #e5e7eb; display: flex; flex-direction: column;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.seo-score-number {
    font-size: 24px; font-weight: 800; line-height: 1; font-family: var(--font-headline);
}
.seo-score-label {
    font-size: 10px; color: var(--primary); font-weight: 600;
}
.seo-overall { flex: 1; }
.seo-health-badge {
    font-size: 13px; font-weight: 600; padding: 4px 12px;
    border-radius: 6px; display: inline-block; margin-bottom: 4px;
}
.seo-health-green { background: #d1fae5; color: #065f46; }
.seo-health-yellow { background: #fef3c7; color: #92400e; }
.seo-health-red { background: #fef2f2; color: #dc2626; }
.seo-score-note {
    font-size: 10px; color: var(--text-muted); font-style: italic;
}

/* Stats Grid */
.seo-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 14px;
}
.seo-stat {
    background: var(--surface-low); border-radius: var(--radius-sm);
    padding: 12px 14px; text-align: center;
}
.seo-stat-value {
    font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; font-family: var(--font-headline);
}
.seo-stat-value .seo-stat-of {
    font-size: 12px; font-weight: 500; color: var(--text-muted);
}
.seo-stat-value.seo-stat-warn { color: #ef4444; }
.seo-stat-label {
    font-size: 10px; color: var(--text-muted); margin-top: 3px;
    line-height: 1.3;
}

/* Keywords */
.seo-keywords-section {
    margin-bottom: 14px;
}
.seo-keywords-title {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px;
}
.seo-keywords-list {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.seo-keyword-tag {
    font-size: 11px; font-weight: 500; background: var(--primary-light);
    color: var(--primary); padding: 3px 10px; border-radius: 12px;
    border: 1px solid rgba(70, 71, 211, 0.15);
}

/* Audit Button */
.seo-audit-section {
    display: flex; align-items: center; gap: 12px;
    padding-top: 10px; border-top: 1px solid var(--border);
}
.seo-audit-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-btn); padding: 10px 22px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.15s; box-shadow: 0 2px 8px rgba(70, 71, 211, 0.25);
}
.seo-audit-btn:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(70, 71, 211, 0.3); }
.seo-audit-btn:active { transform: scale(0.95); }
.seo-audit-btn:disabled {
    opacity: 0.7; cursor: not-allowed;
}
.seo-audit-time {
    font-size: 11px; color: var(--text-muted);
}

/* ── Power Commands Grid (Prompts page) ──────────────────────────────── */
.power-commands-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}
.power-cmd-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; background: var(--bg-card);
    outline: 1px solid var(--border-ghost); border: none; border-radius: var(--radius);
    cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.power-cmd-card:hover {
    outline-color: rgba(70, 71, 211, 0.3); background: rgba(70, 71, 211, 0.04);
    box-shadow: var(--shadow); transform: translateY(-1px);
}
.power-cmd-icon { font-size: 24px; flex-shrink: 0; }
.power-cmd-info { flex: 1; min-width: 0; }
.power-cmd-label { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.power-cmd-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.power-cmd-arrow { color: var(--text-muted); flex-shrink: 0; opacity: 0; transition: opacity 0.15s; }
.power-cmd-card:hover .power-cmd-arrow { opacity: 1; }

/* ── Content Calendar ─────────────────────────────────────────────────── */

.cal-header-stats {
    font-size: 12px; color: var(--text-muted); font-weight: 500;
    margin-left: auto; margin-right: 8px;
}

/* Trending box */
.cal-trending {
    background: #fef9c3;
    border: none; outline: 1px solid rgba(252, 211, 77, 0.3); border-radius: var(--radius-sm);
    padding: 14px 18px; margin-bottom: 14px;
}
.cal-trending-header {
    font-size: 12px; font-weight: 700; color: #92400e; margin-bottom: 8px;
}
.cal-trending-icon { font-size: 14px; }
.cal-trending-list {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.cal-trending-tag {
    font-size: 11px; font-weight: 600; background: #fff;
    color: #78350f; padding: 3px 12px; border-radius: var(--radius-pill);
    border: 1px solid #fbbf24;
}

/* Calendar — row-based layout (replaces old table) */
.cal-list { margin-bottom: 12px; }
.cal-list-header {
    display: grid; grid-template-columns: 110px 1fr 80px auto;
    gap: 12px; padding: 10px 18px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.2em; color: var(--text-muted);
    background: var(--surface-low); border-bottom: 1px solid var(--border);
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.cal-list-header span:last-child { text-align: right; }
.cal-entry {
    display: grid; grid-template-columns: 110px 1fr 80px auto;
    gap: 12px; padding: 12px 18px; align-items: center;
    border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.cal-entry:last-child { border-bottom: none; }
.cal-entry:hover { background: rgba(70, 71, 211, 0.02); }
.cal-entry-today { background: rgba(70, 71, 211, 0.04); }
.cal-entry-today:hover { background: rgba(70, 71, 211, 0.06); }
.cal-entry-overdue { background: #fef2f2; }
.cal-entry-overdue:hover { background: #fee2e2; }

.cal-entry-date {
    font-weight: 600; font-size: 12px; color: var(--text); white-space: nowrap;
}
.cal-today-badge {
    display: inline-block; font-size: 9px; font-weight: 700; color: var(--primary);
    background: var(--primary-light); padding: 2px 6px;
    border-radius: 4px; margin-left: 4px;
}
.cal-entry-body {
    min-width: 0;
}
.cal-entry-title {
    font-weight: 600; font-size: 13px; color: var(--text); line-height: 1.3;
    margin-bottom: 3px;
}
.cal-entry-meta {
    display: flex; align-items: center; gap: 8px;
}
.cal-type-tag {
    font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill);
    white-space: nowrap; color: #fff; letter-spacing: 0.03em; text-transform: uppercase;
}
.cal-type-post { background: #6b7280; }
.cal-type-page { background: #2563eb; }
.cal-type-knowledgebase { background: #7c3aed; }
.cal-type-listing { background: #059669; }
.cal-type-bonus { background: #d97706; }
.cal-type-slot { background: #dc2626; }
.cal-cat-tag {
    font-size: 10px; font-weight: 500; background: var(--surface-low);
    color: var(--on-surface-variant); padding: 3px 10px; border-radius: var(--radius-pill);
    border: none; white-space: nowrap;
}
.cal-status {
    font-size: 11px; font-weight: 500; white-space: nowrap;
}
.cal-status-suggested { color: var(--text-muted); }
.cal-status-scheduled { color: #2563eb; }
.cal-status-written { color: #059669; }
.cal-status-skipped { color: #9ca3af; text-decoration: line-through; }

.cal-entry-status { text-align: center; }

.cal-entry-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
    white-space: nowrap;
}
.cal-write-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: 8px; padding: 6px 14px; font-size: 11px;
    font-weight: 600; cursor: pointer; transition: all 0.15s;
    box-shadow: 0 1px 4px rgba(70, 71, 211, 0.2);
}
.cal-write-btn:hover { background: var(--primary-hover); }
.cal-write-btn:active { transform: scale(0.95); }
.cal-task-btn {
    background: #fff; color: var(--text); border: 1px solid var(--border);
    border-radius: 5px; padding: 5px 10px; font-size: 11px;
    font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.cal-task-btn:hover { border-color: var(--primary); color: var(--primary); }
.cal-task-btn-done { background: #dcfce7; color: #166534; border-color: #86efac; pointer-events: none; }
.cal-skip-btn {
    background: transparent; color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 8px; padding: 5px 12px; font-size: 10px;
    cursor: pointer; transition: all 0.15s;
}
.cal-skip-btn:hover {
    background: #fef2f2; border-color: #fca5a5; color: #dc2626;
}
.cal-schedule-btn {
    background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa;
    border-radius: 8px; padding: 5px 12px; font-size: 11px;
    font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.cal-schedule-btn:hover { background: #ffedd5; border-color: #fb923c; }
.cal-schedule-btn:active { transform: scale(0.95); }
.cal-schedule-done { background: #dcfce7; color: #166534; border-color: #86efac; pointer-events: none; }

/* Clickable entry + expand icon */
.cal-entry { cursor: pointer; }
.cal-entry:active { background: var(--bg); }
.cal-expand-icon {
    display: inline-block; font-size: 10px; color: var(--text-muted);
    margin-left: 6px; transition: transform 0.2s;
}
.cal-entry-expanded .cal-entry { background: var(--bg); }
.cal-entry-wrap { border-bottom: 1px solid var(--border); }
.cal-entry-wrap:last-child { border-bottom: none; }
.cal-entry { border-bottom: none; }

/* Expandable detail panel */
.cal-detail {
    background: #f8fafc; border-top: 1px solid var(--border);
    padding: 0 16px;
    animation: calDetailSlide 0.2s ease;
}
@keyframes calDetailSlide {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}
.cal-detail-inner {
    padding: 16px 0 16px 122px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.cal-detail-section { }
.cal-detail-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px;
}
.cal-detail-text {
    font-size: 13px; color: var(--text); line-height: 1.6; margin: 0;
}
.cal-detail-outline {
    margin: 0; padding-left: 18px; font-size: 13px;
    color: var(--text); line-height: 1.8;
}
.cal-detail-outline li { margin-bottom: 2px; }

/* Footer */
.cal-footer {
    padding-top: 14px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.cal-footer-hint {
    font-size: 11px; color: var(--text-muted); font-style: italic;
}
.cal-regen-btn {
    background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 16px; font-size: 12px;
    font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.cal-regen-btn:hover {
    background: var(--primary-light); border-color: var(--primary); color: var(--primary);
}

/* ── Progress Breakdown Chips ─────────────────────────────────────────────── */

.dashboard-progress-breakdown {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.pb-chip {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 500;
    border: 1px solid transparent; cursor: default;
}
.pb-chip-green { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.pb-chip-yellow { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.pb-chip-red { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ── Quick Access (Knowledge Base + Power Commands) ──────────────────────── */

.qa-section { margin-bottom: 20px; }
.qa-section:last-child { margin-bottom: 0; }
.qa-section-title {
    font-size: 12px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.2em;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.qa-section-link {
    font-size: 11px; font-weight: 500; text-transform: none;
    letter-spacing: 0; color: var(--primary);
    text-decoration: none; margin-left: auto;
}
.qa-section-link:hover { text-decoration: underline; }

/* Power Commands Grid */
.qa-power-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.qa-power-btn {
    display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 20px 12px;
    background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius-lg); cursor: pointer;
    transition: all 0.2s; text-align: center; box-shadow: var(--shadow);
}
.qa-power-btn:hover {
    background: var(--primary); color: white;
    box-shadow: var(--shadow-lg); transform: translateY(-2px);
}
.qa-power-btn:hover .qa-power-icon,
.qa-power-btn:hover .qa-power-label,
.qa-power-btn:hover .qa-power-desc { color: white; }
.qa-power-icon { font-size: 24px; }
.qa-power-label {
    font-size: 12px; font-weight: 600; color: var(--text);
    line-height: 1.3;
}
.qa-power-desc {
    font-size: 10px; color: var(--text-muted); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Master Prompts Grid */
.qa-prompts-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.qa-prompt-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: var(--bg-card);
    outline: 1px solid var(--border-ghost); border: none; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text);
    transition: all 0.2s; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.qa-prompt-card:hover {
    outline-color: rgba(70, 71, 211, 0.3); background: rgba(70, 71, 211, 0.04);
    transform: translateY(-1px); box-shadow: var(--shadow);
}
.qa-prompt-icon { font-size: 20px; flex-shrink: 0; }
.qa-prompt-title {
    font-size: 12px; font-weight: 500; line-height: 1.3;
    flex: 1; min-width: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.qa-prompt-cat {
    position: absolute; top: 4px; right: 6px;
    font-size: 8px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.3px; padding: 1px 5px;
    border-radius: 3px; opacity: 0.7;
}
.qa-cat-junior { background: #dbeafe; color: #2563eb; }
.qa-cat-advanced { background: #fef3c7; color: #d97706; }
.qa-cat-expert { background: #ede9fe; color: #7c3aed; }

/* ── Task Summary (Dashboard compact card) ───────────────────────────────── */

.task-summary-viewall {
    margin-left: auto; font-size: 12px; font-weight: 500;
    color: var(--primary); text-decoration: none;
}
.task-summary-viewall:hover { text-decoration: underline; }

.ts-empty {
    font-size: 13px; color: var(--text-muted); text-align: center;
    padding: 16px 0;
}
.ts-status-row {
    display: flex; gap: 8px; margin-bottom: 14px;
}
.ts-pill {
    font-size: 12px; font-weight: 600; padding: 4px 12px;
    border-radius: 12px;
}
.ts-pill-todo { background: #fef3c7; color: #92400e; }
.ts-pill-progress { background: #dbeafe; color: #1e40af; }
.ts-pill-done { background: #d1fae5; color: #065f46; }

.ts-list { display: flex; flex-direction: column; gap: 4px; }
.ts-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg);
    transition: border-color 0.15s;
}
.ts-row:hover { border-color: #c7cad0; }
.ts-inprog-dot { color: #3b82f6; font-size: 8px; flex-shrink: 0; }
.ts-title {
    flex: 1; font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ts-done-btn {
    background: transparent; border: 1px solid var(--border);
    border-radius: 4px; width: 26px; height: 26px;
    cursor: pointer; font-size: 12px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; flex-shrink: 0;
}
.ts-done-btn:hover { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }

.ts-more {
    text-align: center; font-size: 11px; color: var(--text-muted);
    padding: 6px 0;
}

/* ── Tasks Page (Full Board) ─────────────────────────────────────────────── */

.tasks-page { background: var(--bg); }

.tb-container {
    max-width: 1400px; margin: 0 auto;
    padding: 20px 24px;
}
.tb-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.tb-header-left { display: flex; align-items: center; gap: 12px; }
.tb-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-title { font-size: 20px; font-weight: 800; margin: 0; font-family: var(--font-headline); }
.tb-total { font-size: 13px; color: var(--text-muted); }

.tb-filters { display: flex; gap: 4px; }
.tb-filter-btn {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 14px; font-size: 12px;
    font-weight: 500; cursor: pointer; transition: all 0.15s;
    color: var(--text-muted);
}
.tb-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 6px rgba(70, 71, 211, 0.2); }
.tb-filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.tb-filter-btn:active { transform: scale(0.95); }

.tb-action-btn {
    padding: 6px 14px; border-radius: 6px; font-size: 12px;
    font-weight: 600; cursor: pointer; border: 1px solid var(--border);
    transition: all 0.15s;
}
.tb-add-btn { background: var(--primary); color: #fff; border-color: var(--primary); }
.tb-add-btn:hover { background: var(--primary-hover); }
.tb-clear-btn { background: var(--bg-card); color: var(--text-muted); }
.tb-clear-btn:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* Add Task Form */
.tb-add-form {
    background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius); padding: 20px;
    margin-bottom: 16px; box-shadow: var(--shadow);
}
.tb-input, .tb-textarea, .tb-select {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; font-family: var(--font);
    margin-bottom: 8px; box-sizing: border-box;
}
.tb-textarea { resize: vertical; }
.tb-add-form-row { display: flex; gap: 8px; align-items: center; }
.tb-add-form-row .tb-select { width: auto; margin-bottom: 0; }
.tb-submit-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: 6px; padding: 8px 18px; font-size: 12px;
    font-weight: 600; cursor: pointer;
}
.tb-submit-btn:hover { background: var(--primary-hover); }
.tb-cancel-btn {
    background: transparent; border: 1px solid var(--border);
    border-radius: 6px; padding: 7px 14px; font-size: 12px;
    cursor: pointer; color: var(--text-muted);
}

/* Kanban Board */
.tb-board {
    display: flex; gap: 16px; min-height: calc(100vh - 200px);
}
.tb-column {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.tb-col-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; padding: 8px 12px; border-radius: 6px;
    margin-bottom: 10px; border: 1px solid transparent;
}
.tb-col-header.todo { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tb-col-header.in-progress { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tb-col-header.done { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.tb-col-count {
    background: rgba(0,0,0,0.1); padding: 2px 8px;
    border-radius: 8px; font-size: 11px;
}
.tb-col-body {
    display: flex; flex-direction: column; gap: 8px;
    flex: 1;
}

/* Task Cards */
.tb-card {
    background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius-sm); padding: 12px 14px;
    transition: all 0.2s; cursor: pointer; box-shadow: var(--shadow-sm);
}
.tb-card:hover {
    box-shadow: var(--shadow); transform: translateY(-1px);
    outline-color: rgba(70, 71, 211, 0.3);
}
.tb-card-done { opacity: 0.55; }
.tb-card-done .tb-card-title { text-decoration: line-through; }

.tb-card-expanded {
    border-color: var(--primary); background: #fafbff;
    box-shadow: var(--shadow);
}

.tb-card-main {
    display: flex; align-items: center; gap: 8px;
}
.tb-card-arrows {
    display: flex; gap: 2px; flex-shrink: 0;
}
.tb-arrow-btn {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 4px; width: 24px; height: 24px;
    font-size: 10px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    color: var(--text-muted); transition: all 0.15s;
}
.tb-arrow-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.tb-arrow-btn.tb-arrow-right { }

.tb-card-title {
    flex: 1; font-size: 13px; font-weight: 500; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tb-card-expanded .tb-card-title {
    -webkit-line-clamp: unset; overflow: visible;
}

/* Card badges (comments, files, expand) */
.tb-card-badges {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 6px;
}
.tb-badge {
    font-size: 10px; padding: 1px 6px; border-radius: 10px;
    background: var(--bg); color: var(--text-muted); white-space: nowrap;
}
.tb-badge-comments { background: rgba(70, 71, 211, 0.1); color: var(--primary); }
.tb-badge-files { background: rgba(245,158,11,0.1); color: #d97706; }
.tb-created-by { font-size: 10px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.tb-act-open {
    background: var(--bg) !important; color: var(--primary) !important;
    border: 1px solid var(--border) !important; margin-left: auto !important;
}

/* Expanded details */
.tb-card-details {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.tb-card-desc {
    font-size: 12px; color: var(--text); line-height: 1.5;
    margin-bottom: 8px; white-space: pre-wrap;
}
.tb-card-meta {
    font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
}
.tb-post-link {
    color: #2563eb; text-decoration: none; font-weight: 500;
    transition: color 0.15s;
}
.tb-post-link:hover { color: #1d4ed8; text-decoration: underline; }
.tb-card-actions {
    display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap;
}
.tb-act-btn {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 4px; padding: 4px 10px; font-size: 11px;
    cursor: pointer; transition: all 0.15s; color: var(--text-muted);
    font-weight: 500;
}
.tb-act-btn:hover { background: #e5e7eb; }
.tb-act-ai:hover { background: rgba(70, 71, 211, 0.06); border-color: rgba(70, 71, 211, 0.4); color: var(--primary); }
.tb-act-done:hover { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.tb-act-del:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.tb-act-edit:hover { background: #fffbeb; border-color: #fcd34d; color: #d97706; }

.tb-empty-col {
    font-size: 12px; color: var(--text-muted); text-align: center;
    padding: 20px 10px; opacity: 0.6;
}
.tb-show-more {
    background: transparent; border: 1px dashed var(--border);
    border-radius: 6px; padding: 8px; font-size: 12px;
    color: var(--text-muted); cursor: pointer; text-align: center;
    width: 100%; transition: all 0.15s;
}
.tb-show-more:hover {
    border-color: var(--primary); color: var(--primary);
    background: var(--primary-light);
}

/* Edit form inside expanded card */
.tb-edit-form {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 0 4px;
}
.tb-edit-label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.tb-edit-input {
    width: 100%; padding: 8px 10px; font-size: 13px;
    font-family: var(--font); border: 2px solid var(--primary);
    border-radius: 6px; outline: none; box-sizing: border-box;
    transition: border-color 0.15s;
}
.tb-edit-input:focus { border-color: var(--primary-hover); }
.tb-edit-textarea {
    width: 100%; padding: 8px 10px; font-size: 13px;
    font-family: var(--font); border: 2px solid var(--border);
    border-radius: 6px; outline: none; box-sizing: border-box;
    resize: vertical; min-height: 60px; transition: border-color 0.15s;
}
.tb-edit-textarea:focus { border-color: var(--primary); }
.tb-edit-buttons {
    display: flex; gap: 8px; margin-top: 4px;
}
.tb-edit-save {
    padding: 6px 16px; font-size: 13px; font-family: var(--font);
    font-weight: 600; background: var(--primary); color: white;
    border: none; border-radius: 6px; cursor: pointer;
    transition: background 0.15s;
}
.tb-edit-save:hover { background: var(--primary-hover); }
.tb-edit-cancel {
    padding: 6px 16px; font-size: 13px; font-family: var(--font);
    font-weight: 500; background: transparent; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
    transition: all 0.15s;
}
.tb-edit-cancel:hover { background: var(--bg); color: var(--text); }

/* Start button */
.tb-act-start:hover { background: rgba(70, 71, 211, 0.06); border-color: rgba(70, 71, 211, 0.4); color: var(--primary); }

/* ── Scan & Generate Button ──────────────────────────────────────────────── */
.tb-scan-btn {
    background: var(--primary); color: white;
    border: none; border-radius: var(--radius-btn); padding: 8px 18px; font-size: 13px;
    font-family: var(--font); font-weight: 600; cursor: pointer;
    transition: all 0.15s; box-shadow: 0 2px 8px rgba(70, 71, 211, 0.25);
}
.tb-scan-btn:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(70, 71, 211, 0.3); }
.tb-scan-btn:active { transform: scale(0.95); }
.tb-scan-btn:disabled { opacity: 0.7; cursor: wait; }

/* Dashboard scan button (empty state) */
.ts-empty-wrap { text-align: center; padding: 10px 0; }
.ts-scan-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary); color: white;
    border: none; border-radius: 6px; padding: 10px 20px; font-size: 14px;
    font-family: var(--font); font-weight: 600; cursor: pointer;
    margin-top: 12px; transition: background 0.15s;
}
.ts-scan-btn:hover { background: var(--primary-hover); }
.ts-scan-btn:disabled { opacity: 0.7; cursor: wait; }

/* ── File Upload in Task Form ───────────────────────────────────────────── */
.tb-file-label {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; font-family: var(--font); cursor: pointer;
    background: white; color: var(--text-muted); transition: all 0.15s;
}
.tb-file-label:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tb-file-preview {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.tb-file-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; background: #f0f0ff; border: 1px solid #e0e0f0;
    border-radius: 6px; font-size: 12px; color: var(--text);
}
.tb-file-tag small { color: var(--text-muted); }

/* ── Attachments on task cards ──────────────────────────────────────────── */
.tb-card-attachments {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.tb-attachment-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; background: #f8f8ff; border: 1px solid #e8e8f0;
    border-radius: 4px; font-size: 11px; color: var(--text);
}
.tb-attachment-tag small { color: var(--text-muted); }

/* ── Calendar "Add to Tasks" button ────────────────────────────────────── */
.cal-task-btn {
    background: transparent; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 10px; font-size: 12px; font-family: var(--font);
    cursor: pointer; color: var(--text-muted); transition: all 0.15s;
    white-space: nowrap;
}
.cal-task-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.cal-task-btn:disabled { cursor: default; }
.cal-task-btn-done { color: var(--success); border-color: var(--success); background: #d1fae5; }

/* ── Content Velocity Governor ─────────────────────────────────────────── */
.vel-bar-row {
    display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
    flex-wrap: wrap;
}
.vel-stats { display: flex; align-items: baseline; gap: 2px; }
.vel-big-num { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; font-family: var(--font-headline); }
.vel-of { font-size: 16px; color: var(--text-muted); font-weight: 500; }
.vel-label { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.vel-remaining { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.vel-status-badge {
    font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.vel-status-badge.vel-ok { background: #d1fae5; color: #065f46; }
.vel-status-badge.vel-warn { background: #fef3c7; color: #92400e; }
.vel-status-badge.vel-limit { background: #fee2e2; color: #991b1b; }

.vel-bar-track {
    width: 100%; height: 10px; background: var(--bg); border-radius: 6px;
    overflow: hidden; border: 1px solid var(--border); margin-bottom: 10px;
}
.vel-bar-fill {
    height: 100%; border-radius: 6px;
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

.vel-ramp-info {
    font-size: 11px; color: var(--primary); background: rgba(70, 71, 211, 0.08); padding: 4px 10px;
    border-radius: 6px; margin-bottom: 8px; display: inline-block;
}
.vel-week-range {
    font-size: 11px; color: var(--text-muted); margin-bottom: 12px;
}

.vel-posts-header {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
.vel-posts-list { display: flex; flex-direction: column; gap: 4px; }
.vel-post-row {
    display: flex; align-items: center; gap: 8px; font-size: 13px;
    padding: 4px 0;
}
.vel-post-dot { color: #10b981; font-size: 8px; }
.vel-post-type { font-size: 10px; color: var(--text-muted); background: var(--bg-tertiary, #f3f4f6); padding: 1px 6px; border-radius: 12px; white-space: nowrap; }
.vel-post-title { flex: 1; color: var(--text); }
.vel-post-date { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.vel-posts-empty { font-size: 13px; color: var(--text-muted); font-style: italic; }

/* Velocity Settings Modal */
.vel-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.vel-modal {
    background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); outline: 1px solid var(--border-ghost);
    width: 420px; max-width: 90vw; overflow: hidden;
}
.vel-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.vel-modal-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
.vel-modal-close {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--text-muted); line-height: 1;
}
.vel-modal-close:hover { color: var(--text); }
.vel-modal-body { padding: 20px; }
.vel-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px; border-top: 1px solid var(--border);
    background: var(--bg);
}
.vel-form-group { margin-bottom: 16px; }
.vel-form-group label {
    display: block; font-size: 13px; font-weight: 600;
    margin-bottom: 4px; color: var(--text);
}
.vel-form-group input[type="number"],
.vel-form-group input[type="date"] {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 6px; font-size: 14px; font-family: var(--font);
    background: var(--bg);
}
.vel-form-hint {
    font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block;
}
.vel-ramp-schedule { margin-top: 12px; }
.vel-ramp-preview {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.vel-ramp-step {
    font-size: 11px; padding: 4px 10px; border-radius: 6px;
    background: #f3f4f6; color: #374151; font-weight: 500;
}

/* ── Dashboard Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .dashboard-container { padding: 16px; }
    .dashboard-header { padding: 20px; }
    .dashboard-progress-number { font-size: 28px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-card-full { grid-column: 1; }
    .dashboard-placeholder-columns { flex-direction: column; }
    .dashboard-placeholder-actions { flex-direction: column; }
    .action-btn-placeholder { justify-content: center; }
    .task-board-columns { flex-direction: column; }
    .seo-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .seo-top-row { flex-direction: column; text-align: center; }
    .cal-entry { grid-template-columns: 80px 1fr 70px 140px; gap: 8px; padding: 10px 12px; }
    .cal-entry-title { font-size: 12px; }
    .cal-entry-actions { gap: 4px; }
    .cal-write-btn, .cal-task-btn, .cal-skip-btn, .cal-schedule-btn { padding: 4px 8px; font-size: 10px; }
    .cal-detail-inner { padding-left: 0; grid-template-columns: 1fr; }
    .cal-list-header { grid-template-columns: 80px 1fr 70px 140px; }
    .cal-trending-list { flex-direction: column; }
    .qa-power-grid { grid-template-columns: repeat(2, 1fr); }
    .qa-prompts-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-progress-breakdown { gap: 4px; }
    .pb-chip { font-size: 10px; padding: 2px 7px; }
    .tb-board { flex-direction: column; min-height: auto; }
    .tb-header { flex-direction: column; align-items: flex-start; }
    .tb-container { padding: 12px; }
    .topbar-center .site-select { min-width: 160px; }
    .gsc-table th, .gsc-table td { padding: 6px 8px; font-size: 11px; }
    .gsc-summary { flex-wrap: wrap; gap: 8px; }
}

/* ─── Search Console Card ────────────────────────────────────────────────── */

.gsc-summary {
    display: flex; gap: 16px; align-items: center; margin-bottom: 14px;
    padding: 12px 16px; background: var(--surface-low); border-radius: var(--radius-sm);
}
.gsc-summary-item { display: flex; flex-direction: column; align-items: center; }
.gsc-summary-value { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.gsc-summary-label { font-size: 11px; color: var(--text-muted); }
.gsc-summary-period { font-size: 11px; color: var(--text-muted); font-style: italic; }

.gsc-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.gsc-toggle-btn {
    padding: 6px 14px; font-size: 12px; font-family: var(--font); font-weight: 500;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
    color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.gsc-toggle-btn:hover { color: var(--primary); border-color: var(--primary); }
.gsc-toggle-btn:active { transform: scale(0.95); }
.gsc-toggle-btn.active {
    background: rgba(70, 71, 211, 0.08); color: var(--primary);
    border-color: rgba(70, 71, 211, 0.25); font-weight: 600;
}

.gsc-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.gsc-table th {
    text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.2em;
    border-bottom: 2px solid var(--border); background: var(--surface-low);
}
.gsc-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.gsc-table tbody tr { transition: background 0.15s; }
.gsc-table tbody tr:hover { background: rgba(70, 71, 211, 0.03); }
.gsc-kw-cell { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsc-url-cell { font-size: 11px; color: var(--text-muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsc-suggestion { font-size: 11px; color: var(--text-muted); max-width: 180px; }

.gsc-position-badge {
    display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 700; text-align: center; min-width: 36px;
}
.gsc-position-good { background: #dcfce7; color: #16a34a; }
.gsc-position-warning { background: #fef3c7; color: #d97706; }
.gsc-position-bad { background: #fee2e2; color: #ef4444; }

.gsc-not-configured {
    text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 14px;
}
.gsc-not-configured p { margin: 0; }

/* GSC Property Selector */
.gsc-link-row { display: flex; gap: 8px; align-items: center; }
.gsc-property-select { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: var(--bg-card); }

/* ═══════════════════════════════════════════════════════════════════════════
   SEO Strategy Page
   ═══════════════════════════════════════════════════════════════════════════ */

.seo-container {
    max-width: 1400px; margin: 0 auto; padding: 24px 20px;
}

/* Strategy Brief Card */
.seo-strategy-card {
    background: var(--bg-card); border-radius: var(--radius); outline: 1px solid var(--border-ghost); border: none;
    padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
    border-left: 3px solid var(--primary);
}
.seo-strategy-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.seo-strategy-header h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-muted); }
.seo-brief-saved {
    font-size: 12px; color: var(--success); font-weight: 500;
    background: #ecfdf5; padding: 2px 10px; border-radius: 12px;
}
.seo-brief-textarea {
    width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; font-family: var(--font); font-size: 14px; color: var(--text);
    resize: vertical; background: var(--bg); line-height: 1.5;
}
.seo-brief-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(70, 71, 211, 0.15); }

/* Site Config Bar */
.seo-config-bar {
    display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px;
    background: var(--bg-card); border-radius: 8px; padding: 14px 20px;
    outline: 1px solid var(--border-ghost); box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.seo-config-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.seo-config-field-wide { flex: 1.5; }
.seo-config-field label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted);
}
.seo-config-field input {
    border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px;
    font-family: var(--font); font-size: 13px; color: var(--text);
    background: var(--bg); transition: border-color 0.15s;
}
.seo-config-field input:focus { outline: none; border-color: var(--primary); }
.seo-config-saved {
    font-size: 11px; font-weight: 600; color: var(--success); white-space: nowrap;
    padding-bottom: 8px;
}
@media (max-width: 768px) {
    .seo-config-bar { flex-direction: column; align-items: stretch; }
}

/* Stats Row */
.seo-stats-row {
    display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.seo-stat-box {
    flex: 1; min-width: 120px; background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow);
    border-top: 3px solid var(--border);
}
.seo-stat-box:first-child { border-top-color: var(--primary); }
.seo-stat-good { border-top-color: var(--success); }
.seo-stat-warn { border-top-color: var(--warning); }
.seo-stat-muted { border-top-color: var(--text-muted); }
.seo-stat-value { display: block; font-size: 30px; font-weight: 800; color: var(--text); line-height: 1; font-family: var(--font-headline); }
.seo-stat-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; }
.seo-stat-good .seo-stat-value { color: var(--success); }
.seo-stat-warn .seo-stat-value { color: var(--warning); }
.seo-stat-muted .seo-stat-value { color: var(--text-muted); }

/* Main Layout */
.seo-layout {
    display: flex; gap: 20px; align-items: flex-start;
}

/* Cluster Sidebar */
.seo-clusters-sidebar {
    width: 220px; flex-shrink: 0; background: var(--bg-card); outline: 1px solid var(--border-ghost); border: none;
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.seo-sidebar-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.seo-sidebar-header h3 { font-size: 14px; font-weight: 600; }
.seo-sidebar-add {
    width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); font-size: 16px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; color: var(--text-muted); transition: all .15s;
}
.seo-sidebar-add:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.seo-cluster-list { display: flex; flex-direction: column; gap: 4px; }
.seo-cluster-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 8px 10px; border: none; border-radius: 6px; background: transparent;
    font-size: 13px; color: var(--text); cursor: pointer; text-align: left; transition: all .15s;
}
.seo-cluster-btn:hover { background: var(--bg); }
.seo-cluster-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 600; border-left: 3px solid var(--primary); padding-left: 7px; }
.seo-cluster-count {
    font-size: 11px; background: var(--bg); padding: 1px 6px; border-radius: 10px;
    color: var(--text-muted); min-width: 20px; text-align: center;
}
.seo-cluster-item { display: flex; align-items: center; gap: 2px; }
.seo-cluster-item .seo-cluster-btn { flex: 1; }
.seo-cluster-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.seo-cluster-item:hover .seo-cluster-actions { opacity: 1; }
.seo-cluster-edit, .seo-cluster-del {
    border: none; background: transparent; cursor: pointer; font-size: 12px; padding: 4px;
    color: var(--text-muted); border-radius: 4px;
}
.seo-cluster-edit:hover { color: var(--primary); }
.seo-cluster-del:hover { color: var(--danger); }

/* Keywords Main */
.seo-keywords-main { flex: 1; min-width: 0; }

/* Action Bar */
.seo-action-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.seo-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.seo-filter-bar select {
    padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; background: var(--bg-card); color: var(--text);
}
.seo-action-btns { display: flex; gap: 8px; }
.seo-action-btn {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-card); font-size: 13px; cursor: pointer; color: var(--text);
    font-weight: 500; transition: all .15s;
}
.seo-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.seo-sync-btn { background: #ecfdf5; border-color: #86efac; color: #16a34a; }
.seo-sync-btn:hover { background: #dcfce7; }
.seo-sync-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Add Form */
.seo-add-form {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.seo-input {
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; flex: 1; min-width: 120px; background: var(--bg);
}
.seo-input-url { min-width: 180px; }
.seo-input:focus { outline: none; border-color: var(--primary); }
.seo-select {
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; background: var(--bg-card);
}
.seo-submit-btn {
    padding: 7px 16px; background: var(--primary); color: #fff; border: none;
    border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.seo-submit-btn:hover { background: var(--primary-hover); }
.seo-cancel-btn {
    padding: 7px 14px; background: transparent; color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 6px; font-size: 13px; cursor: pointer;
}

/* Bulk Import */
.seo-bulk-import {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.seo-bulk-textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 6px;
    padding: 10px; font-size: 13px; font-family: var(--font); margin-bottom: 8px;
    resize: vertical; background: var(--bg);
}
.seo-bulk-textarea:focus { outline: none; border-color: var(--primary); }
.seo-bulk-options { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Keywords Table */
.seo-table {
    width: 100%; border-collapse: collapse; background: var(--bg-card);
    outline: 1px solid var(--border-ghost); border: none; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow);
}
.seo-table thead th {
    padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-align: left; border-bottom: 2px solid var(--border); background: var(--surface-low);
    text-transform: uppercase; letter-spacing: 0.2em;
}
.seo-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
.seo-table tbody tr:hover { background: rgba(70, 71, 211, 0.03); }
.seo-table tbody td { padding: 10px 14px; font-size: 13px; vertical-align: middle; }
.seo-kw-cell { font-weight: 500; max-width: 250px; }
.seo-kw-note {
    display: inline-flex; width: 16px; height: 16px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary); font-size: 10px; font-weight: 600;
    align-items: center; justify-content: center; margin-left: 6px; cursor: help;
    vertical-align: middle;
}
.seo-cluster-cell { font-size: 12px; color: var(--text-muted); }
.seo-url-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-url-link { color: var(--primary); text-decoration: none; font-size: 12px; }
.seo-url-link:hover { text-decoration: underline; }

/* Intent Badges */
.seo-intent-badge {
    display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 10px;
    font-weight: 700; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.03em;
}
.seo-intent-informational { background: #dbeafe; color: #1d4ed8; }
.seo-intent-commercial { background: #ffedd5; color: #c2410c; }
.seo-intent-transactional { background: #dcfce7; color: #16a34a; }
.seo-intent-navigational { background: #ede9fe; color: #7c3aed; }
.seo-intent-comparison { background: #fef3c7; color: #92400e; }
.seo-intent-review { background: #fce7f3; color: #be185d; }
.seo-intent-how-to { background: #ccfbf1; color: #0f766e; }
.seo-intent-listicle { background: #e0e7ff; color: #4338ca; }
.seo-intent-brand { background: #fef9c3; color: #854d0e; }
.seo-intent-local { background: #f0fdf4; color: #15803d; }

/* Intent Multi-Picker */
.intent-multi-picker {
    position: relative;
    display: inline-block;
    min-width: 150px;
}
.intent-multi-picker-inline {
    min-width: 120px;
}
.intent-multi-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    background: #1a1a2e;
    border: 1px solid #2d2d4a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #c8c8d4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color .15s;
}
.intent-multi-toggle:hover {
    border-color: #4e4eff;
}
.intent-multi-label {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.intent-multi-arrow {
    font-size: 11px;
    opacity: .6;
    flex-shrink: 0;
}
.intent-multi-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 180px;
    max-height: 260px;
    overflow-y: auto;
    background: #1e1e36;
    border: 1px solid #3d3d5c;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 6px 0;
    margin-top: 4px;
}
.intent-multi-picker.open .intent-multi-dropdown {
    display: block;
}
.intent-multi-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #d1d1e0;
    transition: background .1s;
    white-space: nowrap;
}
.intent-multi-dropdown label:hover {
    background: #2a2a4a;
}
.intent-multi-dropdown input[type="checkbox"] {
    accent-color: #6c63ff;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
.seo-intents-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}
.seo-intents-cell .seo-intent-badge {
    font-size: 10px;
    padding: 1px 6px;
}

/* Content Gap Analysis */
/* Competitors Section */
.seo-competitors-card {
    background: var(--bg-card); border-radius: 8px; padding: 20px 24px;
    margin-top: 20px; outline: 1px solid var(--border-ghost);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.seo-competitors-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.seo-competitors-header h2 {
    font-family: var(--font-headline); font-size: 16px; font-weight: 700; margin: 0;
}
.seo-competitors-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px; margin-top: 12px;
}
.seo-comp-card {
    background: var(--surface-low); border-radius: 8px; padding: 14px 16px;
    outline: 1px solid var(--border-ghost);
}
.seo-comp-card.seo-comp-own {
    border-left: 3px solid var(--primary);
}
.seo-comp-domain {
    font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.seo-comp-dr {
    font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 12px;
    background: var(--primary); color: #fff;
}
.seo-comp-stats {
    display: flex; gap: 16px; font-size: 12px; color: var(--text-muted);
}
.seo-comp-stat-val { font-weight: 700; color: var(--text); display: block; font-size: 14px; }

.seo-content-gap-card {
    background: #16162a;
    border: 1px solid #2d2d4a;
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
}
.seo-content-gap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}
.seo-content-gap-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.seo-content-gap-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f5;
    margin: 0;
}
.seo-content-gap-title svg {
    color: #6c63ff;
}
.seo-content-gap-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.seo-content-gap-desc {
    font-size: 13px;
    color: #8888a4;
    margin: 0 0 16px 0;
}
.seo-content-gap-results {
    min-height: 60px;
}
.seo-content-gap-empty {
    text-align: center;
    padding: 32px 16px;
    color: #6b6b8a;
    font-size: 14px;
}
.seo-gap-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: #1a1a34;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #a0a0bc;
}
.seo-gap-meta strong {
    color: #d1d1e0;
}
.seo-gap-table {
    margin-top: 0;
}
.seo-gap-comp {
    font-size: 12px;
    color: #8888a4;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seo-act-add-gap, .seo-act-task-gap {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #3d3d5c;
    background: #1a1a34;
    color: #c8c8d4;
    transition: all .15s;
}
.seo-act-add-gap:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.seo-act-task-gap:hover {
    background: #6c63ff;
    color: #fff;
    border-color: #6c63ff;
}
.seo-act-added {
    background: #1e3a2e !important;
    color: #4ade80 !important;
    border-color: #2d5a3e !important;
    cursor: default;
}

/* Status Badges */
.seo-status-badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px;
    font-weight: 500; white-space: nowrap;
}
.seo-status-not_ranking { background: #f3f4f6; color: #6b7280; }
.seo-status-tracking { background: #dbeafe; color: #2563eb; }
.seo-status-ranking { background: #fef3c7; color: #b45309; }
.seo-status-on_page_1 { background: #dcfce7; color: #16a34a; }
.seo-status-achieved { background: #dcfce7; color: #15803d; font-weight: 700; }

/* GSC Position Badge */
.seo-gsc-pos {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
    font-weight: 600; min-width: 30px; text-align: center;
}
.seo-gsc-good { background: #dcfce7; color: #16a34a; }
.seo-gsc-warn { background: #fef3c7; color: #b45309; }
.seo-gsc-bad { background: #fee2e2; color: #dc2626; }
.seo-gsc-none { background: #f3f4f6; color: #9ca3af; }
.seo-vol { font-weight: 600; color: var(--text-primary); }
.seo-vol-cell, .seo-kd-cell { text-align: center; white-space: nowrap; }
.seo-kd { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.seo-kd-easy { background: #dcfce7; color: #16a34a; }
.seo-kd-medium { background: #fef3c7; color: #b45309; }
.seo-kd-hard { background: #fed7aa; color: #c2410c; }
.seo-kd-super { background: #fee2e2; color: #dc2626; }
.seo-country-cell { text-align: center; width: 36px; min-width: 36px; font-size: 16px; padding: 4px !important; }

/* Actions */
.seo-actions-cell { white-space: nowrap; }
.seo-act-btn {
    border: none; background: transparent; cursor: pointer; padding: 4px 6px;
    font-size: 13px; color: var(--text-muted); border-radius: 4px; transition: all .15s;
}
.seo-act-btn:hover { background: var(--bg); color: var(--primary); }
.seo-act-del:hover { color: var(--danger); }
.seo-act-save { color: var(--success); font-weight: 600; }

/* Edit Row */
.seo-editing-row { background: #fefce8 !important; }
.seo-edit-input {
    padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px;
    font-size: 12px; width: 100%; background: #fff;
}
.seo-edit-input:focus { outline: none; border-color: var(--primary); }
.seo-edit-select {
    padding: 5px 6px; border: 1px solid var(--border); border-radius: 4px;
    font-size: 12px; background: #fff; width: 100%;
}

/* Dashboard SEO Strategy Card */
.seo-dashboard-stats { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.seo-dash-stat { font-size: 13px; color: var(--text-muted); }
.seo-dash-stat strong { color: var(--text); font-weight: 600; }
.seo-dash-keywords { list-style: none; padding: 0; margin: 0; }
.seo-dash-keywords li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.seo-dash-keywords li:last-child { border-bottom: none; }
.seo-dash-kw { font-weight: 500; }
.seo-dash-progress {
    width: 100%; height: 6px; background: var(--border); border-radius: 3px;
    margin-top: 10px; overflow: hidden;
}
.seo-dash-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width .3s; }

/* Responsive */
@media (max-width: 900px) {
    .seo-layout { flex-direction: column; }
    .seo-clusters-sidebar { width: 100%; }
    .seo-table { font-size: 12px; }
    .seo-action-bar { flex-direction: column; align-items: stretch; }
}
