/* Administration uses a deadline-led queue and a two-column case workspace. */
.admin-workspace { display: grid; gap: 18px; min-width: 0; }
.admin-workspace h2, .admin-workspace h3 { margin: 0; }
.admin-workspace .page-head { margin-bottom: 2px; overflow-wrap: anywhere; }
.admin-workspace .page-head p { max-width: 68ch; }

.admin-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); padding: 0; }
.admin-kpi { min-width: 0; padding: 15px 18px; }
.admin-kpi + .admin-kpi { border-left: 1px solid var(--line); }
.admin-kpi span, .admin-kpi small { display: block; color: var(--muted); }
.admin-kpi strong { display: block; font-size: 25px; font-weight: 650; margin: 2px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.admin-kpi small { font-size: 12px; }

.admin-split { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; align-items: start; }
.admin-stack, .admin-form { display: grid; gap: 16px; min-width: 0; }
.admin-section { min-width: 0; }
.admin-section-head, .admin-controls, .admin-actions, .admin-row-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-section-head { justify-content: space-between; padding-bottom: 12px; }
.admin-section-head > div:first-child { min-width: 0; }
.admin-section-head p, .admin-note, .admin-block p { margin: 5px 0 0; }

.admin-presets { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; }
.admin-preset {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left;
}
.admin-preset span {
  padding-inline: 5px; min-width: 19px; border-radius: 4px;
  background: var(--soft); color: var(--muted); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums;
}
.admin-preset:hover { background: var(--soft); color: var(--ink); }
.admin-preset[aria-pressed="true"] { background: var(--accent-soft); color: var(--blue); border-color: #a9cfdf; }
.admin-preset[aria-pressed="true"] span { background: #fff; color: var(--blue); }
.admin-workspace > .admin-presets {
  margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.admin-workspace > .admin-presets .admin-preset { border-color: transparent; }
.admin-workspace > .admin-presets .admin-preset[aria-pressed="true"] { border-color: #a9cfdf; }

.admin-controls { margin: 0 0 13px; }
.admin-controls label { flex: 0 1 150px; }
.admin-controls label:first-child { flex: 1 1 210px; }
.admin-search-single { max-width: 650px; }
.admin-controls input, .admin-controls select, .admin-form input, .admin-form select, .admin-form textarea { width: 100%; min-width: 0; }
.admin-controls button { align-self: flex-end; }
.admin-section label { display: grid; gap: 5px; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
.admin-table td, .admin-table th { padding: 9px 11px; vertical-align: middle; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.admin-table th { background: var(--soft); }
.admin-table tr:hover td { background: #f8fbfd; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .admin-number, .admin-table-financial th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table-financial td.admin-number { white-space: nowrap; }
.admin-table td strong { display: block; font-weight: 650; }
.admin-table td small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.admin-table td .admin-link { font-weight: 650; }
.admin-case-title { width: 40%; }
.admin-table-queue :is(th,td):nth-child(2) { width: 89px; white-space: nowrap; }
.admin-case-due { width: 24%; min-width: 126px; }
.admin-case-state { font-size: 13px; }
.admin-code, .admin-due time { font-variant-numeric: tabular-nums; }
.admin-code { font-weight: 650; }
.admin-due { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: 12px; color: var(--muted); }
.admin-due > span:first-child { flex: 1 0 100%; font-weight: 590; }
.admin-due.is-overdue time, .admin-due-state { color: var(--danger); font-weight: 650; }
.admin-attention-item { display: grid; gap: 4px; }

.admin-link { min-height: 32px; padding: 4px 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.admin-link:hover { text-decoration: underline; }
.admin-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.35; padding: 3px 7px; border-radius: 5px; background: #eef2f6; color: #414f61; }
.admin-tag[data-tone="bad"] { background: #ffebe9; color: #992b24; }
.admin-tag[data-tone="warn"] { background: #fff1d8; color: #7d4d05; }
.admin-tag[data-tone="good"] { background: #e4f5ed; color: #176747; }
.admin-tag[data-tone="info"] { background: #e7f4fc; color: #075e90; }
.admin-rule { border-top: 1px solid var(--line); }
.admin-block { padding: 13px 0; }
.admin-block + .admin-block { border-top: 1px solid var(--line); }
.admin-block strong { font-weight: 650; }
.admin-block dl, .admin-definition {
  display: grid; grid-template-columns: minmax(80px,1fr) minmax(0,1.3fr); gap: 8px 16px; margin: 12px 0 0;
}
.admin-definition dt, .admin-block dt { color: var(--muted); }
.admin-definition dd, .admin-block dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.admin-timeline { padding-left: 16px; margin: 0; list-style: none; border-left: 1px solid var(--line); }
.admin-timeline li { position: relative; padding: 0 0 16px; }
.admin-timeline li:last-child { padding-bottom: 0; }
.admin-timeline li::before { content: ""; position: absolute; width: 7px; height: 7px; left: -20px; top: 7px; border-radius: 50%; background: var(--accent); }
.admin-timeline time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.admin-timeline p { margin: 3px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.admin-summary { border-left: 3px solid var(--accent); background: #eef7fd; padding: 12px 14px; border-radius: 0 5px 5px 0; }
.admin-summary p { margin: 4px 0 0; }
.admin-row-main { justify-content: space-between; }
.admin-row-main > * { min-width: 0; }
.admin-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-check { display: flex !important; align-items: flex-start; gap: 8px !important; }
.admin-check input { width: auto; margin-top: 4px; }
.admin-empty { padding: 18px 0 6px; color: var(--muted); }

@media (min-width: 970px) {
  .admin-split-detail { grid-template-columns: minmax(0,1fr) minmax(230px,31%); }
  .admin-split-default { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (min-width: 1240px) {
  .admin-split-queue { grid-template-columns: minmax(0,1fr) clamp(230px,20vw,300px); }
  .admin-split-queue > aside { align-self: start; }
}
@media (min-width: 921px) and (max-width: 1239px) {
  .role-admin { padding-top: 21px; }
  .admin-workspace { gap: 13px; }
  .admin-workspace .page-head h1 { font-size: 28px; }
  .admin-kpi { padding: 10px 13px; }
  .admin-kpi strong { font-size: 23px; }
  .admin-summary { padding-block: 8px; }
  .admin-summary .btn { min-height: 36px; }
  .admin-section { padding: 14px; }
  .admin-section-head { padding-bottom: 8px; }
  .admin-presets { margin-bottom: 9px; }
  .admin-controls { margin-bottom: 9px; }
}
@media (max-width: 620px) {
  .admin-workspace { gap: 14px; }
  .admin-kpis { grid-auto-flow: row; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-kpi { padding: 9px 11px; font-size: 13px; }
  .admin-kpi strong { font-size: 21px; margin: 1px 0; }
  .admin-kpi small { line-height: 1.25; }
  .admin-kpi:nth-child(odd) { border-left: 0; }
  .admin-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .admin-kpi:last-child:nth-child(odd) { grid-column: 1/-1; }

  .admin-presets { gap: 4px; }
  .admin-preset { min-height: 44px; padding: 5px 8px; font-size: 12px; }
  .admin-workspace > .admin-presets { padding: 4px; }
  .admin-controls { margin-bottom: 8px; align-items: flex-start; }
  .admin-controls label { flex-basis: 110px; font-size: 12px; }
  .admin-controls label:first-child { flex-basis: 100%; }
  .admin-controls :is(input,select), .admin-controls button { min-height: 44px; }
  .admin-link { min-height: 39px; }
  .admin-callout-detail { display: none; }
  .admin-summary { padding: 11px; }
  .admin-section-head { padding-bottom: 7px; }

  .admin-table,.admin-table tbody { display: block; }
  .admin-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .admin-table tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .admin-table td { display: block; padding: 0; width: auto; min-width: 0; border: 0; }
  .admin-table td:first-child { flex: 1 0 100%; }
  .admin-table tr:hover td { background: transparent; }
  .admin-table-queue td:nth-child(2) { width: auto; }
  .admin-table-queue .admin-case-due { flex: 1 0 100%; }
  .admin-table-financial td.admin-number { text-align: left; white-space: normal; }
  .admin-table-financial td:nth-child(n+3) { flex: 1 1 95px; }
}
