/* WattsWorkforce app · additions on top of watts.css (the prototype design system, the source of truth).
   This file only maps the app's own markup onto the prototype's classes and styles the few pieces the prototype rendered in JS. */

/* rail: no visible scrollbar (still scrolls) */
.rail-scroll { scrollbar-width: none; }
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-foot .nav-item { background: transparent; }
.rail-foot form { margin: 0; }
.menu-btn { border: 0; }

/* topbar bits rendered without JS */
.topbar .lang-toggle a { text-decoration: none; color: var(--text-2); }
.topbar .lang-toggle a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.topbar .segmented a { padding: 3px 9px; font-size: 12px; border-radius: 7px; font-weight: 600; }
.bell { position: relative; }
.bell .nav-count { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--orange); color: var(--on-orange); font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 4px; text-align: center; }
details.user-menu { position: relative; }
details.user-menu > summary { list-style: none; cursor: pointer; }
details.user-menu > summary::-webkit-details-marker { display: none; }
details.user-menu .popover { right: 0; top: calc(100% + 6px); }
details.user-menu .popover .menu-item { text-decoration: none; }
details.user-menu .popover form { margin: 0; }
details.user-menu .popover .menu-item.danger { color: var(--danger); }
details.user-menu .popover .menu-item.danger svg { color: var(--danger); }
.popover .menu-header { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 6px 10px 4px; }

/* page header (views use .page-header > .titles + .actions) */
.page-header .titles > .eyebrow a { color: inherit; text-decoration: none; }
.page-header .titles > .eyebrow a:hover { color: var(--orange-text); }
.page-header .titles > p.muted { color: var(--text-2); font-size: 14.5px; max-width: 72ch; }

/* cards: .hd / .bd / .ft and list rows inside cards */
.card > .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .hd h2 { font-family: var(--font-body); font-size: 15px; font-weight: 600; }
.card > .hd > a { font-size: 13px; }
.card > .bd { padding: 16px 18px; min-width: 0; }
.card > .ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card > .row, .card > a.row, .card > form.row, .card > div.row { padding: 11px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card > .hd + .row { border-top: 0; }
.card > :first-child.row { border-top: 0; }
.card > a.row { text-decoration: none; color: var(--text); }
.card > a.row:hover { background: color-mix(in srgb, var(--surface-3) 50%, transparent); }
.card > .row .grow { display: flex; flex-direction: column; gap: 2px; }
.card > .row .grow > .strong { font-size: 13.5px; }
.card > .row .grow > .small.muted, .card > .row .grow > .xsmall.muted { color: var(--text-3); }
.card > .row > svg:last-child { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.card.tbl-wrap { overflow-x: auto; }
.card > .tbl-wrap { overflow-x: auto; }

/* stats: .stats > .stat > .l .v .m */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stats .stat { gap: 4px; }
.stat .l { font-size: 12px; color: var(--text-3); font-weight: 600; }
.stat .v { font-family: var(--font-display); font-weight: 600; font-size: 27px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.stat .m { font-size: 12px; color: var(--text-3); }
.tone-ok { color: var(--success); } .tone-warn { color: var(--warning); } .tone-danger { color: var(--danger); } .tone-accent { color: var(--orange-text); }

/* badges: .tag */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.tag.ok { background: var(--success-soft); color: var(--success); }
.tag.warn { background: var(--warning-soft); color: var(--warning); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.neutral { background: var(--surface-3); color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }

/* buttons: .btn.primary etc. */
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn.primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; }

/* alerts: .alert.ok / .danger / .warn / .info */
.alert.ok { border-color: color-mix(in srgb, var(--success) 30%, transparent); background: var(--success-soft); }
.alert.danger { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-soft); }
.alert.warn { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-soft); }
.alert.info { border-color: color-mix(in srgb, var(--info) 30%, transparent); background: var(--info-soft); }
.alert.ok, .alert.danger, .alert.warn, .alert.info { color: var(--text); }

/* tables: .tbl */
.tbl-wrap { overflow-x: auto; min-width: 0; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--text-3); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.tbl tr.clickable { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
.card.tbl-wrap .tbl th:first-child, .card.tbl-wrap .tbl td:first-child { padding-left: 18px; }

/* people */
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .nm { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.person .nm span:last-child { font-size: 12px; color: var(--text-3); }
.avatar { background: var(--graphite); }

/* forms: plain inputs look like .input/.select; .form grid; .field label */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
.form .span-2 { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not(.input), select:not(.select), textarea:not(.textarea) {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 14px; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
textarea:not(.textarea) { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
select:not(.select) { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent); }
input.input-validation-error { border-color: var(--danger); }
input[readonly], input[disabled], select[disabled] { background: var(--surface-2); color: var(--text-2); }
input[type="file"] { font-size: 13px; }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err, .field-validation-error, .validation-summary-errors { font-size: 12px; color: var(--danger); font-weight: 500; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 18px 18px; margin: 0; background: var(--surface); box-shadow: var(--shadow-1); }
legend { padding: 0 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }
.check { align-items: center; }
/* app switch: <label class="switch"><input><span></span></label> */
.switch > span { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; display: inline-block; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* grids used by views */
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* auth extras */
.auth-art .lockup { display: flex; align-items: flex-end; gap: 8px; }
.auth-art .lockup .product { font-family: var(--font-display); letter-spacing: .3em; color: var(--orange); font-weight: 600; font-size: 14px; padding-bottom: 3px; }
.auth-art .bullets { display: flex; flex-direction: column; gap: 8px; color: #C9C9CE; font-size: 13.5px; }
.auth-art .bullets div { display: flex; align-items: center; gap: 8px; }
.auth-art .bullets svg { width: 18px; height: 18px; flex: none; }
.auth-card .label .link-btn { margin-left: auto; text-decoration: none; }
.auth-card .ghost-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.auth-card a.btn { text-decoration: none; }
.auth-card .lang { align-self: flex-end; }

/* staff tab bar on phones (links instead of buttons) */
.tabbar a { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-3); padding: 4px 0; text-decoration: none; }
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.active { color: var(--orange-text); font-weight: 600; }
.tabbar a.punch-tab svg { width: 26px; height: 26px; background: var(--orange); color: var(--on-orange); border-radius: 999px; padding: 5px; box-sizing: content-box; margin-top: -14px; box-shadow: 0 4px 12px rgba(245, 130, 32, .45); }

/* misc used by views */
.mono { font-variant-numeric: tabular-nums; }
h1 .tag { vertical-align: middle; font-family: var(--font-body); }
.ol-steps { list-style: none; margin: 0; padding: 0; }
code.mono { display: block; }
/* pay item guide: label / explanation pairs */
.guide { display: grid; grid-template-columns: 170px 1fr; gap: 10px 18px; margin: 0; font-size: 13px; line-height: 1.5; }
.guide dt { color: var(--text-3); font-weight: 600; }
.guide dd { margin: 0; color: var(--text-2); }
@media (max-width: 640px) { .guide { grid-template-columns: 1fr; gap: 2px; } .guide dd { margin-bottom: 8px; } }
details.guide-item { border-top: 1px solid var(--line); }
details.guide-item > summary { cursor: pointer; padding: 12px 20px; display: flex; gap: 10px; align-items: baseline; }
details.guide-item > .guide { padding: 0 20px 16px; }
@media print { .rail, .topbar, .tabbar, .actions, .btn { display: none !important; } .app { display: block; } .content { max-width: none; padding: 0; } }
