:root {
    --primary: #3b82f6;
    --bg: #1e293b;
    --sidebar-bg: #0f172a;
    --card-bg: #334155;
    --text: #f1f5f9;
    --subtext: #94a3b8;
    --sidebar-width: 260px;
}

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

/* --- Sidebar (Mobile First) --- */
.sidebar {
    width: 100%;
    background: var(--sidebar-bg);
    color: white;
    padding: 20px;
    border-bottom: 1px solid #334155;
    box-sizing: border-box;
    z-index: 100;
}

.sidebar-title {
    font-weight: bold; 
    font-size: 1.2rem; 
    margin-bottom: 15px;
}

.sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--subtext);
    margin: 10px 0;
}

.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.archive-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    background: #1e293b;
    white-space: nowrap;
    transition: background 0.2s;
}

.archive-link:hover {
    background: #334155;
    color: white;
}

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

header h3 {
    margin: 0 0 25px 0;
    font-size: 1.1rem;
    color: var(--subtext);
    font-weight: 500;
}

.search-wrapper { margin-bottom: 30px; }

#searchInput {
    width: 100%;
    max-width: 500px;
    padding: 12px 18px;
    background: var(--sidebar-bg);
    border: 1px solid #475569;
    border-radius: 10px;
    outline: none;
    color: white;
    box-sizing: border-box;
}

#searchInput::placeholder { color: #64748b; }

/* --- Grid & Cards --- */
.doc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.doc-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #475569;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.doc-card:hover { 
    transform: translateY(-3px); 
    border-color: var(--primary);
    background: #3e4e63;
}

.card-hidden { display: none !important; }
.category { font-size: 0.7rem; font-weight: 700; color: var(--primary); text-transform: uppercase; margin-bottom: 8px; }
.doc-card h2 { font-size: 1.1rem; margin: 0 0 10px 0; color: #ffffff; }
.doc-card p { font-size: 0.9rem; color: var(--subtext); flex-grow: 1; margin: 0; }

/* --- Pagination --- */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #475569;
    background: var(--sidebar-bg);
    color: white;
    cursor: pointer;
    border-radius: 6px;
}

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

/* --- Desktop View (768px+) --- */
@media (min-width: 768px) {
    body { flex-direction: row; }
    .sidebar {
        width: var(--sidebar-width);
        position: fixed;
        height: 100vh;
        border-right: 1px solid #334155;
        border-bottom: none;
        padding: 30px 20px;
    }
    .archive-list { flex-direction: column; overflow-x: visible; }
    .archive-link { background: transparent; }
    .sidebar-title { margin-bottom: 40px; }
    .main-content { margin-left: var(--sidebar-width); padding: 40px; }
    .doc-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
}