/* ─── ADP tab · a workspace derivative mirroring odoo.css, only its grid and sections live here ─── */

/* departments · the section's list · the selected worker */
.adp-workspace { --rail-w: 14rem; --panel-w: 22rem; grid-template-columns: var(--rail-col) minmax(0, 1fr) var(--panel-col); }

/* the pane is a column of chrome and one scrolling view, not a scroller itself */
.adp-pane { display: flex; flex-direction: column; overflow: hidden; }
.adp-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.adp-section .table-scroll { flex: 1; min-height: 0; margin-bottom: 0; }

/* an amount ADP still masks · hatched where the figure will sit, so the finished layout shows before the data does */
.adp-shell { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text-muted) 12%, transparent) 6px 12px); }
.adp-shell-mark { display: inline-block; min-width: 4.5rem; padding: 0 0.4rem; border: 1px dashed var(--border); border-radius: var(--radius-sm, 4px); color: var(--text-muted); font-size: 0.72rem; text-align: center; }
.adp-pay-foot td { font-weight: 650; border-top: 2px solid var(--border); }

/* the period stepper · ‹ label › joined into one control, so the period on screen is always named */
.adp-period { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm, 4px); background: var(--surface); overflow: hidden; }
.adp-period.hidden { display: none; }
.adp-period-step { border: 0; background: none; padding: 0 0.55rem; font-size: 1rem; line-height: 1; color: var(--text-sub); cursor: pointer; }
.adp-period-step:hover:not(:disabled) { background: var(--row-hover); }
.adp-period-step:disabled { color: var(--text-faint); cursor: default; }
.adp-period-label { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.22rem 0.65rem; border-inline: 1px solid var(--border-light); font-weight: 650; font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* the strip of pay periods above the table · the shared .ps-* component draws the inside */
.adp-strip { flex: none; display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.6rem; padding: 0.5rem 0.7rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-md, 6px); background: var(--surface); }
.adp-strip-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; }
.adp-strip-title { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.adp-strip-hint { margin-left: auto; font-size: 0.72rem; color: var(--text-faint); }
@media (max-width: 700px) { .adp-strip-hint { display: none; } }

/* unconfirmed periods on the strip hatched like the split bar's unconfirmed share · the one being worked fills only as far as now by the shared component */
#adp-period-strip .ps-seg.is-unconfirmed { background-image: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--warning) 25%, transparent) 3px 6px); }

/* the banner over the table · what kind of number it holds, toned by state */
.adp-banner { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin-bottom: 0.6rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md, 6px); background: var(--surface); font-size: 0.84rem; }
.adp-banner.hidden { display: none; }
.adp-banner.is-unconfirmed { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.adp-banner.is-confirmed   { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.adp-banner-facts { display: inline-flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; color: var(--text-sub); }
.adp-banner-part { display: inline-flex; align-items: center; gap: 0.35rem; }

/* confirmed and unconfirmed read apart by colour wherever they sit side by side */
.adp-confirmed { color: var(--success); }
.adp-unconfirmed { color: var(--warning); }
td.adp-confirmed, td.adp-unconfirmed, dd.adp-confirmed, dd.adp-unconfirmed { font-weight: 600; }
/* a total that mixes states · its share confirmed, the rest hatched */
.adp-split { display: inline-grid; gap: 3px; justify-items: end; }
.adp-split-bar { display: flex; width: 6rem; height: 4px; border-radius: 2px; overflow: hidden; background: var(--surface-deep); }
.adp-split-bar .is-confirmed { background: var(--success); }
.adp-split-bar .is-unconfirmed { background: repeating-linear-gradient(135deg, var(--warning) 0 3px, color-mix(in srgb, var(--warning) 35%, transparent) 3px 6px); }

/* a worker row is a selection, not just a row to read */
#adp-roster-tbody tr,
#adp-time-tbody tr { cursor: pointer; }
.adp-pay-foot.hidden { display: none; }

/* where a pay figure comes from · a statement, an estimate, or the period still being worked, each in its own tone */
.adp-glyph { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; border-radius: var(--radius-sm, 4px); flex: none; }
.adp-glyph svg { width: 0.75rem; height: 0.75rem; }
.adp-glyph--statement { color: var(--success); background: var(--success-bg); }
.adp-glyph--estimate  { color: var(--warning); background: var(--warning-bg); }
.adp-glyph--running   { color: var(--info-color); background: var(--info-bg); }
.adp-money { display: inline-flex; align-items: center; gap: 0.3rem; font-variant-numeric: tabular-nums; }

/* the worker panel · who, then the summary, then one run per kind of detail */
.adp-who { display: flex; flex-direction: column; gap: 0.4rem; }
.adp-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
/* two figures a row, the hairlines between them drawn by the gap · gross pay takes a row of its own */
.adp-summary { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border-light); border: 1px solid var(--border-light); border-radius: var(--radius-md, 6px); overflow: hidden; }
.adp-summary > div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0.6rem; min-width: 0; background: var(--surface); }
.adp-summary > .is-wide { grid-column: 1 / -1; }
.adp-summary-k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.adp-summary-v { font-size: 0.95rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adp-summary-s { font-size: 0.72rem; color: var(--text-muted); }

.adp-periods { display: flex; flex-direction: column; gap: 0.35rem; }
.adp-period-row { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.4rem 0.55rem; border: 1px solid var(--border-light); border-radius: var(--radius-md, 6px); }
.adp-period-name { font-weight: 600; font-size: 0.82rem; }
.adp-period-dates { font-size: 0.74rem; color: var(--text-muted); }
.adp-period-figs { display: flex; flex-direction: column; align-items: flex-end; gap: 0.05rem; font-size: 0.82rem; }
.adp-period-hours { font-size: 0.74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.adp-period-paid { font-size: 0.7rem; color: var(--text-faint); }

.adp-codes { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.adp-codes th { text-align: left; font-size: 0.68rem; font-weight: 600; color: var(--text-faint); padding: 0 0 0.25rem; border-bottom: 1px solid var(--border-light); }
.adp-codes td { padding: 0.25rem 0; border-bottom: 1px solid var(--border-light); }
.adp-codes .col-num { text-align: right; padding-left: 0.6rem; }
.adp-codes tfoot td { border-bottom: 0; font-weight: 650; }

.adp-signoff { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 0.5rem; font-size: 0.8rem; }
.adp-signoff > div { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }

.adp-days { display: flex; flex-direction: column; font-size: 0.8rem; }
.adp-day { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 0.5rem; padding: 0.22rem 0; border-bottom: 1px dashed var(--border-light); font-variant-numeric: tabular-nums; }
.adp-day:last-child { border-bottom: 0; }

/* the ADP record, folded · its summary reads as the panel's other headings */
.adp-record { border-top: 1px solid var(--border-light); padding-top: 0.6rem; }
.adp-record > summary { cursor: pointer; list-style-position: inside; }
.adp-record > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.adp-record .panel-meta { margin-top: 0.5rem; }
