:root {
    --bg: #0b0d13;
    --bg-surface: #141721;
    --bg-elevated: #1c2030;
    --bg-hover: #232840;
    --border: #262b3d;
    --border-light: #1e2235;
    --text: #e8eaf4;
    --text-secondary: #a0a5be;
    --text-muted: #6b7194;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-subtle: rgba(99,102,241,0.12);
    --success: #22c55e;
    --success-subtle: rgba(34,197,94,0.12);
    --warning: #f59e0b;
    --warning-subtle: rgba(245,158,11,0.12);
    --error: #ef4444;
    --error-subtle: rgba(239,68,68,0.12);
    --info: #3b82f6;
    --info-subtle: rgba(59,130,246,0.12);
    --sidebar-w: 256px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-elevated: 0 4px 12px rgba(0,0,0,0.4);
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ===== APP LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-header {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.logo-sub {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.sidebar-nav { padding: 0.5rem 0; flex: 1; }

.nav-group { margin-bottom: 0.25rem; }

.nav-group-title {
    padding: 0.75rem 1.25rem 0.35rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

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

.nav-item.active {
    background: var(--primary-subtle);
    color: var(--primary-hover);
    font-weight: 600;
    border-left-color: var(--primary);
}

.nav-item.disabled {
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.5;
}

.nav-icon {
    font-size: 0.85rem;
    width: 1.3rem;
    text-align: center;
    flex-shrink: 0;
}

.badge-soon {
    margin-left: auto;
    font-size: 0.55rem;
    background: var(--border);
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ===== SIDEBAR USER ===== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background: var(--error-subtle);
    color: var(--error);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 1.75rem 2.25rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.page-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header-desc {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.page-body { padding: 1.75rem 2.25rem 2.5rem; flex: 1; }

.page-description {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 680px;
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

/* ===== INFO BAR ===== */
.info-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0;
    background: var(--bg-surface);
    border-radius: var(--radius);
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.info-item {
    padding: 0.85rem 1.15rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.info-item:last-child { border-right: none; }

.info-item strong {
    display: block;
    color: var(--text);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition);
}

.stat-card:hover { border-color: var(--primary); }

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

/* ===== SECTION ===== */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 0.5rem;
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.action-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-elevated);
}

.action-card:hover::before { opacity: 1; }

.action-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.action-title {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 0.3rem;
}

.action-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.action-card-external .action-desc::after {
    content: ' \2197';
    color: var(--text-muted);
}

/* ===== DATA TABLES ===== */
.table-container {
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.data-table thead th {
    text-align: left;
    padding: 0.85rem 1.1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-table tbody td {
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

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

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover { background: var(--bg-hover); }

.clickable-row { cursor: pointer; }

.cell-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.4;
}

.cell-evidence {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary);
}

.cell-nextstep {
    font-size: 0.73rem;
    color: var(--info);
    margin-top: 0.2rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.67rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-active { background: var(--success-subtle); color: var(--success); }
.badge-inactive { background: var(--bg-elevated); color: var(--text-muted); }
.badge-coming_soon { background: var(--warning-subtle); color: var(--warning); }
.badge-open { background: var(--primary-subtle); color: var(--primary-hover); }
.badge-in_progress { background: var(--info-subtle); color: var(--info); }
.badge-done { background: var(--success-subtle); color: var(--success); }
.badge-ignored { background: var(--bg-elevated); color: var(--text-muted); }
.badge-reviewing { background: var(--warning-subtle); color: var(--warning); }
.badge-paused { background: var(--warning-subtle); color: var(--warning); }
.badge-archived { background: var(--bg-elevated); color: var(--text-muted); }
.badge-direct { background: var(--error-subtle); color: var(--error); }
.badge-indirect { background: var(--warning-subtle); color: var(--warning); }
.badge-reference { background: var(--info-subtle); color: var(--info); }
.badge-aspirational { background: var(--primary-subtle); color: var(--primary-hover); }
.badge-impact-high { background: var(--error-subtle); color: var(--error); }
.badge-impact-medium { background: var(--warning-subtle); color: var(--warning); }
.badge-impact-low { background: var(--success-subtle); color: var(--success); }
.badge-seo { background: var(--primary-subtle); color: var(--primary-hover); }
.badge-content { background: var(--info-subtle); color: var(--info); }
.badge-technical { background: var(--warning-subtle); color: var(--warning); }
.badge-conversion { background: var(--success-subtle); color: var(--success); }
.badge-competitor { background: var(--error-subtle); color: var(--error); }
.badge-idea { background: var(--primary-subtle); color: var(--primary-hover); }
.badge-brief, .badge-draft { background: var(--info-subtle); color: var(--info); }
.badge-reviewed, .badge-approved { background: var(--success-subtle); color: var(--success); }
.badge-published_manual { background: var(--success-subtle); color: var(--success); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(99,102,241,0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99,102,241,0.35);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

/* ===== FORMS ===== */
.form-container { max-width: 640px; }

.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-hidden { display: none !important; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    max-width: 440px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ===== TOOL CARDS ===== */
.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.65rem;
    box-shadow: var(--shadow-card);
    transition: border-color var(--transition);
}

.tool-card:not(.tool-disabled):hover { border-color: var(--primary); }

.tool-card.tool-disabled {
    opacity: 0.55;
    background: var(--bg);
}

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tool-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-name {
    font-weight: 800;
    font-size: 1.05rem;
}

.tool-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
    line-height: 1.55;
}

.tool-external-note {
    font-size: 0.73rem;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    border-left: 2px solid var(--info);
}

.tool-form .form-group { margin-bottom: 0.85rem; }

.tool-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tool-coming-soon {
    font-size: 0.83rem;
    color: var(--text-muted);
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    text-align: center;
}

/* ===== DETAIL ===== */
.detail-header { margin-bottom: 1.25rem; }

.detail-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.detail-brand {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== ANALYZER ===== */
.analyzer-hero {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.analyzer-hero .form-row {
    align-items: flex-end;
}

.analyzer-hero .form-group { margin-bottom: 0; }

.analyzer-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 0.85rem;
}

.analyzer-note-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--info-subtle);
    color: var(--info);
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.analyzer-result { margin-top: 1.75rem; }

.alert {
    padding: 1rem 1.35rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: var(--error-subtle);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.score-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.75rem;
    padding: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 4px solid;
    background: var(--bg);
}

.score-good { border-color: var(--success); }
.score-medium { border-color: var(--warning); }
.score-low { border-color: var(--error); }

.score-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.score-good .score-value { color: var(--success); }
.score-medium .score-value { color: var(--warning); }
.score-low .score-value { color: var(--error); }

.score-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 600;
}

.score-summary { font-size: 0.95rem; line-height: 1.6; }
.score-summary strong { display: block; font-size: 1.1rem; margin-bottom: 0.25rem; }

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.1rem;
}

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
}

.result-card h4 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--primary-hover);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
}

.result-item:last-child { border-bottom: none; }

.result-label {
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 500;
}

.result-value {
    text-align: right;
    word-break: break-word;
    color: var(--text);
}

.result-missing {
    color: var(--error);
    font-weight: 600;
}

.result-present {
    color: var(--success);
    font-weight: 600;
}

.recommendations-card {
    border-color: rgba(99,102,241,0.25);
    border-left: 3px solid var(--primary);
}

.rec-list, .h2-list {
    list-style: none;
    padding: 0;
}

.rec-list li, .h2-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.84rem;
    line-height: 1.5;
}

.rec-list li:last-child, .h2-list li:last-child { border-bottom: none; }

.rec-list li::before {
    content: "\2192 ";
    color: var(--primary);
    font-weight: 700;
}

/* ===== CONNECTED TOOLS STATUS ===== */
.tools-status-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tool-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tool-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.tool-status-dot.connected { background: var(--success); }
.tool-status-dot.pending { background: var(--warning); }

/* ===== STATUS & SCORE BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.status-badge.status-success { background: rgba(16,185,129,.15); color: #10b981; }
.status-badge.status-failed { background: rgba(239,68,68,.15); color: #ef4444; }
.status-badge.status-blocked { background: rgba(245,158,11,.15); color: #f59e0b; }
.status-badge.status-timeout { background: rgba(245,158,11,.15); color: #f59e0b; }
.status-badge.status-invalid_url { background: rgba(156,163,175,.15); color: #9ca3af; }

.score-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.score-badge-good { background: rgba(16,185,129,.15); color: #10b981; }
.score-badge-medium { background: rgba(245,158,11,.15); color: #f59e0b; }
.score-badge-low { background: rgba(239,68,68,.15); color: #ef4444; }
.score-badge-na { background: rgba(156,163,175,.1); color: #6b7280; }

/* ===== SECTION DIVIDER ===== */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 2rem 0 1.5rem;
}

