@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg: #f7f4fb;
  --bg-accent: #eef8f4;
  --surface: #ffffff;
  --surface-muted: #faf8fc;
  --border: #e8e2f0;
  --text: #3d3550;
  --text-muted: #7a708c;
  --lavender: #c9b8e8;
  --lavender-deep: #9b7fd4;
  --mint: #b8e8d4;
  --mint-deep: #5cb896;
  --peach: #ffd4c4;
  --peach-deep: #e8957a;
  --sky: #c4dff5;
  --shadow: 0 8px 32px rgba(125, 100, 160, 0.08);
  --shadow-hover: 0 12px 40px rgba(125, 100, 160, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --content-max-width: calc(1080px + 1in);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text);
  background: linear-gradient(145deg, var(--bg) 0%, var(--bg-accent) 55%, #fff5f0 100%);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.delivery-date-input {
  position: relative;
  display: block;
  width: 100%;
}

.delivery-date-input__display {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  text-align: left;
  font: inherit;
  line-height: inherit;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  pointer-events: none;
}

.delivery-date-input__display--placeholder {
  color: var(--text-muted);
}

/*
  Native date input covers the full field. Expand the calendar-indicator hit
  target so a click anywhere opens the picker (not only the icon edge).
*/

.delivery-date-input__picker {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.01;
  cursor: pointer;
  color: transparent;
  background: transparent;
}

.delivery-date-input__picker::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

body {
  margin: 0;
  min-height: 100vh;
}

#root {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button,
input,
select {
  font: inherit;
}

/* Layout */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(247, 244, 251, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: min(336px, 84vw);
  object-fit: contain;
  flex-shrink: 0;
}

.brand-logo--large {
  height: 96px;
  max-width: min(560px, 92vw);
}

.brand--wordmark {
  gap: 0;
}

.login-card-logo {
  margin: 0 auto 1rem;
}

.login-brand--wordmark {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.login-app-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lavender-deep);
}

.login-app-updated {
  margin: 0.25rem 0 0;
  font-size: calc(0.9rem - 2pt);
  font-weight: 600;
  color: var(--lavender-deep);
}

.login-version-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--lavender-deep);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.login-version-link:hover {
  color: #7a5fbf;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(61, 53, 80, 0.45);
}

.modal-card {
  width: min(100%, 28rem);
  max-height: min(85vh, 32rem);
  overflow: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-hover);
}

.modal-card--app-version {
  width: min(100%, 56rem);
  max-height: min(90vh, 40rem);
}

.modal-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal-card__close {
  flex-shrink: 0;
}

.app-version-dialog__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.app-version-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.app-version-dialog__select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a708c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.app-version-dialog__select:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(155, 127, 212, 0.2);
}

.app-version-dialog__loading {
  margin: 0;
}

.app-version-dialog__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.app-version-dialog__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.app-version-dialog__select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a708c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.app-version-dialog__select:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(155, 127, 212, 0.2);
}

.app-version-dialog__loading {
  margin: 0 0 1rem;
}

.app-version-dialog__comments-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.app-version-dialog__comments {
  width: 100%;
  min-height: 10rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .modal-card--app-version {
    width: min(100%, 100%);
  }

  .app-version-dialog__summary {
    grid-template-columns: 1fr;
  }
}

.brand-title {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.header-nav-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.header-nav-back {
  align-self: center;
}

.header-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.header-nav-refresh {
  align-self: center;
  white-space: nowrap;
}

.header-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-signout-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.header-user-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lavender-deep);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
  text-align: center;
  width: 100%;
}

.header-signout-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  line-height: 1.2;
}

.module-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.module-tab {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.module-tab:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.module-tab--active {
  background: var(--lavender);
  color: #4a3568;
}

.app-main {
  flex: 1;
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* Page */

.page-header {
  margin-bottom: 1.75rem;
}

.page-header--detail,
.page-header--with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
  margin: 0;
  line-height: 1.25;
}

.detail-title-id {
  word-break: break-all;
}

.detail-payable-label {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  white-space: normal;
}

.page-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: #2f2840;
}

.page--monthly-collection .page-header h1 {
  font-size: calc(1.85rem * 1.1);
}

.page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1.25rem;
}

.page-title-row h1 {
  margin-top: 0;
  margin-bottom: 0;
}

.page-title-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.page-title-stack h1 {
  margin-top: 0;
  margin-bottom: 0;
}

.warehouse-status-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.warehouse-status-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.warehouse-status-count__code {
  font-weight: 700;
  color: #2f2840;
}

.warehouse-status-count__value {
  font-variant-numeric: tabular-nums;
}

.status-admin-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  width: 100%;
}

.status-admin-form .form-field {
  flex: 1 1 12rem;
  min-width: 10rem;
  margin: 0;
}

.detail-header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.detail-back-link {
  margin-top: 0;
}

.page-back-link {
  display: inline-flex;
  margin-bottom: 0.5rem;
}

.delivery-team-badge {
  margin-left: 0.5rem;
  vertical-align: middle;
}

.guid-display {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(135deg, rgba(201, 184, 232, 0.35), rgba(184, 232, 212, 0.35));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.guid-display-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--lavender-deep);
}

.guid-display code {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  color: #2f2840;
  word-break: break-all;
}

.guid-display-hint {
  flex-basis: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.guid-display--pending code {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
}

.guid-display--secondary {
  margin-top: 0.5rem;
  background: var(--surface-muted);
}

.page-lead {
  margin-top: 0.75rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lavender-deep);
  font-weight: 600;
}

.summary-pill {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--mint) 100%);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
  min-width: 120px;
  box-shadow: var(--shadow);
}

.summary-pill-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #2f2840;
  line-height: 1;
}

.summary-pill-label {
  display: block;
  font-size: 0.85rem;
  color: #4a4060;
  margin-top: 0.25rem;
}

.summary-pill-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.65rem;
}

