:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --border: #334155;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem;
}

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

header {
    margin-bottom: 3rem;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.accent {
    color: var(--accent);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

#last-updated {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

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

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

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

.value-small {
    font-size: 1.25rem;
    color: var(--text-primary);
}

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

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

.chart-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.chart-card canvas {
    max-height: 300px;
    width: 100% !important;
}

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

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

.card-header-actions h3 {
    margin-bottom: 0;
}

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

.filter-select,
.filter-input {
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--accent);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Firefox */
}

.tabs::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    /* Prevent text wrapping */
    flex-shrink: 0;
    /* Prevent shrinking */
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.action-btn.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    /* Changed from var(--border-color) to var(--border) */
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    color: var(--text-primary);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.topic-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-cell {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.8rem;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-failure {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-neutral {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.status-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.links-stack {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.phase-atelier {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.phase-pr {
    background-color: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.phase-merged {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.phase-archived {
    background-color: rgba(107, 114, 128, 0.2);
    color: #d1d5db;
}

/* Links */
a {
    color: var(--accent);
    /* Changed from var(--primary-color) to var(--accent) */
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #818cf8;
    text-decoration: underline;
}

.phase-conception {
    background-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.phase-development {
    background-color: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.verdict-approve {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.verdict-reject {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.verdict-safe-for-auto {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.verdict-warn {
    background-color: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

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

    body {
        padding: 1rem;
    }
}

/* Model Table Styles */
.model-name {
    font-weight: 600;
    color: var(--text-primary);
}

.model-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    max-width: 300px;
    line-height: 1.4;
}

.capabilities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.simple-table th {
    text-align: left;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.simple-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.simple-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

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