
/* ClockSync UI v2 — single responsive layer. Flat colors; no gradients. */
:root{
  --ui-bg:#15171c;--ui-surface:#22262d;--ui-surface-high:#292e36;
  --ui-border:#444b55;--ui-gold:#ffc529;--ui-text:#f6f7f9;
  --ui-muted:#afb7c3;--ui-positive:#b4efbf;--ui-negative:#ffb7aa;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:90px}
body{overflow-x:clip;background:var(--ui-bg)}
[hidden]{display:none!important}
button,select,input,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.55}
button:not(:disabled),summary,a{-webkit-tap-highlight-color:transparent}
:where(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--ui-gold);outline-offset:3px}
.panel{min-width:0}
#app-panel,#admin-panel,.workspace-content,.workspace-shell{min-width:0}
.muted{color:var(--ui-muted)}
.message{font-size:13px;line-height:1.55;overflow-wrap:anywhere}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.mobile-screen-heading,.mobile-nav,.mobile-more-panel,.mobile-scan-brand,.mobile-crew-list{display:none}
.nav-icon{display:inline-flex;align-items:center;justify-content:center}
.punch-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.punch-heading h2{margin:2px 0 0;font-size:22px;color:var(--ui-text)}
.punch-heading .eyebrow{margin:0}
.punch-status-pill{color:#a5e3b1;background:#244434;border:1px solid #356248;display:inline-flex;align-items:center;border-radius:999px;padding:7px 11px;font-weight:700;font-size:12px;white-space:nowrap}
.punch-status-pill.off{color:#c5ced7;background:#313741;border-color:#4d5763}
.punch-privacy{font-size:12px;color:var(--ui-muted);line-height:1.5;margin:15px 0 0;border-top:1px solid var(--ui-border);padding-top:13px}
.scan-location-note{color:#e2cb91;font-size:13px;line-height:1.6}
.add-job-panel{border:1px solid var(--ui-border);border-radius:11px;background:var(--ui-surface-high);margin-top:20px;overflow:hidden}
.add-job-panel>summary{padding:15px 18px;color:var(--ui-gold);font-weight:800;cursor:pointer;list-style:none}
.add-job-panel>summary::-webkit-details-marker{display:none}
.add-job-panel>summary:after{content:"＋";float:right;font-size:19px;line-height:1}
.add-job-panel[open]>summary:after{content:"−"}
.add-job-panel .inline-form{padding:0 18px 18px}
.add-job-panel label{flex:1;min-width:0}
.site-summary{cursor:pointer}
.site-summary strong{overflow-wrap:anywhere}
.worker-entry,.alert-entry{overflow-wrap:anywhere}
#activity-section .entry{gap:12px}
#activity-section .entry strong{font-size:14px}
#activity-section .entry small{font-size:12px;line-height:1.7}
#entries .entry>span{border-radius:100px;background:#343940;color:#d8dce2;padding:5px 9px;font-size:11px;white-space:nowrap}
#entries .entry .entry-duration{display:inline-block;margin-top:5px;color:var(--ui-gold);font-size:13px;font-weight:700}
.login-brand-emblem:before{display:none}
.auth-layout .auth-panel input{width:100%}
#scan-panel .scan-actions button{font-weight:850;letter-spacing:.04em}
.timesheet .rate-input{min-width:0}
#day-shift-dialog,#edit-shift-dialog,#qr-dialog{z-index:120}
#mobile-nav,#mobile-more-panel{z-index:110}
.qr-card,.edit-shift-card,.day-edit-card{max-height:min(92vh,850px);overflow-y:auto}
#scan-message:not(:empty),#punch-message:not(:empty){margin:14px 0 0}
#scan-panel .scan-location-note{margin:12px 0}

/* Desktop: stronger information hierarchy and predictable scrolling. */
@media(min-width:821px){
  .sn-stats{grid-template-columns:repeat(5,minmax(0,1fr))}
  .sn-sidebar{top:14px}
  #admin-panel{max-width:none!important;width:100%}
  .timesheet-list{min-width:0}
  .timesheet-site>.site-summary:after{content:"⌄";font-size:21px;color:inherit;opacity:.7}
  .timesheet-site[open]>.site-summary:after{content:"⌃"}
  .table-scroll{scrollbar-width:thin;scrollbar-color:#555d68 #24272d}
  #worker-clock-section{max-width:550px!important}
  .add-job-panel .inline-form{display:flex;align-items:end;gap:12px}
  .add-job-panel .inline-form button{flex-shrink:0}
  .nav-action{font-weight:650}
  .nav-action.nav-active{font-weight:850}
  .weekly-panel{margin-bottom:22px}
}

/* Mobile application layout */
@media(max-width:820px){
  html,body{width:100%;max-width:100%;overflow-x:clip}
  main{max-width:none!important;width:100%!important;margin:0 auto!important;padding:0 12px!important}
  .topbar{min-height:64px;height:64px;padding:6px 13px!important;position:sticky;top:0;z-index:80;background:#121419;border-bottom:1px solid #5d4c23}
  .topbar .cs-brand{padding:0;gap:7px}
  .cs-brand-mark{width:46px!important;height:46px!important}
  .cs-wordmark{font-size:16px!important;gap:2px;line-height:.91}
  .status{font-size:11px;padding:6px 10px;white-space:nowrap}
  #app-panel{width:100%;max-width:100%!important;padding-bottom:calc(93px + env(safe-area-inset-bottom))}
  .workspace-shell{display:block!important;width:100%}
  .workspace-content{display:flex;flex-direction:column;gap:0;width:100%}
  .sn-sidebar,.workspace-content>.welcome-row{display:none!important}
  .mobile-screen-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:22px 5px 15px}
  .mobile-screen-heading .eyebrow{font-size:10px;letter-spacing:.15em;margin:0 0 3px}
  .mobile-screen-heading h1{font-size:27px;line-height:1.2;margin:0;color:var(--ui-text);letter-spacing:-.035em}
  .mobile-screen-heading .muted{font-size:12px;line-height:1.4;margin:5px 0 0}
  .mobile-icon-button{display:grid;place-items:center;min-width:44px;min-height:44px;border-radius:11px;font-size:23px;line-height:1}
  #admin-panel,#worker-clock-section,#activity-section{width:100%!important;max-width:none!important;margin:0!important}
  #admin-panel{border:0!important;border-top:0!important;box-shadow:none!important;background:transparent!important;padding:0!important}
  #worker-clock-section,#activity-section{border-radius:16px;padding:22px 18px}
  #reason-panel:not([hidden]){display:block;margin:0 0 16px;padding:18px;border:1px solid #a98439;border-radius:13px}
  #reason-panel textarea{width:100%}
  #reason-panel button{width:100%;min-height:52px}
  /* Screen switching: the app never renders all six admin sections at once. */
  #admin-panel,#worker-clock-section,#activity-section{display:none!important}
  body[data-mobile-view="jobs"] #admin-panel:not([hidden]),
  body[data-mobile-view="week"] #admin-panel:not([hidden]),
  body[data-mobile-view="crew"] #admin-panel:not([hidden]),
  body[data-mobile-view="alerts"] #admin-panel:not([hidden]){display:block!important}
  body[data-mobile-view="clock"] #worker-clock-section{display:block!important}
  body[data-mobile-view="activity"] #activity-section{display:block!important}
  body[data-mobile-view="jobs"] #admin-panel > .admin-alert-summary,
  body[data-mobile-view="jobs"] #weekly-section{display:none!important}
  body[data-mobile-view="week"] #admin-panel > :not(#weekly-section),
  body[data-mobile-view="crew"] #admin-panel > :not(#timesheet-week-bar):not(#job-search-box):not(#admin-jobs):not(#job-search-feedback),
  body[data-mobile-view="alerts"] #admin-panel > :not(.admin-alert-summary){display:none!important}
  body[data-mobile-view="alerts"] #admin-panel>.admin-alert-summary{display:block!important}
  .sn-stats{display:flex!important;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px;margin:0 0 18px;padding:1px 0 9px;scrollbar-width:none}
  .sn-stats::-webkit-scrollbar{display:none}
  .sn-stat{flex:0 0 143px;min-height:96px;scroll-snap-align:start;padding:13px;border-radius:12px;gap:8px}
  .sn-stat>span{font-size:11px;line-height:1.3}
  .sn-stat strong{font-size:24px!important}
  .admin-workspace>.section-heading{display:flex;align-items:center;gap:10px;margin-bottom:8px}
  .admin-workspace>.section-heading h2{font-size:20px!important}
  .admin-workspace>.section-heading .eyebrow{font-size:10px}
  #admin-refresh{min-height:44px;white-space:nowrap}
  .admin-workspace>p.muted{font-size:12px;line-height:1.6;margin:4px 2px 14px}
  #admin-jobs{margin:10px 0 0;gap:11px}
  .timesheet-site{border-radius:13px!important;overflow:hidden!important;margin:0!important}
  .timesheet-site>.site-summary{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px 16px;min-height:77px}
  .site-summary strong{font-size:17px!important}
  .site-summary span{font-size:12px;color:#c5c9d0;text-align:left;line-height:1.5;overflow-wrap:anywhere}
  .timesheet-site[open]>.site-summary span{color:#252525}
  .timesheet-site>p.muted{font-size:12px;padding:0 15px;margin:13px 0 0}
  .site-toolbar{padding:13px 15px}
  .site-qr-preview{display:block!important;background:#282c33;border:1px solid #434951;border-radius:11px;padding:14px!important;max-width:none}
  .site-qr-preview>.inline-qr{display:none!important}
  .qr-side{display:block}
  .qr-side strong{display:block;font-size:13px}
  .qr-side small{display:block;font-size:11px;line-height:1.6;margin:5px 0}
  .job-entry-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px!important}
  .job-entry-actions button{min-height:43px;white-space:normal!important;font-size:12px}
  .job-entry-actions .qr-button{display:block;grid-column:1/-1;order:-1}
  /* A full table is maintained on desktop; the phone receives crew cards. */
  .timesheet-site>.table-scroll{display:none!important}
  .mobile-crew-list{display:grid!important;gap:10px;padding:0 14px 15px}
  .mobile-worker{border:1px solid #454b55;background:#20242a;border-radius:11px;overflow:hidden;min-width:0}
  .mobile-worker>summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px}
  .mobile-worker>summary::-webkit-details-marker{display:none}
  .mobile-worker-name{font-size:14px;font-weight:800;color:#fafafa;overflow-wrap:anywhere}
  .mobile-worker-meta{display:flex;flex-direction:column;gap:5px;align-items:flex-end;flex-shrink:0}
  .mobile-worker-hours{font-size:14px;font-weight:850;color:#ffcf4c;font-variant-numeric:tabular-nums}
  .mobile-worker-state{font-size:11px;color:#b6c4cc}
  .mobile-worker[open]>summary{border-bottom:1px solid #444b54}
  .mobile-worker-content{padding:14px 12px 15px}
  .mobile-worker-rate{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
  .mobile-worker-rate>span{display:grid;gap:4px;font-size:11px;color:#b4bdc7}
  .mobile-worker-rate>span strong{color:#f5f6f8;font-size:13px}
  .mobile-worker-rate .rate-input{width:112px;max-width:112px;min-height:44px;font-size:16px}
  .mobile-worker-days{display:grid;grid-template-columns:repeat(7,minmax(42px,1fr));gap:4px;overflow-x:auto;scrollbar-width:thin;padding-bottom:6px;margin-bottom:6px}
  .mobile-worker-days .daily-cell{min-width:42px;min-height:65px;border:1px solid #464c55;border-radius:7px;background:#2c3037;padding:6px 3px;color:#fff;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px}
  .mobile-worker-days .daily-cell .mobile-day-label{font-size:10px;color:#b2bdc7}
  .mobile-worker-days .daily-cell strong{font-size:12px;font-variant-numeric:tabular-nums}
  .mobile-worker-days .daily-cell:active{background:#50452f!important}
  .mobile-worker-hint{margin:4px 0 12px;color:#b4bdc7;font-size:11px}
  .mobile-worker-shifts{display:grid;gap:8px}
  .mobile-worker-shifts .shift-detail{margin:0;border:1px solid #404751;background:#2a2e35;padding:12px;border-radius:8px;min-width:0;overflow-wrap:anywhere;font-size:12px}
  .shift-detail button{min-height:42px;margin-top:8px;width:100%}
  .mobile-crew-empty{color:#b3bcc7;padding:12px;font-size:13px}
  #add-job-panel{margin-top:15px}
  #add-job-panel .inline-form{display:grid;gap:12px}
  #add-job-panel input{min-height:48px}
  #add-job-panel button{width:100%;min-height:48px}
  .admin-alert-summary{margin:0!important;padding:16px;border-radius:13px}
  .alert-entry{padding:14px 0;line-height:1.6;font-size:13px}
  .alert-entry small{font-size:12px;line-height:1.6}
  .weekly-panel{margin:0!important;padding:15px!important;border:1px solid #444b54;border-top:2px solid #b78d28;border-radius:13px;background:#202329}
  .weekly-head{display:block!important}
  .weekly-head h3{font-size:20px!important;margin:2px 0 7px}
  #calendar-workdays{font-size:12px}
  .week-controls{display:grid!important;grid-template-columns:48px 1fr 48px;gap:8px;margin:16px 0 8px}
  .week-controls select{grid-column:1/-1;width:100%!important;min-height:48px}
  .week-controls button{width:100%;min-height:45px;padding:6px}
  .week-range{font-size:13px}
  #weekly-calendar{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .calendar-day{min-height:75px!important;display:grid!important;grid-template-columns:56px minmax(0,1fr) 85px;grid-template-rows:auto auto;gap:4px 10px;padding:11px!important;align-items:center;border-radius:9px}
  .calendar-day-head{grid-column:1;grid-row:1/3;display:grid;justify-content:start;gap:5px;font-size:13px}
  .calendar-hours{grid-column:2;grid-row:1;font-size:17px!important;line-height:1}
  .calendar-cost{grid-column:2;grid-row:2;font-size:13px}
  .calendar-day small{display:none}
  .calendar-edit{grid-column:3;grid-row:1/3;position:static!important;min-height:44px!important;margin:0!important;left:auto!important;right:auto!important;bottom:auto!important;font-size:11px;border-radius:8px}
  .calendar-note{font-size:12px;line-height:1.5}
  #worker-clock-section{max-width:none!important;padding:22px 18px}
  #worker-clock-section .clock-state{font-size:28px;line-height:1.2;margin:10px 0 8px}
  #worker-clock-section .punch-status-pill{font-size:11px}
  #worker-clock-section label{margin-top:20px}
  #worker-clock-section select{min-height:54px;font-size:16px;width:100%}
  #worker-clock-section .punch-button{display:block;width:100%;min-height:72px;border-radius:12px;font-size:20px;font-weight:850;margin-top:18px}
  #worker-clock-section .punch-button:disabled{opacity:.55}
  #worker-clock-section #active-job{font-size:13px;line-height:1.6}
  #activity-section{padding:19px 15px}
  #activity-section .section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
  #activity-section .section-heading h2{font-size:20px}
  #activity-section #refresh{min-height:44px}
  #activity-section .entry{padding:13px 0;display:flex;align-items:flex-start;gap:10px}
  #activity-section .entry>div{min-width:0}
  #activity-section .entry>span{font-size:10px}
  /* Persistent bottom navigation */
  #mobile-nav:not([hidden]){display:flex!important;position:fixed;left:0;right:0;bottom:0;z-index:90;background:#171a20;border-top:1px solid #4c5059;min-height:calc(68px + env(safe-area-inset-bottom));padding:6px 8px calc(7px + env(safe-area-inset-bottom));gap:4px;align-items:stretch;justify-content:space-around}
  #mobile-nav button{border:0!important;border-radius:10px!important;background:transparent!important;color:#bac3cd!important;min-height:55px;flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;padding:6px 3px;box-shadow:none!important;font-size:11px;font-weight:700}
  #mobile-nav button .nav-icon{font-size:25px;line-height:1.1}
  #mobile-nav button.active{background:#393528!important;color:#ffc529!important}
  #mobile-nav button.active .nav-icon{color:#ffc529}
  #mobile-nav button:active{background:#2b3038!important}
  #mobile-more-panel:not([hidden]){display:flex;position:fixed;inset:0;z-index:115;background:#000a;align-items:flex-end;justify-content:center}
  .mobile-more-sheet{width:100%;max-width:560px;border:1px solid #454c55;border-radius:20px 20px 0 0;background:#22262d;padding:18px 18px calc(28px + env(safe-area-inset-bottom));display:grid;gap:9px}
  .mobile-more-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px;gap:10px}
  .mobile-more-top h2{margin:2px 0;font-size:22px}
  .mobile-more-top .eyebrow{margin:0;font-size:10px}
  .mobile-more-sheet>button:not(#mobile-more-close){display:flex;align-items:center;gap:12px;min-height:52px;border:1px solid #424951;border-radius:10px;background:#2c3138;color:#f3f4f6;text-align:left;padding:10px 14px}
  .mobile-more-sheet>button>span:last-child{margin-left:auto}
  .mobile-more-sheet #mobile-menu-signout{border-color:#54443e;background:#302726}
  #scan-panel{max-width:none!important;margin:16px 0 0!important;padding:22px 18px 25px;border-radius:16px;text-align:left}
  .mobile-scan-brand{display:flex;align-items:center;gap:9px;color:#d3dae2;font-size:12px;font-weight:750;margin:0 0 20px}
  .mobile-scan-brand img{height:42px;width:42px}
  #scan-panel h1{font-size:29px;line-height:1.2;margin:7px 0 11px}
  #scan-address{font-size:14px;line-height:1.55}
  #scan-status{border:1px solid #444c57;border-radius:10px;background:#2b3038;padding:14px;font-size:14px;font-weight:700;color:#f4f5f7}
  #scan-panel .scan-actions{display:grid;grid-template-columns:1fr;gap:9px;margin:15px 0 5px}
  #scan-panel .scan-actions button{min-height:70px;font-size:20px;border-radius:12px}
  #scan-panel .scan-actions button:disabled{display:none}
  #scan-panel #scan-dashboard{display:block;width:100%;min-height:49px;margin:16px 0 0}
  #scan-panel #scan-message{min-height:0;font-size:13px;line-height:1.6}
  .auth-layout{max-width:500px;margin:18px auto 35px}
  .login-brand-panel{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:15px;padding:15px!important}
  .login-brand-panel .eyebrow{display:none}
  .login-brand-panel h2{font-size:18px;line-height:1.25;margin:0}
  .login-brand-emblem{min-width:64px;min-height:64px!important;max-width:64px!important;width:64px!important;height:64px!important;aspect-ratio:1!important;margin:0!important}
  .login-brand-emblem img{width:64px;height:64px;max-height:64px!important}
  .auth-layout .auth-panel{padding:23px 19px;min-height:0}
  .auth-layout .auth-panel h1{font-size:29px}
  .auth-mini-brand{margin-bottom:14px}
  .auth-mini-brand img{height:42px;width:42px}
  .auth-layout .actions{display:grid;gap:10px}
  .auth-layout .actions button{width:100%;min-height:52px}
  #name-panel{margin:18px 0}
  #name-panel input,#name-panel button{min-height:52px}
  .qr-dialog{padding:0!important;align-items:flex-end!important}
  .qr-card,.day-edit-card,.edit-shift-card{max-width:100%;width:100%;margin:0;max-height:min(90dvh,850px);overflow-y:auto;border-radius:20px 20px 0 0!important;padding:22px 18px calc(26px + env(safe-area-inset-bottom))}
  .qr-card .section-heading{display:flex;justify-content:space-between;align-items:flex-start}
  .qr-actions,.edit-shift-card .actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .qr-actions button,.edit-shift-card button{min-height:48px}
  .qr-url{overflow-wrap:anywhere;font-size:10px}
  #qr-canvas{margin:14px auto}
  .day-shift-list{max-height:50dvh}
  footer{font-size:10px;text-align:center;padding-bottom:calc(75px + env(safe-area-inset-bottom))}
}
@media(max-width:370px){
  .cs-brand-mark{width:40px!important;height:40px!important}
  .cs-wordmark{font-size:14px!important}
  .mobile-worker-days{grid-template-columns:repeat(7,minmax(38px,1fr))}
  .mobile-worker-days .daily-cell{min-width:38px}
  .mobile-screen-heading h1{font-size:25px}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important}
}
@media print{
  .mobile-nav,.mobile-more-panel{display:none!important}
  body{overflow:visible!important}
}

/* Search, consistent actions, and additional usability polish */
.job-search-box{display:grid;gap:8px;margin:16px 0 14px}
.job-search-box label{font-weight:750;font-size:13px;color:#d4dae3}
#job-search{width:100%;height:47px;min-height:47px;padding:10px 13px;border:1px solid #4b535d;border-radius:10px;background:#262b32;color:#fff;font-size:15px;outline-offset:2px}
#job-search::placeholder{color:#9fa9b7}
#job-search:focus{border-color:#ffc529}
@media(max-width:820px){
  .job-search-box{margin:12px 0 14px}
  .job-search-box label{font-size:12px}
  #job-search{height:49px;font-size:16px}
  #admin-panel .job-search-box{display:grid}
  .job-entry-actions button.qr-button{display:block;grid-column:1/-1;order:-1;background:#ffc529!important;border-color:#ffc529!important;color:#16181c!important;font-weight:800}
  .job-entry-actions button.print-site-button{order:0}
  .job-entry-actions button.site-gps-button{order:1}
  .mobile-more-sheet>button{cursor:pointer}
  #app-panel{padding-bottom:calc(100px + env(safe-area-inset-bottom))}
  #mobile-more-panel:not([hidden]){display:flex!important}
}

/* Polished navigation icons and signed-in identity */
.mobile-nav .nav-icon svg{width:24px;height:24px;display:block;fill:none;stroke:currentColor}
.mobile-account-detail{color:#aeb8c4;line-height:1.6;font-size:12px;padding:6px 4px 4px;margin:0;overflow-wrap:anywhere}
.mobile-account-detail span{display:block;color:#f1f2f4;font-size:13px;font-weight:650}
@media(max-width:820px){
 #mobile-nav button.active svg{stroke:#ffc529}
 #mobile-nav button[aria-expanded="true"]{background:#393528!important;color:#ffc529!important}
 .mobile-more-sheet #mobile-menu-signout{width:100%}
}

.job-search-feedback{padding:16px;margin:8px 0;border:1px dashed #62646a;border-radius:10px;text-align:center;color:#c5cbd3;font-size:13px}

@media print{body.printing-site .site-qr-preview>.inline-qr{display:block!important;visibility:visible!important;width:65mm!important;height:65mm!important;margin:8mm auto!important}body.printing-site .site-qr-preview>.inline-qr canvas,body.printing-site .site-qr-preview>.inline-qr img{width:65mm!important;height:65mm!important;display:block!important}}

/* Instant clarity for active employee shifts */
.live-shift-duration,.scan-duration{font-variant-numeric:tabular-nums;font-weight:800;color:#ffc529;letter-spacing:-.025em}
.live-shift-duration{font-size:22px;margin:6px 0 13px}
.scan-duration{font-size:22px;margin:8px 0 14px}
@media(max-width:820px){
 .live-shift-duration{font-size:25px;margin:10px 0 14px}
 #scan-panel .scan-duration{border:1px solid #57502f;border-radius:10px;background:#332e22;padding:13px 15px;text-align:center;font-size:23px}
}

/* Calendar navigation stays close to the corresponding timesheet */
.timesheet-week-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:10px 0 12px;padding:10px 13px;background:#282d35;border:1px solid #434a53;border-radius:11px}
.timesheet-week-bar strong{font-size:14px;color:#f7f8fa;font-weight:800}
.timesheet-week-actions{display:flex;align-items:center;gap:6px}
.timesheet-week-actions button{min-width:39px;min-height:39px;border-radius:8px;line-height:1;font-size:15px;padding:6px}
.timesheet-week-actions button:nth-child(2){min-width:65px;font-size:12px;font-weight:750}
@media(max-width:820px){
 .timesheet-week-bar{margin:0 0 11px;flex-wrap:wrap;padding:10px 12px}
 .timesheet-week-bar strong{font-size:13px}
 .timesheet-week-actions button{min-height:44px;min-width:44px}
 .timesheet-week-actions button:nth-child(2){min-width:66px}
}

/* Out-of-bounds explanation: always accessible from QR or dashboard */
body.reason-open,body.alert-detail-open{overflow:hidden}
.reason-dialog,.alert-detail-dialog{position:fixed;inset:0;z-index:180;background:rgba(6,8,11,.86);padding:18px;display:none;align-items:center;justify-content:center}
#reason-panel.reason-dialog:not([hidden]),#alert-detail-dialog.alert-detail-dialog:not([hidden]){display:flex!important}
.reason-card,.alert-detail-card{width:min(100%,550px);max-height:calc(100dvh - 36px);overflow-y:auto;border-radius:16px;border:1px solid #575344;border-top:4px solid #ffc529;background:#242830;padding:24px;color:#f6f7f9}
.reason-head{display:flex;justify-content:space-between;align-items:start;gap:12px}
.reason-head h2{margin:4px 0 10px;font-size:26px}
.reason-head .eyebrow{margin:0;font-size:11px}
.reason-head button{min-height:42px;white-space:nowrap}
.reason-card #reason-description{margin:5px 0 8px;line-height:1.6;color:#d0d6de;font-size:14px}
.reason-context{background:#363123;border:1px solid #685531;color:#ffda7a;border-radius:9px;padding:12px 13px;font-weight:750;font-size:13px;line-height:1.5;margin:12px 0 21px}
.reason-card form{display:grid;gap:13px}
.reason-card form label{display:grid;gap:9px;font-weight:800;font-size:14px;color:#f1f3f6}
.reason-card textarea{width:100%;min-height:124px;padding:13px;font-size:16px;line-height:1.5;background:#171a20;color:#f2f3f6;border:1px solid #5f6873;border-radius:10px;resize:vertical}
.reason-card textarea:focus{outline:2px solid #ffc529;border-color:#ffc529;outline-offset:1px}
.reason-hint{color:#b7c1cc;margin:0;font-size:12px;line-height:1.55}
.reason-card #reason-submit{min-height:56px;width:100%;border-radius:10px;font-size:16px;font-weight:850}
.reason-card #reason-message{margin:12px 0 0;font-size:13px;line-height:1.5}
.reason-reminder{margin:16px 0;border:1px solid #99762e;border-radius:11px;background:#302a1f;padding:15px;color:#f6df9e}
.reason-reminder strong{font-size:15px;color:#ffd16b}
.reason-reminder p{margin:7px 0 13px;line-height:1.5;font-size:13px}
.reason-reminder .open-reason{min-height:46px;padding:9px 15px;border-color:#ce9a29;background:#4c3c22;color:#ffe19d;font-weight:750}
.reason-reminder .open-reason:hover{background:#594626}

/* Alert list and details */
.alert-summary-heading{display:flex;gap:12px;justify-content:space-between;align-items:baseline;flex-wrap:wrap}
.alert-summary-heading strong{font-size:17px;color:#fbe8b1}
.alert-summary-heading .muted{font-size:12px}
.admin-alert-summary>p.muted{font-size:13px;margin:9px 0 13px;line-height:1.5}
.alert-filters{display:flex;gap:7px;margin-bottom:13px;flex-wrap:wrap}
.alert-filters button{background:#302e2b!important;border:1px solid #60533a!important;color:#dcd4c0!important;padding:8px 13px!important;font-size:12px!important;border-radius:100px!important;min-height:39px}
.alert-filters button[aria-pressed="true"]{background:#ffc529!important;border-color:#ffc529!important;color:#1a1b1e!important;font-weight:850}
#admin-alerts{display:grid;gap:10px}
.alert-card{background:#272b30!important;color:#f5f6f8!important;border:1px solid #55483a!important;border-radius:11px!important;padding:14px 16px!important;text-align:left!important;display:grid!important;gap:7px!important;width:100%;box-shadow:none!important;min-height:0!important}
.alert-card:hover,.alert-card:focus-visible{background:#353533!important;border-color:#ffc529!important}
.alert-card-top{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between}
.alert-card-top strong{font-size:15px}
.alert-status{display:inline-flex;align-items:center;border-radius:100px;font-size:11px;line-height:1.2;padding:6px 9px;font-weight:800}
.alert-status.needs-reason{background:#5b352c;color:#ffd1be}
.alert-status.has-reason{background:#274b3b;color:#b6eccd}
.alert-card-site{font-size:13px;color:#c3cad2}
.alert-card-bottom{font-size:12px;color:#aeb8c3;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.alert-card-bottom>span{color:#ffce5f;font-weight:750}
.alert-empty{padding:14px;color:#c9ced5;font-size:13px}
.alert-detail-dialog{z-index:190}
.alert-detail-card{width:min(100%,590px);border-color:#6c5940}
.alert-detail-card .section-heading{display:flex;gap:12px;align-items:start;justify-content:space-between}
.alert-detail-card .section-heading h2{font-size:24px;margin:3px 0 8px}
.alert-detail-card .section-heading .eyebrow{font-size:11px}
#alert-detail-close{min-height:44px}
.alert-detail-site{color:#c4cad2;font-size:14px;margin:6px 0 12px}
.alert-detail-state{border-radius:9px;padding:12px;margin:8px 0 16px;font-weight:750;font-size:13px}
.alert-detail-state.pending{background:#49342b;color:#ffd2ad}
.alert-detail-state.explained{background:#264233;color:#aef0c7}
.alert-facts{display:grid;gap:0;margin:12px 0 18px;border:1px solid #4c535d;border-radius:10px;overflow:hidden}
.alert-facts>div{display:grid;grid-template-columns:minmax(100px,45%) 1fr;gap:10px;padding:12px 13px;background:#2a2e35;border-bottom:1px solid #444b55;font-size:13px}
.alert-facts>div:nth-child(even){background:#242830}
.alert-facts>div:last-child{border-bottom:0}
.alert-facts dt{color:#b5bfca;font-weight:650}
.alert-facts dd{margin:0;color:#f5f6f8;font-weight:750;overflow-wrap:anywhere}
.alert-facts a{font-weight:750}
.alert-reason{border:1px solid #b59142;background:#332d21;border-radius:10px;padding:16px}
.alert-reason>strong{color:#ffce67;font-size:14px}
.alert-reason p{font-size:14px;line-height:1.65;color:#f6f2e4;white-space:pre-wrap;overflow-wrap:anywhere;margin:9px 0 0}
.alert-detail-note{font-size:11px;line-height:1.55;color:#aab3bf;margin:15px 0 0}
@media(max-width:820px){
 .reason-dialog,.alert-detail-dialog{padding:0!important;align-items:flex-end!important}
 #reason-panel.reason-dialog:not([hidden]),#alert-detail-dialog.alert-detail-dialog:not([hidden]){display:flex!important}
 .reason-card,.alert-detail-card{border-radius:20px 20px 0 0;width:100%;max-height:93dvh;padding:23px 18px calc(27px + env(safe-area-inset-bottom));border-bottom:0}
 .reason-card textarea{min-height:144px}
 .reason-head h2{font-size:24px}
 .alert-detail-card .section-heading h2{font-size:22px}
 .alert-card{padding:15px 14px!important}
 .alert-facts>div{grid-template-columns:44% 1fr;padding:13px 11px}
 .alert-filters button{min-height:44px;padding:10px 12px!important}
 .reason-reminder{padding:14px}
 .reason-reminder .open-reason{width:100%}
}

/* Safe dismissal of GPS alerts: never deletes clock records */
.alert-list-row{display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:8px;align-items:stretch}
.alert-list-row .alert-card{min-width:0}
.alert-inline-action{font-size:12px!important;font-weight:800!important;min-height:52px;border:1px solid #69615a!important;border-radius:10px!important;white-space:nowrap}
.alert-inline-action:hover:not(:disabled){border-color:#ffc529!important;color:#ffc529!important}
.alert-detail-actions{margin-top:18px;display:flex;justify-content:flex-end}
.alert-detail-actions button{min-height:48px;min-width:138px;font-weight:800}
#alert-action-message:not(:empty){margin-top:12px}
@media(max-width:540px){
 .alert-list-row{grid-template-columns:minmax(0,1fr) 72px;gap:6px}
 .alert-inline-action{font-size:11px!important;min-width:0!important;padding:7px!important}
 .alert-card-top strong{font-size:14px}
 .alert-detail-actions button{width:100%}
}
