/* ============================================
   Easy Red 2 Wiki - Modern Military Theme
   Clean, sleek design - professional grey palette
   ============================================ */

:root {
    /* Modern dark palette - neutral greys */
    --color-bg-dark: #121212;
    --color-bg: #1a1a1a;
    --color-bg-card: #222222;
    --color-bg-card-hover: #2a2a2a;
    --color-bg-highlight: #303030;
    
    /* Accent colors */
    --color-accent: #c9302c;
    --color-accent-hover: #d9534f;
    --color-link: #a0a0a0;
    --color-link-hover: #d0d0d0;
    --color-success: #5cb85c;
    --color-warning: #d29922;
    --color-danger: #d9534f;
    
    /* Text colors */
    --color-text: #b0b0b0;
    --color-text-muted: #808080;
    --color-text-bright: #e8e8e8;
    
    /* Borders */
    --color-border: #383838;
    --color-border-light: #484848;
    --color-border-bright: #606060;
    
    /* Typography */
    --font-main: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    
    /* Effects */
    --shadow-sm: 0 1px 0 rgba(0,0,0,0.08);
    --shadow-md: 0 3px 6px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.3);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --container-width: 1280px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg-dark);
}

a { color: var(--color-link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--color-link-hover); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-bright);
    font-weight: 600;
    line-height: 1.3;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-bright);
    font-size: 1.125rem;
    font-weight: 700;
}

.logo:hover { color: var(--color-text-bright); text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.logo-img { height: 32px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 20px; }

.search-form { display: flex; position: relative; }

.search-input {
    width: 280px;
    padding: 8px 12px 8px 36px;
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder { color: var(--color-text-muted); }
.search-input:focus {
    outline: none;
    border-color: var(--color-link);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.search-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

.nav-links { display: flex; list-style: none; margin: 0; padding: 0; gap: 8px; align-items: center; }

.nav-links li { display: flex; align-items: center; }

.nav-links a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.nav-links a:hover {
    background: var(--color-bg-card);
    color: var(--color-text-bright);
    text-decoration: none;
}

.logout-form { display: flex; align-items: center; }
.logout-form button {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.logout-form button:hover { background: var(--color-bg-card); color: var(--color-text-bright); }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   Flash Messages
   ============================================ */
.flash-message {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.875rem;
}

.flash-success {
    background: rgba(63, 185, 80, 0.15);
    border-bottom: 1px solid rgba(63, 185, 80, 0.4);
    color: var(--color-success);
}

.flash-error {
    background: rgba(248, 81, 73, 0.15);
    border-bottom: 1px solid rgba(248, 81, 73, 0.4);
    color: var(--color-danger);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
    margin-left: auto;
}
.flash-close:hover { opacity: 1; }

/* ============================================
   Main Content
   ============================================ */
.site-main {
    min-height: calc(100vh - 180px);
    padding: 32px 0;
}

/* Hero */
.hero {
    text-align: center;
    padding: 32px 24px;
    margin-bottom: 32px;
}

.hero-logo {
    margin-bottom: 20px;
}

.hero-logo img {
    max-width: 400px;
    width: 100%;
    height: auto;
}

.hero h1 { margin: 0 0 8px; font-size: 2.25rem; }

.hero-tagline {
    margin: 0 0 16px;
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.hero-description {
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text);
    line-height: 1.7;
}

.hero-description p { margin: 0; }
.hero-description strong { color: var(--color-link); }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--color-border);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-bright);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Section Headers */
.categories-grid h2,
.recent-pages h2,
.browse-categories h2 {
    font-size: 1.25rem;
    margin: 0 0 20px;
}

.categories-grid { margin-bottom: 48px; }

/* Category Grid with Images */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Legacy grid for pages */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 180px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: var(--color-border-light);
    text-decoration: none;
}

.category-card.has-image {
    min-height: 200px;
}

.category-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}

.category-card:hover .category-card-bg {
    transform: scale(1.05);
}

.category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
}

.category-card-content {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.category-card.has-image .category-card-content {
    padding-top: 60px;
}

.category-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.category-card h3 { margin: 0 0 8px; font-size: 1.125rem; color: var(--color-text-bright); }
.category-card.has-image h3 { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.category-card p { margin: 0 0 12px; font-size: 0.875rem; color: var(--color-text-muted); }
.category-card.has-image p { color: rgba(255,255,255,0.8); }

.page-count {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.category-card.has-image .page-count { color: rgba(255,255,255,0.7); }

/* Category Header (full width image) */
.category-header {
    position: relative;
    padding: 40px 32px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    overflow: hidden;
}

.category-header.has-image {
    min-height: 260px;
    display: flex;
    align-items: flex-end;
}

.category-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.category-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.2) 100%);
}

.category-header-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.category-icon-large { font-size: 3rem; display: block; margin-bottom: 16px; }

.category-header h1 {
    margin: 0 0 12px;
    font-size: 2rem;
}

.category-header.has-image h1 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.category-description {
    margin: 0 0 16px;
    font-size: 1.0625rem;
    max-width: 600px;
}

.category-header.has-image .category-description {
    color: rgba(255,255,255,0.9);
}

