:root { color-scheme: light; --ink: #172a2a; --muted: #718180; --line: #e1e9e6; --paper: #fff; --canvas: #f5f8f6; --accent: #087e78; --accent-soft: #e4f3ef; }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Aptos", "Segoe UI", sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
.manage-header { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 6vw; border-bottom: 1px solid var(--line); background: var(--paper); }
.manage-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 6px; color: white; background: var(--accent); }
.back-link { color: var(--muted); font-size: 13px; }
.manage-main { width: min(100% - 36px, 1040px); margin: 42px auto 80px; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading { margin-bottom: 25px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: 32px; letter-spacing: 0; }
h2 { margin: 0; font-size: 19px; }
.entry-total { padding: 7px 10px; border-radius: 3px; color: #42635d; background: var(--accent-soft); font-size: 12px; }
.editor-section, .entries-section { padding: 25px 28px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.entries-section { margin-top: 22px; }
.procedure-editor { margin-top: 28px; border-color: #c9ded7; border-top: 4px solid var(--accent); background: #f5faf8; box-shadow: 0 8px 24px #173a3210; }
.procedure-editor .section-heading { padding-bottom: 17px; border-bottom: 1px solid #dce9e4; }
.section-heading { margin-bottom: 22px; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.cancel-link { color: var(--accent); font-size: 12px; font-weight: 700; }
.entry-form { display: grid; gap: 9px; }
.entry-form label { margin-top: 8px; font-size: 12px; font-weight: 750; }
.entry-form input, .entry-form select, .entry-form textarea { width: 100%; min-height: 41px; padding: 10px 11px; border: 1px solid #d7e1dd; border-radius: 4px; outline: none; color: var(--ink); background: #fff; font: inherit; }
.entry-form textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.entry-form input:focus, .entry-form select:focus, .entry-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #087e781a; }
.entry-form input::placeholder, .entry-form textarea::placeholder { color: #96a29e; }
.editor-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.editor-label-row label { margin: 0; }
.editor-label-row span, .preview-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.preview-wrap { margin-top: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: #f8faf9; }
.preview-label { margin: 0 0 10px; }
.markdown-preview { min-height: 40px; color: #405552; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.markdown-preview > :first-child { margin-top: 0; }
.markdown-preview > :last-child { margin-bottom: 0; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: 1em 0 .4em; font-size: 16px; }
.markdown-preview p { margin: 0 0 .8em; }
.markdown-preview a { color: var(--accent); }
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.resource-grid > div { display: grid; align-content: start; gap: 9px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.primary-button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 4px; color: white; background: var(--accent); font: inherit; font-weight: 750; cursor: pointer; }
.notice, .error-message { margin: 0 0 14px; padding: 11px 13px; border-radius: 4px; font-size: 13px; }
.notice { color: #145c42; background: #e6f4eb; }
.error-message { color: #842b2b; background: #fae9e8; }
.entry-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 13px 9px; border-bottom: 1px solid #edf1ef; }
td:nth-child(2) { color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.row-actions form { margin: 0; }
.edit-button, .delete-button { padding: 5px 8px; border: 0; border-radius: 3px; background: transparent; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.edit-button { color: var(--accent); }
.delete-button { color: #a23b37; }
.delete-button:disabled { color: #aab5b1; cursor: not-allowed; }
.empty-state { padding: 15px; color: var(--muted); background: #f8faf9; }
.management-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.management-form { align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 5px; background: #f8faf9; }
.management-form h3 { margin: 0; font-size: 15px; }
.optional-label { color: var(--muted); font-weight: 400; }
.category-tree { display: grid; gap: 14px; }
.category-card { overflow: hidden; border: 1px solid #cddbd6; border-radius: 5px; background: #fff; }
.category-card-heading, .subcategory-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-card-heading { padding: 16px 18px; background: #f1f7f4; }
.category-card-heading > div:first-child, .subcategory-card-heading > div:first-child { display: grid; gap: 4px; }
.category-card-heading strong, .subcategory-card-heading strong { font-size: 16px; }
.structure-kind { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.structure-count { color: var(--muted); font-size: 12px; }
.structure-actions, .inline-edit-form { display: flex; align-items: center; gap: 8px; }
.structure-actions > form { margin: 0; }
.inline-edit-form input { width: min(210px, 22vw); min-width: 115px; min-height: 34px; padding: 7px 9px; border: 1px solid #d7e1dd; border-radius: 4px; font: inherit; font-size: 12px; }
.subcategory-list { display: grid; gap: 10px; padding: 12px 14px 14px 26px; }
.subcategory-card { border: 1px solid var(--line); border-radius: 4px; }
.subcategory-card-heading { padding: 12px 14px; background: #fff; }
.subcategory-card-heading strong { font-size: 14px; }
.structure-entry-list { display: grid; gap: 0; margin: 0; padding: 0 14px; list-style: none; }
.structure-entry-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid #edf1ef; }
.structure-empty { margin: 0; padding: 10px 14px 13px; color: var(--muted); font-size: 12px; }
.category-empty { padding-left: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
    .manage-header { height: 58px; padding: 0 18px; }
    .manage-main { width: min(100% - 24px, 1040px); margin-top: 28px; }
    .editor-section, .entries-section { padding: 19px 15px; }
    .resource-grid { grid-template-columns: 1fr; gap: 8px; }
    .page-heading { align-items: flex-end; }
    .row-actions { gap: 4px; }
    th, td { padding-left: 6px; padding-right: 6px; }
    .management-forms { grid-template-columns: 1fr; }
    .category-card-heading, .subcategory-card-heading { align-items: flex-start; flex-direction: column; }
    .structure-actions { align-items: stretch; flex-direction: column; width: 100%; }
    .inline-edit-form { width: 100%; }
    .inline-edit-form input { flex: 1; width: auto; min-width: 0; }
    .structure-entry-list li { align-items: flex-start; flex-direction: column; }
}