/* SocDashboard (SOC operational dashboard, /soc/overview) — migrated from SocDashboard.razor.css; scoped under .page-soc-dashboard. */
.page-soc-dashboard { display: flex; flex-direction: column; gap: 34px; }

.page-soc-dashboard .soc-ops { gap: 16px; width: 100%; position: relative; }
.page-soc-dashboard .soc-head { margin-bottom: 2px; }
.page-soc-dashboard .soc-head h1 { font-size: 34px; }

/* ─── Header controls ───────────────────────────────────────────── */
.page-soc-dashboard .range-select { display: inline-flex; border: 1px solid var(--line); }
.page-soc-dashboard .range-btn {
    padding: 8px 15px; border: none; background: var(--surface);
    color: var(--muted); font: 600 13px var(--font-body); cursor: pointer;
    border-right: 1px solid var(--line); transition: background .15s, color .15s;
}
.page-soc-dashboard .range-btn:last-child { border-right: none; }
.page-soc-dashboard .range-btn:hover { color: var(--text); }
.page-soc-dashboard .range-btn.is-active { background: var(--accent-soft); color: var(--accent-2); }

.page-soc-dashboard .btn-icon { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.page-soc-dashboard .btn-icon svg { width: 14px; height: 14px; }

/* Manual refresh — matches the Incidents tab's .tb-btn (that class is scoped to that page). */
.page-soc-dashboard .refresh-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 10px; border: none; border-radius: var(--radius-sm);
    background: transparent; color: var(--muted);
    font: 500 13px var(--font-body); cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.page-soc-dashboard .refresh-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.page-soc-dashboard .refresh-btn svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.page-soc-dashboard .refresh-btn svg.spin { transform-box: fill-box; transform-origin: center; animation: dash-spin .7s linear infinite; }
@keyframes dash-spin { to { transform: rotate(360deg); } }

.page-soc-dashboard .refresh-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.page-soc-dashboard .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(61,220,151,.14); }
.page-soc-dashboard .live-dot.pulsing { background: var(--accent); animation: soc-pulse 1s ease-in-out infinite; }
@keyframes soc-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.page-soc-dashboard .wire-note { display: flex; align-items: center; gap: 9px; padding: 8px 14px; border: 1px dashed var(--accent-line); background: var(--accent-soft); color: var(--muted); font-size: 12.5px; }
.page-soc-dashboard .wire-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ─── Board layout: one 12-column grid, all on one screen ───────────
   Row 1  stat strip (6 tiles, full width)
   Row 2  queue (span 6, spans 2 rows) · By customer (3) · By assignee (3)
   Row 3  queue (cont.)               · Incident volume (span 6)
   Row 4  By priority (4) · By status (4) · SLA (4)                     */
.page-soc-dashboard .soc-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items: start; }
.page-soc-dashboard .stat-strip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.page-soc-dashboard .card--queue    { grid-column: span 6; grid-row: span 2; align-self: stretch; }
.page-soc-dashboard .card--customer { grid-column: span 3; }
.page-soc-dashboard .card--assignee { grid-column: span 3; }
.page-soc-dashboard .card--volume   { grid-column: span 6; }
.page-soc-dashboard .card--priority { grid-column: span 4; }
.page-soc-dashboard .card--status   { grid-column: span 4; }
.page-soc-dashboard .card--sla      { grid-column: span 4; }
/* Keep the donut/goofy boxes the same height regardless of legend length. */
.page-soc-dashboard .card--customer, .page-soc-dashboard .card--assignee { min-height: 258px; }

/* ─── Cards ─────────────────────────────────────────────────────── */
.page-soc-dashboard .card { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px 16px 16px; }
.page-soc-dashboard .card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.page-soc-dashboard .card-head h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); }
.page-soc-dashboard .card-sub { font-size: 12px; color: var(--faint); }

