:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #182a28;
  background: #f3f6f5;
  font-synthesis: none;
  --muted: #536561;
  --line: #dce5e1;
  --primary: #087453;
  --primary-hover: #075d43;
  --danger: #a52f2b;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.75rem, 4vw, 2.3rem); line-height: 1.16; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { margin-bottom: 12px; font-size: 1.1rem; letter-spacing: -.016em; }
p { margin-bottom: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid #168463; outline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.muted, .helptext { color: var(--muted); }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 2; padding: 8px 12px; border-radius: 8px; background: #fff; }
.skip-link:not(:focus) { transform: translateY(-150%); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 30px; background: #132f2a; color: #eef8f3; padding: 28px 18px 20px; }
.brand { min-width: 0; display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; line-height: 1.3; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; place-items: center; flex: 0 0 37px; height: 37px; border-radius: 10px; background: #d0f6e4; color: #184c3f; font-size: 1.2rem; font-weight: 750; }
.brand strong { font-size: .91rem; letter-spacing: .042em; }
.brand small { display: block; margin-top: 3px; color: #adcbc1; font-size: .79rem; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar-nav a { padding: 10px 12px; color: #e4f2eb; border-radius: 8px; text-decoration: none; font-size: .89rem; }
.sidebar-nav a:hover, .sidebar-nav a.current { background: #25463d; color: #f0fff8; }
.sidebar-nav a.current { font-weight: 650; }
.sidebar-account { margin-top: auto; padding: 14px 4px 0; border-top: 1px solid #36534c; display: grid; gap: 7px; font-size: .83rem; }
.account-name { color: #f6fcf9; font-weight: 650; overflow-wrap: anywhere; }
.sidebar-account a, .sidebar-account .text-button { color: #bde3d5; }
.sidebar :focus-visible { outline-color: #b0edd6; }
.text-button { background: transparent; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

.main { width: min(100%, 1272px); padding: 38px clamp(20px, 4vw, 56px) 56px; }
.page-heading { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-heading .muted { font-size: .94rem; }
.back-link { display: inline-block; margin: 0 0 14px; font-size: .86rem; text-underline-offset: 3px; }
.surface { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: clamp(17px, 3vw, 26px); }
.panel > h1 { margin-bottom: 14px; }
.panel > p + .button { margin-top: 14px; }
.narrow { max-width: 590px; }
.stack { display: grid; gap: 15px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 14px; border: 1px solid #c8d6d0; border-radius: 8px; background: #fff; color: #24443b; text-decoration: none; font-size: .86rem; font-weight: 650; line-height: 1.35; }
.button:hover { background: #f1f6f3; color: #19382e; }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger:hover { background: #832420; border-color: #832420; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { min-height: 101px; padding: 13px 15px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: #24443b; }
.stat:hover { border-color: #86b7a5; }
.stat.selected { border-color: #58a389; background: #e8f5ee; }
.stat > span { font-size: .81rem; font-weight: 650; }
.stat > strong { color: #16352d; font-size: 1.68rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin: 0 6px 2px 0; border-radius: 50%; background: #88947b; }
.status-dot.draft { background: #a97822; }
.status-dot.ready { background: #269167; }
.status-dot.archived { background: #60738a; }

.filters { display: flex; flex-wrap: wrap; gap: 11px; align-items: flex-start; padding: 16px 18px; }
.filters .filter-search { flex: 1 1 240px; }
.filter-actions { display: flex; align-items: center; gap: 9px; margin-top: 24px; }
.reset-link { display: inline-flex; min-height: 42px; align-items: center; padding: 0 5px; font-size: .84rem; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: .82rem; font-weight: 650; }
.field input:not([type=checkbox]), .field select, .field textarea { min-height: 42px; width: 100%; padding: 8px 10px; border: 1px solid #c8d6d0; border-radius: 8px; color: #182a28; background: #fff; font-size: .9rem; }
.field input::placeholder { color: #61746c; }
.field textarea { resize: vertical; }
.field [aria-invalid=true] { border-color: var(--danger); }
.helptext { font-size: .81rem; }
.helptext ul { margin: 3px 0 0; padding-left: 19px; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: .85rem; }
.errorlist.nonfield { margin-bottom: 11px; padding: 9px 11px; border-radius: 8px; background: #fdf1ee; }
.notice { margin-bottom: 16px; padding: 11px 14px; background: #e8f5ee; border: 1px solid #b9dccc; border-radius: 8px; color: #1d543e; }

.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; min-width: 670px; border-collapse: collapse; text-align: left; font-size: .86rem; }
th, td { padding: 13px 14px; border-top: 1px solid var(--line); }
thead th { background: #f7f9f8; color: var(--muted); font-size: .78rem; font-weight: 650; }
tbody tr:hover { background: #fafcfb; }
th:first-child { padding-left: 18px; }
td:last-child, thead th:last-child { padding-right: 18px; }
.listing-cell { width: 35%; min-width: 180px; max-width: 330px; overflow-wrap: anywhere; }
.listing-link { font-weight: 690; color: #19392f; text-decoration-color: #a9c7bb; text-underline-offset: 3px; }
.listing-category { display: block; color: var(--muted); font-size: .78rem; font-weight: 450; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; white-space: nowrap; font-size: .76rem; font-weight: 650; }
.badge.draft { color: #694810; background: #fcf1d8; }
.badge.ready { color: #1a6147; background: #e1f4e9; }
.badge.archived { color: #465d72; background: #e9eff5; }
.price { white-space: nowrap; text-align: right; }
.date { white-space: nowrap; color: var(--muted); }
.table-footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.pagination { display: flex; flex-wrap: wrap; gap: 13px; }
.empty { border-top: 1px solid var(--line); padding: 44px 18px; text-align: center; }
.empty h2 { margin-bottom: 5px; }
.empty .button { margin-top: 14px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr); gap: 14px; }
.listing-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-fields { margin: 0; }
.detail-fields > div { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr); gap: 8px; border-top: 1px solid var(--line); padding: 9px 0; font-size: .85rem; }
.detail-fields dt { color: var(--muted); }
.detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.delete-link { margin-top: 15px; font-size: .86rem; }
.delete-link a { color: var(--danger); }

.editor { max-width: 800px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.auth-layout { display: grid; place-items: center; min-height: 100vh; padding: 36px 18px; background: radial-gradient(ellipse at 18% 15%, #dbefe4, transparent 58%), #f3f6f5; }
.auth-wrapper { width: min(100%, 430px); }
.auth-brand { margin-bottom: 16px; }
.auth-brand small { color: var(--muted); }
.auth-card { padding: clamp(19px, 5vw, 32px); box-shadow: 0 18px 50px #183d2e12; }
.auth-card .muted { margin-bottom: 18px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .main { padding-right: 23px; padding-left: 23px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 87px; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell { display: block; }
  .sidebar { padding: 13px 16px; gap: 10px; }
  .sidebar-nav, .sidebar-account { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
  .sidebar-account { padding: 8px 0 0; }
  .sidebar-nav a { padding: 6px 8px; }
  .main { padding: 22px 14px 35px; }
  .summary { gap: 8px; }
  .stat { padding: 10px; }
  .filters { padding: 12px; }
  .filters .filter-search { flex-basis: 100%; }
  .filters .field:not(.filter-search) { flex: 1 1 135px; }
  .filter-actions { margin-top: 0; align-self: flex-end; }
  table { min-width: 0; table-layout: fixed; }
  thead th:first-child { width: 42%; }
  thead th:nth-child(2) { width: 30%; }
  th, td, th:first-child { padding: 10px 8px; }
  th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
  .listing-cell { min-width: 0; }
  td .badge { white-space: normal; overflow-wrap: anywhere; }
  td.price { white-space: normal; overflow-wrap: anywhere; }
  .form-grid { grid-template-columns: 1fr; }
}