.category-stats {
    display: flex;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.category-header.has-image .category-stats {
    color: rgba(255,255,255,0.7);
}

/* Subcategories Section */
.subcategories-section {
    margin-bottom: 40px;
}

.subcategories-section h2,
.category-pages h2 {
    font-size: 1.25rem;
    margin: 0 0 20px;
    color: var(--color-text-bright);
}

/* Page Grid */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.page-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.page-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.page-card-image {
    height: 160px;
    overflow: hidden;
}

.page-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.page-card:hover .page-card-image img {
    transform: scale(1.05);
}

.page-card-content {
    padding: 16px;
}

.page-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.page-card h3 a {
    color: var(--color-text-bright);
}

/* Page List */
.recent-pages { margin-bottom: 48px; }
.page-list { display: flex; flex-direction: column; gap: 12px; }

.page-item {
    display: flex;
    gap: 16px;
    background: var(--color-bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: border-color 0.15s;
}
.page-item:hover { border-color: var(--color-border-light); }

.page-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg-highlight);
}
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }

.page-info { flex: 1; min-width: 0; }
.page-category { font-size: 0.75rem; color: var(--color-link); font-weight: 500; }
.page-info h3 { margin: 4px 0 8px; font-size: 1rem; }
.page-info h3 a { color: var(--color-text-bright); }
.page-info h3 a:hover { color: var(--color-link); }
.page-info p { margin: 0; font-size: 0.875rem; color: var(--color-text-muted); }
.page-info time { font-size: 0.75rem; color: var(--color-text-muted); }

/* Page Grid */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.page-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: all 0.15s;
}
.page-card:hover { border-color: var(--color-border-light); transform: translateY(-2px); }

.page-card-image {
    height: 160px;
    overflow: hidden;
    background: var(--color-bg-highlight);
}
.page-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.page-card:hover .page-card-image img { transform: scale(1.05); }

.page-card-content { padding: 16px; }
.page-card-content h3 { margin: 0 0 8px; font-size: 1rem; }
.page-card-content h3 a { color: var(--color-text-bright); }
.page-card-content p { margin: 0; font-size: 0.8125rem; color: var(--color-text-muted); }

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-link); }

/* ============================================
   Wiki Page
   ============================================ */
.wiki-page {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.status-banner { padding: 10px 24px; font-size: 0.8125rem; font-weight: 500; }
.status-draft { background: var(--color-bg-highlight); color: var(--color-text-muted); }
.status-pending { background: rgba(210, 153, 34, 0.15); color: var(--color-warning); }

.page-header { padding: 24px; border-bottom: 1px solid var(--color-border); }

.featured-image {
    margin: -24px -24px 20px;
    max-height: 400px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--color-bg-highlight) 0%, var(--color-bg-card) 100%);
}
.featured-image img { width: 100%; height: 100%; object-fit: cover; }

.page-header h1 { margin: 0 0 12px; font-size: 1.75rem; }
.page-summary { font-size: 1rem; color: var(--color-text-muted); margin: 0 0 16px; line-height: 1.7; }
.page-meta { font-size: 0.8125rem; color: var(--color-text-muted); }

/* Table of Contents */
.table-of-contents {
    padding: 16px 24px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}
.table-of-contents h4 {
    margin: 0 0 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}
.table-of-contents ol { margin: 0; padding-left: 20px; }
.table-of-contents li { margin: 6px 0; }
.table-of-contents a { color: var(--color-text); font-size: 0.875rem; }
.table-of-contents a:hover { color: var(--color-link); }

/* Page Content */
.page-content { padding: 24px; }
.wiki-section { margin-bottom: 32px; }
.wiki-section:last-child { margin-bottom: 0; }
.wiki-section h2 {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.25rem;
}