/* ─── Stat tiles ────────────────────────────────────────────────── */
.page-soc-dashboard .stat { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.page-soc-dashboard .stat-label { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.page-soc-dashboard .stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.05; color: var(--text); }
.page-soc-dashboard .stat-sub { font-size: 12px; color: var(--faint); }

/* ─── Donut charts ──────────────────────────────────────────────── */
.page-soc-dashboard .donut-block { display: flex; flex: 1; align-items: center; gap: 16px; }
.page-soc-dashboard .donut-wrap { position: relative; flex: none; width: 152px; height: 152px; }
.page-soc-dashboard .donut { width: 152px; height: 152px; }
.page-soc-dashboard .donut circle { transition: stroke-dasharray .4s ease; }
.page-soc-dashboard .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.page-soc-dashboard .donut-total { font-family: var(--font-display); font-size: 29px; font-weight: 700; color: var(--text); line-height: 1; }
.page-soc-dashboard .donut-cap { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.page-soc-dashboard .donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.page-soc-dashboard .donut-legend li { display: grid; grid-template-columns: 11px 1fr auto; align-items: center; gap: 9px; font-size: 12.5px; }
.page-soc-dashboard .donut-legend .dot { width: 11px; height: 11px; border-radius: 2px; }
.page-soc-dashboard .lg-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-soc-dashboard .lg-count { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ─── Volume bars ───────────────────────────────────────────────── */
.page-soc-dashboard .vol-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 14px; }
.page-soc-dashboard .vol-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.page-soc-dashboard .vol-bar-wrap { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.page-soc-dashboard .vol-count { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.page-soc-dashboard .vol-bar { width: 64%; min-height: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-line)); border-radius: 2px 2px 0 0; transition: height .4s ease; }
.page-soc-dashboard .vol-label { font-size: 10px; color: var(--faint); margin-top: 5px; white-space: nowrap; height: 12px; }

/* ─── Horizontal bars (priority / status) ───────────────────────── */
.page-soc-dashboard .hbars { display: flex; flex-direction: column; gap: 11px; }
.page-soc-dashboard .hbar-row { display: grid; grid-template-columns: 100px 1fr 36px 38px; align-items: center; gap: 9px; font-size: 12.5px; }
.page-soc-dashboard .hbar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-soc-dashboard .hbar-track { height: 9px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.page-soc-dashboard .hbar-fill { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.page-soc-dashboard .hbar-count { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.page-soc-dashboard .hbar-pct { text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ─── SLA meters ────────────────────────────────────────────────── */
.page-soc-dashboard .meter { margin-bottom: 14px; }
.page-soc-dashboard .meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.page-soc-dashboard .meter-label { font-size: 13px; color: var(--muted); }
.page-soc-dashboard .meter-value { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.page-soc-dashboard .meter-track { height: 9px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.page-soc-dashboard .meter-fill { height: 100%; background: var(--accent); transition: width .4s ease; }

/* ─── Live queue (primary left column) — 10 rows, no scrollbar ──── */
.page-soc-dashboard .card--queue { display: flex; flex-direction: column; overflow: hidden; align-self: stretch; }
.page-soc-dashboard .queue-scroll { flex: 1; }
/* Fixed layout + per-column widths so the six columns always fit the card and never spill; long
   cells clip with an ellipsis rather than widening the table. */
.page-soc-dashboard .queue-table { font-size: 13px; table-layout: fixed; width: 100%; }
.page-soc-dashboard .queue-table th, .page-soc-dashboard .queue-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-soc-dashboard .queue-table thead th { background: var(--surface); padding: 9px 10px; }
.page-soc-dashboard .queue-table tbody td { padding: 9px 10px; }
.page-soc-dashboard .queue-table th:nth-child(1), .page-soc-dashboard .queue-table td:nth-child(1) { width: 74px; }   /* Key */
.page-soc-dashboard .queue-table th:nth-child(3), .page-soc-dashboard .queue-table td:nth-child(3) { width: 84px; }   /* Pri */
.page-soc-dashboard .queue-table th:nth-child(4), .page-soc-dashboard .queue-table td:nth-child(4) { width: 118px; }  /* Status */
.page-soc-dashboard .queue-table th:nth-child(5), .page-soc-dashboard .queue-table td:nth-child(5) { width: 104px; }  /* Customer */
.page-soc-dashboard .queue-table th:nth-child(6), .page-soc-dashboard .queue-table td:nth-child(6) { width: 48px; }   /* Age */
.page-soc-dashboard .q-summary { color: var(--muted); }

/* ─── Tone helpers ──────────────────────────────────────────────── */
.page-soc-dashboard .tone-good { color: var(--good); }
.page-soc-dashboard .tone-warn { color: var(--warn); }
.page-soc-dashboard .tone-bad  { color: var(--bad); }
.page-soc-dashboard .tone-crit { color: var(--crit); }
.page-soc-dashboard .hbar-fill.tone-good { background: var(--good); }
.page-soc-dashboard .hbar-fill.tone-warn { background: var(--warn); }
.page-soc-dashboard .hbar-fill.tone-bad  { background: var(--bad); }
.page-soc-dashboard .hbar-fill.tone-crit { background: var(--crit); }
.page-soc-dashboard .hbar-fill.tone-neutral { background: var(--accent); }
.page-soc-dashboard .meter-fill.tone-good { background: var(--good); }
.page-soc-dashboard .meter-fill.tone-warn { background: var(--warn); }
.page-soc-dashboard .meter-fill.tone-bad  { background: var(--bad); }

/* ─── Loading skeletons ─────────────────────────────────────────── */
.page-soc-dashboard .sk-donut { width: 152px; height: 152px; border-radius: 50%; flex: none; }
.page-soc-dashboard .sk-queue-row { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.page-soc-dashboard .sk-queue-row:last-child { border-bottom: none; }
.page-soc-dashboard .sk-bar-row { margin-bottom: 13px; }
.page-soc-dashboard .sk-bar-row:last-child { margin-bottom: 0; }

/* ─── Goofy mode ────────────────────────────────────────────────── */
.page-soc-dashboard .goofy-toggle {
    position: absolute; bottom: 8px; right: 10px; z-index: 5;
    width: 15px; height: 15px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2);
    opacity: .28; cursor: pointer; transition: opacity .2s ease, transform .2s ease;
}
.page-soc-dashboard .goofy-toggle:hover { opacity: .9; transform: scale(1.2); }

/* Goofy mode: the black box fills the ENTIRE card (edge to edge, inside the border) so the area the
   pucks bounce in is exactly the box the user sees; the header floats on top. */
.page-soc-dashboard .card--assignee.goofy { position: relative; overflow: hidden; }
.page-soc-dashboard .card--assignee.goofy .card-head { position: relative; z-index: 2; margin-bottom: 0; }
.page-soc-dashboard .dvd-box {
    position: absolute; inset: 0; z-index: 0; overflow: hidden;
    box-sizing: border-box; background: #000;
    transition: box-shadow .2s ease;
}
.page-soc-dashboard .dvd-box.corner-hit { animation: dvd-flash .7s ease; }
@keyframes dvd-flash {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: inset 0 0 0 3px #ffd54f, inset 0 0 60px rgba(255,213,79,.45); }
}
/* NB: .dvd-puck and .dvd-corners are created in JavaScript, so they can't be styled from this scoped
   sheet (they'd lack the scope attribute). Their rules live in wwwroot/app.css (global). */

/* ─── Fullscreen (wall display) ─────────────────────────────────── */
.page-soc-dashboard .soc-ops.is-fs { height: 100vh; overflow-y: auto; padding: 22px 30px; background: var(--bg); }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1250px) {
    .page-soc-dashboard .stat-strip { grid-template-columns: repeat(3, 1fr); }
    .page-soc-dashboard .card--queue { grid-column: 1 / -1; grid-row: auto; }
    .page-soc-dashboard .card--customer, .page-soc-dashboard .card--assignee { grid-column: span 6; }
    .page-soc-dashboard .card--volume { grid-column: 1 / -1; }
    .page-soc-dashboard .card--priority, .page-soc-dashboard .card--status, .page-soc-dashboard .card--sla { grid-column: span 4; }
}
@media (max-width: 820px) {
    .page-soc-dashboard .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .page-soc-dashboard .card--customer, .page-soc-dashboard .card--assignee,
    .page-soc-dashboard .card--priority, .page-soc-dashboard .card--status, .page-soc-dashboard .card--sla { grid-column: 1 / -1; }
    .page-soc-dashboard .donut-block { flex-direction: column; align-items: stretch; }
    .page-soc-dashboard .donut-wrap { align-self: center; }
}
