:root {
  --page: #f4fbfa;
  --paper: #fff;
  --ink: #172e2c;
  --muted: #778580;
  --line: #dceee8;
  --green: #0d9488;
  --green-dark: #08796f;
  --mint: #e7f6f1;
  --kms-accent: #0d9488;
  --kms-accent-rgb: 13, 148, 136;
  --shadow: 0 12px 36px #18372c0b;
}
[hidden] {
  display: none !important;
}
html {
  background: var(--page);
}
body {
  font-family: "DM Sans", "Noto Sans Devanagari", sans-serif;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Manrope, "Noto Sans Devanagari", sans-serif;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: var(--green-dark);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #0d948855;
  outline-offset: 3px;
}
.button {
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
  white-space: normal;
}
.button-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.button-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: #f3d0ca;
}
.button svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.button-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  min-width: 40px;
  min-height: 40px;
  padding: 8px;
  font-size: 11px;
}
.icon-button svg {
  width: 18px;
  height: 18px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--green-dark);
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.small-note {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin: 8px 0;
}
.warning-note {
  padding: 12px;
  background: var(--amber-bg);
  color: var(--amber);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
}
.notice {
  padding: 13px 15px;
  background: var(--mint);
  border-radius: 13px;
  font-size: 12px;
  color: var(--green-dark);
  line-height: 1.6;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 16px;
}
.panel-header,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 16px;
}
.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 46px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.empty svg {
  width: 32px;
  height: 32px;
  color: var(--green);
}
.empty b {
  color: var(--ink);
  font-size: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.submitted,
.badge.awaiting_approval {
  background: #fff3db;
  color: #9b6517;
}
.badge.rejected,
.badge.cancelled {
  background: #fff0ed;
  color: #b64b41;
}
.badge.not_eligible,
.badge.unpaid {
  background: #eef1f1;
  color: #75817e;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  min-height: 44px;
  flex: 1;
  min-width: 0;
}
.search-box svg {
  color: var(--muted);
  width: 18px;
  flex: none;
}
.search-box input {
  border: 0;
  outline: none;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 12px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
  font-size: 11px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.toolbar .custom-select {
  min-width: 130px;
  flex: 1;
}
.toolbar .date-picker-trigger {
  flex: 1;
  min-width: 170px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field input,
.field textarea,
.field select {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}
.field label {
  color: var(--muted);
  font-size: 11px;
}
.field textarea {
  min-height: 65px;
  padding: 10px 12px;
}
.field.full {
  grid-column: 1/-1;
}
.sheet-form {
  gap: 15px;
}
.sheet-form h3 {
  font-size: 14px;
}
.sheet-error {
  color: #bc443c;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.sheet-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sheet-head {
  gap: 12px;
}
.sheet-head h2 {
  font-size: 19px;
}
.sheet-head .icon-button {
  border: 0;
  background: var(--mint);
  border-radius: 50%;
  min-height: 32px;
  min-width: 32px;
  padding: 6px;
}
.sheet-head .icon-button svg {
  width: 17px;
}
.sheet-body {
  padding-bottom: 8px;
}
.sheet-open #backdrop {
  z-index: 100090;
}
.sheet-open {
  overflow: hidden;
}
#sheet {
  background: var(--page);
}
#sheet:focus {
  outline: 0;
}
.form-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.5;
  margin: 10px 0;
}
.form-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
  margin-top: 2px;
  flex: none;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  font-size: 12px;
}
.summary-line span {
  color: var(--muted);
}
.summary-line strong {
  white-space: nowrap;
}
.summary-line.total {
  font-size: 18px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 14px;
  color: var(--green-dark);
}
.line-items {
  display: grid;
  gap: 0;
}
.line-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  min-width: 0;
}
.line-item b {
  font-size: 12px;
  display: block;
}
.line-item small {
  font-size: 10px;
  color: var(--muted);
}
.line-item .line-price {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}
.buyer-details {
  padding: 13px 0;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.buyer-details strong {
  display: block;
}
.timeline {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}
.timeline-entry {
  border-left: 2px solid var(--line);
  padding: 0 0 0 12px;
  font-size: 11px;
  line-height: 1.6;
}
.timeline-entry strong {
  display: block;
  font-size: 12px;
}
.timeline-entry small {
  color: var(--muted);
  display: block;
}
.timeline-entry pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 10px/1.5 monospace;
  margin: 5px 0;
}
.document-hash {
  font: 10px/1.7 monospace;
  word-break: break-all;
}
.payment-qr {
  display: block;
  max-width: 230px;
  width: 100%;
  margin: 14px auto;
  border-radius: 15px;
  background: white;
}
.private-link {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 13px;
  background: var(--mint);
  border-radius: 12px;
}
.private-link code {
  overflow-wrap: anywhere;
  font-size: 11px;
}
.private-link textarea {
  width: 100%;
  height: 61px;
  font: 11px/1.5 monospace;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--paper);
  color: var(--ink);
  resize: none;
}
.actions-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.record-list {
  display: grid;
  gap: 9px;
}
.record-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 12px;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.record-row b {
  display: block;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.record-row small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.record-row > span:nth-child(2) {
  min-width: 0;
}
.record-row .row-money {
  font:
    800 14px Manrope,
    sans-serif;
  text-align: right;
  white-space: nowrap;
}
.record-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.record-avatar svg {
  width: 18px;
}
.record-right {
  display: grid;
  gap: 5px;
  justify-items: end;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
}
.data-table th,
.data-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  font-size: 10px;
  background: var(--mint);
  white-space: nowrap;
}
.data-table td:last-child {
  white-space: nowrap;
}
.data-table small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.data-table input {
  width: 85px;
}
.quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  height: 35px;
  background: var(--paper);
}
.quantity button {
  width: 32px;
  height: 35px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 19px;
}
.quantity input {
  width: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font-size: 12px;
  -moz-appearance: textfield;
  padding: 0;
}
.quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.quantity:focus-within {
  outline: 2px solid #0d948855;
}
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 5px;
  background: #a76a11;
  color: white;
  text-align: center;
  z-index: 200000;
  font-size: 11px;
}
.calendar-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.verification {
  max-width: 650px;
  margin: 80px auto;
}
.verification h1 {
  font-size: 23px;
  margin: 12px 0;
}
.verification p {
  margin: 10px 0;
}
/* Public storefront uses the same controls with a shopping-specific layout. */
.buyer-app {
  background: #f6faf8;
  padding-bottom: 20px;
}
.buyer-header {
  height: 78px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 max(24px, calc((100vw - 1260px) / 2));
  position: sticky;
  top: 0;
  z-index: 30;
}
.buyer-brand {
  display: grid;
  text-decoration: none;
  gap: 0;
  flex: none;
}
.buyer-brand img {
  width: 159px;
  height: 40px;
  object-fit: contain;
}
.buyer-brand span {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.storefront {
  max-width: 1260px;
  margin: auto;
  padding: 36px 24px;
}
.store-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}
.store-intro h1 {
  font-size: 30px;
  letter-spacing: -1.1px;
  margin: 7px 0 9px;
}
.store-intro p {
  font-size: 12px;
  color: var(--muted);
}
.process-label {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 10px;
  color: var(--green-dark);
  white-space: nowrap;
}
.process-label b {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 5px;
}
.process-label i {
  color: #aecdc2;
  font-style: normal;
}
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 315px;
  gap: 25px;
  align-items: start;
}
.catalog-toolbar {
  display: flex;
  gap: 9px;
}
.catalog-toolbar select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 0 10px;
  font-size: 11px;
  max-width: 130px;
}
.unit-chips {
  display: flex;
  gap: 6px;
  overflow: auto;
  padding: 15px 0 12px;
}
.unit-chips button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 10px;
  white-space: nowrap;
}
.unit-chips button.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.catalog-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 10px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 175px;
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}
.product-card.selected {
  border-color: #7ac6ad;
  background: #fcfffe;
}
.product-unit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 12px;
}
.product-unit > span {
  background: var(--mint);
  color: var(--green-dark);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 9px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-unit svg {
  width: 17px;
  height: 17px;
  color: #9dbdb0;
}
.product-card h3 {
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  margin-bottom: 6px;
}
.product-card .product-sku {
  font-size: 9px;
  color: var(--muted);
}
.product-card .product-price {
  font-size: 12px;
  font-weight: 800;
  color: var(--green-dark);
  margin-top: 5px;
}
.product-card footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 4px;
  margin-top: auto;
  padding-top: 14px;
}
.product-card footer small {
  font-size: 9px;
  color: var(--muted);
}
.cart-desktop {
  position: sticky;
  top: 100px;
}
.cart-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 19px;
  box-shadow: var(--shadow);
}
.cart-panel h2 {
  font-size: 17px;
}
.cart-panel .section-head {
  margin-bottom: 5px;
}
.cart-panel .cart-scroll {
  max-height: calc(100dvh - 380px);
  overflow: auto;
  padding-right: 3px;
}
.cart-panel .cart-empty {
  padding: 32px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.cart-panel .cart-empty svg {
  margin: 0 auto 15px;
  width: 34px;
  height: 34px;
  stroke-width: 1.3;
}
.cart-line {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.cart-line h3 {
  font-size: 11px;
  margin-bottom: 9px;
  line-height: 1.5;
}
.cart-line-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-line-controls .icon-button {
  border: 0;
  min-height: 30px;
  min-width: 30px;
  color: var(--muted);
}
.cart-cta {
  margin-top: 15px;
  width: 100%;
}
.cart-total-note {
  display: flex;
  gap: 7px;
  margin-top: 15px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}
.cart-total-note svg {
  width: 15px;
  flex: none;
}
.mobile-cart-bar {
  display: none;
}
.checkout-steps {
  display: flex;
  gap: 9px;
  margin-bottom: 18px;
}
.checkout-steps span {
  font-size: 10px;
  color: var(--muted);
  padding-bottom: 8px;
  flex: 1;
  border-bottom: 2px solid var(--line);
}
.checkout-steps .active {
  color: var(--green-dark);
  border-color: var(--green);
  font-weight: 700;
}
.cart-mobile-sheet .cart-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.cart-mobile-sheet .cart-scroll {
  max-height: none;
}
@media (max-width: 1000px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shop-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 17px;
  }
  .process-label {
    display: none;
  }
}
@media (max-width: 680px) {
  .buyer-header {
    height: 70px;
    padding: 0 16px;
    gap: 8px;
  }
  .buyer-brand img {
    width: 116px;
    height: 34px;
  }
  .buyer-brand span {
    font-size: 7px;
  }
  .header-actions {
    gap: 5px;
  }
  .header-actions .icon-button span {
    display: none;
  }
  .header-actions .button {
    padding: 8px 12px;
    min-height: 39px;
  }
  .storefront {
    padding: 25px 16px;
  }
  .store-intro {
    margin-bottom: 22px;
  }
  .store-intro h1 {
    font-size: 25px;
    max-width: 310px;
    letter-spacing: -0.8px;
    line-height: 1.3;
  }
  .store-intro p {
    max-width: 300px;
    font-size: 11px;
    line-height: 1.6;
  }
  .store-intro .eyebrow {
    font-size: 8px;
  }
  .shop-layout {
    display: block;
  }
  .cart-desktop {
    display: none;
  }
  .product-grid {
    gap: 8px;
  }
  .product-card {
    padding: 13px;
    min-height: 174px;
  }
  .product-card h3 {
    font-size: 11px;
  }
  .catalog-toolbar select {
    max-width: 93px;
    font-size: 10px;
  }
  .catalog-caption {
    font-size: 9px;
  }
  .product-card .quantity input {
    width: 37px;
  }
  .product-card .quantity button {
    width: 28px;
  }
  .mobile-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #ffffffef;
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--line);
  }
  .mobile-cart-bar:not(:empty) {
    display: block;
  }
  .mobile-cart-bar button {
    width: 100%;
    justify-content: space-between;
  }
  .buyer-app {
    padding-bottom: 80px;
  }
  .line-item b {
    font-size: 11px;
  }
  .verification {
    margin: 35px 15px;
  }
  .table-wrap {
    margin: 0 -2px;
  }
  .field-row {
    gap: 8px;
  }
  .sheet-head h2 {
    font-size: 18px;
  }
  .record-row .row-money {
    font-size: 12px;
  }
  .toolbar .custom-select {
    min-width: 120px;
  }
  .product-unit {
    margin-bottom: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .buyer-header,
  .kms-topbar,
  .kms-dock,
  .toolbar,
  .pagination,
  .mobile-cart-bar,
  .sheet-footer,
  #backdrop {
    display: none !important;
  }
  body {
    padding: 0 !important;
    background: white;
  }
  #sheet {
    position: static;
    transform: none;
    max-height: none;
    width: 100%;
    overflow: visible;
  }
  .app {
    display: none;
  }
  .sheet-open #sheet {
    display: block !important;
  }
  .line-item {
    break-inside: avoid;
  }
  @page {
    size: A4;
    margin: 15mm;
  }
}

.header-actions .icon-button {
  width: auto;
  white-space: nowrap;
}
.product-card {
  min-height: 145px;
}
.filter-amount {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 8px 10px;
  min-width: 0;
  width: 130px;
  flex: 1;
  font-size: 11px;
}

#calendarPopover {
  z-index: 100300 !important;
  max-height: calc(100dvh - 24px);
  overflow: auto;
}