.card-title-row .delivery-order-qty-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.detail-header-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.delivery-detail-qty-summary {
  flex-shrink: 0;
}

.detail-header-qty-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  align-self: flex-end;
}

.delivery-payment-status-badge {
  align-self: flex-end;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #00b83f;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.detail-header-qty-column--finance {
  width: fit-content;
  max-width: 100%;
}

.detail-header-qty-column--finance .delivery-detail-qty-summary {
  width: 100%;
}

.detail-header-qty-column--finance .summary-pill-stack--finance {
  align-self: stretch;
  min-width: 0;
  max-width: none;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}

.detail-header-qty-column--finance .finance-payment-actions .picking-done-btn {
  width: 100%;
}

.detail-header-aside-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.detail-header-aside-actions .summary-pill-actions {
  width: 100%;
  min-width: 0;
}

.detail-header-aside-actions .picking-done-btn {
  width: 100%;
}

.summary-pill-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.page-header--finance {
  align-items: flex-start;
}

.summary-pill-stack--finance {
  align-items: stretch;
  align-self: flex-start;
  gap: 1.15rem;
  min-width: 15rem;
  max-width: 17.5rem;
  margin-top: 0.15rem;
  padding: 1.25rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-finance-summary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.15rem;
  width: 100%;
}

.summary-pill-stack--finance .summary-pill-actions {
  width: 100%;
  min-width: 0;
  gap: 0.75rem;
}

.summary-pill-stack--finance .status-admin-form--finance {
  margin-top: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  width: 100%;
}

.summary-pill-stack--finance .status-admin-form--finance .form-field {
  flex: none;
  width: 100%;
  min-width: 0;
}

.summary-pill-stack--finance .status-admin-form--finance .picking-done-btn {
  width: 100%;
  align-self: stretch;
}

@media (max-width: 640px) {
  .summary-pill-stack--finance {
    max-width: none;
    width: 100%;
    margin-top: 0.75rem;
  }
}

.summary-pill-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  min-width: 120px;
}

.picking-done-btn {
  width: 100%;
}

