/*
  Area pass: Safety 1 (boards: canvas-safety Main / Accidents / AccidentRecord / AccidentDelete / DrugAlcoholTests /
  DrugTestRecord / DrugTestDelete / CarrierPacket / ComplianceDateField).
  Scoped under .pui-safety1 (the page body) and the pui-safety1- prefix. Sheets and dialogs are portaled out of the
  page body, so they hang off their own root classes (pui-safety1-sheet, pui-safety1-confirm).
*/

.pui-page.pui-safety1 { padding: 24px 28px 40px; gap: 20px; }

/* ── Chips ("Show only", "Needs you") ───────────────────────────────────────────────────── */

.pui-safety1-needs-label {
    font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted-foreground); margin-right: 4px;
}
.pui-safety1 .cn-button.pui-safety1-chip {
    height: 32px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; color: var(--foreground); box-shadow: none; gap: 8px;
}
.pui-safety1 .cn-button.pui-safety1-chip:hover { background: var(--accent); }
.pui-safety1 .cn-button.pui-safety1-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--tone-info-bg); }
.pui-safety1 .pui-safety1-chip .cn-badge { height: 20px; }
.pui-safety1 .pui-safety1-chip .cn-badge::before { display: inline-block; }

/* ── List card: tabs, filter bar, table, footer ─────────────────────────────────────────── */

.pui-safety1 .pui-list-card.cn-card { overflow: hidden; gap: 0; padding: 0; border-radius: 12px; }
.pui-safety1 .pui-list-toolbar { padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 12px; }
.pui-safety1 .pui-list-card .cn-tabs-list {
    display: flex; gap: 2px; padding: 3px; background: var(--muted); border-radius: 9px; width: max-content;
    max-width: 100%; height: auto;
}
.pui-safety1 .pui-list-card .cn-tabs-trigger {
    height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; gap: 6px; box-shadow: none;
    border: 0; color: var(--muted-foreground);
}
.pui-safety1 .pui-list-card .cn-tabs-trigger[aria-selected="true"] {
    background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.2 0.02 258 / .08);
}
.pui-safety1-count { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--muted-foreground); }

.pui-safety1 .pui-filter-bar { align-items: center; gap: 8px; }
.pui-safety1-filter-label { font-size: 13px; color: var(--muted-foreground); }

.pui-safety1 .pui-list-table { padding: 0; }
.pui-safety1 .pui-list-card table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pui-safety1 .pui-list-card thead th {
    height: 38px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--muted-foreground);
    border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left;
}
.pui-safety1 .pui-list-card tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.pui-safety1 .pui-list-card tbody tr:last-child td { border-bottom: 0; }
.pui-safety1 .pui-list-card tbody tr:hover td { background: oklch(0.98 0.004 250); }
.pui-safety1 .pui-list-card tbody tr.pui-safety1-group-row td {
    background: var(--muted); font-size: 12px; font-weight: 500; color: var(--muted-foreground); padding: 8px 12px;
}
.pui-safety1 .pui-list-card tbody tr.pui-safety1-group-row:hover td { background: var(--muted); }
.pui-safety1 .pui-list-card tbody tr.pui-safety1-group-row .cn-hstack, .pui-safety1 .pui-list-card tbody tr.pui-safety1-group-row .sc-hstack { align-items: baseline; }
.pui-safety1-block-note { font-size: 12px; font-weight: 500; color: var(--tone-danger-fg); }
.pui-safety1 .pui-list-footer { padding: 0; border-top: 1px solid var(--border); }
.pui-safety1 .pui-list-footer .pui-pager { border-top: 0; }
.pui-safety1-foot { padding: 12px 16px; font-size: 13px; color: var(--muted-foreground); width: 100%; box-sizing: border-box; }
.pui-safety1-foot .pui-num { font-size: 13px; }

/* The last column is the row menu / action. */
.pui-safety1-menu-col { width: 48px; padding-left: 4px !important; padding-right: 8px !important; text-align: right; }

/* ── Outline buttons inside the area (board: white fill, --input border, no shadow) ─────── */

