:root {
  --req-panel-width: 360px;
}

body.req-open {
  overflow: hidden;
}

.req-toggle {
  border: 1px solid rgba(106, 230, 201, 0.4);
  background: rgba(106, 230, 201, 0.12);
  color: var(--text, #eef2f7);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.req-toggle:hover {
  border-color: rgba(106, 230, 201, 0.7);
  box-shadow: 0 8px 16px rgba(106, 230, 201, 0.18);
  transform: translateY(-1px);
}

.req-toggle.is-open {
  border-color: rgba(255, 184, 108, 0.7);
  background: rgba(255, 184, 108, 0.18);
}

.req-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 8000;
}

.req-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.req-panel {
  position: fixed;
  top: var(--page-pad-top, 24px);
  bottom: var(--page-pad-bottom, 24px);
  right: var(--page-pad-x, 18px);
  width: min(var(--req-panel-width), calc(100% - 32px));
  background: var(--panel, #0f131b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(3, 8, 18, 0.55);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.25s ease;
  z-index: 9000;
}

.req-panel.open {
  transform: translateX(0);
}

.req-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: rgba(15, 19, 27, 0.95);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  gap: 10px;
}

.req-header-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #eef2f7);
}

.req-close {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text, #eef2f7);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.req-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-truck-sep {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  margin: 10px 0 4px;
}

.req-truck-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 12px 4px;
}

.req-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(11, 14, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.req-item.mixed-group-row {
  border-color: rgba(255, 184, 108, 0.3);
  background: rgba(255, 184, 108, 0.08);
}

.req-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.req-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text, #eef2f7);
}

.req-meta,
.req-desc,
.req-qty-note,
.req-linked-summary {
  font-size: 11px;
  color: var(--muted, #a5b0c0);
}

.req-mixed-pill {
  align-self: flex-start;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 184, 108, 0.45);
  color: rgba(255, 184, 108, 0.9);
}

.req-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.req-controls input {
  width: 70px;
  background: rgba(10, 12, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 8px;
  color: var(--text, #eef2f7);
  font-size: 12px;
  text-align: center;
}

.req-del {
  border: none;
  background: rgba(255, 90, 90, 0.18);
  color: #ff8b8b;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.req-actions {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: rgba(12, 15, 22, 0.95);
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
}

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

.req-actions button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #eef2f7);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.req-actions button.primary {
  border-color: rgba(106, 230, 201, 0.6);
  background: rgba(106, 230, 201, 0.18);
  color: #ecfffa;
}

.req-actions button.danger {
  border-color: rgba(255, 110, 110, 0.6);
  background: rgba(255, 110, 110, 0.18);
  color: #ffd4d4;
}

.req-actions button:hover {
  border-color: rgba(106, 230, 201, 0.7);
  box-shadow: 0 10px 22px rgba(106, 230, 201, 0.18);
  transform: translateY(-1px);
}

.req-section {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  background: rgba(10, 12, 18, 0.6);
}

.req-section + .req-section {
  margin-top: 10px;
}

.req-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: rgba(15, 19, 27, 0.9);
  border: none;
  color: var(--text, #eef2f7);
  padding: 8px 12px;
  cursor: pointer;
}

.req-section-chevron {
  width: 10px;
  height: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.6);
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.req-section.open .req-section-chevron {
  transform: rotate(45deg);
}

.req-section.collapsed .req-section-body {
  display: none;
}

.req-section-title {
  font-size: 12px;
  font-weight: 600;
}

.req-section-count {
  font-size: 11px;
  color: var(--muted, #a5b0c0);
}

.req-section-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.structured-qty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.structured-qty label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted, #a5b0c0);
}

.structured-qty input {
  width: 100%;
  text-align: left;
}

.structured-qty-total,
.structured-qty-note {
  font-size: 10px;
  color: var(--muted, #a5b0c0);
}

.req-linked-entry {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  background: rgba(8, 12, 18, 0.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.req-linked-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--muted, #a5b0c0);
}

.req-linked-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 184, 108, 0.18);
  color: rgba(255, 184, 108, 0.95);
}

.req-linked-sub {
  color: var(--text, #eef2f7);
}

.req-linked-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
}

.modal-box {
  background: var(--panel, #0f131b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  padding: 18px 20px;
  width: min(520px, 94vw);
  color: var(--text, #eef2f7);
  box-shadow: 0 24px 50px rgba(3, 8, 18, 0.55);
  display: grid;
  gap: 12px;
}

.modal-box.modal-box--spinner {
  width: min(380px, 90vw);
  text-align: center;
  gap: 16px;
}

.modal-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted, #a5b0c0);
}

.modal-field input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(10, 12, 18, 0.8);
  color: var(--text, #eef2f7);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.modal-actions button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #eef2f7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions .primary {
  border-color: rgba(106, 230, 201, 0.6);
  background: rgba(106, 230, 201, 0.18);
}

.modal-actions .secondary {
  border-color: rgba(255, 255, 255, 0.12);
}

.modal-actions .danger {
  border-color: rgba(255, 110, 110, 0.6);
  background: rgba(255, 110, 110, 0.18);
  color: #ffd4d4;
}

.modal-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid rgba(106, 230, 201, 0.25);
  border-top-color: rgba(106, 230, 201, 0.9);
  animation: req-spin 0.9s linear infinite;
  margin: 0 auto;
}

.modal-detail-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted, #a5b0c0);
}

.modal-detail-empty {
  font-size: 12px;
  color: var(--muted, #a5b0c0);
}

.mixed-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 12000;
}

.mixed-modal {
  background: var(--panel, #0f131b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  padding: 18px 20px;
  width: min(420px, 92vw);
  color: var(--text, #eef2f7);
  box-shadow: 0 22px 40px rgba(3, 8, 18, 0.45);
}

.mixed-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.mixed-modal-actions button {
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  cursor: pointer;
}

.mixed-modal-actions .secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text, #eef2f7);
}

.mixed-modal-actions .danger {
  background: rgba(255, 110, 110, 0.8);
  color: #111;
}

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

@media (max-width: 960px) {
  .req-panel {
    right: 16px;
  }
}