.picking-done-error {
  margin: 0;
  font-size: 0.8rem;
  padding: 0.5rem 0.65rem;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.page-header-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.page-header-links {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.page-header-main .page-header-links {
  margin-top: 0;
}

.list-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  color: var(--lavender-deep);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(47, 40, 64, 0.06);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

.list-refresh-btn:hover:not(:disabled) {
  background: var(--lavender-soft, #ebe4f4);
  border-color: var(--lavender);
  color: #4a3568;
  box-shadow: 0 2px 6px rgba(74, 53, 104, 0.12);
}

.list-refresh-btn:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 2px;
}

.list-refresh-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.list-refresh-btn__icon {
  display: inline-flex;
  font-size: 1.15rem;
  line-height: 1;
}

.list-refresh-btn--busy .list-refresh-btn__icon {
  animation: list-refresh-spin 0.75s linear infinite;
}

@keyframes list-refresh-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.list-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem 1.25rem;
  max-width: 52rem;
  padding: 1rem 1.25rem;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

.list-pagination--tabs {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.list-pagination__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.list-pagination__tab {
  min-width: 2.25rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.list-pagination__tab:hover:not(:disabled) {
  border-color: var(--lavender-deep, #7c6aad);
}

.list-pagination__tab--active {
  background: var(--lavender-deep, #7c6aad);
  border-color: var(--lavender-deep, #7c6aad);
  color: #fff;
  font-weight: 600;
}

.list-pagination__tab--nav {
  min-width: auto;
}

.list-pagination__tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.list-pagination__ellipsis {
  padding: 0 0.25rem;
  color: var(--text-muted, #6b6575);
  user-select: none;
}

.list-pagination__range {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.list-pagination__range--muted {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted, #6b6575);
}

.delivery-order-search-field {
  grid-column: 1 / -1;
}

.delivery-order-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.delivery-order-search__input {
  flex: 1 1 12rem;
  min-width: 0;
}

.delivery-order-search__button {
  flex: 0 0 auto;
}

.delivery-order-search-error {
  grid-column: 1 / -1;
  margin: 0;
}

.delivery-order-search__status {
  align-self: center;
  font-size: 0.85rem;
  white-space: nowrap;
}

.delivery-order-search__results {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.list-filters--payment-summary {
  max-width: 56rem;
}

.list-filters--finance-reports {
  max-width: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.list-filters--finance-reports .form-field {
  min-width: 0;
}

.monthly-delivery-report-location-filter {
  min-width: 0;
}

.monthly-delivery-report-location-filter__wrap {
  position: relative;
}

.monthly-delivery-report-location-filter__trigger {
  width: 100%;
  padding: 0.6rem 0.75rem;
  padding-right: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a708c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.monthly-delivery-report-location-filter__trigger:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(155, 127, 212, 0.2);
}

.monthly-delivery-report-location-filter__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.monthly-delivery-report-location-filter__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 14rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(42, 34, 58, 0.12);
  overflow: hidden;
}

.monthly-delivery-report-location-filter__hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.monthly-delivery-report-location-filter__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 14rem;
  overflow-y: auto;
}

.monthly-delivery-report-location-filter__item {
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.list-filters-period {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  min-width: 0;
}

.list-filters-period .form-field {
  min-width: 0;
}

.list-filters-status-line {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2f2840;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.card-title-row .card-title {
  margin-bottom: 0;
}

.card-title-with-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-lines-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.detail-lines-add-actions {
  margin-top: 1rem;
}

.section-summary-divider {
  display: block;
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.return-to-warehouse-section__lead {
  margin: 0.35rem 0 0;
  max-width: 36rem;
}

.add-box-form {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.add-box-form-actions {
  margin-top: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--lavender-deep), #7b9fd4);
  color: #fff;
  box-shadow: 0 4px 16px rgba(155, 127, 212, 0.35);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(155, 127, 212, 0.45);
}

.btn-secondary {
  background: var(--mint);
  color: #2a5040;
  border-color: #a0dcc4;
}

.btn-approve {
  background: linear-gradient(135deg, #81c784, #66bb6a);
  color: #fff;
  border-color: #5cb85c;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.35);
  text-transform: uppercase;
}

.btn-approve:hover:not(:disabled) {
  color: #fff;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.45);
}

.btn-danger {
  color: #9a3030;
  border-color: #f0c0c0;
}

.btn-danger:hover:not(:disabled) {
  background: #fde8e8;
  color: #7a2020;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

/* Badges */

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--peach);
  color: #6b4030;
}

.badge--mint {
  background: var(--mint);
  color: #2a5040;
}

.badge--lavender {
  background: var(--lavender);
  color: #4a3568;
}

/* Note list */

.note-list {
  display: grid;
  gap: 1rem;
}

.note-list-item {
  list-style: none;
}

.note-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.note-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--lavender);
}

.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.note-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.note-delete-btn {
  flex-shrink: 0;
}

.note-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.note-card-link:hover .note-guid {
  color: var(--lavender-deep);
}

.note-card-link:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 4px;
  border-radius: 4px;
}

.note-id {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.note-status {
  display: inline-block;
  font-weight: 600;
  color: #000;
  padding: 0.25rem 0.65rem;
  background: #e8e4ec;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.3;
  white-space: normal;
}

.note-status--o {
  background: #e0e0e0;
  color: #000;
}

.note-status--fr {
  background: #b3e5fc;
  color: #000;
}

.note-status--wr {
  background: #ce93d8;
  color: #000;
}

.note-status--transit {
  background: #ffb74d;
  color: #000;
}

.note-status--rt {
  background: #ffe082;
  color: #000;
}

.note-status--delivered {
  background: #c8e6c9;
  color: #1b5e20;
}

.note-status--pa {
  background: #2e7d32;
  color: #fff;
}

.note-status--pp {
  background: #424242;
  color: #69f0ae;
}

.note-guid {
  font-size: 1.15rem;
  font-weight: 600;
  color: #2f2840;
  margin-bottom: 1rem;
  word-break: break-all;
}

.note-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1.25rem;
}

.note-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.note-meta dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Delivery order charges — wide desktop: one row */

.delivery-order-charges-summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem 0.6rem;
  align-items: start;
}

.delivery-order-charges-summary > div {
  min-width: 0;
}

.delivery-order-charges-summary dt {
  margin-bottom: 0.1rem;
  line-height: 1.2;
}

.delivery-order-charges-summary dd {
  font-size: 0.85rem;
  line-height: 1.25;
  word-break: break-word;
}

/* iPad landscape / narrow desktop — 4 columns, total full width */

@media (max-width: 1100px) {
  .delivery-order-charges-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem 0.75rem;
  }

  .delivery-order-charges-summary__total {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-top: 0.55rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--border);
  }

  .delivery-order-charges-summary__total dt {
    margin-bottom: 0;
  }

  .delivery-order-charges-summary__total dd {
    font-size: 0.95rem;
    text-align: right;
  }
}

/* iPad portrait — 3 columns */

@media (max-width: 834px) {
  .app-main {
    padding: 1.5rem 1.15rem 2.5rem;
  }

  .delivery-order-charges-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem 0.65rem;
  }

  .page-header--detail,
  .page-header--with-action {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-header-aside {
    align-items: stretch;
    width: 100%;
  }

  .detail-header-qty-column {
    align-self: stretch;
  }

  .delivery-detail-qty-summary {
    justify-content: flex-start;
  }

  .summary-pill-row {
    justify-content: flex-start;
  }

  .summary-pill {
    flex: 1 1 7.5rem;
    min-width: 0;
  }
}

/* iPhone / small phones — 2 charge items per row */

@media (max-width: 640px) {
  .delivery-order-charges-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
  }

  .delivery-order-charges-summary > div {
    padding: 0.6rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .delivery-order-charges-summary dt {
    margin-bottom: 0.12rem;
    font-size: 0.65rem;
    line-height: 1.15;
  }

  .delivery-order-charges-summary dd {
    font-size: 0.82rem;
    line-height: 1.25;
    text-align: left;
  }

  .delivery-order-charges-summary__total {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-top: 0.15rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
  }

  .delivery-order-charges-summary__total dt {
    margin-bottom: 0;
    font-size: 0.72rem;
  }

  .delivery-order-charges-summary__total dd {
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
  }

  .detail-header-links {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-header-links .btn,
  .detail-header-links .detail-back-link {
    width: 100%;
    justify-content: center;
  }

  .summary-pill-row {
    flex-direction: column;
  }

  .summary-pill {
    width: 100%;
    flex: none;
  }
}

.note-meta-status {
  grid-column: 1 / -1;
}

.note-meta-status dd {
  margin-top: 0.15rem;
}

/* Compact delivery list (+2pt on list text) */

.note-list--compact {
  --note-list-font-plus: 2pt;
  gap: 0.5rem;
}

.note-card--compact {
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: none;
}

.note-card--compact:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.note-card-lead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.note-card--compact .note-status {
  padding: 0.12rem 0.5rem;
  font-size: calc(0.7rem + var(--note-list-font-plus, 2pt));
  line-height: 1.25;
  border-radius: 4px;
}

.badge--compact {
  padding: 0.12rem 0.5rem;
  font-size: calc(0.68rem + var(--note-list-font-plus, 2pt));
}

.note-card--compact .note-card-actions {
  gap: 0.35rem;
  flex-shrink: 0;
}

.note-card--compact .note-card-actions .btn-sm {
  padding: 0.22rem 0.55rem;
  font-size: calc(0.72rem + var(--note-list-font-plus, 2pt));
}

/* Two-line list item layout */

.note-card--two-line .note-card-two-line-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.note-card--two-line .note-card-link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.note-card-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-width: 0;
  line-height: 1.35;
}

.note-card-row--primary {
  flex-wrap: wrap;
}

.note-card-row--primary .note-guid {
  font-size: calc(0.92rem + var(--note-list-font-plus, 2pt));
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card-row--secondary {
  margin: 0;
  font-size: calc(0.78rem + var(--note-list-font-plus, 2pt));
  font-weight: 500;
  color: var(--text);
  flex-wrap: wrap;
  row-gap: 0.15rem;
}

.note-list-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  min-width: 0;
  max-width: 100%;
}

.note-list-meta-label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.note-list-meta-sep {
  flex-shrink: 0;
  color: var(--border);
  user-select: none;
}

/* Empty & states */

.empty-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

.empty-card h2 {
  margin-bottom: 0.5rem;
  color: #2f2840;
}

.empty-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.state-panel {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.state-panel--error {
  color: #8b4040;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--lavender-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fields (read) */

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.delivery-order-header-meta {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.delivery-order-header-meta__payment-row {
  margin-top: 1.25rem;
}

.field--grid-full {
  grid-column: 1 / -1;
}

.field--remarks .field-value {
  white-space: pre-wrap;
}

.remarks-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.remarks-edit-actions {
  margin-top: 0;
  padding-top: 0;
}

.note-list-item--finance-select {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.note-list-item__select {
  flex-shrink: 0;
  margin: 0;
  padding-top: 1.1rem;
}

.note-list-item--finance-select .note-card {
  flex: 1;
  min-width: 0;
}

.finance-select-all-row {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
}

.finance-select-all {
  font-weight: 500;
  color: #2f2840;
}

.finance-select-all-count {
  font-weight: 400;
  color: var(--text-muted);
}

.finance-bulk-approve-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.finance-bulk-approve-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.field-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.field-value {
  font-weight: 500;
  color: #2f2840;
}

.field-value--mono {
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  word-break: break-all;
}

/* Form */

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
}

.form-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field--grid-full {
  grid-column: 1 / -1;
}

.transport-company-form__section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transport-company-form__lead {
  margin: -0.25rem 0 1rem;
}

.settings-section-lead {
  margin: 0 0 1rem;
}

.transport-company-form__charges-hint {
  margin: 1lh 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.transport-company-form__charges-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transport-company-form__charges-grid--primary,
.transport-company-form__charges-grid--fuel-erp-support {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transport-company-money-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d8d0e8;
  border-radius: 8px;
  background: #fff;
  cursor: text;
}

.transport-company-money-field:focus-within {
  border-color: #7c6b9e;
  box-shadow: 0 0 0 2px rgb(124 107 158 / 18%);
}

.transport-company-money-field__display {
  width: 100%;
}

.transport-company-money-field__placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.transport-company-money-field:not(.transport-company-money-field--editing)
  .transport-company-money-field__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.transport-company-money-field--editing .transport-company-money-field__input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
  box-shadow: none;
}

.transport-company-delete-blocked-dialog__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2f2840;
}

.transport-company-delete-blocked-dialog__message {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.transport-company-delete-blocked-dialog__actions {
  display: flex;
  justify-content: flex-end;
}

.transport-charges-form__rows-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.transport-charges-form__rows-header .card-title {
  margin: 0;
}

.transport-charges-form__table input {
  width: 100%;
  min-width: 0;
}

.transport-charges-form__actions-col {
  width: 6.5rem;
  white-space: nowrap;
}

.ot-charge-form__fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ot-charge-form__fields .form-field {
  min-width: 0;
}

.ot-charge-form__code-input {
  width: 3.25rem;
  min-width: 3.25rem;
  max-width: 3.25rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-family: ui-monospace, monospace;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ot-charge-form__code-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.ot-charge-form__amount-input {
  width: 30%;
  max-width: 30%;
}

.prop-charge-form__fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prop-charge-form__fields .form-field {
  min-width: 0;
}

.prop-charge-form__code-input {
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-family: ui-monospace, monospace;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prop-charge-form__amount-input {
  width: 30%;
  max-width: 30%;
}

.prop-charge-form__fields textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
}

.prop-code-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prop-code-cell__code {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.transport-company-form__address-card .card-title {
  margin-bottom: 1rem;
}

.transport-company-form__address-lines {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transport-company-form__address-lines .form-field {
  min-width: 0;
}

.form-grid--pricing {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .form-grid--2,
  .form-grid--pricing,
  .transport-company-form__charges-grid--primary,
  .transport-company-form__charges-grid--fuel-erp-support {
    grid-template-columns: 1fr;
  }
}

.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a4060;
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field textarea {
  resize: vertical;
  min-height: 6rem;
  line-height: 1.45;
}

.form-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a708c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(155, 127, 212, 0.2);
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.detail-lines {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-line {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem 1.25rem;
  margin: 0;
  background: var(--surface-muted);
}

.form-field-checkbox {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-label input[type='checkbox'] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--lavender-deep);
  cursor: pointer;
}

.checkbox-hint {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.form-actions--card {
  margin-top: 1.25rem;
  margin-bottom: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.settings-section-alert {
  margin-top: 1rem;
  margin-bottom: 0;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.settings-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle__track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 5.75rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s ease;
  overflow: hidden;
}

.settings-toggle__text {
  position: relative;
  z-index: 2;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s ease, font-weight 0.15s ease;
}

.settings-toggle__text--off {
  color: var(--text);
  opacity: 0.55;
}

.settings-toggle__text--on {
  color: var(--text-muted, #6b6280);
  opacity: 0.55;
}

.settings-toggle__thumb {
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  z-index: 1;
  width: calc(50% - 0.3125rem);
  height: calc(100% - 0.375rem);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}

.settings-toggle__input:not(:checked) + .settings-toggle__track .settings-toggle__text--off {
  color: var(--text);
  opacity: 1;
  font-weight: 800;
}

.settings-toggle__input:checked + .settings-toggle__track {
  background: var(--lavender-deep);
}

.settings-toggle__input:checked + .settings-toggle__track .settings-toggle__text--off {
  color: rgba(255, 255, 255, 0.72);
  opacity: 1;
  font-weight: 700;
}

.settings-toggle__input:checked + .settings-toggle__track .settings-toggle__text--on {
  color: var(--text);
  opacity: 1;
  font-weight: 800;
}

.settings-toggle__input:checked + .settings-toggle__track .settings-toggle__thumb {
  transform: translateX(calc(100% + 0.3125rem));
}

.settings-toggle__input:focus-visible + .settings-toggle__track {
  outline: 2px solid var(--lavender-deep);
  outline-offset: 2px;
}

.settings-toggle__input:disabled + .settings-toggle__track {
  opacity: 0.55;
  cursor: not-allowed;
}

.detail-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  white-space: nowrap;
}

.detail-row-input {
  width: 100%;
  min-width: 5rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.detail-row-input--3-digit {
  width: calc(6ch + 1rem);
  min-width: 0;
  max-width: calc(6ch + 1rem);
  text-align: center;
}

.input--8ch {
  width: calc(8ch + 1rem);
  min-width: 0;
  max-width: calc(8ch + 1rem);
  box-sizing: border-box;
}

.input--5ch {
  width: calc(5ch + 1rem);
  min-width: 0;
  max-width: calc(5ch + 1rem);
  box-sizing: border-box;
}

.input--7ch {
  width: calc(7ch + 1rem);
  min-width: 0;
  max-width: calc(7ch + 1rem);
  box-sizing: border-box;
}

.detail-row-input--5-digit {
  width: calc(5ch + 1rem);
  min-width: 0;
  max-width: calc(5ch + 1rem);
  text-align: center;
}

.adjustment-order-fee-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
}

.adjustment-order-fee-fields .form-field {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}

.adjustment-order-total-card {
  border-color: rgba(120, 140, 220, 0.35);
}

.adjustment-order-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.adjustment-order-total-label {
  font-weight: 600;
  color: #2f2840;
}

.adjustment-order-total-value {
  font-size: 1.25rem;
  color: var(--mint-deep);
}

.adjustment-order-total-hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.adjustment-order-lines-table th:nth-child(4),
.adjustment-order-lines-table th:nth-child(5),
.adjustment-order-lines-table td:nth-child(4),
.adjustment-order-lines-table td:nth-child(5) {
  width: calc(5ch + 2rem);
  white-space: nowrap;
}

.promoter-qty-save-actions {
  margin-top: 0.75rem;
  justify-content: flex-end;
}

.detail-row--editing {
  background: rgba(155, 127, 212, 0.06);
}

.detail-line legend {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--lavender-deep);
  padding: 0 0.35rem;
}

.remove-line {
  margin-top: 0.75rem;
}

/* Compact packed-box lines (create delivery order) */

.detail-lines--compact {
  gap: 0.5rem;
}

.detail-lines-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.detail-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.detail-lines-table th,
.detail-lines-table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.detail-lines-table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface);
  white-space: nowrap;
}

.detail-lines-table tbody tr:last-child td {
  border-bottom: none;
}

.detail-lines-table__num {
  width: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
}

.detail-lines-table__actions {
  width: 2.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}

.detail-lines--compact .detail-row-input {
  padding: 0.3rem 0.45rem;
  font-size: 0.8125rem;
  min-width: 0;
}

.detail-line-remove {
  min-width: 1.75rem;
  padding: 0.15rem 0.35rem;
  line-height: 1;
  font-size: 1.1rem;
}

.detail-lines-summary {
  margin: 0;
  font-size: 0.78rem;
}

.card-title-count {
  font-weight: 500;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert--error {
  background: #fde8e8;
  border: 1px solid #f0c0c0;
  color: #7a3030;
}

.alert--success {
  background: #e8f5e9;
  border: 1px solid #b8dfc0;
  color: #2e5a36;
}

.locations-alert {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.locations-alert p {
  margin: 0;
}

.location-select__search {
  margin-bottom: 0;
}

.location-select__wrap {
  position: relative;
}

.location-select__trigger {
  width: 100%;
  padding: 0.6rem 0.75rem;
  padding-right: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a708c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.location-select__trigger:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(155, 127, 212, 0.2);
}

.location-select__trigger:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.location-select__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(42, 34, 58, 0.12);
  overflow: hidden;
}

.location-select__search-wrap {
  padding: 0.45rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
}

.location-select__search-wrap .location-select__search {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.location-select__search-wrap .location-select__search:focus {
  outline: none;
  border-color: var(--lavender-deep);
  box-shadow: 0 0 0 3px rgba(155, 127, 212, 0.2);
}

.location-select__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 14rem;
  overflow-y: auto;
}

.location-select__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.location-select__option:hover,
.location-select__option:focus {
  outline: none;
  background: var(--surface-muted);
}

.location-select__option--selected {
  background: rgba(155, 127, 212, 0.12);
  font-weight: 600;
}

.location-select__empty {
  padding: 0.55rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Table */

.table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.sortable-th-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
}

.sortable-th-btn:hover,
.sortable-th-btn:focus-visible {
  color: var(--text);
}

.sortable-th-btn--active {
  color: var(--text);
  font-weight: 600;
}

.sortable-th-indicator {
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.45;
}

.sortable-th-btn--active .sortable-th-indicator {
  opacity: 1;
}

.data-table tbody tr:hover {
  background: #faf8fc;
}

.data-table tbody tr.clickable-row {
  cursor: pointer;
}

.data-table .cell-strong {
  font-weight: 600;
  color: #2f2840;
}

.data-table .cell-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta {
  margin-top: 1rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(160deg, #ede8f5 0%, #e8f5ef 45%, #fff8f5 100%);
}

.login-shell--loading {
  background: linear-gradient(160deg, #ede8f5 0%, #e8f5ef 45%, #fff8f5 100%);
}

.login-card--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  color: var(--text-muted);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  box-shadow: var(--shadow-hover);
}

.login-tagline {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lavender-deep);
  margin: 0.1rem 0 0.35rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2f2840;
}

.login-form {
  gap: 0.25rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.login-local-version {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.settings-groups {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.settings-group-title {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* Finance (FI) and Manager (DB) landing — module tiles */

.finance-landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(72vh, 640px);
  padding: 2rem 1.25rem 3rem;
  text-align: center;
}

.finance-landing-header {
  margin-bottom: 2rem;
  max-width: 44rem;
  width: 100%;
}

.finance-landing-heading {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 3.35rem);
  font-weight: 700;
  color: #2f2840;
  letter-spacing: -0.02em;
}

.finance-landing-lead {
  margin: 0.75rem 0 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.finance-module-nav {
  width: 100%;
  max-width: 44rem;
}

.finance-module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.finance-module-list > li {
  display: flex;
  min-width: 0;
}

.finance-module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  width: 100%;
  height: 100%;
  min-height: 12.5rem;
  padding: 1.5rem 1.25rem 1.35rem;
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.finance-module-card.finance-tile--notes {
  background: linear-gradient(135deg, #f8f4ff 0%, #ffffff 48%, #f0faf5 100%);
  border-color: rgba(155, 127, 212, 0.35);
}

.finance-module-card.finance-tile--summary {
  background: linear-gradient(135deg, #eef9f3 0%, #ffffff 48%, #fff8f4 100%);
  border-color: rgba(92, 184, 150, 0.35);
}

.finance-module-card.finance-tile--reports {
  background: linear-gradient(135deg, #fff6ee 0%, #ffffff 48%, #f4f6ff 100%);
  border-color: rgba(224, 168, 120, 0.4);
}

.finance-module-card.finance-tile--additional {
  background: linear-gradient(135deg, #eef4ff 0%, #ffffff 48%, #f5f0ff 100%);
  border-color: rgba(120, 140, 220, 0.35);
}

.finance-module-card.finance-tile--notes .finance-module-card-icon {
  background: rgba(201, 184, 232, 0.35);
  color: var(--lavender-deep);
}

.finance-module-card.finance-tile--summary .finance-module-card-icon {
  background: rgba(184, 232, 212, 0.45);
  color: var(--mint-deep);
}

.finance-module-card.finance-tile--reports .finance-module-card-icon {
  background: rgba(255, 220, 184, 0.5);
  color: #b86a2a;
}

.finance-module-card.finance-tile--additional .finance-module-card-icon {
  background: rgba(196, 210, 255, 0.45);
  color: #4a5fc9;
}

.finance-module-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  flex-shrink: 0;
}

.finance-module-card-icon .finance-tile-icon-svg {
  width: 1.5rem;
  height: 1.5rem;
}

.finance-module-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.finance-module-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2f2840;
  line-height: 1.25;
}

.finance-module-card-desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
  min-height: calc(0.9rem * 1.45 * 3);
  max-width: 15.5rem;
}

.finance-module-card-action {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.finance-module-card.finance-tile--notes .finance-module-card-action {
  color: var(--lavender-deep);
}

.finance-module-card.finance-tile--summary .finance-module-card-action {
  color: var(--mint-deep);
}

.finance-module-card.finance-tile--reports .finance-module-card-action {
  color: #b86a2a;
}

.finance-module-card.finance-tile--additional .finance-module-card-action {
  color: #4a5fc9;
}

.finance-module-card.finance-tile--notes:hover {
  border-color: var(--lavender-deep);
}

.finance-module-card.finance-tile--summary:hover {
  border-color: var(--mint-deep);
}

.finance-module-card.finance-tile--reports:hover {
  border-color: #b86a2a;
}

.finance-module-card.finance-tile--additional:hover {
  border-color: #4a5fc9;
}

.finance-module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.finance-module-card:focus-visible {
  outline: 3px solid var(--lavender-deep);
  outline-offset: 3px;
}

.page--finance-delivery-list .page-back-link {
  margin-bottom: 0.5rem;
}

.page--finance-reports-hub .page-header {
  margin-bottom: 1.5rem;
}

.finance-reports-hub-lead {
  margin: 0.5rem 0 0;
  max-width: 42rem;
  font-size: 1.02rem;
  line-height: 1.5;
}

.finance-reports-hub-panel {
  padding: 1.35rem 1.35rem 1.5rem;
}

.finance-reports-hub-panel__title {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.finance-reports-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.finance-report-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  width: 100%;
  padding: 1.15rem 1.2rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(224, 168, 120, 0.45);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, #fff9f3 0%, #ffffff 52%, #f7f4ff 100%);
  box-shadow: var(--shadow);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.finance-report-card:hover {
  transform: translateY(-2px);
  border-color: #b86a2a;
  box-shadow: var(--shadow-hover);
}

.finance-report-card:focus-visible {
  outline: 3px solid var(--lavender-deep);
  outline-offset: 3px;
}

.finance-report-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 16px;
  background: rgba(255, 220, 184, 0.55);
  color: #b86a2a;
}

.finance-report-card__icon-svg {
  width: 1.75rem;
  height: 1.75rem;
}

.finance-report-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.finance-report-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2f2840;
  line-height: 1.3;
}

.finance-report-card__desc {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.finance-report-card__action {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.finance-report-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #c97d3a 0%, #b86a2a 100%);
  box-shadow: 0 2px 8px rgba(184, 106, 42, 0.28);
}

.finance-report-card__chevron {
  font-size: 1.15rem;
  font-weight: 700;
  color: #b86a2a;
}

@media (max-width: 720px) {
  .finance-report-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .finance-report-card__icon {
    margin-inline: auto;
  }

  .finance-report-card__action {
    justify-content: center;
    margin-top: 0.35rem;
  }
}

.finance-reports-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.finance-reports-section-title {
  margin: 0 0 1rem;
  padding: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2f2840;
  border-bottom: 1px solid var(--border);
}

.page--finance-reports .payment-summary-table-wrap {
  padding: 1rem 1.25rem 1.25rem;
}

.page--finance-reports .page-header-lead {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}

.monthly-delivery-report {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.monthly-delivery-report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.monthly-delivery-report-toolbar__summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.monthly-delivery-report-toolbar__period {
  margin: 0;
  font-size: 1rem;
}

.monthly-delivery-report-toolbar__meta {
  margin: 0;
  font-size: 0.92rem;
}

.monthly-delivery-report-toolbar__actions {
  flex-shrink: 0;
}

.monthly-delivery-report-section {
  padding: 0;
  overflow: hidden;
}

.monthly-delivery-report-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(248, 244, 255, 0.7) 0%, #fff 100%);
}

.monthly-delivery-report-section__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #2f2840;
}

.monthly-delivery-report-section__meta {
  margin: 0;
  font-size: 0.88rem;
  white-space: nowrap;
}

.monthly-delivery-report-table-wrap {
  overflow-x: auto;
  padding: 0 0.35rem 0.35rem;
}

.order-receive-discrepancy-report__header {
  margin-bottom: 1rem;
}

.order-receive-discrepancy-report__title {
  margin: 0;
  font-size: 1.05rem;
}

.order-receive-discrepancy-report__meta {
  margin: 0.35rem 0 0;
}

.order-receive-discrepancy-report-table-wrap {
  overflow-x: auto;
  padding: 0 0.35rem 0.35rem;
}

.order-receive-discrepancy-report-table {
  min-width: 56rem;
  font-size: 0.88rem;
}

.order-receive-discrepancy-report-table th,
.order-receive-discrepancy-report-table td {
  vertical-align: middle;
  padding: 0.62rem 0.7rem;
}

.order-receive-discrepancy-report-table thead th {
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: normal;
  color: #4a4458;
  background: rgba(248, 244, 255, 0.95);
}

.order-receive-discrepancy-report-table__num {
  text-align: right;
  white-space: nowrap;
}

.monthly-delivery-report-table {
  min-width: 58rem;
  font-size: 0.88rem;
}

.monthly-delivery-report-table th,
.monthly-delivery-report-table td {
  vertical-align: middle;
  padding: 0.62rem 0.7rem;
}

.monthly-delivery-report-table thead th {
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: normal;
  color: #4a4458;
  background: rgba(248, 244, 255, 0.95);
  border-bottom: 2px solid rgba(155, 127, 212, 0.25);
}

.monthly-delivery-report-table__header-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
}

.monthly-delivery-report-table thead th:not(.monthly-delivery-report-table__num)
  .monthly-delivery-report-table__header-stack {
  align-items: flex-start;
}

.monthly-delivery-report-table__num {
  text-align: right;
  white-space: nowrap;
}

.monthly-delivery-report-table__date {
  white-space: nowrap;
}

.monthly-delivery-report-table__desc {
  min-width: 16rem;
  max-width: 28rem;
  line-height: 1.4;
}

.monthly-delivery-report-table__amount {
  font-weight: 700;
  color: #2f2840;
}

.monthly-delivery-report-table__order-row:nth-child(even) {
  background: rgba(250, 250, 252, 0.9);
}

.monthly-delivery-report-table__prop-row td {
  color: var(--text-muted);
  background: rgba(255, 249, 243, 0.75);
  font-size: 0.84rem;
}

.monthly-delivery-report-table__box-row td {
  color: var(--text-muted);
  background: rgba(250, 250, 252, 0.85);
  font-size: 0.84rem;
}

.monthly-delivery-report-table__rtw-row td,
.monthly-delivery-report-table__charge-row td {
  color: var(--text-muted);
  background: rgba(250, 250, 252, 0.85);
  font-size: 0.84rem;
}

.monthly-delivery-report-table__ot-row td {
  color: var(--text-muted);
  background: rgba(245, 248, 255, 0.9);
  font-size: 0.84rem;
}

.monthly-delivery-report-table__total-row th,
.monthly-delivery-report-table__total-row td {
  font-weight: 700;
  border-top: 2px solid rgba(155, 127, 212, 0.35);
  background: rgba(248, 244, 255, 0.85);
}

@media (max-width: 720px) {
  .monthly-delivery-report-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .monthly-delivery-report-toolbar__actions .btn {
    width: 100%;
  }

  .monthly-delivery-report-section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .monthly-delivery-report-section__meta {
    white-space: normal;
  }
}

@media print {
  .page--finance-reports .list-filters,
  .page--finance-reports .page-back-link,
  .monthly-delivery-report-toolbar__actions {
    display: none;
  }

  .monthly-delivery-report-section {
    break-inside: avoid-page;
  }
}

@media (max-width: 540px) {
  .finance-module-list {
    grid-template-columns: 1fr;
    max-width: 20rem;
    margin-inline: auto;
  }

  .finance-module-card-desc {
    min-height: calc(0.9rem * 1.45 * 3);
  }
}

@media (max-width: 720px) {
  .finance-module-card {
    min-height: 11.5rem;
    padding: 1.25rem 0.85rem 1.15rem;
  }

  .finance-module-card-desc {
    max-width: none;
  }
}

.settings-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-card-link:hover {
  border-color: var(--lavender);
  box-shadow: 0 4px 16px rgba(80, 60, 120, 0.08);
}

.settings-card-link .card-title {
  margin-bottom: 0.35rem;
}

.payment-summary-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

.payment-summary-total-label {
  font-weight: 600;
}

.payment-summary-total-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #4a3568;
}

.payment-summary-total-meta {
  margin-left: auto;
}

.payment-summary-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payment-summary-group {
  padding: 1rem 1.25rem 1.25rem;
}

.payment-summary-group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.payment-summary-group-header h2 {
  font-size: 1.05rem;
}

.payment-summary-group-total {
  font-weight: 700;
  color: #4a3568;
}

.payment-summary-table-wrap {
  padding: 0;
  overflow-x: auto;
}

.payment-summary-table {
  width: 100%;
  margin: 0;
}

.payment-summary-table-num {
  text-align: right;
  white-space: nowrap;
}

.payment-summary-table-amount {
  font-weight: 600;
  color: #4a3568;
}

.payment-summary-company-link {
  font-weight: 600;
  color: #4a3568;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.payment-summary-company-link:hover {
  color: #2d1f45;
}

.payment-summary-table-row--selected td {
  background-color: #f3eef9;
}

.payment-summary-drilldown-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.payment-summary-drilldown-header .monthly-charges-orders-panel__title {
  margin: 0;
}

.payment-summary-company-panel {
  margin-top: 1.25rem;
}

.payment-summary-table tfoot .payment-summary-table-total-row th,
.payment-summary-table tfoot .payment-summary-table-total-row td {
  background-color: #b2ebf2;
}

.payment-summary-table tfoot .payment-summary-table-total-row:hover th,
.payment-summary-table tfoot .payment-summary-table-total-row:hover td {
  background-color: #b2ebf2;
}

.payment-summary-footnote {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.monthly-charges-header-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font-size: calc(1.85rem * 0.5 * 1.5);
  line-height: 1.35;
}

.monthly-charges-header-total {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.monthly-charges-header-total__label {
  font-weight: 600;
  color: #000;
}

.monthly-charges-header-total__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1565c0;
}

.monthly-charges-header-ytd-qty {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font-size: calc(1.85rem * 0.5 * 1.5);
  line-height: 1.35;
}

.monthly-charges-header-ytd-qty__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.monthly-charges-header-ytd-qty__label {
  font-weight: 600;
  color: #000;
}

.monthly-charges-header-ytd-qty__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1565c0;
}

.payment-summary-total--monthly {
  flex-wrap: wrap;
}

.monthly-collection-period-summary {
  align-items: baseline;
}

.monthly-collection-qty-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.monthly-collection-qty-inline > div {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.monthly-collection-qty-inline dt {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.monthly-collection-qty-inline dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #4a3568;
  font-variant-numeric: tabular-nums;
}

.payment-summary-orders-toggle {
  margin-left: auto;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: #4a3568;
  text-decoration: underline;
  cursor: pointer;
}

.payment-summary-orders-toggle:hover {
  color: #2d1f45;
}

.payment-summary-orders-toggle-hint {
  text-decoration: none;
}

.monthly-charges-orders-panel {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem 1.25rem;
}

.monthly-charges-orders-panel__title {
  margin: 0;
  font-size: 1.05rem;
}

.monthly-charges-orders-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.monthly-charges-orders-panel__status-filter {
  min-width: 14rem;
  margin: 0;
}

.monthly-charges-orders-wrap {
  overflow-x: auto;
}

.monthly-charges-orders-table {
  width: 100%;
  margin: 0;
}

.monthly-charges-order-link {
  font-weight: 600;
  color: #4a3568;
}

.monthly-charges-order-link:hover {
  color: #2d1f45;
}

.monthly-charges-orders-empty {
  margin: 0;
}

.page--delivery-driver-board .page-header {
  margin-bottom: 1rem;
}

.dd-board {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dd-dataset {
  padding: 0;
  overflow: hidden;
}

.dd-board-panel {
  width: 100%;
  min-width: 0;
  padding: 1.1rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.dd-board-panel:last-child {
  border-bottom: none;
}

.dd-board-panel__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: #2f2840;
}

.dd-board-table-wrap {
  margin-top: 0;
}

.dd-board-table {
  font-size: 0.78rem;
}

.dd-board-table th,
.dd-board-table td {
  padding: 0.45rem 0.5rem;
  vertical-align: top;
}

.dd-board-table__num {
  text-align: right;
  white-space: nowrap;
}

.dd-board-panel .dd-board-table tbody tr:last-child td {
  border-bottom: none;
}

.dd-board-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wh-board-card {
  padding: 0;
  overflow: hidden;
}

.wh-board-note-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wh-board-note-list .note-list-item:last-child .note-card {
  margin-bottom: 0;
}

.wh-board-panel__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.dd-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(47, 40, 64, 0.45);
}

.dd-confirm-dialog {
  width: min(100%, 480px);
  margin: 0;
  padding: 1.5rem;
  box-shadow: var(--shadow-hover);
}

.dd-confirm-dialog__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2f2840;
}

.dd-confirm-dialog__lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.dd-confirm-dialog__fields {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dd-confirm-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dd-confirm-dialog .alert {
  margin-top: 1rem;
  margin-bottom: 0;
}

.mark-payment-paid-dialog__fields {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.mark-payment-paid-dialog__timestamp {
  display: block;
  padding: 0.55rem 0.75rem;
  background: var(--surface-muted, #f5f3f8);
  border: 1px solid var(--border, #ddd8e6);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2f2840;
}

@media (max-width: 640px) {
  .app-main {
    padding: 1.25rem 1rem 2rem;
  }

  .header-inner {
    padding: 0.85rem 1rem;
    flex-wrap: wrap;
  }

  .module-tabs {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .header-nav {
    flex-basis: 100%;
    margin-left: 0;
  }

  .header-nav-end {
    width: 100%;
    justify-content: space-between;
  }

  .header-user-name {
    max-width: 8rem;
  }

  .page-header h1 {
    font-size: 1.45rem;
  }

  .page--monthly-collection .page-header h1 {
    font-size: calc(1.45rem * 1.1);
  }

  .monthly-charges-header-totals {
    font-size: calc(1.45rem * 0.5 * 1.5);
  }

  .monthly-charges-header-ytd-qty {
    font-size: calc(1.45rem * 0.5 * 1.5);
  }
}