.pui-safety1 .cn-button-variant-outline,
.pui-safety1-sheet .cn-button-variant-outline,
.pui-safety1-confirm .cn-button-variant-outline { background: var(--card); border-color: var(--input); box-shadow: none; }
.pui-safety1 .cn-button-variant-outline:hover,
.pui-safety1-sheet .cn-button-variant-outline:hover,
.pui-safety1-confirm .cn-button-variant-outline:hover { background: var(--accent); }

/* ── Compliance overview table: the board's column proportions ───────────────────────────── */

.pui-safety1-table { table-layout: fixed; min-width: 900px; }
.pui-safety1-table thead th:nth-child(1) { width: 29%; }
.pui-safety1-table thead th:nth-child(2) { width: 28%; }
.pui-safety1-table thead th:nth-child(3) { width: 11%; }
.pui-safety1-table thead th:nth-child(5) { width: 150px; }
.pui-safety1-table td .cn-button-size-sm { height: 32px; }

/* ── Accidents table ─────────────────────────────────────────────────────────────────────── */

.pui-safety1-acc-table td .pui-safety1-tow { height: 22px; font-size: 12px; font-weight: 500; }
.pui-safety1-acc-table td .pui-safety1-tow::before { display: none; }

/* ── Sheets (Record accident, Record test) ───────────────────────────────────────────────── */

.pui-safety1-sheet .cn-sheet { background: var(--card); gap: 0; }
.pui-safety1-sheet .pui-sheet-header { padding: 20px 68px 16px 24px; gap: 4px; border-bottom: 1px solid var(--border); }
.pui-safety1-sheet .pui-sheet-section { padding: 20px 24px; gap: 14px; }
.pui-safety1-sheet .pui-sheet-section:last-child { border-bottom: 0; }
.pui-safety1-sheet .pui-sheet-section-title { font-size: 14px; font-weight: 600; }
.pui-safety1-sheet .pui-sheet-footer { padding: 14px 24px; background: var(--card); }
.pui-safety1-sheet .pui-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pui-safety1-sheet .pui-fields > .pui-safety1-span { grid-column: 1 / -1; }
.pui-safety1-sheet .cn-textarea { min-height: 84px; }
.pui-safety1-city-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 140px; gap: 14px; }
.pui-safety1-switch-row { align-items: center; min-height: 20px; }
.pui-safety1-switch-label { font-size: 13px; font-weight: 500; }
.pui-safety1-sheet .pui-sheet-section > .sc-vstack { gap: 14px; }

/* The compliance date field: a full-width outline button with a calendar icon, left aligned. */
.pui-safety1-sheet .cn-date-picker { display: block; position: relative; width: 100%; }
.pui-safety1-sheet .cn-date-picker-trigger,
.pui-safety1 .cn-date-picker-trigger {
    width: 100%; height: 36px; justify-content: flex-start; gap: 8px; padding: 0 12px; font-size: 14px; font-weight: 400;
    border: 1px solid var(--input); border-radius: 8px; background: var(--card); color: var(--foreground); box-shadow: none;
}
.pui-safety1-sheet .cn-date-picker-trigger[data-empty="true"] { color: var(--muted-foreground); }
.pui-safety1-date-clear { border-top: 1px solid var(--border); display: flex; justify-content: center; padding: 6px; }
.pui-safety1-date-clear .cn-button { width: 100%; }

/* ── Confirmation dialogs (board: 440px, 14px radius, header 20px 24px, footer with a top rule) ─────
   The dialog root is portaled out of .pui-safety1, so these hang off the root class. */

.cn-dialog-root.pui-safety1-confirm .cn-dialog {
    padding: 0; gap: 0; border-radius: 14px; max-width: calc(100vw - 32px); width: min(440px, calc(100vw - 32px));
}
.cn-dialog-root.pui-safety1-confirm .cn-dialog-header { padding: 20px 24px 20px; gap: 4px; }
.cn-dialog-root.pui-safety1-confirm .cn-dialog-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.cn-dialog-root.pui-safety1-confirm .cn-dialog-description { font-size: 13px; line-height: 1.45; color: var(--muted-foreground); }
.cn-dialog-root.pui-safety1-confirm .cn-dialog-footer {
    margin: 0; padding: 16px 24px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
}

