/* TradeRailPR230 — Service / Work Orders */

/* ── Service card badges ──────────────────────────────────────────────────── */

.p230-svc-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  align-items: center;
}

.p230-svc-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.p230-svc-type {
  background: #f0f4ff;
  color: #3b4fc4;
  border: 1px solid #c7d0f8;
}

.p230-svc-pri-normal {
  background: #f0fff4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.p230-svc-pri-high {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.p230-svc-pri-emergency {
  background: #fff4f4;
  color: #991b1b;
  border: 1px solid #fecaca;
  animation: p230-pulse 1.6s ease-in-out infinite;
}

@keyframes p230-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

.p230-svc-symptom {
  width: 100%;
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.p230-svc-contact {
  width: 100%;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 1px;
}

/* ── Card action row ──────────────────────────────────────────────────────── */

.p230-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.p230-card-btn {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1.4;
}

.p230-card-btn:hover { background: #f3f4f6; }

.p230-card-btn-turnover {
  border-color: #FF6B00;
  color: #FF6B00;
}

.p230-card-btn-turnover:hover { background: #fff4ed; }

/* ── Controls bar inject button ──────────────────────────────────────────── */

.p230-controls-svc-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #374151;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.12s, border-color 0.12s;
}

.p230-controls-svc-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* ── Modal overlay (shared pattern with PR228) ───────────────────────────── */

.p230-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.p230-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
}

.p230-modal-hdr {
  padding: 18px 20px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.p230-modal-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}

.p230-modal-actions {
  padding: 14px 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── Form grid ───────────────────────────────────────────────────────────── */

.p230-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.p230-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

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

.p230-input {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  color: #111827;
  background: #fff;
  transition: border-color 0.12s;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.p230-input:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 2px rgba(255,107,0,0.12);
}

.p230-textarea {
  resize: vertical;
  min-height: 72px;
}

/* ── Emergency warning ───────────────────────────────────────────────────── */

.p230-emergency-warn {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff4f4;
  border: 1px solid #fecaca;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #991b1b;
}

/* ── Turnover description ─────────────────────────────────────────────────── */

.p230-turnover-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px;
  line-height: 1.5;
}

/* ── Ticket detail ───────────────────────────────────────────────────────── */

.p230-ticket-detail {
  max-width: 520px;
}

.p230-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p230-detail-row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  align-items: flex-start;
}

.p230-detail-row b {
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 80px;
  padding-top: 1px;
}

.p230-detail-row span {
  color: #111827;
  line-height: 1.45;
}

.p230-detail-full {
  flex-direction: column;
  gap: 4px;
}

.p230-detail-full b { min-width: unset; }

/* ── Shared button styles (mirrors PR228) ─────────────────────────────────── */

.p230-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1.4;
}

.p230-btn-primary {
  background: #FF6B00;
  color: #fff;
}
.p230-btn-primary:hover { background: #e05a00; }

.p230-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.p230-btn-secondary:hover { background: #e5e7eb; }

.p230-btn-ghost {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}
.p230-btn-ghost:hover { background: #f9fafb; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .p230-form-grid {
    grid-template-columns: 1fr;
  }
  .p230-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    margin: 0;
  }
  .p230-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .p230-svc-symptom,
  .p230-svc-contact {
    max-width: 100%;
  }
}
