:root {
  --ink: #20323e;
  --muted: #6d7b84;
  --accent: #a93235;
  --accent-soft: #f8eceb;
  --line: #e0e6e9;
  --paper: #ffffff;
  --canvas: #f3f6f7;
  --green: #176b53;
  --danger: #a93235;
  --nav: #1d303b;
  --shadow: 0 8px 28px rgba(25, 48, 61, .055);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(4vw, calc((100vw - 1500px) / 2)); color: #fff; background: var(--nav); box-shadow: 0 3px 14px rgba(25, 48, 61, .12); }
h1,h2,h3,h4,p { margin-top: 0; }
h1 { font-size: 24px; line-height: 1.1; margin: 0; letter-spacing: -.035em; }
.brand-button { padding: 0; color: inherit; background: transparent; border: 0; border-radius: 0; font: inherit; letter-spacing: inherit; text-align: left; }
.brand-button:hover { filter: none; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }
.brand-button:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
h2 { font-size: 21px; line-height: 1.25; margin-bottom: 8px; letter-spacing: -.02em; }
h3 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.eyebrow { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 750; color: var(--accent); margin: 0 0 5px; }
header .eyebrow { color: #f4b8b6; }
.header-actions { display: flex; align-items: center; gap: 13px; color: #d4dfe3; font-size: 13px; }
.header-actions span { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 7px 11px; }
main { width: min(1500px, 92vw); padding: 28px 0 52px; margin: auto; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { flex: 1; min-width: 260px; }
.toolbar select { min-width: 245px; }
input,select { font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5dfe3; border-radius: 9px; padding: 11px 13px; outline: none; box-shadow: 0 1px 2px rgba(25,48,61,.025); }
input:focus,select:focus { border-color: #9db1ba; box-shadow: 0 0 0 3px rgba(78,117,133,.12); }
button { font: inherit; font-weight: 650; color: white; background: var(--green); border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; cursor: pointer; transition: background .15s ease, transform .15s ease, box-shadow .15s ease; }
button:hover { filter: brightness(.96); box-shadow: 0 3px 8px rgba(29,60,71,.1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary { background: #fff; color: #425762; border-color: #dce4e7; }
.danger { background: #a93235; color: #fff; }
.header-actions .secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.16); }
.header-actions form { margin: 0; }
.directory-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); gap: 18px; align-items: start; }
.area-nav,.area-panel,.facts-block,.group-block,.search-card,.advanced-search { background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.area-nav { padding: 17px 13px; position: sticky; top: 16px; }
.area-nav h2 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin: 2px 9px 12px; }
.area-link { width: 100%; display: block; text-align: left; color: #425762; background: transparent; border-radius: 8px; padding: 10px 11px; margin: 3px 0; font-weight: 550; border: 0; box-shadow: none; }
.area-link:hover,.area-link.selected { background: var(--accent-soft); color: #782d30; box-shadow: none; }
.area-link.selected { position: relative; font-weight: 700; }
.area-link.selected::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 4px; background: var(--accent); }
.area-nav #newArea { width: 100%; margin-top: 12px; }
.area-panel { padding: 24px; min-width: 0; }
.area-heading,.table-heading,.block-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.area-heading { margin: 0 0 18px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.area-heading h2 { margin: 0; font-size: 26px; }
.area-actions,.table-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.area-actions button,.table-tools button { padding: 8px 11px; font-size: 13px; }
.facts-block { padding: 16px 18px; margin: 12px 0; background: #fbfcfc; box-shadow: none; border-radius: 11px; }
.block-title { margin-bottom: 12px; }
.block-title h3 { font-size: 14px; }
.block-title button { padding: 6px 10px; font-size: 12px; }
.facts-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 22px; }
.fact { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; border-bottom: 1px solid #e9eef0; padding: 8px 2px; }
.fact>div:first-child { display: grid; gap: 2px; }
.fact b { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .045em; }
.fact span { white-space: pre-wrap; font-size: 13px; }
.mini-actions,.column-actions { display: flex; align-items: center; gap: 3px; }
.mini-actions button,.column-actions button { padding: 3px 6px; background: transparent; color: var(--muted); font-size: 12px; border: 0; box-shadow: none; }
.mini-actions button:hover,.column-actions button:hover { background: #edf2f3; box-shadow: none; }
.table-heading { margin: 26px 0 11px; }
.group-block { overflow: hidden; margin: 13px 0; box-shadow: none; border-radius: 11px; }
.group-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--accent-soft); padding: 12px 15px; color: #702b2e; border-bottom: 1px solid #f0dedd; }
.group-title h4 { margin: 0; font-size: 14px; }
.group-title a { font-size: 12px; color: #702b2e; text-decoration: none; }
.group-title .mini-actions button { color: #702b2e; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 680px; }
th { background: #f6f8f9; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .045em; color: #6e7d85; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 13px; border-bottom: 1px solid #edf1f2; vertical-align: top; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
td a { color: #176b78; text-decoration: none; }
td a:hover { text-decoration: underline; }
.column-actions { display: inline-flex; margin-left: 8px; }
.row-actions { white-space: nowrap; }
.row-actions button { font-size: 11px; padding: 6px 8px; margin: 1px; }
.add-entry { margin: 9px 12px 11px; color: #29454e; }
.empty-state,.muted { color: var(--muted); padding: 10px 0; }
.search-card { padding: 17px 19px; margin: 12px 0; }
.search-card h3 { margin: 5px 0; }
.search-card p:last-child { margin: 0; }
.search-card div { color: #4d5c64; }
.advanced-search { padding: 13px 16px; margin: 0 0 20px; box-shadow: none; }
.advanced-search summary { font-weight: 700; color: var(--ink); cursor: pointer; }
.filter-help { color: var(--muted); font-size: 13px; margin: 10px 0; }
.filter-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.filter-row select:first-child { min-width: 120px; }
.filter-row select { min-width: 150px; }
.filter-row input { flex: 1; min-width: 150px; }
.filter-row button { font-size: 20px; line-height: 1; padding: 8px 12px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.filter-actions button { font-size: 13px; padding: 8px 10px; }
.login-page { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 20% 20%, #edf2f4, #f7f8f8 62%); }
.login-card { width: min(440px,92vw); padding: 34px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 55px rgba(32,49,61,.12); }
.login-card form { display: grid; gap: 13px; margin-top: 22px; }
.login-card label,#fieldForm label,#groupForm label,.entry-fields label { display: grid; gap: 6px; font-weight: 650; }
.hint { color: var(--muted); font-size: 12px; margin-top: 20px; }
.error { background: #fce8e7; color: #8d282b; padding: 10px; border-radius: 8px; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(550px,94vw); box-shadow: 0 20px 70px rgba(16,34,45,.24); }
dialog::backdrop { background: rgba(19,35,45,.52); backdrop-filter: blur(2px); }
dialog form { padding: 22px; display: grid; gap: 13px; }
.dialog-title,.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-title { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.dialog-title h2 { margin: 0; }
.dialog-actions { justify-content: flex-end; padding-top: 8px; }
.icon { background: none; color: var(--ink); font-size: 24px; padding: 0 6px; border: 0; box-shadow: none; }
.entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-fields label:first-child { grid-column: 1/-1; }
.archive-row { background: white; }
.archive-actions { display: flex; gap: 8px; }
.archive-actions button { font-size: 12px; padding: 6px 8px; }
@media(max-width:850px) { .directory-layout { grid-template-columns: 1fr; } .area-nav { position: static; } .area-nav #areaButtons { display: flex; gap: 6px; overflow: auto; } .area-link { min-width: max-content; width: auto; } .facts-grid { grid-template-columns: 1fr; } .area-heading { align-items: flex-start; flex-direction: column; } }
@media(max-width:700px) { .filter-row { align-items: stretch; flex-wrap: wrap; } .filter-row select,.filter-row input { flex: 1; min-width: 130px; } }
@media(max-width:520px) { header { align-items: flex-start; gap: 10px; flex-direction: column; padding: 16px 4vw; } .header-actions { width: 100%; justify-content: space-between; } main { width: 92vw; padding-top: 20px; } .toolbar select { width: 100%; } .area-panel { padding: 15px; } .entry-fields { grid-template-columns: 1fr; } .entry-fields label:first-child { grid-column: auto; } }
/* Scrollable all-areas overview and consistent metadata/table alignment */
.content-panels { min-width: 0; }
.area-nav .area-search { width: 100%; padding: 9px 10px; margin: 0 0 10px; font-size: 13px; }
.facts-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.overview-panel { min-width: 0; }
.overview-panel .area-heading { align-items: flex-start; }
.overview-intro { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.overview-org { margin-bottom: 18px; }
.overview-list { display: grid; gap: 15px; }
.overview-area { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #fff; }
.overview-area-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.overview-area-heading h2 { margin: 0; font-size: 20px; }
.overview-area-heading .eyebrow { margin-bottom: 4px; }
.overview-area .facts-block { margin: 12px 0; }
.overview-area .group-block { margin: 12px 0 0; }
table { table-layout: fixed; min-width: 850px; }
th,td { overflow-wrap: anywhere; }
@media(max-width:1150px) { .facts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:850px) { .facts-grid { grid-template-columns: 1fr; } .overview-area-heading { align-items: flex-start; flex-direction: column; } }
.organization-selector { display: block; }
.organization-selector { min-width: 245px; }
.toolbar .organization-selector select { width: 100%; min-width: 245px; }
#organizationSelect option[value="__create_org__"] { font-weight: 700; color: var(--green); }
.results-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 3px 0 13px; }
.results-heading h2 { margin-bottom: 2px; }
.results-heading p { color: var(--muted); margin: 0; font-size: 13px; }
.results-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.results-actions button { font-size: 13px; padding: 8px 11px; }
.results-table { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.results-table table { min-width: 1000px; table-layout: auto; }
.results-table td { font-size: 13px; padding: 10px 12px; }
.results-table .result-location { color: #586d77; min-width: 220px; }
.results-table .open-result { font-size: 12px; padding: 6px 9px; }
.results-table .result-row { cursor: pointer; }
.results-table .result-row:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
#areaPanel tr.result-highlight { background: #fff1ce; outline: 2px solid #e3ad3d; outline-offset: -2px; }
.header-actions .header-link { display: inline-flex; align-items: center; padding: 8px 13px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; font-weight: 650; }
.header-actions .header-link:hover,.header-actions .header-link.current { background: rgba(255,255,255,.2); }
.guide-page .brand-button { display: inline-block; text-decoration: none; }
.guide-main { width: min(1320px,92vw); }
.guide-intro { padding: 8px 0 26px; max-width: 850px; }
.guide-intro h2 { font-size: clamp(29px,4vw,42px); margin-bottom: 10px; }
.guide-intro p:last-child { font-size: 16px; color: #526672; }
.guide-back { display: inline-block; margin-bottom: 22px; color: var(--green); text-decoration: none; font-weight: 700; }
.guide-back:hover,.guide-return:hover { text-decoration: underline; }
.guide-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 22px; align-items: start; }
.guide-nav { display: grid; gap: 4px; position: sticky; top: 18px; padding: 18px 13px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.guide-nav strong { padding: 4px 9px 9px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.guide-nav a { display: block; border-radius: 7px; padding: 8px 9px; color: #425762; text-decoration: none; font-size: 13px; }
.guide-nav a:hover,.guide-nav a:focus-visible { background: var(--accent-soft); color: var(--ink); }
.guide-content { display: grid; gap: 18px; min-width: 0; }
.guide-card { scroll-margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: clamp(20px,3vw,32px); box-shadow: var(--shadow); }
.guide-card h2 { font-size: 25px; margin-bottom: 13px; }
.guide-card p,.guide-card li { color: #40545f; }
.guide-card p { max-width: 78ch; }
.guide-card figure { margin: 22px 0 0; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfb; }
.guide-card figure img { display: block; width: 100%; height: auto; border-radius: 6px; }
.guide-card figcaption { padding: 11px 8px 4px; color: var(--muted); font-size: 13px; }
.guide-steps { padding-left: 24px; margin: 8px 0 0; }
.guide-steps li { padding-left: 5px; margin-bottom: 10px; }
.guide-steps li::marker { color: var(--accent); font-weight: 700; }
.guide-levels { list-style: none; padding: 0; display: grid; gap: 9px; }
.guide-levels li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfc; }
.guide-levels strong { color: var(--ink); }
.guide-note { max-width: none !important; padding: 13px 16px; margin: 18px 0 0; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); }
.guide-table-wrap { overflow-x: auto; }
.guide-table { min-width: 560px; table-layout: auto; }
.guide-table th:first-child { width: 120px; }
.guide-table tbody th { background: #fff; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.guide-table td { font-size: 14px; }
.guide-return { display: inline-block; margin-top: 10px; color: var(--green); font-weight: 700; text-decoration: none; }
@media(max-width:800px) { .guide-layout { grid-template-columns: 1fr; } .guide-nav { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); } .guide-nav strong { grid-column: 1/-1; } }
@media(max-width:520px) { .guide-levels li { grid-template-columns: 1fr; gap: 3px; } .guide-nav { grid-template-columns: 1fr; } .guide-card { padding: 19px; } .header-actions { justify-content: flex-start; flex-wrap: wrap; } }
