/* Work orders + related resource detail pages — Taoyen tokens (workflow :root), aligned with maintenance forms */

.wo-show-page {
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

/* Stat strip — teal primary accent (not legacy sky blue) */
.resource-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.resource-stat-card {
  background: var(--white, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--slate-200, #e2e8f0);
}

.resource-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resource-stat-card--primary .resource-stat-icon {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12) 0%, rgba(15, 118, 110, 0.08) 100%);
  color: var(--teal, #0d9488);
}

.resource-stat-card--success .resource-stat-icon {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12) 0%, rgba(21, 128, 61, 0.08) 100%);
  color: var(--green, #16a34a);
}

.resource-stat-card--info .resource-stat-icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(29, 78, 216, 0.08) 100%);
  color: #2563eb;
}

.resource-stat-card--warning .resource-stat-icon {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(180, 83, 9, 0.08) 100%);
  color: var(--amber, #d97706);
}

.resource-stat-content {
  flex: 1;
  min-width: 0;
}

.resource-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin-bottom: 0.25rem;
  line-height: 1;
  font-family: var(--font-th, "Sarabun", sans-serif);
}

.resource-stat-label {
  font-size: 0.875rem;
  color: var(--slate-500, #64748b);
  font-weight: 500;
}

/* Horizontal action row (e.g. quotation toolbar) — primary/secondary like form-actions */
.wo-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

/* Stacked primary actions (sidebar) — full width, min tap height */
.wo-quick-actions,
.resource-stacked-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wo-quick-actions .btn,
.resource-stacked-actions .btn,
.wo-quick-actions form.button_to,
.resource-stacked-actions form.button_to {
  width: 100%;
  margin: 0;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
}

.wo-quick-actions form.button_to .btn,
.resource-stacked-actions form.button_to .btn {
  width: 100%;
}

/* Extra-items alert: match form-actions spacing */
.wo-alert-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.wo-alert-actions .btn {
  min-height: 40px;
}

/* Detail grid helpers (work order show) */
.wo-show-page .detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wo-show-page .detail-label {
  font-size: 0.75rem;
  color: var(--slate-500, #64748b);
  font-weight: 500;
}

.wo-show-page .detail-value {
  font-size: 0.875rem;
  color: var(--slate-800, #1e293b);
  font-weight: 600;
}

.wo-show-page .icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wo-show-page .icon-box svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
}

.wo-show-page .icon-box-primary {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: var(--teal, #0d9488);
}

.wo-show-page .icon-box-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #a855f7;
}

.wo-show-page .icon-box-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);
  color: #22c55e;
}

.wo-show-page .grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .wo-show-page .grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .wo-show-page .col-span-2 {
    grid-column: span 1 / span 1;
  }
}

.wo-show-page .col-span-2 {
  grid-column: span 2 / span 2;
}

.wo-show-page .col-span-1 {
  grid-column: span 1 / span 1;
}

.quotation-show-page .detail-item {
  min-width: 0;
}

.quotation-show-page .detail-value {
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quotation-show-page .card .grid.grid-cols-2 {
  align-items: start;
}

.wo-show-page .qr-code-container {
  display: inline-block;
  padding: 1rem;
  background: var(--white, #fff);
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--slate-200, #e2e8f0);
}

.wo-show-page .qr-code-img {
  display: block;
  margin: 0 auto;
  width: 200px;
  height: 200px;
}

/* Extra items approval alert (work order show) */
.extra-items-alert {
  margin-bottom: 1.5rem;
}

.extra-items-alert .alert-content {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.extra-items-alert .alert-icon {
  flex-shrink: 0;
}

.extra-items-alert .alert-message h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #92400e;
}

.extra-items-alert .alert-message p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #92400e;
}
