/* Helpdesk surfaces keep their workspace palette; state chips use opaque,
   contrasting pairs so their meaning stays readable on every workspace. */
.helpdesk-cases-layout .ticket-card .ticket-meta { gap: 8px; flex-wrap: wrap; }
.helpdesk-cases-layout .ticket-card .ticket-meta > strong { color: var(--card-text, var(--ink)); font-size: calc(16px + var(--font-size-increase, 0px)); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.hd-dashboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.hd-dashboard-card { background: var(--workspace-surface, var(--surface-secondary)); color: var(--card-text, var(--ink)); border: 1px solid color-mix(in srgb, currentColor 16%, transparent); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.hd-dashboard-card h2 { color: inherit; font-size: 13px; line-height: 1.35; font-weight: 500; margin: 0 0 8px; }
.hd-dashboard-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: 12px; line-height: 20px; }
.hd-dashboard-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.hd-dashboard-row > :last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 15px; }
.hd-dashboard-case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.hd-dashboard-total { border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.hd-dashboard-agents { list-style: none; margin: 0; padding: 0 4px 0 0; max-height: 60px; overflow: auto; scrollbar-width: thin; }
.hd-dashboard-agents .hd-dashboard-row { padding: 0; }
.hd-dashboard-agents .hd-dashboard-row > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.hd-dashboard-card .muted { color: inherit; opacity: .8; font-size: 12px; margin: 0; }
.hd-dashboard--all-agents { grid-auto-rows: 1fr; align-items: stretch; }
.hd-dashboard--all-agents .hd-dashboard-agents { max-height: none; overflow: visible; padding-right: 0; }
.hd-dashboard--all-agents .hd-dashboard-agents .hd-dashboard-row > :first-child { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.helpdesk-cases-layout .ticket-card > p.helpdesk-ticket-people { display: block; color: var(--card-text, var(--ink)); font-size: calc(13px + var(--font-size-increase, 0px)); line-height: 1.45; white-space: normal; overflow: visible; overflow-wrap: anywhere; }

:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  line-height: 1.4; padding: 5px 10px; border-radius: 999px; border: 1px solid transparent;
  background: #edf2f7; color: #334155; white-space: nowrap;
}
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip.new { background: #e4edff; color: #173c80; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip.in-progress { background: #dceeff; color: #164d7a; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip.waiting { background: #fff0ce; color: #694300; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip.paused { background: #eee8fb; color: #584087; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip.resolved { background: #dff2e7; color: #1c6340; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip.closed { background: #e5eaf1; color: #38475c; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip :is(svg, i) { color: inherit; }
:is(.helpdesk-cases-layout, #helpdeskResults, .ticket-detail-dialog) .status-chip svg { stroke: currentColor; }
.helpdesk-cases-layout .ticket-card .priority-dot { box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-text, var(--ink)) 30%, transparent); }
.helpdesk-cases-layout .ticket-card .priority-dot.low { background: #55b985; }
.helpdesk-cases-layout .ticket-card .priority-dot.medium { background: #e8ac3e; }
.helpdesk-cases-layout .ticket-card .priority-dot:is(.high, .urgent) { background: #ed6a78; }

.ticket-detail-dialog .ticket-detail-body { padding: 16px 20px; }
.ticket-detail-dialog .ticket-detail-summary { align-items: start; gap: 14px; }
.ticket-detail-dialog :is(.ticket-detail-primary, .ticket-detail-service) { min-height: 0; height: auto; padding: 16px; }
.ticket-detail-dialog .ticket-detail-badges { margin-bottom: 12px; }
.ticket-detail-dialog .ticket-detail-grid { gap: 10px 16px; }
.ticket-detail-dialog .ticket-detail-grid > div > span { font-size: 12px; }
.ticket-detail-dialog .ticket-detail-grid strong { line-height: 1.45; }
.ticket-detail-dialog .ticket-custom-values { margin-top: 12px; padding-top: 12px; }
.ticket-detail-dialog .ticket-detail-primary > .button { margin-top: 12px; min-height: 34px; }
.ticket-detail-dialog .ticket-detail-service > h3 { margin: 0 0 12px; font-size: 16px; }
.ticket-detail-dialog .ticket-detail-service > .button { margin-top: 12px; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-facts { display: grid; gap: 10px; margin: 0; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-facts dt { font-size: 12px; color: inherit; opacity: .78; margin-bottom: 4px; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-facts dd { font-size: 14px; line-height: 1.4; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-summary { margin-top: 12px; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-indicator { display: inline-flex; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; margin-top: 12px; background: #e5eaf1; color: #38475c; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-indicator.on-time { background: #dff2e7; color: #1c6340; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-indicator.overdue { background: #fde4e7; color: #8a2434; }
:is(.ticket-detail-dialog, .helpdesk-case-preview) .helpdesk-sla-indicator.paused { background: #eee8fb; color: #584087; }
.helpdesk-case-preview > .helpdesk-sla-summary { margin: 0 20px 20px; }
.ticket-detail-dialog .ticket-waiting-note { background: var(--workspace-surface, var(--surface-secondary)); color: var(--card-text, var(--ink)); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-left: 3px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 10px; font-size: 13px; line-height: 1.5; padding: 10px 14px; }
.ticket-detail-dialog .ticket-detail-columns { margin-top: 14px; }

@media (max-width: 1150px) { .hd-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .hd-dashboard { gap: 8px; }
  .hd-dashboard-card { padding: 10px 12px; }
  .ticket-detail-dialog .ticket-detail-body { padding: 12px; }
  .ticket-detail-dialog .ticket-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .hd-dashboard { grid-template-columns: 1fr; } }

.helpdesk-priority-form { display: grid; gap: 14px; max-width: 720px; }
.helpdesk-priority-form .check-field { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; font-size: 14px; }
.helpdesk-priority-form .check-field input { flex: 0 0 auto; margin-top: 4px; accent-color: var(--accent); }
.helpdesk-priority-form > .field { max-width: 320px; }
.helpdesk-priority-form > p { margin: 0; }
.helpdesk-priority-form [hidden] { display: none; }
.helpdesk-priority-actions { display: flex; flex-wrap: wrap; gap: 10px; }
