.panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.panel-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface2);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.header-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.panel-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background-color: var(--surface2);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.field-value {
  font-size: 0.95rem;
  color: var(--text);
}

.field-value.status {
  text-transform: capitalize;
}

.reason-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--critical); /* Adjusted dynamically */
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.reason-box.high {
  border-left-color: var(--high);
}

.reason-box.medium {
  border-left-color: var(--medium);
}

.reason-box.low {
  border-left-color: var(--low);
}

.reason-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.reason-box.critical .reason-label { color: var(--critical); }
.reason-box.high .reason-label { color: var(--high); }
.reason-box.medium .reason-label { color: var(--medium); }
.reason-box.low .reason-label { color: var(--low); }

.reason-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.action-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.action-recommendation {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.primary-action-btn {
  background-color: var(--orange);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition: background-color 0.15s;
}

.primary-action-btn:hover {
  background-color: var(--orange-hover);
}

.completed-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--low);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border: 1px solid var(--low);
  background-color: var(--surface);
  border-radius: var(--radius-md);
}

.contact-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.contact-link {
  color: var(--green);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-link:hover {
  text-decoration: underline;
}

.items-list {
  background-color: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.item-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.item-row:last-child {
  border-bottom: none;
}

.item-name {
  font-size: 0.9rem;
}

.item-variant {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  font-weight: 600;
}
