:root {
    --bg: #f7f8fb;
    --panel: #ffffff;
    --text: #162033;
    --muted: #667085;
    --line: #d9dee8;
    --brand: #1f6feb;
    --brand-strong: #174ea6;
    --ok: #0b7a55;
    --warn: #9a6700;
    --danger: #b42318;
    --radius: 8px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: #10233f; color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { color: #fff; font-weight: 750; font-size: 20px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { color: #fff; padding: 10px 12px; border-radius: 6px; }
.nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.hero { background: #dfeafb; border-bottom: 1px solid var(--line); }
.hero-inner { padding: 56px 0; }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 54px); line-height: 1.08; letter-spacing: 0; }
.hero p { margin: 0; max-width: 720px; color: #344054; font-size: 18px; }
.section { padding: 32px 0; }
.section h2 { margin: 0 0 16px; font-size: 26px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.bootstrap-card { padding: 0; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card h2 { font-size: 22px; }
.meta { color: var(--muted); font-size: 14px; }
.eyebrow { margin: 0 0 6px; color: var(--brand-strong); font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 32px; line-height: 1.15; }
.page-subtitle { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
.public-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 86px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.metric span { display: block; color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 6px; font-size: 28px; line-height: 1; }
.metric .metric-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 8px; background: #eef4ff; color: var(--brand); font-size: 22px; line-height: 1; }
.list-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); background: #fbfcff; }
.list-tools input { max-width: 380px; }
.list-sentinel { min-height: 1px; }
.list-status { margin: 12px 14px 14px; }
.table-scroll { width: 100%; overflow-x: auto; }
.admin-form-card { margin-bottom: 18px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-sidebar { position: sticky; top: 18px; }
.form-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.form-section-head h2 { margin: 0 0 4px; font-size: 22px; }
.form-section-head p { margin: 0; }
.form-grid.wide { max-width: none; }
.textarea-small { min-height: 96px !important; }
.textarea-large { min-height: 320px !important; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.form-actions.stacked { align-items: stretch; flex-direction: column; margin-top: 16px; }
.hint-box { padding: 12px; border: 1px dashed var(--line); border-radius: 6px; background: #fbfcff; color: var(--muted); font-size: 14px; }
.check-row { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px !important; font-weight: 650; }
.check-row input { width: auto !important; min-height: 0 !important; }
.content-card { display: flex; flex-direction: column; gap: 8px; }
.content-card h2 { margin: 0; }
.read-more { margin-top: auto; font-weight: 650; }
.rich-content { line-height: 1.65; }
.rich-content p, .rich-content ul, .rich-content ol, .rich-content blockquote { margin: 0 0 14px; }
.rich-content ul, .rich-content ol { padding-left: 24px; }
.rich-content blockquote { padding: 10px 14px; border-left: 3px solid var(--brand); background: #f6f8fc; color: #344054; }
.rich-content h2, .rich-content h3, .rich-content h4 { margin: 18px 0 10px; }
.document-stack { display: grid; gap: 10px; }
.document-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcff; }
.document-row p { margin: 4px 0 0; }
.document-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.media-file { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.media-thumb { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; background: #f1f4f9; }
.media-thumb-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--brand); font-size: 24px; line-height: 1; }
.media-preview-frame { min-height: 360px; display: flex; align-items: center; justify-content: center; background: #f7f8fb; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.media-preview-image { display: block; max-width: 100%; max-height: min(70vh, 760px); object-fit: contain; }
.media-preview-pdf { width: 100%; height: min(72vh, 760px); border: 0; background: #fff; }
.media-preview-empty { width: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.media-preview-empty .mdi { color: var(--brand); font-size: 42px; line-height: 1; }
.media-preview-empty p { margin: 0; }
.empty-state { padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; color: var(--muted); }
.empty-state.small { padding: 12px; }
.compact { min-height: 32px; padding: 5px 10px; font-size: 14px; }
.button, button:not(.btn):not(.btn-close), input[type=submit]:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 6px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.button.secondary { background: #fff; color: var(--brand); }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button .mdi, button:not(.btn):not(.btn-close) .mdi, .admin-icon-button .mdi { flex: 0 0 auto; width: 1.15em; font-size: 1.15em; line-height: 1; text-align: center; }
.rich-editor .rich-editor-toolbar button { min-height: 32px; width: 34px; padding: 0; border: 1px solid var(--line); background: #fff; color: var(--text); }
.rich-editor .rich-editor-toolbar button:hover { border-color: var(--brand); color: var(--brand); }
.rich-editor .rich-editor-toolbar select { width: auto; min-height: 32px; padding: 4px 8px; }
.form-grid { display: grid; gap: 14px; max-width: 760px; }
label:not(.form-label):not(.form-check-label) { display: grid; gap: 6px; font-weight: 650; }
input:not(.form-control):not(.form-check-input), textarea:not(.form-control), select:not(.form-select) {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 11px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
textarea:not(.form-control) { min-height: 130px; resize: vertical; }
.rich-editor-source { display: none !important; }
.rich-editor { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.rich-editor-toolbar button, .rich-editor-toolbar select { min-height: 32px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text); }
.rich-editor-toolbar button { width: 34px; padding: 0; }
.rich-editor-toolbar select { width: auto; padding: 4px 8px; font: inherit; }
.rich-editor-toolbar button:hover { border-color: var(--brand); color: var(--brand); }
.rich-editor-area { min-height: 320px; padding: 12px 14px; outline: none; line-height: 1.6; }
.rich-editor-area:focus { box-shadow: inset 0 0 0 2px rgba(31,111,235,.18); }
.rich-editor-area h2, .rich-editor-area h3, .rich-editor-area p { margin: 0 0 12px; }
.rich-editor-area ul, .rich-editor-area ol { margin: 0 0 12px 22px; padding: 0; }
table:not(.table) { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
table:not(.table) th, table:not(.table) td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table:not(.table) th { background: #f1f4f9; }
tr[hidden], .accordion-item[hidden] { display: none !important; }
.status { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 13px; background: #eef4ff; color: #174ea6; }
.status.ok { background: #e7f6ef; color: var(--ok); }
.status.warn { background: #fff4d6; color: var(--warn); }
.layout, .admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar, .admin-sidebar { background: #10233f; color: #fff; padding: 20px; }
.sidebar a, .admin-sidebar .nav-link { display: block; color: #fff; padding: 9px 10px; border-radius: 6px; }
.sidebar a:hover, .admin-sidebar .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.admin-sidebar .nav-link.active { background: #1f6feb; }
.admin-sidebar .nav-link { display: flex; align-items: center; gap: 9px; }
.admin-sidebar .nav-link .mdi { flex: 0 0 20px; width: 20px; font-size: 19px; line-height: 1; text-align: center; opacity: .9; }
.admin-sidebar .nav-link.active .mdi { opacity: 1; }
.admin-icon-button { display: inline-flex; align-items: center; gap: 6px; }
.main, .admin-main { padding: 24px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.alert:not(.alert-primary):not(.alert-secondary):not(.alert-success):not(.alert-danger):not(.alert-warning):not(.alert-info):not(.alert-light):not(.alert-dark) { padding: 12px 14px; border-radius: 6px; background: #fff4d6; border: 1px solid #f2cc60; margin-bottom: 16px; }
.footer { padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); background: #fff; }

@media (max-width: 800px) {
    .topbar-inner, .toolbar, .page-head, .list-tools, .document-row, .document-actions, .form-actions { align-items: flex-start; flex-direction: column; }
    .grid-3 { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: 1fr; }
    .list-tools input { max-width: none; }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-sidebar { position: static; }
    .layout, .admin-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .main { padding: 16px; }
}
