/* static/style.css */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #475569;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.nav-brand a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

.user-info {
    color: var(--primary);
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success { background: rgba(34, 197, 94, 0.2); border: 1px solid var(--success); }
.alert-error { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--error); }
.alert-info { background: rgba(59, 130, 246, 0.2); border: 1px solid var(--info); }
.alert-warning { background: rgba(245, 158, 11, 0.2); border: 1px solid var(--warning); }

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
}

/* Auth */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox input {
    width: auto;
}

.form-group.checkbox label {
    margin: 0;
    font-weight: normal;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
}

/* Dashboard */
.dashboard h1 {
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-card ul {
    list-style: none;
}

.dashboard-card li {
    padding: 0.5rem 0;
    color: var(--text-muted);
}

.dashboard-card li strong {
    color: var(--text);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* SQL Console */
.sql-console h1 {
    margin-bottom: 1.5rem;
}

.console-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
}

.table-sidebar {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.table-sidebar h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.table-info {
    margin-bottom: 1.5rem;
}

.table-info h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.table-info ul {
    list-style: none;
}

.table-info li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-info code {
    background: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.col-type {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: bold;
}

.badge.pk {
    background: var(--warning);
    color: black;
}

.console-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sql-form {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.sql-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 150px;
}

.sql-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.example-queries {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.example-queries h4 {
    margin-bottom: 1rem;
}

.query-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

.results {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.results h3 {
    margin-bottom: 1rem;
}

.table-wrapper {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.results-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--primary);
}

.results-table tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.no-results {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .console-layout {
        grid-template-columns: 1fr;
    }

    .table-sidebar {
        position: static;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Organisations Grid */
.organisations-grid, .prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.org-card, .prompt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.org-card:hover, .prompt-card:hover {
    border-color: var(--primary);
}

.org-header, .prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.org-header h3, .prompt-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.org-slug, .prompt-org {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.org-description, .prompt-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.org-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.org-meta, .prompt-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.org-actions, .prompt-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Badges */
.badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.category-badge {
    display: inline-block;
    background: var(--bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.version-badge {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Tags */
.prompt-tags, .tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: var(--bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Filters */
.filters-bar {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filters-form select {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

/* Prompt Detail */
.prompt-detail {
    max-width: 900px;
}

.back-link {
    margin-bottom: 1.5rem;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
}

.back-link a:hover {
    color: var(--primary);
}

.prompt-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.prompt-detail-header h1 {
    margin-bottom: 0.5rem;
}

.prompt-org-link {
    color: var(--text-muted);
}

.header-badges {
    display: flex;
    gap: 0.5rem;
}

.detail-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--primary);
}

.prompt-content {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.detail-card h4 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detail-card ul {
    list-style: none;
}

.detail-card li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.detail-card code {
    background: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

/* API Docs Card */
.api-docs-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.api-docs-card h3 {
    margin-bottom: 1rem;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.endpoint:last-child {
    border-bottom: none;
}

.endpoint code {
    background: var(--bg);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: var(--success);
}

.endpoint span {
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

/* Small Button */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Analytics Dashboard Styles */

.analytics-dashboard {
    max-width: 1600px;
    margin: 0 auto;
}

.analytics-dashboard .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.header-content h1 {
    margin-bottom: 0.25rem;
}

.header-content p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.time-filter {
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-icon {
    font-size: 2rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.metric-max {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
}

.metric-name {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
}

.metric-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.metric-change.up {
    color: var(--success);
}

.metric-change.down {
    color: var(--error);
}

.metric-progress {
    margin-top: auto;
}

.progress-bar {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Chart Cards */
.charts-row {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.charts-row.two-col {
    grid-template-columns: repeat(2, 1fr);
}

.charts-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
    .charts-row.three-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .charts-row.two-col,
    .charts-row.three-col {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-card.large {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.chart-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
}

.chart-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.chart-summary {
    text-align: right;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.summary-change {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.summary-change.up {
    color: var(--success);
}

.summary-change.down {
    color: var(--error);
}

.summary-note {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-container {
    height: 300px;
    position: relative;
}

.chart-container.doughnut {
    height: 280px;
}

/* Sentiment Chart */
.sentiment-chart {
    padding: 1rem 0;
}

.sentiment-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.sentiment-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s;
}

.sentiment-segment:hover {
    filter: brightness(1.1);
}

.sentiment-segment.positive {
    background: var(--success);
}

.sentiment-segment.neutral {
    background: var(--warning);
}

.sentiment-segment.negative {
    background: var(--error);
}

.sentiment-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.positive {
    background: var(--success);
}

.legend-color.neutral {
    background: var(--warning);
}

.legend-color.negative {
    background: var(--error);
}

/* Actions Section */
.actions-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0 0 0.25rem 0;
}

.section-header p {
    color: var(--text-muted);
    margin: 0;
}

.action-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Action Cards */
.actions-list {
    display: grid;
    gap: 1rem;
}

.action-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

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

.action-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.action-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.action-priority.high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.action-priority.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.action-priority.low {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.action-category {
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.action-status {
    margin-left: auto;
    font-size: 0.875rem;
    font-weight: 500;
}

.action-status.completed {
    color: var(--success);
}

.action-status.in_progress {
    color: var(--info);
}

.action-status.pending {
    color: var(--text-muted);
}

.action-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.action-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.action-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.meta-value.highlight {
    color: var(--success);
}

.meta-value.impact-high,
.meta-value.impact-very-high {
    color: var(--error);
}

.meta-value.impact-medium {
    color: var(--warning);
}

/* Action Steps */
.action-steps {
    margin-bottom: 1rem;
}

.steps-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: none;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.steps-toggle:hover {
    background: var(--border);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.steps-list {
    margin: 0.75rem 0 0 0;
    padding-left: 1.5rem;
}

.steps-list li {
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.steps-list li::marker {
    color: var(--primary);
}

.action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assigned-to {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 2rem;
    }

    .action-meta {
        gap: 1rem;
    }

    .meta-item {
        min-width: 45%;
    }

    .chart-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .chart-summary {
        text-align: left;
    }
}

/* Header with actions */
.header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

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

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

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

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

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-card.success .stat-value {
    color: var(--success);
}

.stat-card.error .stat-value {
    color: var(--error);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Data Table */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.data-table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.data-table a {
    color: var(--primary);
    text-decoration: none;
}

.empty-row {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem !important;
}

/* Status & Type Badges */
.status-badge, .type-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.status-badge.running {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.type-badge.scheduled {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.type-badge.manual {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.type-badge.api {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.detail-grid-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    padding: 0.5rem 0;
}

.detail-item strong {
    color: var(--text-muted);
    font-weight: 500;
}

.code-block {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Consolas', monospace;
    font-size: 0.875rem;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.modal-body h4 {
    margin: 1rem 0 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============== Citations Page Styles ============== */

/* Top Domains Section */
.top-domains-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.top-domains-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.domains-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.domain-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.domain-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.domain-name {
    color: var(--text);
    font-weight: 500;
}

.domain-count {
    color: var(--text-muted);
}

.domain-bar {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.domain-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Domain Badge */
.domain-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary);
    font-family: 'Consolas', monospace;
}

/* Citation Link */
.citation-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.citation-link:hover {
    color: var(--primary);
}

/* Title Cell */
.title-cell {
    max-width: 300px;
}

/* Confidence Bar */
.confidence-bar {
    position: relative;
    height: 20px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
    min-width: 80px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #22d3ee);
    border-radius: 10px;
}

.confidence-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text);
}

/* Execution Link */
.execution-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Consolas', monospace;
    font-size: 0.875rem;
}

.execution-link:hover {
    color: var(--primary);
}

/* Citation Detail View */
.citation-detail-view {
    display: grid;
    gap: 1rem;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-row label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-row.full-width {
    grid-column: 1 / -1;
}

.snippet-text {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.modal-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* ============== AI Models Page Styles ============== */

/* Add Model Section */
.add-model-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.add-model-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.add-model-form .form-row {
    display: flex;
    gap: 0.75rem;
}

.add-model-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.add-model-form input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.model-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

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

.model-card.inactive {
    opacity: 0.6;
}

.model-card.inactive:hover {
    opacity: 1;
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.model-icon {
    font-size: 2rem;
}

.model-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.active {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.inactive {
    background: var(--text-muted);
}

.model-name {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-family: 'Consolas', monospace;
    word-break: break-all;
}

.model-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.model-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.model-stat .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.model-stat .stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

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

.inline-form {
    display: inline;
}

/* Button Variants */
.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Capabilities Section */
.capabilities-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.capabilities-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.capabilities-table {
    overflow-x: auto;
}

.capabilities-table code {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Stats Card Variants */
.stat-card.success .stat-value {
    color: var(--success);
}

.stat-card.warning .stat-value {
    color: var(--warning);
}

/* Text Muted */
.text-muted {
    color: var(--text-muted);
}

/* Empty State Enhancement */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .add-model-form .form-row {
        flex-direction: column;
    }

    .model-stats {
        grid-template-columns: 1fr;
    }

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

/* ============== Analytics Page Styles ============== */

.analytics-page {
    max-width: 1400px;
}

/* Controls */
.analytics-controls {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.controls-form {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.control-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.control-group select {
    padding: 0.625rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    min-width: 200px;
}

/* GEO Score Hero */
.geo-score-hero {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(99, 102, 241, 0.1) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
}

.geo-score-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.geo-score-circle {
    position: relative;
    width: 180px;
    height: 180px;
}

.geo-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.geo-score-circle .score-bg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 8;
}

.geo-score-circle .score-fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.score-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.score-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.geo-grade {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
}

.geo-grade.grade-a { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.geo-grade.grade-b { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.geo-grade.grade-c { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.geo-grade.grade-d { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.geo-grade.grade-f { background: rgba(239, 68, 68, 0.3); color: #ef4444; }

.geo-score-info {
    flex: 1;
}

.geo-score-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
}

.score-change {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.score-change.positive { color: var(--success); }
.score-change.negative { color: var(--error); }

.quick-stats {
    display: flex;
    gap: 2rem;
}

.quick-stat {
    display: flex;
    flex-direction: column;
}

.quick-stat .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.quick-stat .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Score Components */
.score-components {
    margin-bottom: 1.5rem;
}

.score-components h3 {
    margin-bottom: 1rem;
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.component-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.component-name {
    font-weight: 500;
}

.component-weight {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.component-score {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.score-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-text {
    font-weight: 600;
    min-width: 36px;
}

.component-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.component-detail {
    font-size: 0.75rem;
    color: var(--primary);
    margin: 0.5rem 0 0 0;
}

/* Charts Section */
.charts-section {
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-card.large {
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    margin: 0;
    font-size: 1rem;
}

.chart-container {
    height: 300px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Model Metrics */
.model-metrics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.model-metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.model-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.model-executions {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.model-rates {
    display: flex;
    gap: 1rem;
}

.rate-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rate-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.rate-value {
    font-weight: 600;
    color: var(--primary);
}

/* Competitor Comparison */
.win-rate {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 500;
}

.competitor-comparison-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.competitor-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
}

.competitor-item.yours {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
}

.competitor-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.competitor-icon {
    font-size: 1rem;
}

.competitor-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.competitor-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.competitor-badge.you {
    background: var(--primary);
    color: white;
}

.competitor-rate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rate-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.rate-bar.yours {
    background: var(--primary);
}

.rate-bar.competitor {
    background: var(--text-muted);
}

.competitor-item.winning .rate-bar.competitor {
    background: var(--success);
}

.competitor-item.losing .rate-bar.competitor {
    background: var(--error);
}

/* Metrics Table */
.metrics-table-section {
    margin-bottom: 1.5rem;
}

.metrics-table-section h3 {
    margin-bottom: 1rem;
}

.status-winning {
    color: var(--success);
    font-weight: 600;
}

.status-losing {
    color: var(--error);
    font-weight: 600;
}

.status-tied {
    color: var(--text-muted);
}

/* Empty State */
.empty-state.large {
    padding: 6rem 2rem;
}

.empty-state.large h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-data {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .geo-score-hero {
        flex-direction: column;
        text-align: center;
    }

    .quick-stats {
        justify-content: center;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .geo-score-circle {
        width: 140px;
        height: 140px;
    }

    .score-value {
        font-size: 2.5rem;
    }

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

/* ─── Sentiment badges ──────────────────────────── */
.sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.sentiment-badge.positive {
    background: #d4edda;
    color: #155724;
}

.sentiment-badge.neutral {
    background: #fff3cd;
    color: #856404;
}

.sentiment-badge.negative {
    background: #f8d7da;
    color: #721c24;
}

.sentiment-badge.pending {
    background: #e2e3e5;
    color: #6c757d;
}

/* ─── Score display ─────────────────────────────── */
.score-value {
    font-weight: 700;
    font-family: monospace;
    font-size: 0.9rem;
}

.score-value.positive { color: #28a745; }
.score-value.neutral  { color: #ffc107; }
.score-value.negative  { color: #dc3545; }
.score-value.pending   { color: #adb5bd; }

/* ─── Mention count pill ────────────────────────── */
.mention-count {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ─── Entity type badges ────────────────────────── */
.type-badge.organisation {
    background: #cce5ff;
    color: #004085;
}

.type-badge.competitor {
    background: #f5c6cb;
    color: #721c24;
}

/* ─── Action button row ─────────────────────────── */
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

/* ─── Progress bar ──────────────────────────────── */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-bar {
    height: 100%;
    background: var(--primary, #007bff);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ─── Larger modal variant ──────────────────────── */
.modal-lg {
    max-width: 900px;
    width: 90%;
}

/* ─── Error text ────────────────────────────────── */
.error-text {
    color: #dc3545;
}

/* ─── Form helpers for batch modal ──────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}
/* ─── Priority badges ───────────────────────────── */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.priority-badge.critical { background: #f8d7da; color: #721c24; }
.priority-badge.high     { background: #ffe0b2; color: #e65100; }
.priority-badge.medium   { background: #fff3cd; color: #856404; }
.priority-badge.low      { background: #d4edda; color: #155724; }

/* ─── Category badges ───────────────────────────── */
.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: #e9ecef;
    color: #495057;
}

.category-badge.schema          { background: #d1ecf1; color: #0c5460; }
.category-badge.content         { background: #d4edda; color: #155724; }
.category-badge.technical_seo   { background: #cce5ff; color: #004085; }
.category-badge.writing_style   { background: #e2d5f1; color: #4a1a7a; }
.category-badge.structured_data { background: #fff3cd; color: #856404; }
.category-badge.link_building   { background: #ffe0b2; color: #e65100; }
.category-badge.brand_mention   { background: #f8d7da; color: #721c24; }

/* ─── Effort & impact badges ────────────────────── */
.effort-badge, .impact-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.effort-badge.small  { background: #d4edda; color: #155724; }
.effort-badge.medium { background: #fff3cd; color: #856404; }
.effort-badge.large  { background: #f8d7da; color: #721c24; }

.impact-badge.high   { background: #d4edda; color: #155724; }
.impact-badge.medium { background: #fff3cd; color: #856404; }
.impact-badge.low    { background: #e9ecef; color: #6c757d; }

/* ─── Inline status select ──────────────────────── */
.status-select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
}

.status-select.todo        { border-color: #6c757d; color: #6c757d; }
.status-select.in_progress { border-color: #007bff; color: #007bff; background: #e7f1ff; }
.status-select.in_review   { border-color: #ffc107; color: #856404; background: #fff9e6; }
.status-select.completed   { border-color: #28a745; color: #155724; background: #d4edda; }
.status-select.dismissed   { border-color: #adb5bd; color: #6c757d; background: #f8f9fa; }

/* ─── Row states ────────────────────────────────── */
.completed-row { opacity: 0.6; }
.dismissed-row { opacity: 0.5; }
.overdue-row   { border-left: 3px solid #dc3545; }
.overdue-text  { color: #dc3545; font-weight: 600; }

/* ─── Form rows (multi-column) ──────────────────── */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* ─── Danger button ─────────────────────────────── */
.btn-danger {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.btn-danger:hover { background: #c82333; }

/* ─── Text muted ────────────────────────────────── */
.text-muted { color: #6c757d; }

/* ─── Section header (for analytics partial) ────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.analytics-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}