/* ===== ANALYSIS HISTORY TABLE ===== */
.cell-url { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; }
.cell-title { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 0.85rem; }
.cell-date { white-space: nowrap; color: var(--text-muted); font-size: 0.82rem; }
.analysis-saved-note { margin-top: 1rem; text-align: center; font-size: 0.9rem; }
.analysis-saved-note a { color: var(--primary); text-decoration: underline; }

/* ===== ANALYZER DETAIL PAGE ===== */
.detail-header { margin-bottom: 1.5rem; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color .15s; }
.back-link:hover { color: var(--primary); }
.analysis-detail { }
.detail-meta { margin-bottom: 1.5rem; }
.detail-url { font-size: 1.15rem; font-weight: 600; color: var(--text); word-break: break-all; margin-bottom: 0.5rem; }
.detail-info { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.detail-date { font-size: 0.82rem; color: var(--text-muted); }

/* ===== FILTER BAR ===== */
.filter-bar {
    margin-bottom: 1.25rem;
}
.filter-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.filter-form select {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
}
.filter-form select:focus { border-color: var(--primary); }

/* ===== PRIORITY SCORE ===== */
.priority-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    border: 2px solid;
}
.priority-high { border-color: var(--error); color: var(--error); background: var(--error-subtle); }
.priority-medium { border-color: var(--warning); color: var(--warning); background: var(--warning-subtle); }
.priority-low { border-color: var(--text-muted); color: var(--text-muted); background: var(--bg-elevated); }