.section-text { line-height: 1.8; }
.section-text p { margin: 0 0 16px; }
.section-text p:last-child { margin-bottom: 0; }
.section-text code {
    font-family: var(--font-mono);
    background: var(--color-bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
}
.section-text strong { color: var(--color-text-bright); }

/* Tables */
.wiki-table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.wiki-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.wiki-table th, .wiki-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.93em;
}
.wiki-table th { font-weight: 600; color: var(--color-text-bright); }
/* Header highlighting when wide-headers class is present (all tables with header rows) */
.wiki-table.wide-headers th { background: var(--color-bg); }
.wiki-table tr:last-child td { border-bottom: none; }
.wiki-table tr:hover td { background: var(--color-bg-highlight); }
/* Bold cells for 2-column tables (property names in first column) */
.wiki-table .bold-cell { font-weight: 600; color: var(--color-text-bright); }
/* Split-halves tables: balanced column widths with visual separator */
.wiki-table.split-halves { table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.wiki-table.split-halves th,
.wiki-table.split-halves td { width: 25%; }
/* Subtle visual separator between left and right halves */
.wiki-table.split-halves th:nth-child(3),
.wiki-table.split-halves td:nth-child(3) {
    border-left: 1px solid var(--color-border);
    padding-left: 12px;
}
.wiki-table.split-halves th:nth-child(2),
.wiki-table.split-halves td:nth-child(2) {
    padding-right: 12px;
}

/* Media */
.section-image, .section-video { margin: 20px 0; }
.section-image img { border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.section-image figcaption, .section-video figcaption {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-align: center;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Page Footer */
.page-footer {
    padding: 20px 24px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}
.page-actions { display: flex; gap: 12px; }
.page-actions-top { 
    position: absolute; 
    top: 16px; 
    right: 16px; 
    z-index: 10;
}
.wiki-page { position: relative; }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.page-info-footer { font-size: 0.8125rem; color: var(--color-text-muted); }
.page-info-footer p { margin: 4px 0; }
.page-info-footer strong { color: var(--color-text); }

/* ============================================
   Category Header (legacy - see main styles above)
   ============================================ */
.category-icon-large { font-size: 3rem; display: block; margin-bottom: 16px; }

/* ============================================
   Search
   ============================================ */
.search-header { text-align: center; margin-bottom: 32px; }
.search-form-large { display: flex; max-width: 560px; margin: 24px auto 0; }
.search-form-large input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--color-text);
}
.search-form-large input::placeholder { color: var(--color-text-muted); }
.search-form-large input:focus { outline: none; border-color: var(--color-link); }
.search-form-large button {
    padding: 14px 24px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}
.search-form-large button:hover { background: var(--color-accent-hover); }

.search-results { margin-bottom: 32px; }
.results-count { margin-bottom: 20px; color: var(--color-text-muted); }
.no-results {
    text-align: center;
    padding: 48px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.browse-categories { margin-top: 48px; }
.category-links { display: flex; flex-wrap: wrap; gap: 10px; }
.category-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.875rem;
    transition: all 0.15s;
}
.category-link:hover {
    text-decoration: none;
    border-color: var(--color-border-light);
    background: var(--color-bg-card-hover);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); }

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

.btn-success { background: var(--color-success); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-small { padding: 6px 12px; font-size: 0.8125rem; }
.btn-block { display: flex; width: 100%; }

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.875rem; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--color-text-muted); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-link);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}
.form-group textarea { resize: vertical; min-height: 120px; }

.field-error { display: block; color: var(--color-danger); font-size: 0.8125rem; margin-top: 6px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    margin-bottom: 8px;
    cursor: pointer;
}
.radio-group input[type="radio"] { width: auto; }

/* ============================================
   Proposal Form
   ============================================ */
.proposal-form {
    max-width: 720px;
    background: var(--color-bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}
.page-header-simple { margin-bottom: 32px; }
.page-header-simple h1 { margin: 0 0 8px; }
.page-header-simple p { color: var(--color-text-muted); margin: 0; }

.success-message {
    text-align: center;
    padding: 48px;
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.3);
    border-radius: var(--radius-lg);
}
.success-message h2 { color: var(--color-success); margin: 0 0 12px; }

.error-message {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--color-danger);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.table-headers-input, .table-row-input { display: flex; gap: 8px; margin-bottom: 8px; }
.table-headers-input input, .table-row-input input { flex: 1; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 48px 0 24px;
    margin-top: 64px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-section h4 { margin: 0 0 16px; font-size: 0.875rem; font-weight: 600; }
.footer-section ul { list-style: none; margin: 0; padding: 0; }
.footer-section li { margin: 8px 0; }
.footer-section a { color: var(--color-text-muted); font-size: 0.875rem; }
.footer-section a:hover { color: var(--color-link); }

.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--color-border); }
.footer-bottom p { margin: 4px 0; font-size: 0.8125rem; color: var(--color-text-muted); }
.footer-vat { font-size: 0.75rem !important; margin-top: 8px !important; opacity: 0.7; }

/* ============================================
   Empty State & Utilities
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}
.empty-state a { color: var(--color-link); }

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

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    background: var(--color-bg-highlight);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    html { font-size: 14px; }
    .main-nav { 
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg-card);
        border-bottom: 1px solid var(--color-border);
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        z-index: 1000;
    }
    .main-nav.active { display: flex; }
    .main-nav .nav-links { 
        flex-direction: column; 
        gap: 8px;
        width: 100%;
    }
    .main-nav .nav-links li { width: 100%; }
    .main-nav .nav-links a,
    .main-nav .nav-links button { 
        display: block;
        width: 100%;
        padding: 10px;
        text-align: left;
    }
    .main-nav .search-form { width: 100%; }
    .mobile-menu-toggle { display: block; }
    .header-content { position: relative; }
    .hero { padding: 32px 20px; }
    .hero h1 { font-size: 1.5rem; }
    .hero-logo img { max-width: 280px; }
    .hero-stats { gap: 24px; flex-wrap: wrap; }
    .hero-stat-value { font-size: 1.5rem; }
    .container { padding: 0 16px; }
    .page-header { padding: 20px; }
    .page-header h1 { font-size: 1.375rem; }
    .featured-image { margin: -20px -20px 16px; }
    .page-content { padding: 20px; }
    .page-footer { flex-direction: column; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .page-item { flex-direction: column; }
    .page-thumb { width: 100%; height: 140px; }
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-dark); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-border-light); }

::selection { background: rgba(88, 166, 255, 0.3); }
