@import url("./layout.css");
:root {
  --ink: #26382f;
  --muted: #727a72;
  --green: #294b39;
  --line: #e4e6de;
  --paper: #fafbf7;
  --sage: #e9eee3;
  --radius: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--paper);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #bd8547;
  outline-offset: 3px;
}
svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  z-index: 20;
  background: white;
  padding: 15px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -1.1px;
  margin-bottom: 10px;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 0;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 7px;
}
.muted {
  color: var(--muted);
  margin-bottom: 0;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.heading-dot {
  color: #a1b083;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 17px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s;
}
.primary {
  background: var(--green);
  color: #fff;
}
.primary:hover {
  background: #1e392a;
}
.secondary {
  background: white;
  border-color: #dce0d6;
  color: var(--ink);
}
.secondary:hover {
  background: #f1f3eb;
}
.full {
  width: 100%;
}
.text-link,
.back-link {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}
.back-link {
  display: inline-block;
  margin-bottom: 22px;
}
.text-link:hover,
.back-link:hover,
.panel-heading a:hover {
  text-decoration: underline;
}
.pill {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  background: var(--sage);
  color: #4b6342;
  padding: 5px 9px;
  border-radius: 5px;
  white-space: nowrap;
}
.pill.urgent {
  background: #faeee4;
  color: #94622c;
}
.pill.light {
  background: #ffffff12;
  border: 1px solid #ffffff25;
  color: #eef2df;
  letter-spacing: 1.5px;
  font-size: 9px;
}
.count {
  font-size: 11px;
  background: #f0f2e9;
  border-radius: 5px;
  padding: 3px 7px;
  color: var(--muted);
  margin-left: 7px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 23px 24px 18px;
}
.panel-heading a,
.panel-heading > .muted {
  font-size: 11px;
  font-weight: 500;
}
.empty-state {
  text-align: center;
  padding: 48px 22px;
  color: var(--muted);
}
.empty-state > svg {
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  color: #859574;
}
.empty-state h3 {
  color: var(--ink);
}
.empty-state p {
  font-size: 13px;
  margin-bottom: 17px;
}
.empty-state.compact {
  padding: 33px 20px;
}
.row-main {
  min-width: 0;
  flex: 1;
}
.row-main strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.row-main small {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.task-row,
.event-row,
.inventory-row,
.member-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-top: 1px solid #f0f1eb;
}
.task-row:hover,
.event-row:hover,
.inventory-row:hover {
  background: #fafbf7;
}
.task-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid #d7ddcf;
  border-radius: 5px;
  flex-shrink: 0;
}
.task-checkbox.in-progress {
  background: #e5ebd8;
  border-color: #a9b58d;
}
.event-time {
  font-size: 12px;
  font-weight: 600;
  color: #59704a;
  align-self: flex-start;
  padding-top: 1px;
}
.item-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0eee5;
  color: #8c8059;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-family: Georgia, serif;
  font-size: 20px;
}
.stock-value {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}
.stock-value small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.finance-panel {
  padding-bottom: 24px;
}
.balance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 24px 22px;
  gap: 14px;
}
.balance > span {
  color: var(--muted);
  font-size: 12px;
}
.balance > span + span {
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.balance strong {
  display: block;
  color: var(--ink);
  font-size: 27px;
  letter-spacing: -1px;
  font-weight: 550;
  margin-top: 8px;
}
.finance-panel > .muted {
  font-size: 11px;
  margin: 0 24px 20px;
}
.finance-panel > .button {
  margin-left: 24px;
}
.activity-panel {
  margin-top: 22px;
}
.audit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid #f0f1eb;
  font-size: 12px;
}
.audit-row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.audit-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.audit-row time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.audit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a2b18d;
  flex-shrink: 0;
}
.padded {
  padding: 10px 24px 24px;
  font-size: 13px;
}
.notice {
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid #e5dfcc;
  background: #f8f5eb;
  color: #726340;
  border-radius: 10px;
  font-size: 12px;
}
.message {
  border: 1px solid #c6d6bc;
  background: #edf5e7;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 22px;
  color: #365327;
}
.form-panel {
  max-width: 760px;
  padding: 30px;
}
.field {
  margin-bottom: 21px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 7px;
}
.field label > span {
  color: #798a65;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
.field input,
.field select,
.field textarea,
.filters input,
.filters select,
.form-actions select {
  border: 1px solid #d5dbd0;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
}
.field textarea {
  resize: vertical;
}
.helptext {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.helptext ul {
  padding-left: 18px;
}
.form-errors,
.field-errors {
  color: #9e3c30;
  font-size: 12px;
}
.form-errors {
  padding: 12px 16px;
  background: #fff0ed;
  border: 1px solid #f0cfc7;
  border-radius: 7px;
  margin-bottom: 20px;
}
.form-errors ul,
.field-errors ul {
  margin: 0;
  padding-left: 16px;
}
.has-error input,
.has-error select,
.has-error textarea {
  border-color: #b45240;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px;
}
.search-field {
  flex: 1;
  min-width: 180px;
}
.search-field input {
  width: 100%;
  background: #fbfcf8;
}
.results-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  background: #f8f9f4;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 550;
  white-space: nowrap;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
td {
  padding: 19px 20px;
  border-bottom: 1px solid #eef0e8;
  max-width: 290px;
  overflow-wrap: anywhere;
}
td:last-child {
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafbf8;
}
.record-link {
  font-weight: 600;
  display: inline-block;
  min-height: 24px;
}
.pagination {
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  gap: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.detail-panel {
  padding: 28px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  margin: 0;
}
.detail-grid dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-grid dd {
  font-size: 15px;
  margin: 0;
  overflow-wrap: anywhere;
}
.notes {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 24px;
}
.notes p {
  white-space: normal;
  overflow-wrap: anywhere;
  color: #5f6b5f;
  margin: 12px 0 0;
}
.calendar-scroll {
  overflow-x: auto;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 700px;
}
.weekday {
  background: #f8f9f4;
  padding: 10px 12px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
  border-top: 1px solid var(--line);
}
.calendar-day {
  min-height: 125px;
  padding: 9px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.calendar-day:nth-child(7n) {
  border-right: 0;
}
.calendar-day.outside {
  background: #fafbf8;
  color: #a2a99d;
}
.day-number {
  display: flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.today .day-number {
  background: var(--green);
  color: white;
  border-radius: 50%;
}
.calendar-event {
  display: block;
  background: #edf2e7;
  border-left: 2px solid #84986a;
  border-radius: 4px;
  padding: 5px 7px;
  margin-top: 7px;
  font-size: 11px;
  overflow-wrap: anywhere;
  color: #3d5534;
}
.calendar-event small {
  display: block;
  font-size: 9px;
  margin-bottom: 3px;
  color: #6c7d5f;
}
.team-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.team-grid .form-panel h2 {
  margin-bottom: 25px;
}
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: radial-gradient(ellipse at 0 100%, #d9e0c8, transparent 60%),
    #f2f4ec;
}
.auth-card {
  width: 440px;
  max-width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 42px;
  box-shadow: 0 20px 70px #2a422610;
}
.auth-card .auth-brand {
  color: var(--green);
  margin-bottom: 42px;
  padding: 0;
}
.auth-card .brand-caption {
  color: var(--muted);
}
.auth-card .brand-mark {
  background: var(--green);
  color: white;
}
.auth-card h1 {
  font-size: 38px;
  margin-bottom: 14px;
}
.auth-card form {
  margin-top: 28px;
}
.auth-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin: 24px 0 0;
}
.auth-card .button {
  justify-content: space-between;
}

/* Order preparation and shared stock availability. */
.order-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px;
  border-top: 1px solid var(--line);
}
.order-actions label {
  font-size: 12px;
  font-weight: 600;
}
.order-actions select {
  flex: 1;
  min-width: 180px;
  max-width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.message.error {
  background: #fff0ed;
  border-color: #f0cfc7;
  color: #9e3c30;
}
.print-hint {
  margin-top: 24px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .order-actions {
    padding: 18px;
  }
  .order-actions label {
    width: 100%;
  }
  .order-actions select {
    width: 100%;
    flex-basis: 100%;
    min-width: 0;
  }
  .panel-heading:has(.actions) {
    flex-wrap: wrap;
  }
}
@media print {
  .sidebar,
  .topbar,
  .page-footer,
  .back-link,
  .demo-banner,
  .print-hint,
  .skip-link {
    display: none !important;
  }
  .workspace {
    margin: 0;
    width: 100%;
  }
  .main-content {
    padding: 0;
  }
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }
  .print-sheet {
    border: 0;
    padding: 0;
    overflow: visible;
  }
  .print-sheet .table-scroll {
    overflow: visible;
  }
  .print-sheet table {
    min-width: 0;
  }
  .print-sheet tr {
    break-inside: avoid;
  }
  .print-sheet th,
  .print-sheet td {
    padding: 10px;
  }
  .page-heading {
    margin-bottom: 20px;
  }
}

@media (max-width: 760px) {
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .order-lines-table {
    min-width: 0 !important;
  }
  .order-lines-table thead {
    display: none;
  }
  .order-lines-table tbody,
  .order-lines-table tr {
    display: block;
  }
  .order-lines-table tr {
    padding: 14px 18px;
    border-top: 1px solid var(--line);
  }
  .order-lines-table td {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }
  .order-lines-table td::before {
    content: attr(data-label);
    text-align: left;
    color: var(--muted);
    flex-shrink: 0;
  }
}

.notification-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  background: #e6ecd9;
  color: #304834;
  border-radius: 12px;
  font-size: 10px;
  text-align: center;
}
.notification-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-top: 1px solid var(--line);
}
.notification-card.unread {
  border-left: 3px solid #789463;
}
.notification-copy {
  min-width: 0;
}
.notification-copy h2 {
  margin: 10px 0 7px;
  overflow-wrap: anywhere;
}
.notification-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.notification-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.notification-card .actions {
  flex-shrink: 0;
}
.field input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--green);
}
@media (max-width: 760px) {
  .notification-card {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }
  .notification-copy h2 {
    font-size: 16px;
  }
}
.receipt-details {
  padding: 24px;
  border-top: 1px solid var(--line);
}

