@font-face {
  font-family: 'Instrument Sans';
  src: url('instrument-sans.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: 'Instrument Sans', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1814;
  background: #f5f2ed;
  color-scheme: light;
  --green: #2d6a4f;
  --border: #e0dbd2;
  --muted: #686459;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--green); }
button, a, input, select, textarea { transition: background-color .14s, color .14s, border-color .14s, box-shadow .14s; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #83b69b; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon { width: 19px; height: 19px; flex-shrink: 0; }
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.shell.sidebar-collapsed .sidebar { display: none; }
.sidebar, .navdrawer {
  background: linear-gradient(165deg, #252422, #211f19 75%);
  color: #e9e5dc;
  border: 1px solid #ffffff0b;
  border-radius: 14px;
  box-shadow: 0 3px 12px #211f1926, 0 1px 3px #211f191a;
}
.sidebar { position: sticky; top: 10px; height: calc(100dvh - 20px); margin: 10px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { padding: 22px 16px; text-align: center; border-bottom: 1px solid #ffffff0b; }
.brand img { display: block; width: 112px; height: 70px; object-fit: contain; margin: auto; background: #fff; padding: 7px; border-radius: 7px; }
.nav-label { font-size: 10px; letter-spacing: 2px; color: #89867c; margin: 24px 20px 12px; }
.sidebar nav, .navdrawer nav { display: grid; gap: 4px; padding: 0 10px; margin-top: 8px; }
.sidebar nav .icon, .navdrawer nav .icon { width: 16px; height: 16px; opacity: .85; }
.sidebar nav button[aria-current=page] .icon, .navdrawer nav button[aria-current=page] .icon { opacity: 1; }
.sidebar nav button, .navdrawer nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 9px 12px; text-align: left; font-size: 13.5px; letter-spacing: .1px; color: #bcb9b0; background: transparent; border: 0; border-radius: 8px; }
.sidebar nav button:hover, .navdrawer nav button:hover { background: linear-gradient(#ffffff0f, #ffffff05); color: #fff; }
.sidebar nav button[aria-current=page], .navdrawer nav button[aria-current=page] { background: linear-gradient(#ffffff1f, #ffffff0f 40%, #ffffff08); color: #fff; font-weight: 500; box-shadow: inset 0 1px 0 #ffffff1f, inset 0 -1px 0 #0000004d, 0 2px 4px #00000033, 0 0 0 1px #ffffff08; }
.identity { display: flex; align-items: center; gap: 8px; margin: auto 14px 12px; padding: 14px 2px 4px; border-top: 1px solid #f5f2ed16; }
.identity-name { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; font-weight: 400; color: #bcb9b0; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--green); color: #fff; font-size: 10px; font-weight: 600; }
.signout, .menu-toggle, .sidebar-toggle, .drawer-close { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 8px; min-width: 44px; min-height: 44px; color: inherit; }
.signout { min-width: 32px; min-height: 32px; padding: 0; color: #bcb9b0; }
.signout .icon, .btn .icon { width: 18px; height: 18px; }
.sidebar-toggle .icon { width: 16px; height: 16px; }
.metric-label .icon { width: 17px; height: 17px; }
.signout:hover, .drawer-close:hover { background: #ffffff0d; color: #fff; }
.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar { min-height: 76px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 14px; }
.breadcrumb { display: flex; align-items: center; min-width: 0; gap: 12px; }
.breadcrumb strong { font-weight: 700; color: inherit; }
.breadcrumb-divider { margin: 0; }
.menu-toggle { display: none; }
.sidebar-toggle { min-width: 28px; min-height: 28px; padding: 0; }
.sidebar-toggle:hover { background: #eeeae3; }
main { padding: 38px; width: 100%; max-width: 1600px; margin: 0 auto; min-width: 0; }
h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.025em; margin: 5px 0; font-weight: 600; overflow-wrap: anywhere; }
h1:focus { outline: none; }
h2 { font-size: 19px; letter-spacing: -.02em; margin: 0; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { color: var(--muted); margin: 8px 0 18px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.6px; color: #716d62; }
.pageheading { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; min-height: 76px; margin-bottom: 30px; }
.pageheading > div { min-width: 0; }
.pageheading .eyebrow { margin: 0; }
.pageheading p:not(.eyebrow) { margin: 9px 0 0; font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: #fff; color: #1a1814; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 500; min-height: 44px; line-height: 1.35; text-decoration: none; }
.btn:hover:not(:disabled) { background: #eeeae3; border-color: #c9c2b6; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #24573f; box-shadow: 0 3px 10px #2d6a4f26; }
.btn.small { font-size: 12px; padding: 8px 11px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel, .metric { background: #fff; border: 1px solid #e6e1d8; border-radius: 16px; box-shadow: 0 1px 2px #1a181408; min-width: 0; }
.panel { margin: 22px 0; overflow: hidden; }
.panelheader { padding: 20px 24px; border-bottom: 1px solid #efede9; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pad { padding: 24px; }
.pad > .panelheader { padding: 0 0 18px; margin-bottom: 6px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px; margin-bottom: 22px; background: var(--green); color: #fff; border-radius: 16px; }
.hero > div { min-width: 0; }
.hero-overline { color: #c5ddcf; font-size: 11px; letter-spacing: 1.8px; }
.hero h2 { font-size: 19px; font-weight: 400; margin: 14px 0 6px; }
.hero-number { display: block; font-size: 42px; line-height: 1.2; font-weight: 600; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.hero p { margin: 14px 0 0; color: #c5ddcf; font-size: 13px; }
.hero-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); gap: 10px; align-self: stretch; }
.hero-summary > div { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px; border: 1px solid #ffffff30; background: #ffffff05; border-radius: 10px; }
.hero-summary span { color: #c5ddcf; font-size: 12px; }
.hero-summary strong { font-size: 26px; font-weight: 600; }
.hero-summary small { color: #c5ddcf; font-size: 11px; }
.metricrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.metric { padding: 24px; }
.metric-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.metric-label .icon { opacity: .65; }
.metric strong { display: block; margin: 16px 0 8px; font-size: 26px; font-weight: 600; letter-spacing: -.045em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric-note { display: block; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 6px; background: #e4efe7; color: var(--green); font-size: 11px; font-weight: 500; }
.badge.draft { background: #fff1d7; color: #815d21; }
.tablewrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; table-layout: fixed; text-align: left; font-size: 14px; }
.reports-table { min-width: 780px; }
.customers-table { min-width: 640px; }
th { color: var(--muted); font-size: 13px; font-weight: 500; background: #faf9f6; }
th, td { padding: 16px 24px; border-bottom: 1px solid #efede9; vertical-align: middle; overflow-wrap: anywhere; }
th:first-child { width: 32%; }
.reports-table th:nth-child(2) { width: 18%; }
.reports-table th:nth-child(3) { width: 18%; }
.reports-table th:nth-child(4) { width: 14%; }
th:last-child { width: 18%; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7f4ef; }
td strong { display: block; font-weight: 600; }
td .muted { display: block; margin-top: 4px; }
.cell-description { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; white-space: pre-wrap; }
td .btn { font-size: 12px; padding: 9px 12px; }
.textlink { border: 0; padding: 0; background: none; color: var(--green); text-align: left; overflow-wrap: anywhere; }
.textlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.pagination { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid #efede9; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: end; padding: 20px 24px; background: #fff; border: 1px solid #e6e1d8; border-radius: 16px; }
#customers-filter { grid-template-columns: minmax(0, 1fr) auto; }
.formgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.formgrid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
input, select, textarea { font-weight: 400; border: 1px solid #d5cfc5; background: #fff; color: #1a1814; border-radius: 8px; padding: 11px 12px; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #b6ae9f; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px #2d6a4f14; }
textarea { resize: vertical; min-height: 108px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.editorcols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.editorcols .panel:first-child { margin-top: 0; }
.editorcols .pad > label { margin-top: 18px; }
.editorcols .pad > label:first-child { margin-top: 0; }
.notice { border-left: 3px solid var(--green); background: #e4efe7; color: var(--green); padding: 14px 18px; border-radius: 0 8px 8px 0; font-size: 13px; margin: 16px 0; }
.row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding: 14px 0; font-size: 13px; }
.row:last-child { border: 0; }
.row strong { overflow-wrap: anywhere; }
.formactions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.message { margin: 18px 0; padding: 12px 16px; border-radius: 8px; background: #e4efe7; color: var(--green); overflow-wrap: anywhere; }
.message.error { background: #fbe9ea; color: #9e2936; }
.empty { padding: 48px 24px; color: var(--muted); text-align: center; }
.empty > .icon { width: 30px; height: 30px; color: var(--green); }
.empty h3 { margin: 14px 0 6px; color: #1a1814; }
.empty p { font-size: 13px; margin: 0; }
.loading { padding: 30px; }
.footer { margin-top: auto; padding: 22px 38px; color: var(--muted); font-size: 11px; text-align: center; }
.detailgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 26px; }
.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.login { min-height: 100dvh; max-width: none; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.loginform { width: 100%; max-width: 460px; padding: 32px; background: #fff; border: 1px solid #e5dfd7; border-radius: 16px; box-shadow: 0 8px 32px #23201b0a; }
.loginbrand { display: flex; justify-content: center; padding: 8px 0 28px; }
.loginbrand img { width: 128px; height: 80px; object-fit: contain; }
.loginform h1 { font-size: 26px; line-height: 1.25; margin: 9px 0 12px; }
.loginform > p { font-size: 14px; }
.loginform form { display: grid; gap: 18px; margin-top: 25px; }
.loginform .btn { width: 100%; }
.loginform .login-help { font-size: 12px; margin: 24px 0 0; }
.navdrawer { position: fixed; inset: 10px auto 10px 10px; margin: 0; width: min(300px, calc(100% - 20px)); height: calc(100dvh - 20px); max-height: none; padding: 0; }
.navdrawer[open] { display: flex; flex-direction: column; }
.navdrawer::backdrop { background: #1a181455; backdrop-filter: blur(3px); }
.drawer-close { position: absolute; top: 8px; right: 8px; }
@media (max-width: 1150px) {
  .metricrow { gap: 12px; }
  .metric { padding: 20px; }
  .editorcols { grid-template-columns: minmax(0, 1fr); }
  .hero { flex-direction: column; align-items: stretch; }
  .hero-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  main { padding: 24px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .sidebar-toggle { display: none; }
  .menu-toggle { display: inline-flex; margin-left: -8px; }
  .menu-toggle:hover { background: #eeeae3; }
  .topbar { min-height: 68px; padding: 10px 20px; }
  main { padding: 16px 20px 28px; }
  h1 { font-size: 38px; }
  .pageheading { margin-bottom: 24px; }
  .navdrawer nav button { min-height: 44px; }
  .navdrawer .signout { min-width: 44px; min-height: 44px; }
  .metric strong { font-size: 26px; }
  .metric-note { font-size: 11px; }
  .footer { padding: 20px; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 600px) {
  main { padding: 16px 14px 28px; }
  .topbar { padding-inline: 14px; font-size: 12px; }
  h1 { font-size: 29px; }
  .pageheading { align-items: flex-start; gap: 16px; min-height: 0; }
  .pageheading > .btn { width: 100%; }
  .hero { padding: 24px 20px; }
  .hero-number { font-size: 34px; }
  .hero-summary > div { padding: 12px; }
  .metricrow { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .metric { padding: 20px; }
  .metric strong { margin: 10px 0 6px; font-size: 26px; }
  .metric-note { font-size: 12px; }
  .formgrid, .detailgrid { grid-template-columns: minmax(0, 1fr); }
  .formgrid .wide { grid-column: auto; }
  .filters, #customers-filter { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .pad { padding: 20px; }
  .panelheader { padding: 18px 20px; }
  .panelheader h2 { font-size: 17px; }
  .pagination { padding: 18px 20px; }
  .pagination .actions { width: 100%; }
  .pagination .btn { flex: 1; }
  .formactions .btn { flex: 1; }
  /* Keep each record readable on phones, with its action below the data. */
  .reports-table, .customers-table { min-width: 0; display: block; }
  table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table tbody { display: block; }
  table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 20px; border-bottom: 1px solid #efede9; }
  table tr:last-child { border-bottom: 0; }
  table td { display: block; border: 0; padding: 0; min-width: 0; }
  table td::before { content: attr(data-label); display: block; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
  table td:first-child, table td:last-child { grid-column: 1 / -1; }
  table td:first-child::before, table td:last-child::before { display: none; }
  table td:last-child .btn { width: 100%; }
  table td .textlink { font-size: 16px; }
  .reports-table td:nth-child(4) { grid-column: 1 / -1; }
  .reports-table td:nth-child(4) .muted { display: inline; margin-left: 8px; }
}
@media (max-width: 480px) {
  .login { padding: 20px 16px; }
  .loginform { padding: 24px; }
  .loginform h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  button, a, input, select, textarea { transition: none; }
}
