:root {
    color-scheme: light;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #172a24;
    background: #f3f6f3;
    --accent: #165746;
    --border: #dce6df;
    --muted: #53685e;
}

* { box-sizing: border-box; }
body { margin: 0; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { padding: 1.45rem 1rem; background: #16372e; color: #edf7f0; }
.brand { display: block; font-size: 1.15rem; font-weight: 750; margin: 0 0 1.4rem; }
.sidebar a { color: inherit; text-decoration: none; }
.sidebar nav { display: grid; gap: .15rem; }
.sidebar nav a { padding: .55rem .65rem; border-radius: .45rem; font-weight: 500; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #2a5648; }
.account { display: grid; gap: .55rem; margin: 1.3rem 0 0; font-size: .87rem; }
main { min-width: 0; padding: clamp(1rem, 3vw, 2.5rem); }
.auth { width: min(100%, 490px); margin: 8vh auto; }
.auth .brand { color: var(--accent); }
.page-head, .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.page-head span { color: var(--muted); white-space: nowrap; }
h1 { margin: 0 0 1.3rem; font-size: clamp(1.7rem, 4vw, 2.45rem); letter-spacing: -.04em; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: .96rem; margin: 1.45rem 0 .5rem; }
section { padding: 1.1rem; background: #fff; border: 1px solid var(--border); border-radius: .8rem; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: .8rem; margin: 0 0 1rem; }
.metrics section { display: grid; gap: .3rem; }
.metrics span, .muted, .empty { color: var(--muted); }
.metrics strong { font-size: 1.45rem; letter-spacing: -.035em; }
.layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.registry { grid-template-columns: minmax(0, 1fr) minmax(245px, 310px); }
.compact { max-width: 540px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; margin-bottom: .7rem; }
.filters input[type=search] { flex: 1 1 130px; }
.fields, label { display: grid; gap: .35rem; min-width: 0; }
.fields { gap: .8rem; }
label { font-weight: 600; }
input, select, button { min-width: 0; max-width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid #aebfb6; border-radius: .45rem; background: #fff; color: inherit; }
button { background: var(--accent); border-color: var(--accent); color: #fff; cursor: pointer; font-weight: 650; }
button:hover { filter: brightness(1.12); }
a { color: var(--accent); font-weight: 650; }
.secondary { background: #f2f7f4; border-color: #c9dacf; color: var(--accent); }
.danger { color: #952828; border-color: #e7c7c7; background: #fff; }
.delete-form { margin-top: 1rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { padding: .6rem .5rem; border-bottom: 1px solid var(--border); }
th { white-space: nowrap; color: var(--muted); }
td { overflow-wrap: anywhere; }
.selected { background: #eaf5ee; }
.nowrap { white-space: nowrap; }
.nowrap a + a { margin-left: .45rem; }
.error, .feedback { padding: .75rem; border-radius: .45rem; }
.error { color: #902525; background: #fceceb; }
.feedback { color: #1f5945; background: #e0f3e8; }
.alerts, .notice-list { padding: 0; margin: 0 0 .7rem; list-style: none; }
.alerts li, .notice-list li { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.notice-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
@media (max-width: 1040px) {
    .registry { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
    .shell, .layout { grid-template-columns: minmax(0,1fr); }
    .sidebar nav { display: flex; overflow: auto; white-space: nowrap; }
    .sidebar { padding: .85rem; }
    .brand { margin-bottom: .5rem; }
    .account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: .55rem; }
}
