@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: 14px;
  line-height: 1.5;
  color: #302f29;
  background: #f5f3ef;
  color-scheme: light;
  --green: #2e6d53;
  --border: #e6e1d9;
  --input: #ded8ce;
  --surface-soft: #faf9f6;
  --muted: #777267;
}
* { 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: 240px minmax(0, 1fr); min-height: 100dvh; }
.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: 20px 16px; border-bottom: 1px solid #ffffff0b; }
.brand img { display: block; width: min(180px,100%); height: auto; object-fit: contain; margin: auto; filter: brightness(0) invert(1); }
.nav-label { font-size: 10px; letter-spacing: 2.2px; text-transform: uppercase; color: #908d85; margin: 18px 22px 9px; }
.sidebar nav, .navdrawer nav { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 18px; }
.nav-items { display: grid; gap: 3px; padding: 0 10px; }
.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 { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 41px; padding: 10px 12px; text-align: left; font-size: 13.5px; letter-spacing: .1px; color: #ffffff94; 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; }
.sidebar nav button[aria-current=page]::before, .navdrawer nav button[aria-current=page]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: #f9f8f4; border-radius: 2px; }
.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, .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; }
.signout:hover, .drawer-close:hover { background: #ffffff0d; color: #fff; }
.workspace { position: relative; display: flex; flex-direction: column; min-width: 0; }
.mobile-navigation { display: none; }
main { padding: 20px 24px 28px; width: 100%; min-width: 0; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.025em; margin: 9px 0 0; font-weight: 600; overflow-wrap: anywhere; }
h1:focus { outline: none; }
h2 { font-size: 18px; letter-spacing: -.02em; margin: 0; font-weight: 500; }
h3 { font-size: 14px; font-weight: 500; }
p { color: var(--muted); margin: 8px 0 18px; }
.eyebrow { font-size: 10px; font-weight: 500; letter-spacing: .1em; color: #817b70; }
.pageheading { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; flex-wrap: wrap; min-height: 64px; margin-bottom: 24px; }
.pageheading > div { min-width: 0; }
.pageheading > div:first-child { align-self: flex-start; }
.pageheading .eyebrow { margin: 0; line-height: 1.5; }
.pageheading p:not(.eyebrow) { margin: 9px 0 0; font-size: 14px; }
.pageheading-compact { min-height: 0; align-items: center; }
.pageheading-compact h1 { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: #fff; color: #686257; border-radius: 7px; padding: 9px 14px; font-size: 12px; font-weight: 500; min-height: 39px; 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; }
.btn.small { font-size: 12px; padding: 8px 11px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 1px 2px #29251c04; min-width: 0; }
.panel { margin: 22px 0; overflow: hidden; }
.panelheader { padding: 20px 22px; border-bottom: 1px solid #efede9; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pad { padding: 22px; }
.pad > .panelheader { padding: 0 0 18px; margin-bottom: 6px; }
.hero { min-width: 0; padding: 18px; margin-bottom: 22px; background: radial-gradient(ellipse at top left,#26382f 0,transparent 52%),#1c1b18; color: #f6f5f1; border: 1px solid #ffffff12; border-radius: 14px; box-shadow: 0 12px 26px #29251c16; }
.hero-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.hero-heading h1 { font-size: 18px; line-height: 1.3; margin: 0; }
.hero-heading time { color: #cbc9c0; font-size: 12px; }
.hero-result { display: grid; grid-template-columns: minmax(146px,.7fr) minmax(0,2fr); align-items: center; gap: 22px; padding: 16px; border: 1px solid #ffffff18; border-radius: 10px; background: #ffffff06; }
.hero-overline, .hero-summary span, .hero-trend span { color: #b7b7ab; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.hero-number { display: block; margin-top: 6px; color: #8bd3b3; font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.hero-trend { min-width: 0; text-align: right; }
.hero-trend canvas { display: block; width: 100%; height: 80px; }
.hero-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.hero-shortcuts .btn:not(.primary) { color: #f6f5f1; border-color: #ffffff24; background: #ffffff0a; }
.hero-shortcuts .btn:not(.primary):hover { background: #ffffff1a; }
.hero-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.hero-summary button { display: grid; text-align: left; gap: 5px; min-width: 0; padding: 11px 13px; color: #f6f5f1; border: 1px solid #ffffff20; border-radius: 9px; background: #ffffff07; }
.hero-summary button:hover { background: #ffffff10; border-color: #ffffff40; }
.hero-summary strong { font-size: 22px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 20px; background: #e9f2eb; color: #347455; font-size: 10px; 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: #817b70; font: 500 9px ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; background: #faf9f7; }
th, td { padding: 13px 11px; border-bottom: 1px solid #eeeae4; vertical-align: middle; overflow-wrap: anywhere; }
td { font-size: 12px; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
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: #fafbf8; }
td strong { display: block; font-weight: 600; }
td .muted { display: block; margin-top: 3px; font-size: 11px; }
.cell-description { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; white-space: pre-wrap; }
td .btn { font-size: 11px; padding: 5px 9px; min-height: 30px; }
.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(130px, 1fr)); gap: 12px; align-items: end; padding: 16px 22px 18px; background: #fff; border: 1px solid var(--border); border-radius: 13px; }
#customers-filter { grid-template-columns: minmax(0, 1fr) auto; }
.formgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; }
.formgrid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: #302f29; min-width: 0; }
input, select, textarea { font-size: 13px; line-height: 1.4; font-weight: 400; border: 1px solid var(--input); background: var(--surface-soft); color: #302f29; border-radius: 7px; padding: 9px 10px; width: 100%; max-width: 100%; min-width: 0; min-height: 38px; }
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 24px; 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; }
.segmented { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #f4f2ed; }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 6px 10px; color: #787165; border: 1px solid transparent; border-radius: 5px; background: transparent; font-size: 11px; line-height: 1.4; }
.segmented button:is([aria-pressed=true],[aria-current=page]) { color: #354c3a; border-color: #d7d1c6; font-weight: 500; background: #fff; box-shadow: 0 1px 3px #302b2210; }
.segmented button:hover:not([aria-pressed=true]):not([aria-current=page]) { background: #ebe8df; }
.settings-layout { display: grid; align-items: start; grid-template-columns: minmax(0,1fr); gap: 18px; }
.settings-nav { padding: 5px; }
.settings-nav .icon { width: 15px; height: 15px; }
.settings-content { min-width: 0; }
.settings-content > .panel { border-radius: 12px; margin: 0 0 18px; }
.settings-content h3 { margin: 20px 0 14px; }
.settings-content p, .settings-content .muted { font-size: 12px; line-height: 1.65; }
.settings-content .formactions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); justify-content: flex-end; }
.settings-content .btn { min-height: 36px; padding: 8px 12px; }
#signature-form .formgrid { margin-top: 14px; }
.company-selector { margin-top: 15px; }
.company-logo-field { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 18px 0; }
.company-logo-field > label:first-of-type { flex: 1 1 190px; }
.company-logo-field small { font-size: 11px; color: var(--muted); }
.company-logo-preview { display: grid; place-items: center; width: 84px; height: 72px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.company-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 9px; }
.logo-remove { display: flex; align-items: center; gap: 6px; color: #a84339; }
.logo-remove input { width: 14px; min-height: 14px; accent-color: var(--green); }
#import-form { margin-top: 15px; }
.api-spec { margin: 20px 0 0; }
.customer-directory .panelheader { border-bottom: 0; padding-bottom: 16px; }
.customer-directory .segmented { margin: 0 22px 16px; }
.customer-directory .filters { border-inline: 0; border-top: 0; border-radius: 0; padding-top: 0; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; width: fit-content; cursor: pointer; }
.check-inline input { width: 16px; min-height: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--green); }
.import-filters, .import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 22px; }
.import-filters .search-field { flex: 1 1 240px; }
.import-excluded { margin-inline: 22px; }
.import-actions { justify-content: flex-end; border-top: 1px solid var(--border); }
#import-selection-form .panelheader p { margin-bottom: 0; }
#import-table { max-height: 60vh; }
#import-table thead { position: sticky; top: 0; z-index: 1; }
.search-field { display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--muted); }
.search-field .icon { width: 16px; height: 16px; }
.search-field input { border: 0; background: transparent; box-shadow: none; padding: 6px 0; }
.search-field:focus-within { outline: 2px solid #91b09c; outline-offset: 1px; }
.search-field input:focus { outline: none; box-shadow: none; }
.client-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.client-identity > div { min-width: 0; }
.client-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; color: #548167; background: #e2eee5; border-radius: 50%; font-size: 10px; font-weight: 600; }
.customers-table td:first-child strong { font-size: 13px; }
@media (min-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0,1fr) minmax(180px,220px); column-gap: 24px; }
  .settings-nav { grid-column: 2; grid-row: 1; width: 100%; align-items: stretch; flex-direction: column; }
  .settings-nav button { min-height: 36px; justify-content: flex-start; padding: 7px 10px; }
  .settings-content { grid-column: 1; grid-row: 1; width: 100%; max-width: 1000px; justify-self: center; }
}
@media (max-width: 1150px) {
  .editorcols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  main { padding: 16px 14px 28px; }
  h1 { font-size: 28px; }
  .pageheading { margin-bottom: 24px; }
  .mobile-navigation { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; inset: auto 0 0; z-index: 30; min-height: 64px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom,0px)); background: #faf9f6f5; border-top: 1px solid var(--border); box-shadow: 0 -3px 16px #29251c08; backdrop-filter: blur(12px); }
  .mobile-navigation button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 50px; border: 0; border-radius: 9px; background: transparent; color: #817b70; font-size: 10px; }
  .mobile-navigation button[aria-current=page] { background: #eaf1eb; color: var(--green); font-weight: 600; }
  .navdrawer { inset: 0 auto 0 0; height: 100dvh; border-radius: 0 16px 16px 0; }
  .navdrawer .brand { padding: 24px 52px 22px 20px; }
  .navdrawer nav button { min-height: 44px; }
  .navdrawer .signout { min-width: 44px; min-height: 44px; }
  .footer { padding: 20px 16px calc(86px + env(safe-area-inset-bottom,0px)); }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 600px) {
  .pageheading { align-items: flex-start; gap: 16px; min-height: 0; }
  .hero { padding: 14px; }
  .hero-result { grid-template-columns: minmax(0,1fr); gap: 8px; padding: 13px; }
  .hero-number { font-size: 24px; }
  .hero-trend canvas { height: 58px; }
  .hero-summary { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .hero-summary strong { font-size: 20px; }
  .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; }
  .settings-content .pad { padding: 18px 16px; }
  .customer-directory .segmented { margin-inline: 16px; }
  .tablewrap table { min-width: 0; display: block; }
  #import-table { max-height: none; }
  #import-table thead { position: absolute; }
  #import-table tbody td:last-child { grid-column: auto; }
  #import-table tbody td:nth-child(2) { grid-column: 1 / -1; }
  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, table td:first-child, table td:last-child { 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; }
}
