/* =========================
   🎨 DESIGN TOKENS
========================= */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: #e5e7eb;

    --radius: 14px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* 🌙 Dark Mode */
.dark {
    --bg: #020617;
    --surface: #0f172a;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
}

/* GLOBAL */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* LAYOUT */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 20px;
}

/* NAVBAR */
header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid var(--border);
}

.dark header {
    background: rgba(2, 6, 23, 0.7);
}

.nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
}

.nav a {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.nav a:hover {
    color: var(--accent);
}

.nav img {
    width: 30px;
    display: block;
    margin: 0 auto 5px;
}

/* HERO */
.hero {
    text-align: center;
    padding: 60px 20px 30px;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 10px;
}

.hero p {
    color: var(--text-muted);
}

/* GRID */
.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* CARD */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.card h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* LINKS */
.links a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    color: var(--accent);
    margin: 8px 0;
    font-size: 14px;
}

.links a:hover {
    color: var(--accent-hover);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

footer a {
    margin: 0 10px;
    text-decoration: none;
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

footer a:hover {
    color: var(--accent);
}

.copy {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* DARK MODE BUTTON */
.toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* TOP BAR */
.topbar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.topbar h1 {
    margin: 0;
    font-size: 18px;
}

/* WIDER LAYOUT */
.container.wide {
    max-width: 1400px;
}

/* CONTROLS BAR */
.controls-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* TABLE IMPROVEMENTS */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    cursor: pointer;
    user-select: none;
    background: var(--surface);
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

/* COLUMN FILTERS */
.column-filters input {
    width: 100%;
    padding: 6px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* HOVER */
tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* HEADER */
.topbar {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

/* CONTROLS */
.controls-bar {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

/* TABLE CARD */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

/* STICKY HEADER */
thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
}

button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.column-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    margin-top: 8px;
}