/* ===== CELL ACTIONS ===== */
.cell-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

/* ===== REPORT DETAIL ===== */
.report-detail { }
.report-meta { margin-bottom: 1rem; }
.report-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.report-summary-text { font-size: 0.9rem; line-height: 1.7; color: var(--text-secondary); }

/* ===== TABLE WRAPPER ===== */
.table-wrapper {
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

/* ===== ALERT WARNING ===== */
.alert-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.25);
    color: #f59e0b;
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}
.alert-warning a { color: var(--primary); text-decoration: underline; }

/* ===== PROJECT SWITCHER ===== */
.project-switcher {
    padding: 0.65rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.project-switcher-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.project-switcher-select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
}
.project-switcher-select:focus { border-color: var(--primary); }

/* ===== DASHBOARD TWO-COL ===== */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.dash-empty-section {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== PRINT / PDF ===== */
.print-btn { }

@media print {
    .sidebar,
    .page-header,
    .print-btn,
    .back-link,
    .detail-header {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    body {
        background: #fff !important;
        color: #111 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .page-body {
        padding: 0 !important;
    }
    .report-detail {
        max-width: 100%;
    }
    .result-card {
        background: #fff !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    .result-card h4 {
        color: #333 !important;
    }
    .report-title {
        color: #111 !important;
        font-size: 1.5rem !important;
    }
    .report-summary-text {
        color: #333 !important;
    }
    .result-label {
        color: #666 !important;
    }
    .result-value {
        color: #111 !important;
    }
    .badge {
        border: 1px solid #ccc !important;
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    .recommendations-card {
        border-left-color: #6366f1 !important;
    }
    .rec-list li::before {
        color: #6366f1 !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    :root { --sidebar-w: 220px; }
    .page-body { padding: 1.5rem 1.5rem 2rem; }
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .main-content { margin-left: 0; }
    .app-layout { flex-direction: column; }
    .form-row { flex-direction: column; gap: 0; }
    .result-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .tool-cards { grid-template-columns: 1fr; }
    .score-section { flex-direction: column; text-align: center; }
    .page-body { padding: 1.25rem; }
    .info-bar { grid-template-columns: 1fr 1fr; }
    .analyzer-hero { padding: 1.25rem; }
    .dash-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .info-bar { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
