/* Component kit additions: skeletons, error state, responsive tables → cards, side sheet, theme toggle, tabs, validation, FAB. Tokens only. */
@keyframes kit-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skeleton { display: grid; gap: var(--sp-3); padding: var(--sp-2) 0; }
.skeleton .sk { height: 14px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 300% 100%; animation: kit-shimmer 1.4s linear infinite; }
.skeleton .sk.h { height: 72px; border-radius: var(--r-lg); } .skeleton .sk.w60 { width: 60%; } .skeleton .sk.w40 { width: 40%; }
.skeleton-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
@media (prefers-reduced-motion: reduce) { .skeleton .sk { animation: none; } }
.error-state { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--text-muted); }
.error-state .ico { font-size: 34px; color: var(--warning); } .error-state h3 { color: var(--text); margin: var(--sp-2) 0; } .error-state .btn { margin-top: var(--sp-3); }
/* inline validation */
input:user-invalid, select:user-invalid, textarea:user-invalid, .is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field-error { color: var(--danger); font-size: var(--fs-sm); margin-top: 4px; }
/* side sheet (details open beside the list instead of covering it) */
.modal-overlay.sheet { justify-content: flex-end; align-items: stretch; padding: 0; }
.modal.sheet { max-width: min(760px, 100vw); width: 100%; max-height: none; height: 100%; border-radius: var(--r-xl) 0 0 var(--r-xl); transform: translateX(24px); }
.modal-overlay.open .modal.sheet { transform: none; }
/* theme toggle */
.theme-toggle { width: 100%; }
/* responsive tables → stacked cards on phones (labels injected from <th> by kit.js) */
@media (max-width: 640px) {
  table.rt { display: block; } table.rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.rt tbody { display: grid; gap: var(--sp-3); padding: var(--sp-3); }
  table.rt tr { display: grid; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-2) var(--sp-3); }
  table.rt td { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding: 6px 0; border: 0; text-align: right; min-width: 0; }
  table.rt td::before { content: attr(data-label); color: var(--text-subtle); font-size: var(--fs-sm); text-align: left; flex-shrink: 0; }
  table.rt td:not([data-label])::before, table.rt td[data-label=""]::before { content: none; }
  table.rt td:first-child { font-weight: var(--fw-medium); }
  .table-wrap:has(table.rt) { overflow: visible; border: 0; background: transparent; }
}
/* phone quick actions */
.fab { display: none; }
@media (max-width: 640px) {
  .fab { display: block; position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: var(--z-menu, 40); }
  .fab > button { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 24px; box-shadow: var(--shadow-lg); cursor: pointer; }
  .fab .menu { right: 0; bottom: 64px; top: auto; min-width: 210px; }
  .content { padding-bottom: 88px; }
}
/* running timer pill */
.timer-pill { display: none; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--danger) 14%, transparent); border: 1px solid var(--danger); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.timer-pill.on { display: inline-flex; } .timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: kit-shimmer 1.2s ease-in-out infinite alternate; }
/* command palette */
.cmdk { position: fixed; inset: 0; z-index: calc(var(--z-modal) + 5); display: none; align-items: flex-start; justify-content: center; padding: 12vh var(--sp-4) var(--sp-4); background: var(--overlay); }
.cmdk.open { display: flex; } .cmdk-box { width: min(640px, 100%); background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk input { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding: 16px 18px; font-size: var(--fs-lg); outline: none; }
.cmdk-list { max-height: 50vh; overflow: auto; padding: 6px; } .cmdk-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-subtle); padding: 8px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 9px 10px; border-radius: var(--r-md); cursor: pointer; }
.cmdk-item[aria-selected=true], .cmdk-item:hover { background: var(--accent-soft); } .cmdk-item .sub { color: var(--text-subtle); font-size: var(--fs-sm); margin-left: auto; }
.cmdk-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-subtle); }
/* stale / offline banner */
.offline-banner { display: none; position: sticky; top: 0; z-index: 30; background: var(--warning); color: #1a1200; text-align: center; padding: 6px; font-size: var(--fs-sm); }
.offline-banner.on { display: block; }
/* analytics + reports */
.wg { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); }
.wg .card.wide { grid-column: 1 / -1; }
.delta { font-size: var(--fs-sm); } .delta.up { color: var(--success); } .delta.down { color: var(--danger); } .delta.flat { color: var(--text-subtle); }
.kv { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 6px 0; border-bottom: 1px dashed var(--border); } .kv:last-child { border: 0; }
.health { display: inline-flex; align-items: center; gap: 6px; } .health i { width: 9px; height: 9px; border-radius: 50%; background: var(--text-subtle); }
.health.on_track i { background: var(--success); } .health.at_risk i { background: var(--warning); } .health.blocked i { background: var(--danger); }
.bulkbar { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; padding: var(--sp-2) var(--sp-3); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-md); margin-bottom: var(--sp-3); }

/* padded card body (legacy .card-body has no padding because tables sit flush inside cards) */
.card-body.cb { padding: var(--sp-4); }
.card > .p2-muted, .card > p { padding: var(--sp-4); }
