:root{--primary:#00534C;--canvas:#F5F9F7;--secondary:#009B60;--highlight:#65C23D;--accent:#FFBE17}
:root {
 --ink: #15332f; --muted: #4c6861;
 --surface: #fff; --line: #d6e6de; --soft: #e8f5ee; --border: #78948b;
 --error: #8b302a; --error-bg: #fff1ee; --warning: #674900; --warning-bg: #fff2d0;
 font-family: "Inter", system-ui, sans-serif; line-height: 1.5; color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.skip { position: fixed; inset: 8px auto auto 8px; z-index: 2; transform: translateY(-160%); padding: 8px 14px; background: white; }
.skip:focus { transform: none; }
.topbar { min-height: 72px; padding: 12px clamp(16px,4vw,44px); display: flex; justify-content: space-between; align-items: center; gap: 16px; background: white; border-bottom: 1px solid var(--line); }
.brand img { display: block; width: 122px; height: auto; }
.top-actions,.actions,.controls,.intro { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.intro { justify-content: space-between; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; min-height: 42px; background: var(--primary); color: white; text-decoration: none; font-weight: 700; }
.btn:hover { filter: brightness(.95); }
.subtle,.plain { border-color: var(--line); background: var(--surface); color: var(--primary); }
.btn.text { color: var(--primary); background: transparent; padding: 7px 9px; text-align: left; justify-content: flex-start; }
.btn.danger { border-color: #efd2cd; color: var(--error); background: var(--error-bg); }
.gate { display: grid; min-height: 68vh; place-items: center; padding: 22px; }
.gate-content { max-width: 540px; border: 1px solid var(--line); background: white; border-radius: 22px; padding: clamp(22px,5vw,42px); }
.gate-content img { width: 56px; height: auto; margin-bottom: 16px; }
.workspace { display: grid; grid-template-columns: 218px minmax(0,1fr); max-width: 1560px; margin: 0 auto; min-height: calc(100vh - 72px); }
aside { border-right: 1px solid var(--line); padding: 36px 16px; }
.side-nav { position: sticky; top: 24px; display: grid; gap: 5px; }
.side-nav a { display: flex; align-items: center; gap: 9px; padding: 10px 12px; min-height: 44px; color: var(--muted); text-decoration: none; font-weight: 650; border-radius: 9px; }
.side-nav a:hover,.side-nav a[aria-current=page] { color: var(--primary); background: var(--soft); }
.side-nav a[aria-current=page] { box-shadow: inset 3px 0 var(--secondary); font-weight: 800; }
#admin-main { min-width: 0; padding: clamp(18px,4vw,48px); }
.page-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin: 0 0 20px; }
h1,h2,h3 { margin: 0; letter-spacing: -.035em; line-height: 1.15; }
h1 { font-size: clamp(1.65rem,3.8vw,2.5rem); }
h2 { font-size: 1.25rem; }
.page-heading p,.help,.muted { color: var(--muted); }
.page-heading p { margin: 6px 0 0; max-width: 58ch; }
.filter-bar,.edit-form,.login-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-items: end; }
.filter-bar { padding: 16px; background: white; border: 1px solid var(--line); border-radius: 16px; }
label { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-weight: 650; }
input,select,textarea { border: 1px solid var(--border); border-radius: 9px; color: var(--ink); background: white; min-height: 42px; padding: 8px 10px; width: 100%; }
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--primary); }
textarea { resize: vertical; }
.wide { grid-column: 1/-1; }
.status-line { margin: 12px 0; color: var(--muted); }
.status-line:empty { display: none; }
.status-line[data-error] { background: var(--error-bg); color: var(--error); border-radius: 9px; padding: 10px 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,178px),1fr)); gap: 12px; }
.metric { display: grid; gap: 4px; padding: 15px; border: 1px solid var(--line); background: white; border-radius: 14px; text-decoration: none; }
.metric:hover { border-color: var(--secondary); background: var(--soft); }
.metric strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; line-height: 1.05; }
.metric span { color: var(--muted); font-weight: 650; }
.panel { padding: 18px; background: white; border: 1px solid var(--line); border-radius: 15px; margin-top: 15px; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 590px; }
th,td { padding: 13px 14px; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--soft); font-weight: 750; color: var(--primary); }
tr+tr td,tbody tr td { border-top: 1px solid var(--line); }
tbody tr:hover { background: #f8fbf9; }
td .sub { display: block; color: var(--muted); margin-top: 4px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--primary); font-size: .875rem; font-weight: 700; white-space: normal; }
.badge.warn { color: var(--warning); background: var(--warning-bg); }
.badge.alert { color: var(--error); background: var(--error-bg); }
.pagination { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
dialog { border: 1px solid var(--line); border-radius: 18px; width: min(94vw,780px); max-height: 90dvh; padding: clamp(16px,4vw,26px); color: var(--ink); background: white; }
dialog::backdrop { background: #102f2a9e; }
#admin-confirm,#login-dialog { width: min(94vw,510px); }
.dialog-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; align-items: start; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare>section { border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.info { display: grid; grid-template-columns: minmax(90px,1fr) 2fr; gap: 8px 12px; margin: 12px 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.check-label { display: flex; align-items: center; gap: 8px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: 8px; padding: 12px; }
.login-actions { display: grid; gap: 10px; margin-top: 14px; }
.login-form { grid-template-columns: 1fr 1fr; }
.login-divider { color: var(--muted); }
.login-secondary { background: white; color: var(--primary); text-decoration: underline; }
@media(max-width:860px) { .workspace { grid-template-columns: 1fr; } aside { padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); } .side-nav { display: flex; overflow-x: auto; } .side-nav a { white-space: nowrap; } }
@media(max-width:620px) { .filter-bar,.edit-form,.compare { grid-template-columns: 1fr; } .page-heading { align-items: start; } .brand img { width: 95px; } }

.merge-actions { margin: 12px 0; }
.merge-actions p { margin: 0; }
.merge-options { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); }
.merge-options legend { font-weight: 700; }
#detail-content h3:not(:first-child) { margin-top: 14px; }
#detail-content .table-wrap { margin-block: 10px; }
#detail-content .panel:empty { display: none; }
