/* Shared primitives for the replica modules (spec: replica/design/components.md). Uses tokens.css roles. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button.sm { min-height: 32px; padding: 4px 10px; font-size: var(--fs-sm); }
button.lg { min-height: 44px; padding: 10px 18px; font-size: 15px; }
button.danger, button.alt-accent { padding: 6px 14px; border-radius: var(--radius); cursor: pointer; font-family: inherit; font-size: var(--fs); }
button.danger { background: var(--c-danger-soft); color: var(--c-danger-text); border: 1px solid transparent; }
button.alt-accent { background: var(--c-accent); color: var(--c-on-accent); border: none; }
button:disabled, button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
button.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--c-border-strong); border-top-color: var(--c-primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; color: var(--c-text-muted); padding: 28px 16px; }
.empty .mi { display: block; font-size: 40px; margin: 0 auto 8px; color: var(--c-border-strong); }
.empty p { margin: 0 0 12px; }

.skeleton { background: linear-gradient(90deg, var(--c-surface-2), var(--c-border), var(--c-surface-2)); background-size: 200% 100%;
  animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

table.data { display: table; width: 100%; border-collapse: separate; border-spacing: 0; background: var(--c-surface); }
table.data th { text-align: right; font-size: var(--fs-xs); color: var(--c-text-muted); font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid var(--c-border); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
table.data tbody tr:hover { background: var(--c-surface-2); }
table.data th button.plain { all: unset; cursor: pointer; }
table.data th button.plain:focus-visible { outline: 2px solid var(--c-accent); }
table.data .num { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  table.data thead { display: none; }
  table.data tr { display: block; border-bottom: 1px solid var(--c-border); padding: 6px 0; }
  table.data td { display: flex; justify-content: space-between; gap: 12px; border: none; padding: 4px 10px; }
  table.data td::before { content: attr(data-label); color: var(--c-text-muted); font-size: var(--fs-xs); }
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { min-height: 36px; }
.bulkbar { position: sticky; bottom: 12px; display: flex; gap: 8px; align-items: center; background: var(--c-text);
  color: var(--c-surface); border-radius: var(--radius-xl); padding: 8px 12px; box-shadow: var(--shadow-lg); }
.bulkbar[hidden] { display: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin-bottom: 12px; overflow-x: auto; }
.tabs [role=tab] { all: unset; cursor: pointer; padding: 8px 12px; color: var(--c-text-muted); border-bottom: 2px solid transparent;
  white-space: nowrap; }
.tabs [role=tab][aria-selected=true] { color: var(--c-text); border-bottom-color: var(--c-accent); font-weight: 600; }
.tabs [role=tab]:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.tabs .count { font-size: var(--fs-xs); background: var(--c-surface-2); border-radius: var(--radius-pill); padding: 0 6px; margin-inline-start: 4px; }

.tag.info { background: var(--c-nav-active); color: var(--c-navy); }
.tag.neutral { background: var(--c-surface-2); color: var(--c-text-muted); }

.wizard .step { font-size: var(--fs-xs); color: var(--c-text-muted); margin-bottom: 6px; }
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: var(--fs-sm); color: var(--c-text-muted); }
.field .err { color: var(--c-danger-text); font-size: var(--fs-xs); }
.field input[aria-invalid=true], .field select[aria-invalid=true] { border-color: var(--c-danger); }

.drop { display: block; border: 1.5px dashed var(--c-border-strong); border-radius: var(--radius); padding: 14px; text-align: center;
  color: var(--c-text-muted); cursor: pointer; }
.drop.over { border-color: var(--c-accent); background: var(--c-accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.combo { position: relative; }
.combo [role=listbox] { position: absolute; inset-inline: 0; top: 100%; z-index: 20; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 240px; overflow: auto; margin: 4px 0 0; padding: 4px; list-style: none; }
.combo [role=option] { padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.combo [role=option][aria-selected=true], .combo [role=option]:hover { background: var(--c-nav-active); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--c-border); font-size: var(--fs-sm); }
.timeline li time { color: var(--c-text-muted); margin-inline-start: auto; white-space: nowrap; font-size: var(--fs-xs); }
.timeline li.note { background: var(--c-warning-soft); border-radius: var(--radius-sm); padding: 6px 8px; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.slots button.slot { min-height: 36px; background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.slots button[aria-pressed=true] { background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary); }

.pos { display: grid; grid-template-columns: 1fr 320px; gap: 12px; }
.pos .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pos .tile { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px; text-align: right;
  color: var(--c-text); min-height: 72px; }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr; } }

.map { position: relative; height: 360px; overflow: hidden; border-radius: var(--radius-xl); border: 1px solid var(--c-border);
  background: var(--c-surface-2); direction: ltr; }
.map img.tile { position: absolute; width: 256px; height: 256px; user-select: none; }
.map .pin { position: absolute; transform: translate(-50%, -100%); background: var(--c-primary); color: var(--c-on-primary);
  border-radius: var(--radius-pill); padding: 2px 8px; font-size: var(--fs-xs); white-space: nowrap; box-shadow: var(--shadow); }
.map .pin.parcel { background: var(--c-accent); }
.map .attrib { position: absolute; bottom: 2px; right: 4px; font-size: 10px; background: rgba(255,255,255,.8); color: #333; padding: 0 4px; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.checklist li .mi { color: var(--c-border-strong); }
.checklist li.done .mi { color: var(--c-success); }
.checklist li.done span { color: var(--c-text-muted); text-decoration: line-through; }
