
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #f5f6fa;
    color: #1e293b;
}

#app {
    display: flex;
    min-height: 100vh;
}

#app[v-cloak] {
    display: grid;
    place-items: center;
}

#app[v-cloak] > :not(#boot-message) {
    display: none;
}

#boot-message {
    margin: 0;
    padding: 24px;
    color: #475569;
    font-weight: 600;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 24px 16px;
    background: #172033;
    color: white;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 32px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar a {
    display: block;
    padding: 12px 16px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
}

.sidebar .nav-button {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: #cbd5e1;
    text-align: left;
}

.sidebar .nav-button:hover {
    background: #293750;
    color: white;
}

.sidebar a:hover {
    background: #293750;
    color: white;
}

.sidebar a.router-link-active {
    background: #2563eb;
    color: white;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 40px;
}

.content h1 {
    margin-top: 0;
}

.content-card, .markdown-content, .table-wrap {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    margin: 20px 0;
}

.content-card h2 { margin-top: 0; }
.content-card a { color: #1d4ed8; }
.lead { color: #64748b; font-size: 1.15rem; }
.markdown-content { line-height: 1.7; overflow-wrap: anywhere; }
.markdown-content img { max-width: 100%; height: auto; }
.markdown-content pre { overflow-x: auto; padding: 16px; background: #172033; color: #f8fafc; border-radius: 8px; }
.markdown-content blockquote { border-left: 4px solid #cbd5e1; margin-left: 0; padding-left: 16px; color: #475569; }
.editor { min-height: 260px; font-family: ui-monospace, monospace; }
.preview { min-height: 120px; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid #e2e8f0; }
.slug { display: block; color: #64748b; margin-top: 4px; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.card-form {
    background: white;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.field-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

button {
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover {
    background: #1d4ed8;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
.form-control:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
}

.btn-secondary {
    background: #64748b;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: #ef4444;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.loading, .empty-state {
    padding: 32px;
    text-align: center;
    color: #64748b;
    background: white;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
}

.hero { padding: clamp(32px, 7vw, 88px); color: #f8fafc; background: linear-gradient(130deg, #172033, #1d4ed8); border-radius: 18px; }
.hero h1 { max-width: 820px; margin: 12px 0; font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.04; letter-spacing: -.04em; }
.hero .lead { max-width: 700px; color: #dbeafe; font-size: 1.25rem; }
.eyebrow { color: #2563eb; font-size: .76rem; font-weight: 800; letter-spacing: .12em; }
.hero .eyebrow { color: #bfdbfe; }
.home-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.home-toc a { padding: 8px 12px; border: 1px solid #bfdbfe; border-radius: 7px; color: #fff; text-decoration: none; }
.home-toc a:hover { background: #293750; }
.home-page section { scroll-margin-top: 24px; }
.content-card pre { overflow-x: auto; padding: 18px; color: #f8fafc; background: #172033; border-radius: 8px; }
.auth-page { max-width: 540px; margin: 30px auto; }
.auth-page h1 { margin-top: 8px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.auth-links a { color: #1d4ed8; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 20px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: .9rem; }
.site-footer a { color: #1d4ed8; }

@media (max-width: 640px) {
    #app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar a { padding: 8px 10px; }

    .content {
        padding: 24px;
    }

    .site-footer { align-items: flex-start; flex-direction: column; }
}