/* ── Drug and alcohol tests ──────────────────────────────────────────────────────────────── */

.pui-safety1 .pui-filter-bar { padding: 0; }
.pui-safety1-avatar, .pui-safety1 .cn-avatar { width: 32px; height: 32px; flex: none; }
.pui-safety1 [data-slot="avatar-fallback"] { background: var(--secondary); color: var(--secondary-foreground); font-size: 12px; font-weight: 600; }
.pui-safety1-note {
    align-items: flex-start; padding: 12px 14px; border: 1px solid oklch(0.88 0.05 250); border-radius: 10px;
    background: var(--tone-info-bg); color: var(--tone-info-fg); font-size: 13px; line-height: 1.45;
}
.pui-safety1-note svg { margin-top: 2px; }

/* ── Select placeholders inside the filter bars read as normal text (the empty option is "All ...") ───── */

.pui-safety1 .pui-filter-bar .cn-select-trigger[data-placeholder],
.pui-safety1 .pui-safety1-broker-row .cn-select-trigger[data-placeholder] { color: var(--foreground); }
.pui-safety1 .pui-safety1-broker-row .cn-select-trigger { height: 36px; background: var(--card); }

/* ── Carrier packet ──────────────────────────────────────────────────────────────────────── */

.pui-safety1-packet.cn-card { overflow: hidden; gap: 0; padding: 0; border-radius: 12px; }
.pui-safety1-packet-head { padding: 18px 20px 16px; align-items: flex-start; }
.pui-safety1-packet-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pui-safety1-packet-count { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; padding-top: 4px; }
.pui-safety1-seg { width: 116px; height: 3px; border-radius: 999px; }
.pui-safety1-seg-ok { background: var(--primary); }
.pui-safety1-seg-bad { background: var(--tone-danger-fg); }
.pui-safety1-packet-row { padding: 16px 20px; border-top: 1px solid var(--border); min-height: 68px; box-sizing: border-box; }
.pui-safety1-tile {
    width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none;
}
.pui-safety1-tile-ok { background: var(--tone-success-bg); color: var(--tone-success-fg); }
.pui-safety1-tile-bad { background: var(--tone-danger-bg); color: var(--tone-danger-fg); }
.pui-safety1-packet-title { font-size: 14px; font-weight: 600; }
.pui-safety1-coi-bad { font-size: 12px; color: var(--tone-danger-fg); }
.pui-safety1-coi-ok { font-size: 12px; color: var(--muted-foreground); }

/* ── The board's tinted danger alert and the broker label ────────────────────────────────── */

.pui-safety1-alert {
    align-items: flex-start; padding: 12px 14px; border: 1px solid oklch(0.88 0.06 25); border-radius: 10px;
    background: var(--tone-danger-bg); color: var(--tone-danger-fg); font-size: 13px; line-height: 1.45;
}
.pui-safety1-alert-icon { margin-top: 2px; flex: none; }
.pui-safety1-alert-title { font-weight: 600; }
.pui-safety1-broker-row .pui-safety1-filter-label { font-size: 13px; font-weight: 500; color: var(--foreground); }

/* ── The calendar popover of the compliance date field (board: 280px, 36px cells, mono days, bordered chevrons) ── */

.pui-safety1-date .cn-date-picker-content { padding: 0; border-radius: 12px; box-shadow: 0 12px 28px oklch(0.2 0.03 258 / .14); }
.pui-safety1-date .cn-calendar { --cell-size: 36px; padding: 12px; }
.pui-safety1-date .cn-calendar-day { font-family: var(--font-mono); font-size: 13px; }
.pui-safety1-date .cn-calendar-weekday { font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.pui-safety1-date .cn-calendar-nav { border: 1px solid var(--input); background: var(--card); border-radius: 8px; width: 32px; height: 32px; }
.pui-safety1-date .cn-calendar-month-label { font-size: 14px; font-weight: 600; }
.pui-safety1-date-clear { padding: 4px 8px 8px; }
.pui-safety1-date-clear .cn-button { height: 36px; font-weight: 500; }
