/* Work safety card (Work page) and its admin tab.
   Signs follow ISO 7010 colours: hazards are yellow warning signs, required equipment blue mandatory signs.
   Everything around the signs is quiet, shadcn-style: neutral text, hairline borders, small sentence-case labels.
   Colours come from the MudBlazor palette so light and dark themes both work. */

.ws-card {
    --ws-fg: var(--mud-palette-text-primary);
    --ws-muted: var(--mud-palette-text-secondary);
    --ws-border: var(--mud-palette-lines-default);
    --ws-subtle: var(--mud-palette-background-gray);
    --ws-surface: var(--mud-palette-surface);
    --ws-accent: #F59E0B;          /* amber: the one safety accent, used on the header mark only */
    --ws-radius: 8px;
    color: var(--ws-fg);
}

/* ── Header ── */
.ws-header { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.ws-header-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; border-radius: var(--ws-radius);
    background: color-mix(in srgb, var(--ws-accent) 14%, transparent); color: var(--ws-accent);
}
.ws-header-text { flex: 1 1 260px; min-width: 0; }
.ws-title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.ws-description { margin: 2px 0 0; font-size: 0.875rem; line-height: 1.45; color: var(--ws-muted); }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons (shadcn: outline / primary / ghost) ── */
.ws-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
    border-radius: 6px; border: 1px solid transparent; cursor: pointer;
    font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s;
}
.ws-btn .mud-icon-root { font-size: 16px; }
.ws-btn:focus-visible, .ws-toggle:focus-visible { outline: 2px solid var(--ws-fg); outline-offset: 2px; }
.ws-btn:disabled { opacity: .5; cursor: default; }
.ws-btn-outline { background: var(--ws-surface); border-color: var(--ws-border); color: var(--ws-fg); }
.ws-btn-outline:hover:not(:disabled) { background: var(--ws-subtle); }
.ws-btn-primary { background: var(--ws-fg); color: var(--ws-surface); }
.ws-btn-primary:hover:not(:disabled) { opacity: .9; }
.ws-btn-ghost { background: transparent; color: var(--ws-fg); }
.ws-btn-ghost:hover:not(:disabled) { background: var(--ws-subtle); }

/* ── Body and sections ── */
.ws-body { display: flex; flex-direction: column; gap: 28px; }
.ws-sign-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px 40px; }
.ws-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.ws-count {
    display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px;
    background: var(--ws-subtle); color: var(--ws-muted); font-size: 0.75rem; font-weight: 600;
}
.ws-hint { margin: -8px 0 12px; font-size: 0.8125rem; line-height: 1.45; color: var(--ws-muted); }
.ws-muted { margin: 0; font-size: 0.875rem; color: var(--ws-muted); }

/* Instructions: one bordered list, one row per instruction, readable line length. */
.ws-instructions {
    list-style: none; margin: 0; padding: 0; max-width: 820px;
    border: 1px solid var(--ws-border); border-radius: var(--ws-radius); overflow: hidden;
}
.ws-instructions li {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px;
    font-size: 0.975rem; line-height: 1.5;
}
.ws-instructions li + li { border-top: 1px solid var(--ws-border); }
.ws-instruction-icon { flex: none; margin-top: 2px; color: var(--ws-muted); }

/* Empty state */
.ws-empty {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 20px; border: 1px dashed var(--ws-border); border-radius: var(--ws-radius);
}
.ws-empty p { margin: 0; font-size: 0.9375rem; color: var(--ws-muted); }

/* Edit mode: category toggles (shadcn toggle group) and footer */
.ws-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-toggle {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; cursor: pointer;
    border: 1px solid var(--ws-border); border-radius: 6px; background: var(--ws-surface); color: var(--ws-fg);
    font: inherit; font-size: 0.875rem; font-weight: 500;
    transition: background-color .15s, color .15s, border-color .15s;
}
.ws-toggle:hover { background: var(--ws-subtle); }
.ws-toggle.on { background: var(--ws-fg); border-color: var(--ws-fg); color: var(--ws-surface); }
.ws-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--ws-border); }

/* ── Signs ── */
.safety-tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.safety-tile { display: inline-flex; flex-direction: column; align-items: center; width: 112px; gap: 8px; user-select: none; }
.safety-tile.clickable { cursor: pointer; }
.safety-tile-sign { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; transition: transform .1s; }
.safety-tile.clickable:hover .safety-tile-sign { transform: scale(1.04); }
.safety-tile-sign.hazard { background: #FFD600; color: #000; border: 4px solid #000; border-radius: 10px; }
.safety-tile-sign.ppe { background: #1565C0; color: #fff; border: 4px solid #1565C0; border-radius: 50%; }
.safety-tile-sign.off { background: transparent; color: #9e9e9e; border: 3px dashed #bdbdbd; }
.safety-tile-label {
    text-align: center; font-size: 0.8125rem; font-weight: 500; line-height: 1.3;
    color: var(--mud-palette-text-primary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.safety-tile-label.off { color: var(--mud-palette-text-secondary); font-weight: 400; }

/* Admin dialog and panel headings, same voice as the card labels */
.safety-section-title { font-size: 0.875rem !important; font-weight: 600 !important; margin-bottom: 10px; }
.safety-icon-preview { font-size: 28px; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
    .safety-tile-sign, .ws-btn, .ws-toggle { transition: none; }
    .safety-tile.clickable:hover .safety-tile-sign { transform: none; }
}

/* ── Small signs (session page reminder) ── */
.safety-tile.small { width: 76px; gap: 6px; }
.safety-tile.small .safety-tile-sign { width: 52px; height: 52px; border-width: 3px; }
.safety-tile.small .safety-tile-sign.hazard { border-radius: 7px; }
.safety-tile.small .safety-tile-label { font-size: 0.6875rem; line-height: 1.25; }

.ws-strip {
    display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; width: 100%;
    margin-top: 12px; padding: 12px 16px; box-sizing: border-box;
    border: 1px solid var(--ws-border); border-radius: var(--ws-radius); background: var(--ws-surface);
}
.ws-strip-title { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; flex: none; }
.ws-strip-icon { color: var(--ws-accent); }
.ws-strip-signs { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Acknowledgement dialog (new production session) ── */
.ws-ack-title { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ws-ack-work + .ws-ack-work { padding-top: 24px; border-top: 1px solid var(--ws-border); }
.ws-ack-work-name { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.ws-ack-actions { display: flex; justify-content: flex-end; width: 100%; padding: 8px 8px 4px; }
.ws-btn.ws-btn-lg { height: 48px; padding: 0 24px; font-size: 1rem; }
.ws-btn.ws-btn-lg .mud-icon-root { font-size: 20px; }
