/* Stage 2 keeps the AHL gold / charcoal identity while tightening dense work views. */
.stage2-page {
    --s2-line: #ddd8ce;
    --s2-muted: #68655f;
    --s2-wash: #f4f1eb;
    --s2-warm: #fbf5e9;
    max-width: 1680px;
    margin-inline: auto;
    padding: clamp(.85rem, 2.2vw, 1.8rem);
}
.stage2-page a { overflow-wrap: anywhere; }
.stage2-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin:0 0 1rem; }
.stage2-heading h1 { margin:0; font-size:clamp(1.55rem, 3vw, 2.2rem); }
.stage2-kicker { margin:0 0 .35rem; color:var(--ahl-gold-dark); font-size:.72rem; font-weight:700; letter-spacing:.11em; text-transform:uppercase; }
.stage2-lead { color:var(--s2-muted); margin:.4rem 0 0; }
.stage2-actions { display:flex; flex-wrap:wrap; gap:.45rem; align-items:center; }
.stage2-nav { display:flex; gap:.2rem; overflow-x:auto; border-bottom:1px solid var(--s2-line); margin:0 0 1rem; scrollbar-width:thin; }
.stage2-nav a { flex:0 0 auto; padding:.65rem .8rem; border-bottom:3px solid transparent; color:var(--s2-muted); text-decoration:none; font-size:.88rem; font-weight:650; }
.stage2-nav a:hover,.stage2-nav a.is-current { color:var(--ahl-dark); }
.stage2-nav a.is-current { border-color:var(--ahl-gold); }
.s2-panel { min-width:0; margin-bottom:1rem; padding:clamp(.9rem, 1.8vw, 1.35rem); background:var(--ahl-surface); border:1px solid var(--s2-line); border-radius:var(--ahl-radius); box-shadow:var(--ahl-shadow); }
.s2-panel-title { display:flex; justify-content:space-between; align-items:flex-end; gap:1rem; margin-bottom:1rem; }
.s2-panel-title h2 { margin:0; font-size:1.12rem; }
.s2-panel-title p { margin:.2rem 0 0; color:var(--s2-muted); font-size:.86rem; }
.s2-filterbar { display:flex; flex-wrap:wrap; align-items:end; gap:.55rem; padding:.8rem; margin-bottom:1rem; border:1px solid var(--s2-line); border-radius:var(--ahl-radius-sm); background:var(--s2-wash); }
.s2-filterbar label { margin:0; }
.s2-filterbar .form-control,.s2-filterbar .form-select { min-width:9rem; }
.s2-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem; }
.s2-grid-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.8rem; }
.s2-field { min-width:0; }
.s2-field-wide { grid-column:1/-1; }
.s2-field .form-label { display:block; }
.s2-form-actions { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-top:.8rem; }
.s2-hint { color:var(--s2-muted); font-size:.82rem; }
.s2-table-wrap { overflow:auto; border:1px solid var(--s2-line); border-radius:var(--ahl-radius-sm); }
.s2-table { margin:0; min-width:680px; }
.s2-table th { white-space:nowrap; }
.s2-table td { vertical-align:top; }
.s2-schedule-table { min-width:900px; }
.s2-day-head { min-width:125px; }
.s2-slot { display:block; padding:.45rem; margin:0 0 .4rem; color:var(--ahl-text); text-decoration:none; background:#fffdfa; border:1px solid var(--s2-line); border-left:3px solid var(--ahl-gold); border-radius:6px; }
.s2-slot:hover { background:var(--s2-warm); border-color:var(--ahl-gold); color:var(--ahl-text); transform:translateY(-1px); }
.s2-slot strong,.s2-slot small { display:block; }
.s2-slot small { color:var(--s2-muted); margin-top:.12rem; }
.s2-entry-card { border:1px solid var(--s2-line); border-radius:var(--ahl-radius-sm); padding:.8rem; margin:.55rem 0; background:#fffdfa; }
.s2-entry-head { display:flex; justify-content:space-between; gap:.6rem; align-items:flex-start; }
.s2-entry-head h3 { margin:0; font-size:.98rem; }
.s2-entry-meta { color:var(--s2-muted); font-size:.84rem; margin:.25rem 0; }
.s2-inline-actions { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; margin-top:.5rem; }
.s2-inline-actions form { display:inline-flex; margin:0; }
.s2-status { display:inline-block; padding:.23rem .55rem; border-radius:999px; background:#f0efec; color:#514f4a; font-size:.76rem; font-weight:700; text-transform:capitalize; }
.s2-status.approved,.s2-status.complete { background:#e4f2e9; color:#155b3b; }
.s2-status.rejected,.s2-status.missing { background:#fae6e4; color:#8b2725; }
.s2-status.submitted,.s2-status.on_hold { background:#fff1d2; color:#78551a; }
.s2-empty { border:1px dashed #d5cec1; border-radius:var(--ahl-radius-sm); background:#fbfaf7; padding:1.25rem; color:var(--s2-muted); }
.s2-empty strong { display:block; color:var(--ahl-text); margin-bottom:.2rem; }
.s2-empty p { margin:0; }
.s2-callout { padding:.8rem 1rem; background:var(--s2-warm); border-left:3px solid var(--ahl-gold); border-radius:0 var(--ahl-radius-sm) var(--ahl-radius-sm) 0; color:#514735; }
.s2-total { display:flex; flex-wrap:wrap; gap:1.5rem; padding:.85rem 1rem; background:var(--s2-wash); border-radius:var(--ahl-radius-sm); }
.s2-total span { color:var(--s2-muted); font-size:.8rem; display:block; }
.s2-total strong { font-size:1.1rem; }
.s2-week-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.72fr); gap:1rem; align-items:start; }
.s2-job-title { font-weight:700; }
.s2-mono { font-variant-numeric:tabular-nums; white-space:nowrap; }
.s2-print-title { display:none; }
.s2-audit { border-top:1px solid var(--s2-line); margin-top:.7rem; padding-top:.6rem; font-size:.82rem; }
.s2-audit details { margin:.3rem 0; }
.s2-audit pre { white-space:pre-wrap; overflow-wrap:anywhere; background:var(--s2-wash); padding:.6rem; border-radius:5px; font-size:.78rem; }
.s2-rate-overrides { border-top:1px solid var(--s2-line); padding-top:.9rem; }
.s2-rate-override { padding:.7rem 0; border-bottom:1px solid var(--s2-line); }
.s2-rate-override-line { display:grid; grid-template-columns:minmax(150px,1fr) minmax(150px,.8fr) minmax(180px,1fr) auto; gap:.7rem; align-items:end; }
.s2-rate-override-line > div:first-child { display:grid; gap:.15rem; padding-bottom:.45rem; }
.s2-rate-override-line > div:first-child span { color:var(--s2-muted); font-size:.82rem; }
.s2-login { max-width:480px; margin:clamp(1.5rem,7vh,5rem) auto; }
.s2-login .s2-panel { padding:clamp(1.2rem,4vw,2rem); }
.s2-login-mark { width:3.2rem; height:3.2rem; display:grid; place-items:center; border-radius:10px; background:var(--s2-warm); color:var(--ahl-gold-dark); font-size:1.4rem; margin-bottom:1rem; }
.stage2-page .btn:focus-visible,.stage2-page a:focus-visible,.stage2-page summary:focus-visible { outline:3px solid rgba(166,123,46,.45); outline-offset:2px; }
.stage2-page .btn,.stage2-page a,.stage2-page .form-control,.stage2-page .form-select { transition:color .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease; }
@media (max-width: 900px) {
    .s2-week-layout { grid-template-columns:minmax(0,1fr); }
}
@media (max-width: 767px) {
    .stage2-page { padding:.75rem; }
    .stage2-heading { align-items:flex-start; flex-direction:column; }
    .stage2-heading .stage2-actions { width:100%; }
    .stage2-heading .stage2-actions .btn { flex:1 1 auto; }
    .s2-grid,.s2-grid-3 { grid-template-columns:minmax(0,1fr); }
    .s2-field-wide { grid-column:auto; }
    .s2-form-actions { align-items:stretch; flex-direction:column; }
    .s2-form-actions .btn { width:100%; }
    .s2-filterbar > * { flex:1 1 100%; }
    .s2-filterbar .form-control,.s2-filterbar .form-select { width:100%; }
    .s2-table-wrap.mobile-cards { overflow:visible; border:0; }
    .s2-table-wrap.mobile-cards .s2-table { min-width:0; }
    .s2-table-wrap.mobile-cards thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
    .s2-table-wrap.mobile-cards tbody,.s2-table-wrap.mobile-cards tr,.s2-table-wrap.mobile-cards td { display:block; width:100%; }
    .s2-table-wrap.mobile-cards tr { border:1px solid var(--s2-line); border-radius:var(--ahl-radius-sm); margin-bottom:.7rem; overflow:hidden; background:var(--ahl-surface); }
    .s2-table-wrap.mobile-cards td { display:grid; grid-template-columns:minmax(7rem,.65fr) minmax(0,1.35fr); gap:.65rem; padding:.55rem .7rem; border-bottom:1px solid #eee9df; }
    .s2-table-wrap.mobile-cards td:last-child { border-bottom:0; }
    .s2-table-wrap.mobile-cards td::before { content:attr(data-label); color:var(--s2-muted); font-size:.76rem; font-weight:700; }
    .s2-entry-head { flex-direction:column; }
    .s2-rate-override-line { grid-template-columns:minmax(0,1fr); }
}
@media print {
    @page { margin:12mm; }
    @page schedule { size:landscape; margin:10mm; }
    .stage2-schedule-page { page:schedule; }
    body { background:#fff !important; color:#111 !important; }
    .navbar,.footer,.no-print,.stage2-nav { display:none !important; }
    .stage2-page { max-width:none; padding:0; }
    .stage2-heading { margin-bottom:8pt; }
    .stage2-heading h1 { font-size:20pt; }
    .s2-print-title { display:block; font-size:9pt; color:#555; margin-bottom:8pt; }
    .s2-panel { box-shadow:none; border:1px solid #999; border-radius:0; padding:8pt; break-inside:avoid; }
    .s2-table-wrap { overflow:visible; border:0; }
    .s2-table,.s2-schedule-table { min-width:0; font-size:8pt; }
    .s2-table th,.s2-table td { padding:4pt; }
    .s2-schedule-table { width:100%; table-layout:fixed; }
    .s2-schedule-table th,.s2-schedule-table td { min-width:0; white-space:normal; overflow-wrap:anywhere; }
    .s2-day-head { min-width:0; }
    .s2-slot { color:#111; padding:3pt; border-radius:0; }
    .s2-slot,.s2-slot strong,.s2-slot small { white-space:normal; overflow-wrap:anywhere; }
    .s2-rate-overrides,.s2-rate-override { display:none !important; }
    .s2-entry-card { break-inside:avoid; }
    .s2-week-layout { display:block; }
    .s2-empty { border-style:solid; }
    a { color:#111 !important; text-decoration:none !important; }
}
