:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #292125;
  background: #f8f6f7;
  --brand: #682534;
  --dark: #371c25;
  --line: #e7dfe2;
  --muted: #685b62;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
body.menu-closed { grid-template-columns: minmax(0, 1fr); }
body.login-page { grid-template-columns: minmax(0, 1fr); }
body.menu-closed aside { display: none; }
a { color: var(--brand); font-weight: 600; text-underline-offset: 3px; }
svg { vertical-align: middle; flex-shrink: 0; }
aside { background: var(--dark); color: #fff; min-height: 100%; padding: 23px 14px; }
.brand { display: grid; gap: 4px; margin: 4px 0 28px; color: #fff; text-decoration: none; }
.brand img { display: block; width: 193px; max-width: 100%; height: auto; }
/* The first visible pixel of the T is 36 px into the 193 px source. */
.brand span { padding-inline-start: min(36px, 18.65%); font-size: .875rem; font-weight: 600; line-height: 1.35; }
aside nav details { margin-bottom: 10px; }
aside nav summary { display: flex; align-items: center; gap: 10px; cursor: pointer; color: #fff; padding: 10px; font-size: .95rem; font-weight: 650; border-radius: 6px; }
aside nav summary::-webkit-details-marker { display: none; }
aside nav summary svg:last-child { margin-left: auto; }
aside nav details[open] summary svg:last-child { transform: rotate(180deg); }
aside nav summary:hover { background: #54303b; }
aside nav a { display: block; border-radius: 6px; margin: 3px 0 3px 29px; padding: 9px 10px; color: #efdbe1; font-size: .92rem; text-decoration: none; font-weight: 500; }
aside nav a:hover, aside nav a[aria-current] { color: #fff; background: #653144; }
.main-shell { min-width: 0; display: flex; flex-direction: column; }
.login-page main { display: grid; align-content: center; width: min(100%, 620px); }
.login-brand { background: var(--dark); padding: 19px 22px; }
.login-brand .brand { margin: 0; }
.login-panel .alert { margin-bottom: 0; }
.topbar { min-height: 65px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); background: #fff; padding: 0 clamp(14px, 4vw, 48px); font-weight: 700; }
.toggle { background: #fff; color: var(--brand); border: 1px solid var(--line); border-radius: 6px; width: 40px; height: 38px; cursor: pointer; }
.environment { margin-left: auto; font-size: .83rem; color: var(--muted); font-weight: 600; }
main { width: min(1200px, 100%); margin: 0 auto; padding: clamp(22px, 4vw, 48px); flex: 1; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.1; letter-spacing: -.035em; }
h2 { font-size: 1.08rem; }
p { line-height: 1.55; color: var(--muted); }
.heading p { margin-top: 8px; }
.breadcrumb { display: inline-block; margin-bottom: 8px; }
.button, .secondary { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; min-height: 42px; border-radius: 7px; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.button { color: #fff; background: var(--brand); border: 1px solid var(--brand); }
.button:hover { background: #52202c; }
.secondary { color: var(--brand); background: #fff; border: 1px solid var(--line); }
.panel { border: 1px solid var(--line); border-radius: 11px; background: #fff; margin-bottom: 18px; overflow: hidden; }
.empty { padding: 40px 25px; text-align: center; }
.empty p, .diagnostic p { margin-top: 6px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); }
th { background: #fbf7f8; color: #423039; font-size: .9rem; }
td { font-size: .95rem; }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: 3px 8px; background: #f1e4e8; border-radius: 5px; color: #582b37; font-weight: 650; font-size: .82rem; }
.status.review { color: #70401d; background: #fff0df; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.cell-note { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; font-weight: 500; }
.form { padding: 22px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; font-weight: 650; }
.period { width: min(100%, 280px); }
input, select { font: inherit; min-width: 0; max-width: 100%; border-radius: 6px; padding: 8px 10px; border: 1px solid #ccbec3; min-height: 42px; background: #fff; color: #292125; }
input[type=file] { width: 100%; }
.upload-card { border: 1px solid var(--line); padding: 15px; border-radius: 8px; }
.upload-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-weight: 650; }
.upload-heading a { display: inline-flex; align-items: center; gap: 5px; }
.actions, .filter { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.filter { padding: 18px; align-items: end; }
.comparison-filter { padding: 14px 0 0; }
.change-groups { padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; list-style: none; }
.change-groups > li { border: 1px solid var(--line); border-radius: 7px; padding: 12px; }
.change-links { padding: 0; margin: 8px 0 0; list-style: none; }
.change-links li { padding-block: 3px; overflow-wrap: anywhere; }
.change-links a { margin-inline-start: 4px; }
.pagination { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 15px; border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 14px; }
.metric, .diagnostic { padding: 18px; }
.metric strong { display: block; margin: 8px 0; font-size: 1.45rem; }
.metric span { font-size: .9rem; color: var(--muted); }
.diagnostic table { margin-top: 12px; }
.price-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); align-items: end; }
.user-entry summary { cursor: pointer; padding: 16px 22px; }
.user-entry summary span { color: var(--muted); margin-inline-start: 12px; }
.user-login { padding: 0 22px; }
.user-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); align-items: end; }
.alert { padding: 14px 18px; margin-bottom: 16px; border: 1px solid #cfbdc4; border-radius: 8px; background: #fff; color: #492835; }
.alert.error { border-color: #b33e51; color: #781d2c; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px clamp(14px, 4vw, 48px); color: var(--muted); border-top: 1px solid var(--line); font-size: .87rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid #ba526c; outline-offset: 3px; }
@media (max-width: 700px) {
  body, body.menu-closed { display: block; }
  aside { min-height: 0; padding: 15px; }
  .brand { margin-bottom: 12px; }
  th, td { padding: 10px; }
}
