:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef2f7;
    --text: #172033;
    --muted: #5f6f86;
    --line: #d9e0ea;
    --brand: #1e4f8f;
    --brand-dark: #173c6e;
    --accent: #f5b942;
    --danger: #b42318;
    --success: #087443;
    --warning: #936800;
    --radius: 14px;
    --shadow: 0 14px 32px rgba(23, 32, 51, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner, .container, .footer-inner {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 52px;
    object-fit: contain;
}

.brand small {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a, .link-button {
    color: var(--text);
    font-weight: 650;
    padding: 8px 10px;
    border-radius: 10px;
}

.nav a:hover, .link-button:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.link-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.hero {
    background: linear-gradient(135deg, var(--brand), #18365d);
    color: #fff;
    padding: 72px 0;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    margin: 0 0 16px;
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.hero p {
    max-width: 760px;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.88);
}

.hero-actions, .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.button, button, input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 750;
    cursor: pointer;
    text-decoration: none;
    min-height: 42px;
}

.button:hover, button:hover, input[type="submit"]:hover {
    background: var(--brand-dark);
    color: #fff;
    text-decoration: none;
}

.button.secondary {
    background: var(--surface-2);
    color: var(--text);
}
.button.secondary:hover { background: #dfe6ef; }

.button.danger, button.danger { background: var(--danger); }
.button.success, button.success { background: var(--success); }

.container { padding: 34px 0 56px; }
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card, .panel, .install-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h2, .card h3, .panel h2, .panel h3 { margin-top: 0; }
.meta, .muted { color: var(--muted); font-size: 0.94rem; }

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 18px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}
.alert-success { border-color: #98d8b9; background: #eaf8f1; color: #064e31; }
.alert-danger { border-color: #f3a5a0; background: #fff0ef; color: var(--danger); }
.alert-warning { border-color: #f1d27a; background: #fff8df; color: var(--warning); }

form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: block; font-weight: 700; margin: 0 0 14px; }
label span { display: block; margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
textarea { min-height: 160px; resize: vertical; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; font-weight: 650; }
.checkbox-label input { width: auto; margin-top: 5px; }
.help { color: var(--muted); font-size: 0.9rem; margin-top: -6px; }

.logo-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}

.logo-preview img {
    max-width: 240px;
    max-height: 96px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.9rem; }

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.82rem;
    font-weight: 800;
}
.badge.pending { background: #fff8df; color: var(--warning); }
.badge.approved { background: #eaf8f1; color: var(--success); }
.badge.rejected, .badge.suspended { background: #fff0ef; color: var(--danger); }

.content-body p { margin: 0 0 1rem; }
.content-body ul, .content-body ol { margin-top: 0; }

.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-menu { position: sticky; top: 94px; }
.admin-menu a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 700; }
.admin-menu a:hover { background: var(--surface-2); text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { padding: 28px 0; color: var(--muted); }

.install-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.install-card { width: min(760px, 100%); }
.form-grid h2 { border-top: 1px solid var(--line); padding-top: 18px; }
.code-copy { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 360px; }


.tox-tinymce {
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
    box-shadow: none !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary {
    background: var(--surface-2) !important;
}

.tox .tox-statusbar {
    border-top-color: var(--line) !important;
}

.tox-fullscreen {
    z-index: 2000 !important;
}

.editor-fallback {
    min-height: 440px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.editor-load-warning {
    margin-bottom: 12px;
}

.content-body blockquote {
    margin-left: 0;
    padding-left: 16px;
    border-left: 4px solid var(--line);
    color: var(--muted);
}

.content-body pre {
    padding: 14px;
    overflow-x: auto;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1rem;
}

.content-body th,
.content-body td {
    border: 1px solid var(--line);
    padding: 10px;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.content-body figure {
    margin: 1.2rem 0;
}

.content-body figcaption {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
    text-align: center;
}

.content-body .lead {
    font-size: 1.15em;
    font-weight: 650;
}

.content-body .button-link {
    display: inline-block;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.content-body .button-link:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.content-body .small-text {
    font-size: 0.88em;
}

.content-body .text-left,
.content-body .align-left { text-align: left; }
.content-body .text-center,
.content-body .align-center { text-align: center; }
.content-body .text-right,
.content-body .align-right { text-align: right; }
.content-body .text-justify,
.content-body .align-justify { text-align: justify; }


.footer-inner p { margin: 0; }
.footer-inner p + p { margin-top: 6px; }
.copyright { font-weight: 750; color: var(--text); }

@media (max-width: 760px) {
    .header-inner { align-items: flex-start; flex-direction: column; padding: 16px 0; }
    .grid.two, .grid.three, form .row, .admin-layout { grid-template-columns: 1fr; }
    .admin-menu { position: static; }
    .hero { padding: 48px 0; }
}


.maintenance-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 42%, #e7edf6 100%);
}

.maintenance-card {
    width: min(720px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: clamp(28px, 5vw, 52px);
    box-shadow: var(--shadow);
    text-align: center;
}

.maintenance-card h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.eyebrow {
    color: var(--brand);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
    margin: 0 0 10px;
}

.maintenance-message {
    font-size: 1.08rem;
    color: var(--muted);
    margin: 0 auto 18px;
    max-width: 580px;
}

.lead {
    font-size: 1.12rem;
    color: var(--muted);
    max-width: 780px;
}

.home-card-editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 10px 0 22px;
}

.mini-fieldset {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: var(--surface-2);
}

.mini-fieldset legend {
    padding: 0 8px;
    font-weight: 800;
}

.resource-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 22px;
}

.badge-link {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
    font-weight: 800;
    font-size: 0.9rem;
}

.badge-link.active,
.badge-link:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    text-decoration: none;
}

.resource-card h2,
.resource-card h3 {
    margin-top: 6px;
}

.resource-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 8px;
}

.resource-meta span {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.read-more {
    font-weight: 800;
}

.resource-detail .button {
    margin-top: 8px;
}

.content-body table {
    margin: 1rem 0;
}

.content-body img {
    height: auto;
    max-width: 100%;
    border-radius: 12px;
}

@media (max-width: 900px) {
    .home-card-editor-grid {
        grid-template-columns: 1fr;
    }
}