.draft-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:16px}
.draft-card{padding:22px;margin-bottom:20px;overflow-wrap:anywhere}
.draft-line{padding:22px;margin:18px 0;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 20px}
.draft-line legend{font-weight:700;padding:0 8px}
.draft-line .field:first-of-type{grid-column:1/-1}
@media(max-width:600px){.draft-line{grid-template-columns:minmax(0,1fr);padding:16px}}
.xml-preview{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:600px;overflow:auto;background:#f5f7f4;padding:16px;border-radius:8px}
.message.warning{background:#faf5e8;border:1px solid #e4d3a4;color:#6a531e}
.assistant-composer{max-width:760px;margin-inline:auto}
.assistant-input{border:1px solid #c8d4c9;border-radius:22px;background:#fff;padding:12px}
.assistant-input textarea{border:0!important;box-shadow:none!important;resize:vertical;min-height:90px;max-height:280px;width:100%;background:transparent}
.assistant-input:focus-within{outline:2px solid #64886c;outline-offset:2px}
.assistant-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.assistant-icon{display:inline-flex;align-items:center;justify-content:center;border:0;background:#edf2ed;color:#263f34;border-radius:50%;width:44px;height:44px;font-size:24px;cursor:pointer;flex:none}
.assistant-icon svg,.assistant-fab svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}
.assistant-icon:disabled{opacity:.35;cursor:default}
.assistant-send{margin-left:auto;background:#263f34;color:#fff}
.assistant-icon:focus-visible,.assistant-fab:focus-visible{outline:3px solid #88a16b;outline-offset:3px}
.assistant-fab{position:fixed;right:22px;bottom:calc(22px + env(safe-area-inset-bottom));display:flex;gap:8px;align-items:center;background:#263f34;color:white;padding:14px 18px;border-radius:28px;box-shadow:0 4px 18px #182c3033;z-index:30;text-decoration:none;font-weight:600}
body:has(.assistant-fab) .page-footer{padding-bottom:90px}
@media(max-width:600px){.assistant-fab{right:14px;bottom:calc(14px + env(safe-area-inset-bottom));padding:13px}.assistant-fab span{display:none}.assistant-composer{padding:16px}.assistant-controls{gap:6px}}
/* Conversational workspace */
body:has(.assistant-chat) .main-content{padding:22px 28px 8px}
body:has(.assistant-chat) .page-footer{display:none}
.assistant-chat{display:flex;flex-direction:column;max-width:1000px;margin:auto;height:calc(100dvh - 150px);min-height:560px;background:#fafbf7;border:1px solid #e3e8de;border-radius:24px;overflow:hidden;box-shadow:0 12px 40px #294b3906}
.chat-header{display:flex;align-items:center;gap:12px;padding:20px 26px;border-bottom:1px solid #e7eade;background:#fff}
.chat-brand-icon,.chat-avatar{display:inline-flex;align-items:center;justify-content:center;background:#294b39;color:#f5f2dc;border-radius:13px;font-family:Georgia,serif;font-size:30px;width:45px;height:45px;flex:none}
.chat-header h1{font-size:21px;margin:0;letter-spacing:-.5px}.chat-header h1 span{font-weight:400;color:#7b8378;margin-left:7px}.chat-header p{margin:2px 0 0;color:#7b8378;font-size:12px}.chat-connection{margin-left:auto;color:#55735b;font-size:11px;white-space:nowrap}
.chat-timeline{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:28px 8%;scroll-behavior:smooth}
.chat-welcome{text-align:center;padding:24px 0 32px}.chat-eyebrow{font-size:10px;letter-spacing:2px;color:#7b906e;font-weight:700}.chat-welcome h2{font-size:30px;letter-spacing:-1px;margin:12px 0}.chat-welcome p{color:#738071;font-size:14px;line-height:1.7}.chat-welcome small{display:block;color:#839080;font-size:11px;margin-top:14px}
.chat-suggestions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:22px 0 0}.chat-suggestions button{border:1px solid #dfe6d8;background:#fff;border-radius:14px;padding:12px 15px;color:#39563e;cursor:pointer;text-align:left}.chat-suggestions button:hover{background:#edf3e9;border-color:#aabc9f}
.chat-turn{margin:0 0 26px}.chat-message{max-width:90%;margin-bottom:18px}.chat-user{margin-left:auto;max-width:80%}.chat-meta{display:flex;align-items:center;gap:8px;font-size:11px;color:#7c8678;margin-bottom:7px}.chat-user .chat-meta{justify-content:flex-end}.chat-meta time{font-size:10px;opacity:.8}.chat-bubble{background:#e8efdf;border-radius:18px 18px 4px 18px;padding:13px 17px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}.chat-avatar{font-size:19px;width:25px;height:25px;border-radius:8px}.chat-answer{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75;padding:1px 0 8px;color:#3d4c3e}
.chat-preview-card{border:1px solid #dce5d6;border-radius:16px;background:#fff;padding:18px;margin-top:8px;box-shadow:0 4px 12px #293c2905}.chat-card-top{display:flex;gap:8px;align-items:center;font-size:11px;color:#668060;flex-wrap:wrap}.chat-card-icon{font-size:22px}.chat-card-state{margin-left:auto;border-radius:8px;background:#f0f4e8;padding:3px 7px;font-size:10px}.chat-preview-card h3{font-size:17px;margin:10px 0 5px;overflow-wrap:anywhere}.chat-preview-card p{font-size:12px;color:#798275;overflow-wrap:anywhere}.chat-preview-link{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #edf0e8;padding-top:12px;margin-top:14px;font-weight:600;color:#395e43;text-decoration:none}
.assistant-chat .assistant-composer{flex:none;max-width:none;width:100%;margin:0;border:0;border-top:1px solid #e6eadf;border-radius:0;background:#fff;padding:14px 7% 12px}.assistant-chat .assistant-input{padding:6px 10px;border-radius:18px;background:#fafbf7}.assistant-chat textarea{min-height:48px;height:54px;max-height:130px;padding:7px;font:inherit;line-height:1.5}.chat-mode{display:flex;align-items:center;gap:8px;margin-bottom:9px;font-size:11px;flex-wrap:wrap}.chat-mode label{display:none}.chat-mode select{border:1px solid #e3e8da;border-radius:8px;background:#f7f9f3;color:#526d50;padding:5px 9px;font:inherit;max-width:100%}.chat-mode span{margin-left:auto;color:#929b89;font-size:10px}.assistant-chat .assistant-icon{width:36px;height:36px;font-size:22px}.assistant-chat #voice-status{font-size:11px;color:#6f7f67;margin:7px 0}.chat-privacy{font-size:9px;color:#8a9483;margin:4px 0}.assistant-chat details{font-size:10px;color:#7d8874}.assistant-chat audio{height:32px;width:100%;margin:4px 0}.chat-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.chat-system{background:#f2f1e7;padding:12px 15px;border-radius:12px;color:#766748;font-size:12px;margin-bottom:16px}.chat-thinking{font-size:12px;color:#788b6c;padding:12px 0;animation:chat-pulse 1.2s ease-in-out infinite}.chat-legacy{font-size:12px;color:#788570}@keyframes chat-pulse{50%{opacity:.45}}
@media(prefers-reduced-motion:reduce){.chat-thinking{animation:none}.chat-timeline{scroll-behavior:auto}}
@media(max-width:700px){body:has(.assistant-chat) .main-content{padding:8px}.assistant-chat{height:calc(100dvh - 215px);min-height:570px;border-radius:18px}.chat-header{padding:14px}.chat-header h1{font-size:18px}.chat-connection{font-size:9px}.chat-brand-icon{width:36px;height:36px;font-size:25px}.chat-header p{display:none}.chat-timeline{padding:20px 16px}.chat-welcome{padding:10px 0 24px}.chat-welcome h2{font-size:25px}.chat-message{max-width:98%}.chat-user{max-width:88%}.assistant-chat .assistant-composer{padding:10px 12px}.chat-mode span{display:none}.chat-suggestions{gap:7px}.chat-suggestions button{font-size:12px;padding:10px}}
/* The composer owns the focus ring; keep the text entry visually integrated. */
.assistant-chat .assistant-composer textarea,
.assistant-chat .assistant-composer textarea:focus {
  border: 0; outline: none; box-shadow: none; resize: none; background: transparent;
}
@media (max-width: 700px) {
  .assistant-chat { height: calc(100dvh - 275px); min-height: 480px; }
}
.document-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:18px;margin:24px 0}.document-card{overflow-wrap:anywhere}.document-preview{width:100%;height:65vh;min-height:320px;border:0;background:#f4f5f0}.document-image{display:block;max-width:100%;max-height:75vh;object-fit:contain;margin:auto}
.document-card,.document-panel{padding:20px}.document-panel{overflow-wrap:anywhere}
.document-archive form{display:grid;gap:10px;margin:16px 0}.document-archive label{display:block}.document-archive input:not([type=checkbox]):not([type=hidden]),.document-archive select{display:block;width:100%;min-height:42px;padding:9px 12px;border:1px solid #d6ddcf;border-radius:8px;background:#fff;font:inherit}.document-archive form .button{justify-self:start}.document-archive .document-card>label{margin-bottom:14px}.document-grid:empty{display:none}.document-archive nav{margin-bottom:16px;overflow-wrap:anywhere}.document-archive details form+form{border-top:1px solid #d6ddcf;padding-top:16px}
.document-card[draggable=true]{cursor:grab}.document-card[draggable=true]:active{cursor:grabbing}.document-drop-active{outline:3px solid #527d54!important;outline-offset:3px;background:#edf4e7!important}.document-upload-drop{padding:24px;margin-bottom:22px;border:2px dashed #9cae90;border-radius:16px;background:#f6f8f2;text-align:center}.document-upload-drop[hidden]{display:none}[data-drop-folder]{transition:background .15s}#document-drag-status{font-size:13px;color:#51634e}
.calendar-day:has(.calendar-day-create){cursor:pointer}.calendar-day-create{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;text-decoration:none}.calendar-day-create:hover,.calendar-day-create:focus-visible{background:#dce9d4;border-radius:50%}#calendar-dialog{border:1px solid #dce1d6;border-radius:20px;padding:28px;width:min(540px,calc(100vw - 24px));max-height:90dvh;overflow:auto;color:#263f34}#calendar-dialog::backdrop{background:rgba(20,38,29,.45)}.calendar-modal-close{float:right;border:0;background:#edf2e8;border-radius:50%;width:36px;height:36px;font-size:24px;cursor:pointer}.calendar-fixed-date{padding:14px;border-radius:12px;background:#edf2e8}.calendar-day-form input:not([type=hidden]),.calendar-day-form select,.calendar-day-form textarea{display:block;width:100%;padding:10px;border:1px solid #ced8c6;border-radius:8px;font:inherit}.calendar-day-form label{display:block;margin-bottom:6px}.calendar-day-form .errorlist{color:#9d3024}

/* Document explorer: the same files and controls in two layouts. */
.document-view-switch { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:18px 0; }
.document-view-switch[hidden], .document-inspector[hidden], #document-preview-open[hidden] { display:none; }
.document-view-switch [aria-pressed="true"] { background:#205c41; color:white; }
.document-actions { margin-top:12px; }
.document-actions summary { cursor:pointer; font-weight:600; }
.document-actions[open] { padding:12px; border:1px solid #cbd9d0; border-radius:10px; }
.document-actions[open] a, .document-actions[open] button { display:inline-block; margin:8px 8px 0 0; }
.document-desktop .document-workspace { display:grid; grid-template-columns:minmax(0, 1.2fr) minmax(280px, 1fr); gap:20px; align-items:start; margin:24px 0; }
.document-desktop .document-files { display:flex; flex-direction:column; gap:8px; margin:0; }
.document-desktop .document-files .document-card { padding:16px; cursor:default; }
.document-desktop .document-files h2 { font-size:17px; margin:8px 0; }
.document-desktop .document-files p { margin:8px 0; }
.document-selected { outline:2px solid #287451; background:#f0f8f3; }
.document-inspector { padding:20px; position:sticky; top:20px; overflow-wrap:anywhere; min-width:0; }
#document-preview-body img { width:100%; max-height:65vh; object-fit:contain; }
#document-preview-body iframe { width:100%; height:60vh; border:0; }
#document-preview-open { margin-top:16px; }
@media(max-width:800px) { .document-desktop .document-workspace { grid-template-columns:1fr; } .document-inspector { position:static; } }
@media(min-width:900px) {
 .document-archive form[method="get"] { grid-template-columns:1fr 2fr 1fr auto; align-items:end; }
 .document-archive form[method="get"] label { grid-row:1; }
 .document-archive form[method="get"] input:not([type="hidden"]), .document-archive form[method="get"] select { grid-row:2; }
 .document-archive form[method="get"] button { grid-column:4; grid-row:2; }
 .document-archive #move-documents { grid-template-columns:minmax(180px,1fr) minmax(220px,2fr) auto; align-items:center; }
}

.stock-pagination { padding:20px 24px; display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.filters.stock-filters { align-items:flex-end; gap:16px; }
.stock-filters label { display:flex; flex-direction:column; gap:8px; min-width:0; }
.stock-detail-layout > .panel { margin-top:24px; margin-bottom:24px; }
.stock-detail-layout > h2 { margin-top:28px; margin-bottom:16px; }

/* Shared select affordance: leave room for text and inset the chevron. */
body select:not([multiple]):not([size]), body select[size="1"] {
  -webkit-appearance:none;
  appearance:none;
  padding-right:42px !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23526758' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-position:right 14px center !important;
  background-size:16px 16px !important;
  background-repeat:no-repeat !important;
}
.stock-filter-actions { display:flex; align-items:center; gap:16px; min-height:44px; }
.stock-filter-actions > a { display:inline-flex; align-items:center; min-height:44px; }
.page-heading.stock-page-heading { margin-bottom:13px; }
@media (forced-colors:active) {
  body select:not([multiple]):not([size]), body select[size="1"] { appearance:auto; background-image:none !important; }
}

/* Keep lot actions together; let the product title use the remaining width. */
@media (min-width: 761px) {
  .stock-detail-layout > .page-heading > div:first-child {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .stock-detail-layout > .page-heading > .actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }
  .stock-detail-layout > .page-heading > .actions .button {
    white-space: nowrap;
  }
}

.lot-removal { max-width: 1140px; margin: 0 auto; }
.lot-removal-layout { display:grid; grid-template-columns:minmax(240px, .8fr) minmax(0, 1.6fr); gap:24px; align-items:start; }
.lot-removal-source, .lot-removal-main { padding:28px; }
.lot-removal h2 { margin:0 0 16px; overflow-wrap:anywhere; }
.lot-removal-main > p, .lot-removal-main form > p { color:var(--muted); line-height:1.6; }
.lot-removal-tag { display:inline-block; background:var(--sage); padding:7px 12px; border-radius:8px; font-size:13px; }
.lot-removal-quantity { padding:25px 0; border-bottom:1px solid var(--line); }
.lot-removal-quantity strong { font-size:38px; letter-spacing:-1px; }
.lot-removal-quantity small { display:block; color:var(--muted); margin-top:5px; }
.lot-removal-source dl { margin:20px 0; }
.lot-removal-source dl div { display:flex; justify-content:space-between; gap:16px; margin:14px 0; font-size:13px; }
.lot-removal-source dt { color:var(--muted); }
.lot-removal-source dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.lot-removal-note { font-size:13px; line-height:1.6; color:var(--muted); }
.lot-removal-targets { border:0; padding:0; margin:22px 0; display:grid; gap:12px; }
.lot-removal-targets legend { font-size:13px; margin-bottom:12px; color:var(--muted); }
.lot-removal-option { display:flex; align-items:center; gap:14px; border:1px solid var(--line); padding:18px; border-radius:12px; cursor:pointer; }
.lot-removal-option:hover { background:var(--paper); }
.lot-removal-option:has(input:checked) { border-color:var(--green); background:var(--sage); box-shadow:0 0 0 1px var(--green); }
.lot-removal-option input, .lot-removal-confirm input { width:18px; height:18px; margin:0; flex-shrink:0; accent-color:var(--green); }
.lot-removal-option span { flex:1; min-width:0; overflow-wrap:anywhere; }
.lot-removal-option small { display:block; color:var(--muted); margin-top:6px; line-height:1.5; }
.lot-removal-option b { white-space:nowrap; font-size:14px; }
.lot-removal-actions { display:flex; flex-wrap:wrap; align-items:center; gap:16px; padding-top:24px; margin-top:24px; border-top:1px solid var(--line); }
.lot-removal-alert { background:#fff6e7; border:1px solid #e8d2ac; padding:18px; border-radius:12px; margin:20px 0; line-height:1.5; }
.lot-removal-alert p { margin:8px 0 0; }
.lot-removal-summary { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:24px 0; }
.lot-removal-summary > div { padding:20px; border-radius:12px; background:var(--paper); border:1px solid var(--line); overflow-wrap:anywhere; }
.lot-removal-summary > div:last-child { background:var(--sage); }
.lot-removal-summary small, .lot-removal-summary span { font-size:12px; color:var(--muted); }
.lot-removal-summary p { font-size:20px; margin:14px 0; }
.lot-removal-confirm { display:flex; align-items:flex-start; gap:12px; line-height:1.5; }
.lot-removal-confirm input { margin-top:3px; }
.lot-removal-empty { padding:20px; background:var(--paper); border-radius:12px; line-height:1.6; }
@media (max-width:760px) {
  .lot-removal-layout, .lot-removal-summary { grid-template-columns:1fr; }
  .lot-removal-source, .lot-removal-main { padding:20px; }
  .lot-removal-option { flex-wrap:wrap; }
  .lot-removal-option b { margin-left:32px; }
}

.stock-archive { margin-top:24px; overflow:hidden; }
.stock-archive > summary { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 26px; cursor:pointer; list-style:none; }
.stock-archive > summary::-webkit-details-marker { display:none; }
.stock-archive > summary:hover { background:var(--paper); }
.stock-archive > summary:focus-visible { outline:2px solid var(--green); outline-offset:-4px; }
.stock-archive-heading { display:flex; align-items:center; gap:16px; }
.stock-archive-heading strong { display:flex; align-items:center; gap:10px; font-size:17px; }
.stock-archive-heading small { display:block; color:var(--muted); margin-top:6px; line-height:1.5; }
.stock-archive-icon { display:grid; place-items:center; width:42px; height:42px; flex-shrink:0; border-radius:12px; background:var(--sage); font-size:24px; }
.stock-archive-count { background:var(--sage); border-radius:20px; padding:3px 9px; font-size:12px; }
.stock-archive-chevron { font-size:24px; transition:transform .15s; }
.stock-archive[open] .stock-archive-chevron { transform:rotate(180deg); }
.stock-archive-body { padding:0 26px 26px; border-top:1px solid var(--line); }
.stock-archive-body > p { margin:18px 0; line-height:1.6; }
.stock-archive-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:16px; }
.stock-archive-card { padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--paper); min-width:0; }
.stock-archive-card header { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:12px; color:var(--muted); }
.stock-archive-badge { border-radius:6px; padding:5px 8px; background:#edece7; color:#62665f; }
.stock-archive-card h3 { margin:18px 0 6px; font-size:17px; overflow-wrap:anywhere; }
.stock-archive-lot { margin:0 0 18px; font-size:14px; overflow-wrap:anywhere; }
.stock-archive-card dl { margin:0 0 20px; }
.stock-archive-card dl div { display:flex; justify-content:space-between; gap:14px; margin-top:10px; font-size:13px; }
.stock-archive-card dt { color:var(--muted); }
.stock-archive-card dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.stock-archive-card .button { width:100%; text-align:center; }
@media(max-width:760px) {
  .stock-archive > summary { padding:18px; }
  .stock-archive-body { padding:0 18px 18px; }
}

.stock-related { padding:26px; }
.stock-related-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.stock-related-heading h2 { margin:0 0 8px; }
.stock-related-heading p { margin:0; color:var(--muted); font-size:13px; line-height:1.6; }
.stock-related-heading > .button { flex-shrink:0; }
.stock-related-badge { display:inline-block; font-size:12px; padding:5px 9px; border-radius:6px; color:var(--green); background:var(--sage); }
.stock-related-quantity { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; margin:16px 0 20px; }
.stock-related-quantity strong { font-size:24px; }
.stock-related-quantity span { font-size:12px; color:var(--muted); }
.stock-related-empty { background:var(--paper); border:1px dashed var(--line); padding:24px; border-radius:12px; }
.stock-related-empty p { margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.6; }
.stock-transformations { display:grid; gap:18px; }
.stock-transformation { border:1px solid var(--line); padding:22px; border-radius:12px; }
.stock-transformation > header { display:flex; justify-content:space-between; align-items:start; gap:16px; }
.stock-transformation h3 { margin:12px 0 0; font-size:18px; overflow-wrap:anywhere; }
.stock-transformation time { color:var(--muted); font-size:13px; white-space:nowrap; }
.stock-transformation-flow { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:18px; margin:22px 0; }
.stock-transformation-flow > div { display:flex; flex-direction:column; align-items:start; gap:8px; background:var(--paper); border-radius:10px; padding:18px; overflow-wrap:anywhere; }
.stock-transformation-flow small { font-size:10px; color:var(--muted); letter-spacing:.06em; }
.stock-transformation-flow a { font-size:13px; }
.stock-transformation-flow b { font-size:22px; margin-top:5px; }
.stock-transformation-arrow { font-size:24px; color:var(--muted); }
.stock-transformation footer { border-top:1px solid var(--line); padding-top:16px; display:flex; align-items:center; justify-content:space-between; gap:14px; }
@media(max-width:760px) {
  .stock-related { padding:20px; }
  .stock-related-heading { align-items:start; flex-direction:column; }
  .stock-transformation { padding:16px; }
  .stock-transformation-flow { grid-template-columns:1fr; gap:8px; }
  .stock-transformation-arrow { transform:rotate(90deg); justify-self:center; }
  .stock-transformation footer { flex-wrap:wrap; }
}

/* Compact related stock cards while keeping quantities and navigation visible. */
.stock-related { padding:20px; }
.stock-related-heading { margin-bottom:16px; gap:14px; }
.stock-related-heading h2 { margin-bottom:5px; font-size:18px; }
.stock-related .stock-archive-grid { gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr)); }
.stock-related .stock-archive-card { padding:14px; }
.stock-related .stock-archive-card h3 { margin:10px 0 4px; font-size:15px; }
.stock-related .stock-archive-card dl { margin-bottom:12px; }
.stock-related .stock-archive-card dl div { margin-top:6px; }
.stock-related .stock-archive-card .button { width:auto; }
.stock-related .button { padding:8px 12px; font-size:12px; }
.stock-related-badge { padding:3px 7px; font-size:11px; }
.stock-related-quantity { margin:8px 0 12px; }
.stock-related-quantity strong { font-size:20px; }
.stock-related-empty { padding:16px; }
.stock-transformations { gap:12px; }
.stock-transformation { padding:14px 16px; }
.stock-transformation > header > div { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.stock-transformation h3 { margin:0; font-size:16px; }
.stock-transformation-flow { gap:12px; margin:12px 0; }
.stock-transformation-flow > div { padding:10px 12px; gap:4px; }
.stock-transformation-flow b { font-size:18px; margin-top:0; }
.stock-transformation footer { padding-top:10px; }
@media(max-width:760px) {
  .stock-related { padding:16px; }
  .stock-related-heading { gap:10px; }
  .stock-transformation { padding:12px; }
  .stock-transformation-flow { gap:4px; }
}

/* Match the compact density of the active lot cards. */
.stock-archive > summary { padding:16px 20px; gap:14px; }
.stock-archive-heading { gap:12px; }
.stock-archive-heading strong { font-size:16px; }
.stock-archive-heading small { margin-top:3px; font-size:12px; }
.stock-archive-icon { width:34px; height:34px; border-radius:9px; font-size:20px; }
.stock-archive-body { padding:0 20px 20px; }
.stock-archive-body > p { margin:12px 0; font-size:13px; }
.stock-archive .stock-archive-grid { gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr)); }
.stock-archive .stock-archive-card { padding:14px; }
.stock-archive .stock-archive-card h3 { margin:10px 0 4px; font-size:15px; }
.stock-archive .stock-archive-lot { margin:0 0 12px; font-size:13px; }
.stock-archive .stock-archive-card dl { margin:0 0 12px; }
.stock-archive .stock-archive-card dl div { margin-top:6px; }
.stock-archive .stock-archive-badge { padding:3px 7px; font-size:11px; }
.stock-archive .stock-archive-card .button { width:auto; padding:8px 12px; font-size:12px; }
@media(max-width:760px) {
  .stock-archive > summary { padding:14px 16px; }
  .stock-archive-body { padding:0 16px 16px; }
}

/* Field crops: compact cards and consistent sections. */
.field-workspace > .page-heading { margin-bottom:20px; }
.field-workspace > .panel { margin:20px 0; }
.field-workspace .filters { gap:14px; align-items:end; padding:18px 20px; }
.field-workspace .filters label { display:flex; flex-direction:column; gap:7px; }
.field-workspace .filters p { margin:0; }
.field-crop-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); gap:14px; padding:0 20px 20px; }
.field-crop-card { border:1px solid var(--line); border-radius:12px; padding:18px; background:var(--paper); min-width:0; }
.field-crop-card header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; color:var(--muted); }
.field-crop-card h2 { font-size:19px; margin:14px 0 5px; overflow-wrap:anywhere; }
.field-crop-variety { margin:0; color:var(--muted); font-size:13px; }
.field-crop-area { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; padding:14px 0; margin-bottom:12px; border-bottom:1px solid var(--line); }
.field-crop-area strong { font-size:23px; }
.field-crop-area span { font-size:12px; color:var(--muted); }
.field-crop-card dl { margin:0 0 16px; }
.field-crop-card dl div { display:flex; justify-content:space-between; gap:12px; margin-top:8px; font-size:13px; }
.field-crop-card dt { color:var(--muted); }
.field-crop-card dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.field-workspace .button { padding:9px 13px; font-size:12px; }
.field-workspace .pagination { padding:14px 20px; }
.field-workspace-detail > .page-heading > div:first-child { min-width:0; overflow-wrap:anywhere; }
.field-workspace-detail .page-heading .actions { flex-shrink:0; }
.field-workspace-detail > .detail-panel, .field-harvest-summary, .field-revisions { padding:20px; }
.field-workspace-detail h2 { font-size:18px; margin:0 0 16px; }
.field-workspace-detail .detail-grid { gap:18px 24px; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); }
.field-workspace-detail .detail-grid dt { font-size:12px; margin-bottom:6px; }
.field-workspace-detail .detail-grid dd { font-size:16px; margin:0; overflow-wrap:anywhere; }
.field-workspace-detail .detail-grid dd small { font-size:12px; color:var(--muted); }
.field-harvest-summary .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.field-harvest-summary .detail-grid > div { padding:12px 16px; background:var(--sage); border-radius:10px; }
.field-harvest-summary .detail-grid dd { font-size:24px; }
.field-workspace-detail .muted { font-size:13px; line-height:1.6; }
.field-workspace-detail .panel-heading { padding:18px 20px; }
.field-workspace-detail .panel-heading h2 { margin:0; }
.field-workspace-detail .notes { margin-top:18px; padding-top:16px; }
.field-operation { margin:12px 20px; padding:14px 16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.field-operation .row-main { min-width:0; overflow-wrap:anywhere; }
.field-operation .row-main > strong { font-size:14px; }
.field-operation .row-main > small { font-size:12px; margin-top:5px; }
.field-operation .row-main p { margin:8px 0; font-size:13px; }
.field-operation-void { border-style:dashed; background:#f2f1ed; }
.field-revisions details { padding:12px 0; border-top:1px solid var(--line); font-size:13px; }
.field-revisions summary { cursor:pointer; line-height:1.6; }
@media(max-width:760px) {
  .field-workspace-detail .page-heading .actions { flex-wrap:wrap; }
  .field-crop-grid { padding:0 14px 14px; }
  .field-workspace .filters { padding:14px; }
  .field-workspace-detail > .detail-panel, .field-harvest-summary, .field-revisions { padding:16px; }
  .field-workspace-detail .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  .field-operation { margin:10px 14px; padding:12px; }
}

/* Give the crop's main data sheet more room than the activity sections. */
.field-workspace-detail > .detail-panel { padding:28px 30px; }
.field-workspace-detail > .detail-panel h2 { margin-bottom:24px; }
.field-workspace-detail > .detail-panel .detail-grid {
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:28px 32px;
}
.field-workspace-detail > .detail-panel .detail-grid dt { margin-bottom:9px; font-size:13px; }
.field-workspace-detail > .detail-panel .detail-grid dd { font-size:18px; }
.field-workspace-detail > .detail-panel .notes { margin-top:26px; padding-top:22px; }
@media(max-width:1000px) {
  .field-workspace-detail > .detail-panel .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .field-workspace-detail > .detail-panel { padding:22px 18px; }
  .field-workspace-detail > .detail-panel .detail-grid { gap:24px 18px; }
  .field-workspace-detail > .detail-panel .detail-grid dd { font-size:16px; }
}
@media(max-width:420px) {
  .field-workspace-detail > .detail-panel .detail-grid { grid-template-columns:1fr; }
}

.field-workspace .filters > a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:end;
  min-height:38px;
  padding:9px 8px;
  line-height:20px;
}
.field-workspace .filters > button { min-height:38px; line-height:20px; }
.field-crop-card dl div {
  display:grid;
  grid-template-columns:92px minmax(0,1fr);
  justify-content:start;
  gap:10px;
  align-items:baseline;
}
.field-crop-card dd { text-align:left; }

.field-site-group + .field-site-group { border-top:1px solid var(--line); }
.field-site-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:18px 20px 14px; }
.field-site-heading h2 { margin:0; font-size:19px; }
.field-site-heading span { color:var(--muted); font-size:12px; }
@media(max-width:760px) { .field-site-heading { align-items:start; flex-direction:column; gap:5px; padding:16px 14px; } }

/* Fit more crops per site without shrinking the text. */
.field-crop-grid {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
  gap:12px;
}
.field-crop-card { padding:14px; }
.field-crop-card h2 { margin-top:10px; font-size:17px; }
.field-crop-area { padding:10px 0; margin-bottom:10px; gap:5px 8px; }
.field-crop-area strong { font-size:21px; }
.field-crop-card dl { margin-bottom:12px; }
.field-crop-card dl div { grid-template-columns:82px minmax(0,1fr); gap:8px; }
@media(max-width:540px) {
  .field-crop-grid { grid-template-columns:1fr; }
}

.phyto-workspace > .page-heading { margin-bottom:20px; }
.phyto-workspace .page-heading > div:first-child { min-width:0; overflow-wrap:anywhere; }
.phyto-workspace > .panel { margin:20px 0; }
.phyto-workspace .button { padding:9px 13px; font-size:12px; }
.phyto-workspace .muted { font-size:13px; line-height:1.6; }
.phyto-filters { align-items:end; gap:12px; padding:18px 20px; }
.phyto-filters label { display:flex; flex-direction:column; gap:7px; flex:1; max-width:500px; }
.phyto-filters > a, .phyto-filters > button { min-height:38px; line-height:20px; }
.phyto-filters > a { display:inline-flex; align-items:center; padding:9px 8px; }
.phyto-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:12px; padding:0 20px 20px; }
.phyto-card { padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--paper); min-width:0; }
.phyto-card header { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; font-size:12px; color:var(--muted); }
.phyto-card h2 { font-size:17px; margin:12px 0; overflow-wrap:anywhere; }
.phyto-badge { display:inline-block; background:var(--sage); color:var(--green); font-size:11px; padding:4px 8px; border-radius:6px; white-space:nowrap; }
.phyto-expired { background:#f8e6e2; color:#943d31; }
.phyto-empty { background:#eeede8; color:#66665b; }
.phyto-used { background:#f5eddb; color:#76591f; }
.phyto-quantity { margin:12px 0 16px; }
.phyto-quantity strong { font-size:26px; }
.phyto-quantity strong span { font-size:16px; }
.phyto-quantity small { display:block; margin-top:4px; color:var(--muted); font-size:12px; }
.phyto-card dl { margin:0 0 16px; }
.phyto-card dl div { display:grid; grid-template-columns:90px minmax(0,1fr); gap:10px; margin-top:8px; font-size:13px; }
.phyto-workspace dt { color:var(--muted); }
.phyto-workspace dd { margin:0; overflow-wrap:anywhere; }
.phyto-overview { padding:24px; display:grid; grid-template-columns:minmax(180px,.7fr) minmax(0,2fr); gap:24px; }
.phyto-balance { border-right:1px solid var(--line); }
.phyto-balance .phyto-quantity { margin-bottom:0; }
.phyto-overview > dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:0; align-content:center; }
.phyto-overview dt { font-size:12px; margin-bottom:8px; }
.phyto-overview dd { font-size:16px; }
.phyto-notes { grid-column:1/-1; border-top:1px solid var(--line); padding-top:16px; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.phyto-notes h2 { margin:0; font-size:16px; }
.phyto-history-heading { padding:20px; display:flex; justify-content:space-between; gap:16px; align-items:center; }
.phyto-history-heading h2 { margin:0; font-size:18px; }
.phyto-history-heading p { margin:6px 0 0; }
.phyto-movements { padding:0 20px; display:grid; gap:12px; }
.phyto-movement { border:1px solid var(--line); border-radius:10px; padding:14px 16px; overflow-wrap:anywhere; }
.phyto-movement header, .phyto-movement header > div { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.phyto-movement header { justify-content:space-between; }
.phyto-movement time { font-size:12px; color:var(--muted); }
.phyto-movement header > strong { font-size:18px; }
.phyto-field { margin:12px 0; font-size:14px; }
.phyto-field small { display:block; margin-top:5px; font-size:12px; color:var(--muted); }
.phyto-movement-notes { font-size:13px; line-height:1.6; margin:10px 0; }
.phyto-void { font-size:12px; background:#eeede8; padding:8px 10px; border-radius:6px; }
.phyto-movement > small { display:block; margin-top:10px; }
@media(max-width:760px) {
  .phyto-overview { grid-template-columns:1fr; padding:18px; gap:18px; }
  .phyto-balance { border-right:0; border-bottom:1px solid var(--line); padding-bottom:16px; }
  .phyto-overview > dl { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .phyto-history-heading { flex-wrap:wrap; padding:16px; }
  .phyto-movements { padding:0 16px; }
  .phyto-grid { padding:0 16px 16px; }
  .phyto-filters { padding:16px; flex-wrap:wrap; }
}

.processing-workspace > .page-heading { margin-bottom:20px; }
.processing-workspace .button { padding:9px 13px; font-size:12px; }
.processing-workspace .muted { font-size:13px; line-height:1.6; }
.processing-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.processing-tools > a { padding:18px; display:flex; flex-direction:column; gap:8px; text-decoration:none; }
.processing-tools > a:hover { border-color:var(--green); background:var(--paper); }
.processing-tools span { font-size:13px; color:var(--muted); line-height:1.6; }
.processing-history { padding:20px; }
.processing-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.processing-heading h2 { font-size:18px; margin:0; }
.processing-help { font-size:13px; color:var(--muted); line-height:1.6; margin:12px 0 18px; }
.processing-history .stock-pagination { padding:20px 0 0; }
.processing-workspace > .form-panel, .processing-workspace > .document-panel { margin:20px 0; padding:24px; }
.processing-workspace .form-panel form > p { margin:0 0 18px; }
.processing-workspace .form-panel form > p > label { display:block; margin-bottom:7px; }
.processing-workspace > .document-panel h2 { font-size:18px; margin-top:24px; }
.processing-workspace > .document-panel h2:first-child { margin-top:0; }
.processing-workspace .stock-related-empty .button { margin-top:14px; }
@media(max-width:760px) {
  .processing-tools { grid-template-columns:1fr; gap:10px; }
  .processing-history { padding:16px; }
  .processing-heading { flex-wrap:wrap; }
  .processing-workspace > .form-panel, .processing-workspace > .document-panel { padding:18px; }
}

.stock-transformation > header > .transformation-status {
  margin-left:auto;
  justify-content:flex-end;
}

.processing-rule-form, .processing-rule-list { padding:22px; margin:20px 0; }
.processing-rule-form h2, .processing-rule-list h2, .processing-form-section h2 { font-size:18px; margin:0; }
.processing-rule-form header > p, .processing-form-section header p { font-size:13px; color:var(--muted); line-height:1.6; margin:7px 0 18px; }
.processing-fields-three { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.processing-fields-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.processing-workspace .field { min-width:0; margin-bottom:14px; }
.processing-workspace .field label { display:block; margin-bottom:8px; font-size:13px; }
.processing-workspace .field .helptext { display:block; margin-top:7px; font-size:12px; line-height:1.5; color:var(--muted); }
.processing-form-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; border-top:1px solid var(--line); padding-top:18px; }
.processing-form-footer > p { font-size:13px; color:var(--muted); line-height:1.6; margin:0; max-width:560px; }
.processing-form-footer > button, .processing-form-footer > .actions { flex-shrink:0; }
.processing-product-group { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
.processing-product-group h3 { font-size:17px; margin:0 0 12px; }
.processing-product-group h3 small { font-size:12px; font-weight:normal; color:var(--muted); margin-left:8px; }
.processing-rule-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:12px; }
.processing-rule-card { border:1px solid var(--line); border-radius:10px; padding:14px; background:var(--paper); min-width:0; overflow-wrap:anywhere; }
.processing-rule-card header { display:flex; justify-content:space-between; align-items:start; gap:12px; }
.processing-rule-card p { display:flex; flex-direction:column; gap:5px; margin:14px 0 0; }
.processing-rule-card p span, .processing-rule-card p small { color:var(--muted); font-size:12px; }
.processing-form-section { padding:22px; margin-bottom:16px; }
.processing-form-section header { display:flex; gap:12px; align-items:start; }
.processing-step { width:28px; height:28px; display:grid; place-items:center; background:var(--sage); color:var(--green); border-radius:8px; flex-shrink:0; font-size:13px; font-weight:bold; }
.processing-unit-note { background:var(--sage); color:var(--green); padding:12px 14px; border-radius:8px; font-size:13px; line-height:1.5; margin:0; }
@media(max-width:760px) {
 .processing-fields-three, .processing-fields-two { grid-template-columns:1fr; gap:0; }
 .processing-form-footer { flex-wrap:wrap; gap:14px; }
 .processing-rule-form, .processing-rule-list, .processing-form-section { padding:18px; }
}

.quantity-with-unit { display:flex; align-items:stretch; }
.quantity-with-unit input { flex:1; min-width:0; width:100%; border-top-right-radius:0; border-bottom-right-radius:0; }
.quantity-unit { display:flex; align-items:center; justify-content:center; min-width:52px; padding:0 14px; border:1px solid var(--line); border-left:0; border-radius:0 8px 8px 0; background:var(--sage); color:var(--green); font-size:14px; font-weight:600; }

.calendar-jump { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding:0 24px 20px; }
.calendar-jump label { display:flex; flex-direction:column; gap:7px; font-size:13px; }
.calendar-jump select { min-width:130px; }
.calendar-jump .button { min-height:40px; }
@media(max-width:760px) { .calendar-jump { padding:0 16px 16px; } }

.calendar-period-picker { position:relative; }
.calendar-period-picker > summary { display:flex; align-items:center; gap:10px; font-size:20px; font-weight:600; cursor:pointer; list-style:none; padding:7px 0; }
.calendar-period-picker > summary::-webkit-details-marker { display:none; }
.calendar-period-picker > summary > span { font-size:18px; color:var(--muted); }
.calendar-period-picker > summary:focus-visible { outline:2px solid var(--green); outline-offset:5px; border-radius:4px; }
.calendar-period-panel { position:absolute; z-index:20; top:calc(100% + 10px); left:0; width:320px; max-width:calc(100vw - 68px); padding:18px; background:white; border:1px solid var(--line); border-radius:14px; box-shadow:0 12px 35px #26382f24; }
.calendar-year-nav { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.calendar-year-nav .button { padding:7px 12px; }
.calendar-picker-year { font-size:18px; }
.calendar-month-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.calendar-month-options a { display:flex; align-items:center; justify-content:center; padding:11px 4px; border-radius:8px; text-decoration:none; font-size:12px; color:var(--ink); }
.calendar-month-options a:hover, .calendar-month-options a:focus-visible { background:var(--sage); }
.calendar-month-options a[aria-current] { background:var(--green); color:white; font-weight:600; }
.calendar-picker-today { display:block; text-align:center; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); font-size:12px; }

.order-detail-workspace > .page-heading { margin-bottom:20px; }
.order-detail-workspace .page-heading > div:first-child { min-width:0; overflow-wrap:anywhere; }
.order-detail-workspace .page-heading .actions { flex-shrink:0; }
.order-detail-workspace > .panel, .order-detail-workspace > .notice { margin:20px 0; }
.order-detail-workspace h2 { font-size:18px; margin:0; }
.order-detail-workspace .button { padding:9px 13px; font-size:12px; }
.order-detail-workspace .muted { font-size:13px; line-height:1.6; }
.order-state { padding:8px 12px; border-radius:8px; font-size:12px; font-weight:600; white-space:nowrap; }
.order-state-new { background:#f5eddb; color:#76591f; }
.order-state-ready { background:#e6edf5; color:#345574; }
.order-state-delivered { background:var(--sage); color:var(--green); }
.order-state-cancelled { background:#eeede8; color:#66665b; }
.order-summary { padding:22px; }
.order-summary dl { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; margin:20px 0 0; }
.order-summary dt { color:var(--muted); font-size:12px; margin-bottom:7px; }
.order-summary dd { margin:0; font-size:15px; overflow-wrap:anywhere; }
.order-instructions { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.order-instructions h3 { font-size:14px; margin:0 0 8px; }
.order-instructions p { font-size:13px; line-height:1.6; margin:0; overflow-wrap:anywhere; }
.order-detail-workspace .panel-heading { padding:18px 20px; gap:16px; }
.order-detail-workspace .order-lines-table th, .order-detail-workspace .order-lines-table td { padding:14px 20px; }
.order-detail-workspace .order-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px 14px; padding:20px; margin:0; background:var(--paper); border-top:1px solid var(--line); }
.order-detail-workspace .order-actions label { grid-column:1/-1; font-size:13px; margin:0; }
.order-detail-workspace .order-actions select { min-width:0; width:100%; }
.order-detail-workspace > .notice { font-size:13px; line-height:1.6; padding:16px 20px; }
.order-billing { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:20px; }
.order-billing p { font-size:13px; line-height:1.6; color:var(--muted); margin:7px 0 0; }
.order-billing > a, .order-billing > form { flex-shrink:0; }
.order-detail-workspace .document-panel h3 { font-size:15px; margin:20px 0 10px; }
.order-detail-workspace .document-panel > p { font-size:13px; line-height:1.6; }
.order-detail-workspace .document-panel .panel-heading { padding:0 0 14px; }
@media(max-width:760px) {
 .order-summary { padding:18px; }
 .order-summary dl { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
 .order-detail-workspace .panel-heading { flex-wrap:wrap; padding:16px; }
 .order-detail-workspace .order-actions { grid-template-columns:1fr; padding:16px; }
 .order-billing { flex-direction:column; align-items:start; padding:18px; }
}

.document-archive > .page-heading { margin-bottom:20px; }
.document-archive .button { padding:9px 13px; font-size:12px; }
.document-archive form[method="get"] { display:grid; grid-template-columns:1fr 2fr 1fr auto; gap:8px 14px; align-items:end; margin-bottom:18px; padding:18px 20px; }
.document-archive form[method="get"] label { grid-row:1; font-size:12px; }
.document-archive form[method="get"] input:not([type="hidden"]), .document-archive form[method="get"] select { grid-row:2; min-width:0; }
.document-search-actions { grid-column:4; grid-row:2; display:flex; align-items:center; gap:12px; }
.document-breadcrumbs { display:flex; flex-wrap:wrap; gap:8px; padding:12px 0; font-size:14px; }
.document-folder-settings { margin:8px 0 16px; padding:14px 18px; }
.document-folder-settings summary { cursor:pointer; font-size:13px; font-weight:600; }
.document-folder-settings form { margin-top:16px; }
.document-folder-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; margin:14px 0 24px; }
.document-folder-tile { padding:16px; background:var(--sage); border:1px solid var(--line); border-radius:10px; font-weight:600; font-size:14px; text-decoration:none; overflow-wrap:anywhere; }
.document-folder-tile:hover { border-color:var(--green); }
.document-file-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; margin:18px 0 12px; }
.document-file-heading h2 { margin:0; font-size:18px; }
.document-file-heading h2 span { font-size:12px; color:var(--muted); margin-left:6px; }
.document-file-heading .document-view-switch { margin:0; }
#document-drag-status { font-size:12px; color:var(--muted); line-height:1.5; }
.document-archive #move-documents[hidden] { display:none; }
.document-archive #move-documents { background:var(--sage); padding:14px 16px; border-radius:10px; margin:12px 0 18px; }
.document-files { grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px; }
.document-files .document-card { padding:16px; min-width:0; }
.document-files .document-card > label { display:block; font-size:12px; color:var(--muted); margin-bottom:12px; }
.document-files .document-card h2 { font-size:17px; margin:10px 0 6px; }
.document-files .document-card > p { margin:8px 0 12px; font-size:13px; }
.document-files .document-card > small { font-size:11px; line-height:1.5; }
.document-actions { padding-top:10px; border-top:1px solid var(--line); margin-top:12px; }
.document-actions summary { font-size:12px; }
.document-inspector h2 { font-size:18px; padding-right:25px; }
.document-preview-close { position:absolute; top:12px; right:14px; border:0; background:var(--sage); border-radius:8px; width:30px; height:30px; cursor:pointer; font-size:22px; }
.document-desktop .document-files .document-card { padding:14px 16px; }
@media(max-width:800px) {
 .document-archive form[method="get"] { grid-template-columns:1fr; padding:16px; }
 .document-archive form[method="get"] label, .document-archive form[method="get"] input:not([type="hidden"]), .document-archive form[method="get"] select, .document-search-actions { grid-row:auto; grid-column:1; }
 .document-file-heading { flex-wrap:wrap; }
}

.document-files .document-empty-state {
  grid-column:1/-1;
  padding:24px;
  margin:0;
}
.document-empty-state h2 { margin:0 0 10px; font-size:18px; }
.document-empty-state p { margin:0; color:var(--muted); line-height:1.6; }
.document-archive > .stock-pagination { padding:18px 0; margin:0; }

.document-preview-close {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  padding:0;
  border:0;
  line-height:1;
  color:var(--ink);
}
.document-preview-close:hover { background:transparent; color:var(--green); }
.document-preview-close:focus-visible { outline:2px solid var(--green); outline-offset:2px; }

.document-upload-page { max-width:1120px; margin:0 auto; }
.document-upload-page .page-heading { margin-bottom:22px; }
.document-upload-layout { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.4fr); gap:20px; align-items:start; }
.document-upload-layout > .panel { padding:24px; }
.document-upload-layout h2 { margin:0 0 22px; font-size:18px; }
.document-upload-page .document-upload-drop { margin:0 0 20px; padding:28px 18px; text-align:center; background:var(--paper); border:2px dashed #cbd9d0; border-radius:12px; }
.document-upload-drop > svg { display:block; margin:0 auto 14px; color:var(--green); }
.document-upload-page .document-upload-drop strong { display:block; font-size:15px; }
.document-upload-page .document-upload-drop p { font-size:12px; line-height:1.6; color:var(--muted); margin:8px 0 0; }
.document-upload-page .field { margin-bottom:18px; min-width:0; }
.document-upload-page .field > label { display:block; margin-bottom:8px; font-size:13px; }
.document-upload-page input[type=file] { width:100%; font-size:12px; }
.document-upload-page input[type=file]::file-selector-button { background:var(--sage); border:0; border-radius:7px; padding:9px 12px; margin-right:10px; color:var(--green); cursor:pointer; }
.document-format-hint { font-size:12px; line-height:1.7; color:var(--muted); margin:0; }
.document-upload-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.document-upload-data textarea { min-height:100px; height:110px; resize:vertical; }
.document-upload-sharing { padding:15px; border-radius:10px; background:var(--paper); border:1px solid var(--line); }
.document-upload-sharing label { display:flex; gap:12px; align-items:start; cursor:pointer; }
.document-upload-sharing input { width:18px; height:18px; flex-shrink:0; margin:2px 0 0; }
.document-upload-sharing strong { font-size:13px; }
.document-upload-sharing small { display:block; margin-top:6px; color:var(--muted); font-size:12px; line-height:1.5; }
.document-upload-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:20px; padding:18px 0; border-top:1px solid var(--line); }
.document-upload-footer > p { font-size:12px; color:var(--muted); margin:0; }
.document-upload-page .button { font-size:13px; }
@media(max-width:800px) {
 .document-upload-layout { grid-template-columns:1fr; gap:16px; }
 .document-upload-layout > .panel { padding:20px; }
 .document-upload-footer { flex-wrap:wrap; }
}
@media(max-width:480px) { .document-upload-fields { grid-template-columns:1fr; gap:0; } }

.unified-personal-work { margin:24px 0 30px; scroll-margin-top:20px; }
.unified-personal-work > h2, .company-overview-heading { font-size:21px; margin:0 0 10px; }
.unified-personal-work > .muted { font-size:13px; line-height:1.6; margin:10px 0 18px; }
.unified-personal-work > .panel { margin:16px 0; }
.unified-personal-work .filters { align-items:end; gap:14px; }
.unified-personal-work .filters label { display:flex; flex-direction:column; gap:7px; }
.unified-personal-work .stats-grid { margin:18px 0; }
.unified-personal-work .stat-card { padding:18px; }
.company-overview-heading { margin-top:30px; }

.work-type-chips { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.work-type-chips a { display:inline-flex; align-items:center; gap:10px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; background:white; text-decoration:none; font-size:13px; }
.work-type-chips strong { padding:2px 6px; border-radius:5px; background:var(--sage); font-size:12px; }
.work-type-chips a[aria-current] { border-color:var(--green); background:var(--sage); }
.unified-personal-work .panel-heading h3 { font-size:16px; margin:0; }

.dispatch-workspace > .page-heading { margin-bottom:20px; }
.dispatch-workspace .button { padding:9px 13px; font-size:12px; }
.dispatch-filter-panel .filters { padding:18px 20px; margin:0; align-items:end; gap:14px; }
.dispatch-filter-panel label { display:flex; flex-direction:column; gap:7px; font-size:13px; }
.dispatch-filter-panel .filters > a { padding:10px 8px; line-height:20px; }
.dispatch-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:18px 0; }
.dispatch-stats .stat-card { padding:18px 20px; }
.dispatch-stats .stat-card strong { font-size:28px; margin-top:8px; }
.dispatch-help { font-size:12px; line-height:1.6; color:var(--muted); margin:16px 0 20px; }
.dispatch-order-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:start; }
.dispatch-order-card { padding:20px; min-width:0; }
.dispatch-order-card > header { display:flex; justify-content:space-between; align-items:start; gap:14px; }
.dispatch-order-card h2 { margin:0; font-size:19px; overflow-wrap:anywhere; }
.dispatch-customer { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:9px 0 18px; font-size:14px; }
.dispatch-order-card dl { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:0 0 18px; }
.dispatch-order-card dt { color:var(--muted); font-size:12px; margin-bottom:7px; }
.dispatch-order-card dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
.dispatch-late { display:inline-block; font-size:11px; color:#943d31; margin-left:8px; }
.dispatch-issues { background:#fff6e7; border:1px solid #ecddbd; border-radius:10px; padding:14px 16px; font-size:13px; line-height:1.6; }
.dispatch-issues h3 { margin:0 0 8px; font-size:13px; color:#76591f; }
.dispatch-issues ul { margin:0; padding-left:18px; }
.dispatch-issues li + li { margin-top:10px; }
.dispatch-stock-ok { background:var(--sage); color:var(--green); padding:12px 14px; border-radius:10px; font-size:13px; margin:0; line-height:1.5; }
.dispatch-review { font-size:12px; line-height:1.6; color:var(--muted); }
.dispatch-order-card footer { display:flex; flex-wrap:wrap; gap:10px; padding-top:18px; }
.dispatch-empty { grid-column:1/-1; padding:28px; }
.dispatch-empty h2 { font-size:18px; margin:0 0 10px; }
.dispatch-empty p { color:var(--muted); font-size:13px; }
.dispatch-workspace > .pagination { padding:18px 0; }
@media(max-width:900px) { .dispatch-order-grid { grid-template-columns:1fr; } }
@media(max-width:540px) {
 .dispatch-stats { gap:8px; }
 .dispatch-stats .stat-card { padding:12px; }
 .dispatch-stats .stat-label { font-size:11px; }
 .dispatch-order-card { padding:16px; }
 .dispatch-filter-panel .filters { padding:16px; }
}

/* Prodotto seminato riconoscibile nelle schede e nel dettaglio. */
.field-sown-product { display:flex; flex-direction:column; gap:3px; margin-top:10px; padding:8px 10px; border-left:2px solid #b8cbbd; border-radius:0 6px 6px 0; background:#f5f8f5; overflow-wrap:anywhere; }
.field-sown-product .field-sown-label { font-size:10px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--green); }
.field-sown-product strong { font-size:18px; line-height:1.25; color:var(--green); }
.field-sown-product .field-sown-variety { font-size:12px; color:var(--muted); }

/* Scontrini: compilazione compatta e conferma separata. */
.receipts-workspace > .panel { margin-top:18px; }
.receipt-connection { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 22px; }
.receipt-connection h2 { font-size:16px; margin:0 0 5px; }
.receipt-connection p { color:var(--muted); margin:0; font-size:13px; }
.receipt-section-heading { padding:22px 22px 16px; }
.receipt-section-heading h2 { margin:0; font-size:21px; }
.receipt-section-heading p:not(.eyebrow) { color:var(--muted); margin:8px 0 0; font-size:13px; }
.receipt-products { padding:0 22px; }
.receipt-product { min-width:0; margin:0 0 14px; padding:12px 14px 16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.receipt-product legend { padding:0 6px; font-size:12px; font-weight:600; color:var(--muted); }
.receipt-product-fields { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1.4fr) minmax(0,.7fr); gap:14px; align-items:start; }
.receipts-workspace .field { min-width:0; }
.receipts-workspace .field label { display:block; margin:0 0 7px; font-size:12px; font-weight:600; }
.receipts-workspace .field input,.receipts-workspace .field select { width:100%; min-width:0; }
.receipt-payment { display:flex; align-items:end; gap:22px; padding:4px 22px 22px; }
.receipt-payment .field { width:240px; flex-shrink:0; }
.receipt-payment p { font-size:12px; color:var(--muted); line-height:1.6; }
.receipt-editor-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 22px; border-top:1px solid var(--line); }
.receipt-editor-footer strong { font-size:14px; }
.receipt-editor-footer p { font-size:12px; color:var(--muted); margin:6px 0 0; line-height:1.5; }
.receipt-editor-footer .button { flex-shrink:0; }
.receipt-history { padding-bottom:8px; }
.receipt-history-filters { display:flex; align-items:end; flex-wrap:wrap; gap:14px; padding:0 22px 18px; }
.receipt-history-filters > a { padding:12px 0; }
.receipt-history > p { margin:0; padding:0 22px 16px; color:var(--muted); font-size:12px; }
.receipt-history-row { padding:16px 22px; border-top:1px solid var(--line); }
.receipt-history-row a { font-weight:600; }
.receipt-history-row p { margin:7px 0 0; color:var(--muted); font-size:13px; }
.receipt-empty { padding:22px; color:var(--muted); }
.receipt-detail > .panel { padding:22px; }
.receipt-summary-row { display:flex; justify-content:space-between; gap:16px; padding:14px 0; border-bottom:1px solid var(--line); }
.receipt-summary-row span { text-align:right; }
.receipt-summary-row small { color:var(--muted); }
@media(max-width:700px) {
 .receipt-connection,.receipt-payment,.receipt-editor-footer { flex-direction:column; align-items:stretch; }
 .receipt-product-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .receipt-product-fields .field:first-child { grid-column:1/-1; }
 .receipt-payment .field { width:100%; }
 .receipt-products { padding:0 14px; }
 .receipt-section-heading,.receipt-editor-footer,.receipt-connection { padding:18px 14px; }
 .receipt-summary-row { flex-direction:column; gap:6px; }
 .receipt-summary-row span { text-align:left; }
}

.receipt-payment { align-items:center; }
.receipt-payment > p { margin:0; }
.receipt-history-filters .field { margin:0; }
.receipt-history-filters > .button,
.receipt-history-filters > a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; margin:0; padding:10px 14px; line-height:22px; }
.receipt-payment .field { margin:0; }
.receipt-payment > p { padding-top:22px; }
@media(max-width:700px) { .receipt-payment > p { padding-top:0; } }

.invoice-navigation { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; }
.invoice-navigation a { padding:10px 15px; border:1px solid var(--line); border-radius:8px; background:white; font-size:13px; text-decoration:none; }
.invoice-navigation a[aria-current="page"] { background:var(--green); border-color:var(--green); color:white; }

/* Registro fatture e importazione: riepilogo compatto e verifica affiancata. */
.invoice-overview > h2 { font-size:16px; margin:0 0 14px; }
.invoice-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.invoice-balance { padding:20px 22px; }
.invoice-balance header { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.invoice-balance h3 { margin:0; font-size:17px; }
.invoice-balance header > span { font-size:10px; letter-spacing:.08em; color:var(--muted); }
.invoice-balance-main { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:20px 0; }
.invoice-balance-main > span { color:var(--muted); font-size:13px; }
.invoice-balance-main strong { font-size:28px; color:var(--green); overflow-wrap:anywhere; }
.invoice-balance dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:0; padding-top:16px; border-top:1px solid var(--line); }
.invoice-balance dt { font-size:11px; color:var(--muted); margin-bottom:7px; }
.invoice-balance dd { margin:0; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.invoice-overdue dd { color:#92563e; }
.invoice-overview-note { font-size:12px; color:var(--muted); line-height:1.6; margin:12px 0 24px; }
.invoice-register-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.invoice-register-heading h2 { font-size:19px; margin:0; }
.invoice-register-heading p { font-size:13px; color:var(--muted); margin:7px 0 0; }
.invoice-ledger-page .filters { padding:18px 20px; gap:12px; align-items:center; }
.invoice-ledger-page .pagination { padding:18px 20px; }
.invoice-ledger-page .empty-state { padding:30px 20px; }
.invoice-import-steps { display:flex; gap:24px; padding:0; list-style:none; margin:0 0 22px; color:var(--muted); font-size:13px; }
.invoice-import-steps li { display:flex; align-items:center; gap:8px; }
.invoice-import-steps span { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--sage); }
.invoice-import-steps [aria-current] { color:var(--green); font-weight:600; }
.invoice-import-steps [aria-current] span { background:var(--green); color:white; }
.invoice-upload-layout,.invoice-review-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:start; }
.invoice-upload-layout > .panel { padding:24px; align-self:stretch; }
.invoice-import-page h2 { font-size:18px; margin:0 0 18px; }
.invoice-file-picker { padding:24px 18px; background:var(--paper); border:1px dashed #c5cec0; border-radius:12px; text-align:center; }
.invoice-file-picker > svg { display:block; margin:0 auto 12px; color:var(--green); }
.invoice-file-picker > strong { font-size:20px; }
.invoice-file-picker p { font-size:13px; color:var(--muted); }
.invoice-file-picker .field { margin:20px 0 0; text-align:left; }
.invoice-file-picker input { width:100%; padding:10px; background:white; font-size:12px; }
.invoice-file-picker input::file-selector-button { border:0; border-radius:6px; background:var(--sage); color:var(--green); padding:9px 12px; margin-right:12px; cursor:pointer; }
.invoice-import-check { padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.invoice-import-check label { display:flex; align-items:flex-start; gap:12px; margin:0; font-size:13px; line-height:1.5; }
.invoice-import-check input[type=checkbox] { flex:0 0 18px; width:18px; height:18px; min-height:18px; margin:2px 0 0; accent-color:var(--green); }
.invoice-import-check small { display:block; color:var(--muted); margin-top:7px; font-size:12px; }
.invoice-format-info { margin-top:22px; }
.invoice-format-info h3 { font-size:13px; margin:16px 0 6px; }
.invoice-format-info p,.invoice-upload-footer p,.invoice-review-form footer p { font-size:12px; line-height:1.6; color:var(--muted); margin:0; }
.invoice-upload-footer { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:22px 0; }
.invoice-original { overflow:hidden; min-width:0; }
.invoice-original > header { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:20px; }
.invoice-original h2 { margin:0 0 7px; }
.invoice-original header p { margin:0; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.invoice-original header > div { min-width:0; }
.invoice-original header .button { flex-shrink:0; }
.invoice-original iframe { display:block; height:65vh; }
.invoice-xml-info,.invoice-extracted { padding:20px; font-size:13px; line-height:1.6; }
.invoice-xml-info { background:var(--paper); }
.invoice-extracted h3 { font-size:14px; margin:0 0 12px; }
.invoice-extracted dl { margin:0; }
.invoice-extracted dl div { display:grid; grid-template-columns:100px minmax(0,1fr); gap:10px; margin:8px 0; }
.invoice-extracted dt { color:var(--muted); }
.invoice-extracted dd { margin:0; overflow-wrap:anywhere; }
.invoice-review-form { padding:22px; min-width:0; }
.invoice-review-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.invoice-review-fields .field { margin:0; }
.invoice-review-fields label { display:block; margin:0 0 7px; font-size:12px; }
.invoice-review-fields input,.invoice-review-fields select { min-width:0; width:100%; }
.invoice-review-fields textarea { min-height:95px; }
.invoice-field-wide { grid-column:1/-1; }
.invoice-review-form .invoice-import-check { margin-top:20px; }
.invoice-review-form footer { display:flex; flex-direction:column; gap:16px; margin-top:18px; }
@media(max-width:1000px) { .invoice-review-layout { grid-template-columns:1fr; } .invoice-original iframe { height:50vh; } }
@media(max-width:700px) {
 .invoice-overview-grid,.invoice-upload-layout { grid-template-columns:1fr; }
 .invoice-register-heading,.invoice-upload-footer { align-items:stretch; flex-direction:column; }
 .invoice-balance { padding:18px; }
 .invoice-balance-main strong { font-size:25px; }
 .invoice-upload-layout > .panel,.invoice-review-form { padding:18px; }
 .invoice-import-steps { gap:14px; font-size:12px; }
 .invoice-review-fields { grid-template-columns:1fr; }
 .invoice-ledger-page .page-heading .actions { flex-wrap:wrap; }
}

.avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.profile-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:22px; align-items:start; }
.profile-overview,.profile-content { display:grid; gap:20px; min-width:0; }
.profile-identity,.profile-security { padding:24px; }
.profile-identity { text-align:center; }
.profile-avatar { width:96px; height:96px; margin:0 auto 16px; border-radius:50%; display:grid; place-items:center; background:var(--sage); color:var(--green); font-size:32px; }
.profile-avatar img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.profile-identity h2 { font-size:21px; margin:0 0 12px; overflow-wrap:anywhere; }
.profile-identity > p { color:var(--muted); font-size:13px; }
.profile-identity dl { text-align:left; margin:24px 0 0; padding-top:18px; border-top:1px solid var(--line); }
.profile-identity dl div + div { margin-top:16px; }
.profile-identity dt { font-size:11px; color:var(--muted); margin-bottom:5px; }
.profile-identity dd { margin:0; font-size:13px; overflow-wrap:anywhere; }
.profile-security h2,.profile-content h2 { font-size:18px; margin:0 0 8px; }
.profile-security p,.profile-content header p { color:var(--muted); font-size:13px; line-height:1.6; margin:0 0 18px; }
.profile-security .profile-role-note { font-size:11px; margin:18px 0 0; }
.profile-personal,.profile-reminders { padding:24px; }
.profile-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.profile-field-wide { grid-column:1/-1; }
.profile-fields .field,.profile-photo-editor .field,.profile-reminder-fields .field { margin:0; min-width:0; }
.profile-page .field label { font-size:12px; margin-bottom:7px; }
.profile-page .field .helptext { display:block; font-size:11px; color:var(--muted); line-height:1.5; margin-top:7px; }
.profile-page input,.profile-page select { min-width:0; }
.profile-page textarea { min-height:90px; }
.profile-photo-editor { display:grid; grid-template-columns:72px minmax(0,1fr); gap:18px; align-items:center; padding:18px; margin:20px 0; background:var(--paper); border:1px solid var(--line); border-radius:12px; }
.profile-photo-preview { height:72px; width:72px; display:grid; place-items:center; background:var(--sage); border-radius:50%; overflow:hidden; font-size:24px; color:var(--green); }
.profile-photo-preview img { width:72px; height:72px; object-fit:cover; }
.profile-photo-editor input[type=file] { font-size:12px; max-width:100%; }
.profile-photo-editor input::file-selector-button { padding:7px 10px; border:0; border-radius:5px; background:var(--sage); color:var(--green); margin-right:8px; cursor:pointer; }
.profile-photo-editor .profile-check { margin-top:12px; }
#profile-photo-status { font-size:12px; color:var(--muted); margin:8px 0 0; }
.profile-check { display:flex; align-items:center; gap:10px; font-size:13px; line-height:1.5; }
.profile-check input[type=checkbox] { flex:0 0 18px; width:18px; height:18px; min-height:18px; margin:0; accent-color:var(--green); }
.profile-content footer { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; padding-top:20px; margin-top:20px; border-top:1px solid var(--line); }
.profile-reminder-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:center; }
.profile-reminder-toggle.profile-field-wide { padding:16px; background:var(--paper); border:1px solid var(--line); border-radius:10px; }
.profile-reminder-toggle p { color:var(--muted); font-size:12px; line-height:1.6; margin:8px 0 0 28px; }
@media(max-width:1000px) { .profile-layout { grid-template-columns:1fr; } .profile-overview { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .profile-overview,.profile-fields { grid-template-columns:1fr; } .profile-personal,.profile-reminders,.profile-identity,.profile-security { padding:18px; } .profile-photo-editor { grid-template-columns:1fr; padding:14px; } .profile-reminder-fields { gap:18px 12px; } }

.member-profile-link { display:flex; align-items:center; gap:12px; min-width:0; flex:1; text-decoration:none; color:inherit; border-radius:6px; }
.member-profile-link .row-main { min-width:0; overflow-wrap:anywhere; }
.member-profile-link:hover strong { text-decoration:underline; }
.member-profile-link:focus-visible { outline:2px solid var(--green); outline-offset:5px; }
.member-open { color:var(--muted); margin-left:auto; padding:0 8px; }
.member-detail-grid { display:grid; grid-template-columns:280px minmax(0,1fr); gap:22px; align-items:start; }
.member-details { display:grid; gap:20px; min-width:0; }
.member-info { padding:24px; }
.member-info h2 { font-size:18px; margin:0 0 20px; }
.member-info dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; margin:0; }
.member-info dt { font-size:12px; color:var(--muted); margin-bottom:7px; }
.member-info dd { margin:0; font-size:14px; overflow-wrap:anywhere; }
.member-info-wide { grid-column:1/-1; }
.member-bio { border-top:1px solid var(--line); margin-top:22px; padding-top:18px; }
.member-bio h3 { font-size:13px; margin:0 0 8px; }
.member-bio p { line-height:1.6; font-size:14px; margin:0; overflow-wrap:anywhere; }
.member-access-status { background:var(--sage); color:var(--green); padding:9px 12px; border-radius:8px; font-size:12px; margin-top:20px; }
.member-access-status.is-disabled { background:#f3ece6; color:#80583e; }
.member-info-note { color:var(--muted); font-size:12px; line-height:1.6; margin:22px 0 16px; }
@media(max-width:800px) { .member-detail-grid { grid-template-columns:1fr; } }
@media(max-width:500px) { .member-info { padding:18px; } .member-info dl { grid-template-columns:1fr; gap:18px; } }

/* Keep invoice dates and amounts readable when the table scrolls on phones. */
.invoice-ledger-page table { min-width:720px; }
.invoice-ledger-page td:nth-child(n+4) { white-space:nowrap; }
