/* Customer Availability Sheet — mirrors Verde availability PDF layout */

/* Quiet view switch: no container chrome, so it reads as a small caption
   rather than a raised control competing with the search bar and category
   pills. The selected side is carried by a soft purple tint + purple text
   instead of a white chip with its own shadow. */
.wff-order-view-switch {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wff-order-view-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.65rem;
  padding: 0.25rem 0.65rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #9ca3af;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wff-order-view-switch-btn:hover {
  color: #5b21b6;
  background: rgba(91, 33, 182, 0.05);
}

.wff-order-view-switch-btn.active {
  background: rgba(91, 33, 182, 0.07);
  color: #5b21b6;
  box-shadow: none;
}

.wff-order-view-switch-btn svg {
  width: 0.8rem;
  height: 0.8rem;
  flex: 0 0 auto;
}

.customer-order-view-btn {
  color: #6b7280;
}

.customer-order-view-btn:hover {
  color: #5d369d;
  background: #fff;
}

.customer-order-view-btn.active {
  color: #5d369d;
  background: #fff;
  box-shadow: 0 1px 4px rgba(28, 32, 36, 0.12);
}

.availability-sheet {
  --avs-ink: #1c2024;
  --avs-mute: #586068;
  --avs-rule: #c8ced4;
  --avs-accent: #5d369d;
  --avs-header-band: #f6f1fa;
  --avs-pot: #e8e7ec;
  --avs-table-head: #6c6a74;
  --avs-table-head-text: #ffffff;
  --avs-zebra: #f6f6f8;
  --avs-alert: #b84d7a;
  --avs-footer: #4a2d75;
  --avs-subtitle: #8a6bb5;

  background: #fff;
  color: var(--avs-ink);
  border: 1px solid rgba(93, 54, 157, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(28, 32, 36, 0.06);
  overflow: hidden;
  font-family: Helvetica, Arial, sans-serif;
}

.availability-sheet-header {
  position: relative;
  background: var(--avs-header-band);
  padding: 1.05rem 1.15rem 0.95rem 1.35rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: start;
}

.availability-sheet-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--avs-accent);
}

.availability-sheet-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--avs-accent);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.availability-sheet-subtitle {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--avs-subtitle);
  line-height: 1.35;
}

.availability-sheet-contact {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--avs-ink);
}

.availability-sheet-contact a {
  color: var(--avs-accent);
  text-decoration: none;
  font-weight: 600;
}

.availability-sheet-week {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--avs-accent);
  text-align: right;
  white-space: nowrap;
}

.availability-sheet-body {
  padding: 0.85rem 1rem 1rem;
}

.availability-sheet-announce {
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  background: #f8f5fc;
  border: 1px solid rgba(93, 54, 157, 0.18);
}

.availability-sheet-announce[data-style='urgent'] {
  background: #fdf4f7;
  border-color: rgba(184, 77, 122, 0.35);
}

.availability-sheet-announce[data-style='info'] {
  background: #f4f7fb;
  border-color: rgba(88, 96, 104, 0.25);
}

.availability-sheet-announce-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.availability-sheet-announce-body {
  font-size: 0.8rem;
  color: var(--avs-mute);
  white-space: pre-wrap;
}

.availability-sheet-customer {
  border: 1.5px solid var(--avs-accent);
  background: #fcfbfd;
  border-radius: 8px;
  padding: 0.85rem 0.95rem 0.7rem;
  margin-bottom: 0.85rem;
}

.availability-sheet-customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
}

.availability-sheet-field {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  border-bottom: 1px solid var(--avs-rule);
  padding-bottom: 0.2rem;
}

.availability-sheet-field.span-2 {
  grid-column: 1 / -1;
}

.availability-sheet-field label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--avs-ink);
}

.availability-sheet-field input,
.availability-sheet-field select,
.availability-sheet-field textarea {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.8rem;
  color: var(--avs-ink);
  font-family: inherit;
  padding: 0.1rem 0;
}

.availability-sheet-field textarea {
  resize: vertical;
  min-height: 1.6rem;
}

.availability-sheet-confirm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin-top: 0.55rem;
  font-size: 0.72rem;
}

.availability-sheet-confirm-row > span {
  font-weight: 700;
  color: var(--avs-mute);
}

.availability-sheet-confirm-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  cursor: pointer;
  font-weight: 500;
}

.availability-sheet-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--avs-rule);
  border-radius: 6px;
}

.availability-sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 640px;
}

.availability-sheet-table thead th {
  background: var(--avs-table-head);
  color: var(--avs-table-head-text);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
  padding: 0.45rem 0.55rem;
}

.availability-sheet-table thead th.qty {
  text-align: center;
  width: 4.5rem;
}

.availability-sheet-table thead th.customer-note {
  width: 8.5rem;
}

.availability-sheet-pot-band td {
  background: var(--avs-pot);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  color: var(--avs-ink);
}

.availability-sheet-table tbody tr.sku-row td {
  padding: 0.28rem 0.5rem;
  font-size: 0.78rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(200, 206, 212, 0.35);
}

.availability-sheet-table tbody tr.sku-row.zebra td {
  background: var(--avs-zebra);
}

.availability-sheet-table tbody tr.sku-row.has-qty td {
  background-color: #f5f3ff !important;
}

.availability-sheet-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.availability-sheet-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.08);
  color: #db2777;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.availability-sheet-clear-btn:hover {
  background: rgba(236, 72, 153, 0.16);
  color: #be185d;
}

.availability-sheet-table .grower-note {
  color: var(--avs-mute);
  font-size: 0.74rem;
}

.availability-sheet-table .grower-note:empty::before,
.availability-sheet-table .grower-note.is-empty {
  font-style: italic;
  color: var(--avs-mute);
}

.availability-sheet-table .qty-cell {
  text-align: center;
}

.availability-sheet-table .qty-input-avs {
  width: 3.4rem;
  text-align: center;
  border: 1px solid var(--avs-rule);
  border-radius: 4px;
  padding: 0.22rem 0.2rem;
  font-size: 0.8rem;
  background: #fff;
}

.availability-sheet-table .qty-input-avs:focus {
  outline: 2px solid rgba(93, 54, 157, 0.25);
  border-color: var(--avs-accent);
}

.availability-sheet-table .customer-note-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 0.2rem 0.25rem;
  font-size: 0.72rem;
  color: var(--avs-ink);
  cursor: text;
}

.availability-sheet-table .customer-note-input:hover:not(:disabled),
.availability-sheet-table .customer-note-input:focus:not(:disabled) {
  border-color: var(--avs-rule);
  background: #fff;
  outline: none;
}

.availability-sheet-table .customer-note-input:disabled {
  cursor: not-allowed;
  color: #9aa1a9;
  background: transparent;
}

.availability-sheet-table .customer-note-input:disabled::placeholder {
  color: #b6bcc4;
  font-style: italic;
}

.availability-sheet-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #e6e1ef;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(28, 32, 36, 0.08);
}

.availability-sheet-bar-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.availability-sheet-bar-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--avs-ink);
}

.availability-sheet-bar-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--avs-mute);
}

/* Match regular-view .btn-primary (lavender) — class also applied in markup */
.availability-sheet-review-btn {
  flex: 0 0 auto;
  font-size: 0.8125rem;
  cursor: pointer;
}

.availability-sheet-review-btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 520px) {
  .availability-sheet-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .availability-sheet-bar-actions {
    width: 100%;
  }

  .availability-sheet-clear-btn,
  .availability-sheet-review-btn {
    justify-content: center;
    flex: 1;
  }
}

.availability-sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: var(--avs-footer);
  color: #fff;
  padding: 0.55rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.availability-sheet-footer span:nth-child(2) {
  text-align: center;
  flex: 1;
}

.availability-sheet-empty,
.availability-sheet-loading,
.availability-sheet-error {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #9ca3af;
  font-weight: 500;
}

.availability-sheet-error {
  color: #b84d7a;
}

.availability-sheet-status {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.availability-sheet-status.info {
  background: #f6f1fa;
  color: #5d369d;
  border: 1px solid rgba(93, 54, 157, 0.15);
}

.availability-sheet-status.warn {
  background: #fdf4f7;
  color: #9b3d63;
  border: 1px solid rgba(184, 77, 122, 0.2);
}

@media (max-width: 768px) {
  .availability-sheet-header {
    grid-template-columns: 1fr;
  }

  .availability-sheet-week {
    text-align: left;
  }

  .availability-sheet-customer-grid {
    grid-template-columns: 1fr;
  }

  .availability-sheet-field.span-2 {
    grid-column: auto;
  }

  .availability-sheet-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
