
.admin-home-main{max-width:1180px}
.admin-dashboard{display:grid;gap:16px}
.dashboard-hero{
  display:flex;align-items:center;gap:18px;padding:18px 20px;
  border:1px solid #dce4e9;border-radius:16px;background:#fff;
}
.dashboard-logo{max-width:150px;max-height:70px;object-fit:contain}
.dashboard-hero-copy{min-width:0;flex:1}
.dashboard-hero-copy h2{margin:2px 0 3px;font-size:26px}
.dashboard-hero-copy p:last-child{margin:0;color:#687782}
.dashboard-kicker{margin:0;color:#8b6b22;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.07em}
.dashboard-refresh{white-space:nowrap}
.dashboard-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.dashboard-action{
  display:flex;align-items:center;gap:12px;min-width:0;padding:14px 16px;
  border:1px solid #dce4e9;border-radius:14px;background:#fff;text-decoration:none;color:inherit
}
.dashboard-action>span{font-size:26px}
.dashboard-action strong,.dashboard-action small{display:block}
.dashboard-action small{margin-top:2px;color:#71808a;line-height:1.3}
.dashboard-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.dashboard-stat{
  display:flex;flex-direction:column;min-width:0;padding:13px;border:1px solid #dce4e9;
  border-radius:14px;background:#fff;color:inherit;text-decoration:none
}
.dashboard-stat .stat-icon{font-size:18px}
.dashboard-stat .stat-value{font-size:25px;font-weight:800;color:#17344d;margin:4px 0}
.dashboard-stat strong{font-size:13px;line-height:1.25}
.dashboard-stat small{margin-top:3px;color:#77848d;line-height:1.3}
.dashboard-stat.dashboard-warn{border-color:#dfbd64;background:#fffaf0}
.dashboard-stat.dashboard-danger{border-color:#de8b82;background:#fff6f4}
.dashboard-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}
.dashboard-panel{margin:0}
.dashboard-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.dashboard-panel-head h2{margin:2px 0 0}
.dashboard-pill{display:inline-flex;align-items:center;justify-content:center;min-width:34px;min-height:28px;padding:2px 9px;border-radius:999px;background:#edf2f5;color:#31546c;font-weight:800;font-size:12px}
.dashboard-pill.alert{background:#fff0ee;color:#9b2b22}
.dashboard-list{display:grid}
.dashboard-list-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-top:1px solid #edf1f3}
.dashboard-list-row:first-child{border-top:0}
.dashboard-list-row div{min-width:0}
.dashboard-list-row strong,.dashboard-list-row small{display:block}
.dashboard-list-row small{margin-top:2px;color:#71808a}
.dashboard-list-row>span{white-space:nowrap;color:#65747e;font-size:12px}
.dashboard-alert{display:block;padding:10px 12px;margin:8px 0;border-radius:10px;text-decoration:none;color:inherit;border:1px solid #e3e7ea}
.dashboard-alert strong,.dashboard-alert span{display:block}
.dashboard-alert span{margin-top:2px;font-size:12px;color:#6e7a82}
.dashboard-alert.warning{background:#fff9e8;border-color:#e3c36d}
.dashboard-alert.danger{background:#fff1ef;border-color:#df8f86}
.dashboard-empty{margin:8px 0;color:#73818a}
.dashboard-clear{padding:12px;border-radius:10px;background:#edf8f1;color:#28613e}
.dashboard-safety-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.dashboard-safety-grid>div{padding:13px;border:1px solid #e0e6ea;border-radius:12px;background:#f9fbfc}
.dashboard-safety-grid .stat-value,.dashboard-safety-grid strong,.dashboard-safety-grid small{display:block}
.dashboard-safety-grid .stat-value{font-size:24px;font-weight:800;color:#17344d}
.dashboard-safety-grid small{margin-top:3px;color:#71808a}
.dashboard-safety-grid .safety-danger{background:#fff1ef;border-color:#df8f86}
.dashboard-footnote{text-align:center;color:#7a8790;font-size:12px;margin:0 0 4px}

@media(max-width:980px){
  .dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px){
  .dashboard-hero{align-items:flex-start;flex-wrap:wrap}
  .dashboard-logo{max-width:120px}
  .dashboard-hero-copy h2{font-size:22px}
  .dashboard-refresh{width:100%;text-align:center}
  .dashboard-actions{grid-template-columns:1fr}
  .dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-grid{grid-template-columns:1fr}
}
@media(max-width:380px){
  .dashboard-stats{grid-template-columns:1fr}
  .dashboard-safety-grid{grid-template-columns:1fr}
}


/* Workforce Connect visual branding */
header .workforce-logo-link{
  display:flex;
  align-items:center;
  padding:5px 0;
  text-decoration:none;
  line-height:1;
}
header .workforce-logo-link img{
  display:block;
  width:210px;
  max-width:32vw;
  height:auto;
  object-fit:contain;
}
.admin-home-main>h1{
  margin-bottom:14px;
  font-size:30px;
  line-height:1.15;
  letter-spacing:-.02em;
  color:#17344d;
}
.dashboard-hero{
  min-height:72px;
}
.dashboard-hero-copy h2{
  margin-top:0;
}
@media(max-width:760px){
  header .workforce-logo-link img{
    width:165px;
    max-width:58vw;
  }
  .admin-home-main>h1{
    font-size:24px;
  }
}


/* Keep Ray & Paul identity visible inside the live dashboard hero */
.dashboard-hero .dashboard-logo{
  width:150px;
  max-width:20%;
  height:auto;
  object-fit:contain;
  flex:0 0 auto;
}
@media(max-width:760px){
  .dashboard-hero .dashboard-logo{
    width:120px;
    max-width:34%;
  }
}


/* COMPACT DASHBOARD BRANDING
   Shallower header, dashboard moved upward, fuller brand moved into footer. */

body > header{
  padding-top:7px !important;
  padding-bottom:7px !important;
  min-height:0 !important;
}

header .workforce-logo-link{
  padding:0 !important;
}

header .workforce-logo-link img{
  width:175px !important;
  max-width:28vw !important;
  max-height:48px !important;
  height:auto !important;
  object-fit:contain !important;
}

.admin-home-main{
  margin-top:18px !important;
}

.admin-home-main > h1{
  margin-top:0 !important;
  margin-bottom:10px !important;
}

.admin-dashboard{
  gap:12px !important;
}

.dashboard-hero{
  padding:11px 16px !important;
  min-height:58px !important;
}

.dashboard-hero .dashboard-logo{
  width:112px !important;
  max-height:52px !important;
}

.dashboard-hero-copy h2{
  font-size:23px !important;
  margin:0 0 2px !important;
}

.dashboard-actions{
  gap:9px !important;
}

.dashboard-action{
  padding:11px 14px !important;
}

.dashboard-stats{
  gap:8px !important;
}

.dashboard-stat{
  padding:10px 11px !important;
}

.dashboard-grid{
  gap:11px !important;
}

.dashboard-list-row{
  padding:8px 0 !important;
}

/* Compact branded footer with the fuller Workforce Connect logo bottom-left */
.workforce-footer{
  max-width:1180px !important;
  margin:12px auto 8px !important;
  padding:10px 20px !important;
  text-align:left !important;
}

.workforce-footer-layout{
  display:grid;
  grid-template-columns:190px minmax(0,1fr);
  gap:18px;
  align-items:center;
}

.workforce-footer-logo-wrap{
  display:flex;
  align-items:center;
  justify-content:flex-start;
}

.workforce-footer-logo-wrap img{
  display:block;
  width:180px;
  max-width:100%;
  height:auto;
}

.workforce-footer-content{
  min-width:0;
  text-align:left;
}

.workforce-footer-brand,
.workforce-footer-links{
  justify-content:flex-start !important;
}

.workforce-footer-details{
  margin:0 !important;
  max-width:none !important;
}

@media(max-width:760px){
  body > header{
    padding-top:6px !important;
    padding-bottom:6px !important;
  }

  header .workforce-logo-link img{
    width:145px !important;
    max-width:52vw !important;
    max-height:42px !important;
  }

  .admin-home-main{
    margin-top:12px !important;
  }

  .admin-home-main > h1{
    margin-bottom:8px !important;
  }

  .dashboard-hero{
    padding:10px 12px !important;
  }

  .dashboard-hero .dashboard-logo{
    width:96px !important;
  }

  .workforce-footer{
    padding:10px 14px !important;
  }

  .workforce-footer-layout{
    grid-template-columns:1fr;
    gap:7px;
  }

  .workforce-footer-logo-wrap img{
    width:155px;
  }

  .workforce-footer-content{
    text-align:left;
  }

  .workforce-footer-brand,
  .workforce-footer-links{
    justify-content:flex-start !important;
  }
}


/* DASHBOARD HEADER TITLE + RESTORED SPACING
   Dashboard title now lives in the blue header, freeing the page itself to breathe. */

body > header{
  padding-top:10px !important;
  padding-bottom:10px !important;
  min-height:52px !important;
}

header .header-text-brand{
  display:flex;
  align-items:center;
  min-width:0;
  text-decoration:none;
  color:#fff !important;
  font-weight:800;
  letter-spacing:-.01em;
  line-height:1.15;
}

header .dashboard-header-title{
  font-size:22px;
  white-space:nowrap;
}

.admin-home-main{
  margin-top:22px !important;
}

.admin-home-main > h1{
  display:none !important;
}

/* Let the dashboard use the space gained from removing the duplicated title. */
.admin-dashboard{
  gap:16px !important;
}

.dashboard-hero{
  padding:17px 20px !important;
  min-height:74px !important;
}

.dashboard-hero .dashboard-logo{
  width:145px !important;
  max-height:68px !important;
}

.dashboard-hero-copy h2{
  font-size:27px !important;
  margin:0 0 4px !important;
}

.dashboard-hero-copy p{
  font-size:14px !important;
}

.dashboard-actions{
  gap:12px !important;
}

.dashboard-action{
  padding:15px 17px !important;
}

.dashboard-action>span{
  font-size:28px !important;
}

.dashboard-action strong{
  font-size:15px !important;
}

.dashboard-action small{
  font-size:12px !important;
}

.dashboard-stats{
  gap:11px !important;
}

.dashboard-stat{
  padding:14px !important;
}

.dashboard-stat .stat-value{
  font-size:27px !important;
}

.dashboard-stat strong{
  font-size:13.5px !important;
}

.dashboard-grid{
  gap:15px !important;
}

.dashboard-panel{
  padding:18px !important;
}

.dashboard-list-row{
  padding:11px 0 !important;
}

.dashboard-alert{
  padding:12px 14px !important;
  margin:9px 0 !important;
}

.dashboard-safety-grid>div{
  padding:15px !important;
}

.dashboard-footnote{
  margin-top:2px !important;
}

@media(max-width:900px){
  header .dashboard-header-title{
    font-size:19px;
    white-space:normal;
    max-width:42vw;
  }
}

@media(max-width:760px){
  body > header{
    padding-top:8px !important;
    padding-bottom:8px !important;
  }

  header .dashboard-header-title{
    font-size:17px;
    max-width:58vw;
  }

  .admin-home-main{
    margin-top:14px !important;
  }

  .dashboard-hero{
    padding:14px !important;
  }

  .dashboard-hero .dashboard-logo{
    width:112px !important;
  }

  .dashboard-hero-copy h2{
    font-size:23px !important;
  }

  .dashboard-action{
    padding:14px !important;
  }

  .dashboard-stat{
    padding:12px !important;
  }

  .dashboard-panel{
    padding:15px !important;
  }
}


/* COMPACT STAFF ROWS
   Designed for a fuller team list: one employee per line on desktop. */
.dashboard-list-row{
  padding:6px 0 !important;
  min-height:0 !important;
}

.dashboard-list-row > div{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  min-width:0 !important;
  flex:1 1 auto !important;
  flex-wrap:nowrap !important;
}

.dashboard-list-row strong,
.dashboard-list-row small{
  display:inline !important;
  margin:0 !important;
  line-height:1.25 !important;
}

.dashboard-list-row strong{
  flex:0 0 auto !important;
  font-size:13px !important;
}

.dashboard-list-row small{
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  font-size:12px !important;
}

.dashboard-list-row > span{
  flex:0 0 auto !important;
  white-space:nowrap !important;
  font-size:11px !important;
}

/* Keeps 15-20 staff readable without the panel becoming needlessly tall. */
.dashboard-panel .dashboard-list{
  gap:0 !important;
}

@media(max-width:760px){
  .dashboard-list-row{
    padding:7px 0 !important;
  }

  .dashboard-list-row > div{
    gap:6px !important;
    flex-wrap:wrap !important;
  }

  .dashboard-list-row small{
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:normal !important;
  }

  .dashboard-list-row > span{
    margin-left:auto !important;
  }
}


/* Ray & Paul logo - give it a little more presence */
.dashboard-hero .dashboard-logo{
  width:180px !important;
  max-width:24% !important;
  max-height:82px !important;
}
@media(max-width:760px){
  .dashboard-hero .dashboard-logo{
    width:135px !important;
    max-width:38% !important;
    max-height:66px !important;
  }
}


/* Active safety checks need to stand out immediately */
.dashboard-safety-grid .safety-active{
  background:#fff0ee !important;
  border:2px solid #9f2d24 !important;
}
.dashboard-safety-grid .safety-active .stat-value,
.dashboard-safety-grid .safety-active strong{
  color:#8f241d !important;
}
.dashboard-safety-grid .safety-danger{
  background:#ffe4e0 !important;
  border:2px solid #7f1712 !important;
}
.dashboard-safety-grid .safety-danger .stat-value,
.dashboard-safety-grid .safety-danger strong{
  color:#7f1712 !important;
}


/* Dashboard viewer account */
.dashboard-viewer-login-card{
  border-left:4px solid #6d7e8b;
}
.viewer-login-status{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:10px;
}
.viewer-login-status form{margin:0}

/* View-only dashboard: non-link cards should look intentionally static. */
.dashboard-read-only .dashboard-stat:not(a),
.dashboard-read-only .dashboard-alert:not(a){
  cursor:default;
}
.dashboard-read-only .dashboard-actions{display:none}

/* Safety names */
.safety-people{
  display:block;
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid rgba(127,23,18,.22);
  font-size:12px;
  line-height:1.35;
  font-weight:800;
  color:#7f1712;
}


/* VIEW-ONLY DASHBOARD CONTRAST
   The viewer dashboard uses static cards rather than links, so give the
   boxes a clearer surface and border so they don't disappear into the page. */

.dashboard-read-only .dashboard-hero{
  background:#f7f9fb !important;
  border:1px solid #cfd9e0 !important;
}

.dashboard-read-only .dashboard-stat{
  background:#f7f9fb !important;
  border:1px solid #cfd9e0 !important;
  box-shadow:0 1px 0 rgba(20,48,68,.03) !important;
}

.dashboard-read-only .dashboard-stat.dashboard-warn{
  background:#fff8e8 !important;
  border-color:#d9b24f !important;
}

.dashboard-read-only .dashboard-stat.dashboard-danger{
  background:#fff0ee !important;
  border-color:#c85a50 !important;
}

.dashboard-read-only .dashboard-panel{
  background:#f7f9fb !important;
  border:1px solid #cfd9e0 !important;
}

.dashboard-read-only .dashboard-list-row{
  border-color:#dfe6ea !important;
}

.dashboard-read-only .dashboard-alert{
  background:#f3f6f8 !important;
  border:1px solid #cbd6dd !important;
}

.dashboard-read-only .dashboard-alert.warning{
  background:#fff7df !important;
  border-color:#d9b24f !important;
}

.dashboard-read-only .dashboard-alert.danger{
  background:#fff0ee !important;
  border-color:#c85a50 !important;
}

/* Keep active safety checks strongly visible on the viewer screen. */
.dashboard-read-only .dashboard-safety-grid > div{
  background:#f7f9fb !important;
  border:1px solid #cfd9e0 !important;
}

.dashboard-read-only .dashboard-safety-grid .safety-active{
  background:#fff0ee !important;
  border:2px solid #9f2d24 !important;
}

.dashboard-read-only .dashboard-safety-grid .safety-danger{
  background:#ffe4e0 !important;
  border:2px solid #7f1712 !important;
}


/* DASHBOARD VISUAL TIDY - view-only contrast, refresh timer, attention count, larger R&P logo */

/* Give the Ray & Paul identity enough presence without taking over the panel. */
.dashboard-hero .dashboard-logo{
  width:220px !important;
  max-width:30% !important;
  max-height:96px !important;
}

/* Timer now lives beside Refresh rather than at the bottom of the page. */
.dashboard-refresh-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

.dashboard-refresh-timer{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  min-height:38px;
  padding:0 10px;
  border:1px solid #9fb0bc;
  border-radius:10px;
  background:#eef3f6;
  color:#17344d;
  font-size:16px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  letter-spacing:.02em;
}

/* Make the red Needs Attention count impossible to miss. */
.dashboard-panel-head .dashboard-pill.alert{
  min-width:46px !important;
  min-height:46px !important;
  padding:4px 12px !important;
  border:2px solid #7f1712 !important;
  background:#b42318 !important;
  color:#fff !important;
  font-size:21px !important;
  font-weight:900 !important;
  box-shadow:0 1px 2px rgba(80,20,15,.15);
}

/* The view-only screen needs stronger separation than the clickable admin version. */
.dashboard-read-only{
  padding:12px;
  border-radius:16px;
  background:#e9eff3;
}

.dashboard-read-only .dashboard-hero{
  background:#f4f7f9 !important;
  border:2px solid #aab8c2 !important;
}

.dashboard-read-only .dashboard-stat{
  background:#eef3f6 !important;
  border:2px solid #aab8c2 !important;
  box-shadow:0 1px 2px rgba(31,55,72,.06) !important;
}

.dashboard-read-only .dashboard-stat.dashboard-warn{
  background:#fff4d6 !important;
  border-color:#c89f34 !important;
}

.dashboard-read-only .dashboard-stat.dashboard-danger{
  background:#ffe9e6 !important;
  border-color:#b9473e !important;
}

.dashboard-read-only .dashboard-panel{
  background:#f4f7f9 !important;
  border:2px solid #aab8c2 !important;
  box-shadow:0 1px 2px rgba(31,55,72,.05) !important;
}

.dashboard-read-only .dashboard-list-row{
  border-color:#cbd6dd !important;
}

.dashboard-read-only .dashboard-alert{
  background:#eaf0f4 !important;
  border:1px solid #aebcc6 !important;
}

.dashboard-read-only .dashboard-alert.warning{
  background:#fff4d6 !important;
  border:2px solid #c89f34 !important;
}

.dashboard-read-only .dashboard-alert.danger{
  background:#ffe9e6 !important;
  border:2px solid #b9473e !important;
}

.dashboard-read-only .dashboard-safety-grid > div{
  background:#eef3f6 !important;
  border:2px solid #aab8c2 !important;
}

.dashboard-read-only .dashboard-safety-grid .safety-active{
  background:#fff0ee !important;
  border:2px solid #9f2d24 !important;
}

.dashboard-read-only .dashboard-safety-grid .safety-danger{
  background:#ffe0dc !important;
  border:2px solid #76150f !important;
}

/* The old bottom refresh footnote is intentionally gone. */
.dashboard-footnote{
  display:none !important;
}

@media(max-width:760px){
  .dashboard-hero .dashboard-logo{
    width:155px !important;
    max-width:42% !important;
    max-height:78px !important;
  }

  .dashboard-refresh-wrap{
    width:100%;
    justify-content:flex-end;
  }

  .dashboard-refresh-timer{
    min-width:54px;
    min-height:36px;
    font-size:15px;
  }

  .dashboard-read-only{
    padding:8px;
  }
}


/* DASHBOARD POLISH - softer borders, shallower hero, tighter footer spacing */

/* Calm the overall viewer surface. */
.dashboard-read-only{
  padding:10px !important;
  background:#f0f4f7 !important;
  border-radius:14px !important;
}

/* Ray & Paul hero: much shallower, still branded. */
.dashboard-hero{
  padding:10px 16px !important;
  min-height:58px !important;
  border-radius:14px !important;
}

.dashboard-hero .dashboard-logo{
  width:165px !important;
  max-width:24% !important;
  max-height:62px !important;
}

.dashboard-hero-copy h2{
  font-size:25px !important;
  margin:0 0 2px !important;
}

.dashboard-hero-copy p{
  margin:0 !important;
  font-size:13px !important;
  line-height:1.3 !important;
}

/* Soften the heavy outlines. */
.dashboard-read-only .dashboard-hero,
.dashboard-read-only .dashboard-stat,
.dashboard-read-only .dashboard-panel,
.dashboard-read-only .dashboard-safety-grid > div{
  border-width:1px !important;
  border-color:#bcc8d0 !important;
  box-shadow:0 1px 2px rgba(23,52,77,.035) !important;
}

.dashboard-read-only .dashboard-stat.dashboard-warn{
  border-color:#d1ad4d !important;
  background:#fff6df !important;
}

.dashboard-read-only .dashboard-stat.dashboard-danger{
  border-color:#c85f55 !important;
  background:#fff0ee !important;
}

.dashboard-read-only .dashboard-alert{
  border-width:1px !important;
  border-color:#bcc8d0 !important;
}

.dashboard-read-only .dashboard-alert.warning{
  border-width:1px !important;
  border-color:#d1ad4d !important;
  background:#fff6df !important;
}

.dashboard-read-only .dashboard-alert.danger{
  border-width:1px !important;
  border-color:#c85f55 !important;
  background:#fff0ee !important;
}

/* Welfare stays obvious when active, but less shouty than before. */
.dashboard-read-only .dashboard-safety-grid .safety-active{
  border:1.5px solid #a83a31 !important;
  background:#fff1ef !important;
}

.dashboard-read-only .dashboard-safety-grid .safety-danger{
  border:2px solid #7f1712 !important;
  background:#ffe6e2 !important;
}

/* Keep room for a long working list without making every card bulky. */
.dashboard-grid{
  gap:12px !important;
}

.dashboard-panel{
  padding:14px 16px !important;
}

.dashboard-panel-head{
  margin-bottom:6px !important;
}

.dashboard-list-row{
  padding:5px 0 !important;
}

.dashboard-list-row strong{
  font-size:12.5px !important;
}

.dashboard-list-row small{
  font-size:11.5px !important;
}

/* Slightly tighter KPI row. */
.dashboard-stats{
  gap:9px !important;
}

.dashboard-stat{
  padding:11px 12px !important;
}

.dashboard-stat .stat-value{
  font-size:25px !important;
}

/* Bring the footer up now the old countdown bar is gone. */
.admin-dashboard{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
}

.admin-home-main{
  padding-bottom:0 !important;
}

.workforce-footer{
  margin-top:8px !important;
  padding-top:8px !important;
  padding-bottom:8px !important;
}

.workforce-footer-layout{
  gap:14px !important;
}

/* Keep the refresh area compact. */
.dashboard-refresh-wrap{
  gap:7px !important;
}

.dashboard-refresh-timer{
  min-width:54px !important;
  min-height:34px !important;
  font-size:15px !important;
  border-color:#b7c3cb !important;
}

.dashboard-refresh{
  min-height:34px !important;
  padding-top:7px !important;
  padding-bottom:7px !important;
}

@media(max-width:760px){
  .dashboard-read-only{
    padding:7px !important;
  }

  .dashboard-hero{
    padding:9px 11px !important;
  }

  .dashboard-hero .dashboard-logo{
    width:125px !important;
    max-width:36% !important;
    max-height:56px !important;
  }

  .dashboard-hero-copy h2{
    font-size:22px !important;
  }

  .dashboard-panel{
    padding:12px !important;
  }

  .workforce-footer{
    margin-top:6px !important;
  }
}


/* WIDESCREEN DASHBOARD LAYOUT
   Makes proper use of a 1920px-style monitor while keeping laptop/mobile layouts intact. */

@media(min-width:1400px){
  .admin-home-main{
    width:calc(100% - 48px) !important;
    max-width:1720px !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }

  .workforce-footer{
    width:calc(100% - 48px) !important;
    max-width:1720px !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }

  /* Give the operational areas more horizontal room. */
  .dashboard-grid{
    grid-template-columns:minmax(0,1.25fr) minmax(440px,.75fr) !important;
    gap:16px !important;
  }

  /* Six status cards stay in one clean row. */
  .dashboard-stats{
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:12px !important;
  }

  /* Working staff can use two columns on a wide monitor.
     Each employee still remains on one horizontal line. */
  #working-now .dashboard-list{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    column-gap:28px !important;
  }

  #working-now .dashboard-list-row{
    min-width:0 !important;
    border-top:1px solid #d6e0e6 !important;
  }

  #working-now .dashboard-list-row:nth-child(1),
  #working-now .dashboard-list-row:nth-child(2){
    border-top:0 !important;
  }

  /* Slightly more breathing room for the alert/detail text. */
  .dashboard-alert{
    padding:12px 14px !important;
  }

  .dashboard-hero{
    padding-left:22px !important;
    padding-right:22px !important;
  }

  .dashboard-hero-copy{
    min-width:0 !important;
  }

  .dashboard-safety-grid{
    gap:14px !important;
  }
}

@media(min-width:1750px){
  .admin-home-main,
  .workforce-footer{
    width:calc(100% - 64px) !important;
    max-width:1820px !important;
  }

  #working-now .dashboard-list{
    column-gap:36px !important;
  }
}


/* BOTH DASHBOARDS - MATCHED WIDESCREEN WIDTH + TWO-COLUMN STAFF LIST */

/* Make full-admin and view-only dashboards occupy the same usable width. */
.admin-home-main,
.admin-home-main .admin-dashboard,
.admin-home-main .dashboard-read-only{
  width:100% !important;
  box-sizing:border-box !important;
}

@media(min-width:1200px){
  .admin-home-main{
    width:calc(100% - 40px) !important;
    max-width:1720px !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }

  /* Viewer dashboard no longer feels visually narrower than full admin. */
  .dashboard-read-only{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  /* Who is working now = two columns on BOTH dashboard types. */
  #working-now .dashboard-list{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    column-gap:30px !important;
    row-gap:0 !important;
  }

  #working-now .dashboard-list-row{
    min-width:0 !important;
    width:100% !important;
    box-sizing:border-box !important;
    border-top:1px solid #d6e0e6 !important;
  }

  #working-now .dashboard-list-row:nth-child(1),
  #working-now .dashboard-list-row:nth-child(2){
    border-top:0 !important;
  }
}

/* Extra-wide monitor breathing room. */
@media(min-width:1600px){
  .admin-home-main{
    width:calc(100% - 56px) !important;
    max-width:1800px !important;
  }

  #working-now .dashboard-list{
    column-gap:40px !important;
  }
}

/* Keep phones/tablets as a single staff column. */
@media(max-width:1199px){
  #working-now .dashboard-list{
    display:block !important;
  }
}


/* TIGHTER VERTICAL RHYTHM
   Helps the full dashboard fit a standard widescreen monitor without feeling cramped. */

.admin-dashboard{
  gap:10px !important;
}

.dashboard-grid{
  gap:10px !important;
}

.dashboard-panel{
  padding:12px 15px !important;
}

.dashboard-panel-head{
  margin-bottom:4px !important;
}

.dashboard-panel-head h2{
  margin-top:1px !important;
  margin-bottom:0 !important;
}

.dashboard-kicker{
  margin-bottom:1px !important;
}

.dashboard-list-row{
  padding:4px 0 !important;
}

.dashboard-alert{
  margin:6px 0 !important;
  padding:9px 12px !important;
}

.dashboard-safety-grid{
  gap:9px !important;
}

.dashboard-safety-grid > div{
  padding:10px 12px !important;
}

.safety-people{
  margin-top:5px !important;
  padding-top:5px !important;
}

.dashboard-stats{
  margin-bottom:0 !important;
}

/* Specifically tighten the gap before Away today / Welfare. */
.admin-dashboard > .dashboard-grid + .dashboard-grid{
  margin-top:-2px !important;
}

/* Pull footer slightly closer to the last dashboard row. */
.workforce-footer{
  margin-top:4px !important;
}

@media(min-width:1200px){
  .admin-dashboard{
    gap:8px !important;
  }

  .dashboard-grid{
    gap:9px !important;
  }

  .dashboard-panel{
    padding:11px 14px !important;
  }

  .dashboard-alert{
    margin:5px 0 !important;
  }
}


/* FINAL SCREEN-FIT TIDY
   Pull the lower Away today / Welfare row upward and trim a few safe pixels. */

@media(min-width:1200px){
  /* Reduce the vertical space consumed by the top operational row. */
  .dashboard-hero{
    padding-top:8px !important;
    padding-bottom:8px !important;
    min-height:52px !important;
  }

  .dashboard-actions{
    gap:8px !important;
  }

  .dashboard-action{
    padding-top:9px !important;
    padding-bottom:9px !important;
  }

  .dashboard-stat{
    padding-top:9px !important;
    padding-bottom:9px !important;
  }

  /* Needs-attention cards can be shorter without losing any information. */
  .dashboard-alert{
    padding-top:7px !important;
    padding-bottom:7px !important;
    margin-top:4px !important;
    margin-bottom:4px !important;
  }

  /* Pull the lower dashboard row visibly upward. */
  .admin-dashboard > .dashboard-grid + .dashboard-grid{
    margin-top:-8px !important;
  }

  /* Make the lower cards slightly shallower. */
  .admin-dashboard > .dashboard-grid + .dashboard-grid .dashboard-panel{
    padding-top:10px !important;
    padding-bottom:10px !important;
  }

  .admin-dashboard > .dashboard-grid + .dashboard-grid .dashboard-panel-head{
    margin-bottom:2px !important;
  }

  /* Remove spare space below the final dashboard row. */
  .admin-dashboard{
    padding-bottom:0 !important;
    margin-bottom:-2px !important;
  }

  .workforce-footer{
    margin-top:2px !important;
  }
}


/* =========================================================
   WIDESCREEN APPLICATION LAYOUT
   Desktop/admin pages use the monitor width.
   Employee Clock and Vehicle Check keep their own mobile-first layouts.
   ========================================================= */

@media(min-width:1200px){

  /* All general/admin pages can use the wide monitor.
     Explicitly leave the employee clock and vehicle check alone. */
  body main:not(.staff-clock-main):not(.vehicle-check-main){
    width:calc(100% - 44px) !important;
    max-width:1780px !important;
    margin-left:auto !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
  }

  .workforce-footer{
    width:calc(100% - 44px) !important;
    max-width:1780px !important;
    margin-left:auto !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
  }

  /* ---------------- MANAGE STAFF ---------------- */

  .manage-staff-main{
    width:calc(100% - 44px) !important;
    max-width:1780px !important;
  }

  .manage-staff-main > h1{
    margin-top:18px !important;
    margin-bottom:12px !important;
  }

  .manage-staff-main .admin-staff{
    display:grid !important;
    grid-template-columns:repeat(12,minmax(0,1fr)) !important;
    gap:12px !important;
    align-items:start !important;
  }

  .manage-staff-main .admin-staff > *{
    grid-column:1 / -1;
    min-width:0;
  }

  .manage-staff-main .admin-staff > .card{
    margin:0 !important;
  }

  .manage-staff-main .add-employee-wide{
    grid-column:1 / -1 !important;
    padding:14px 16px !important;
  }

  .manage-staff-main .add-employee-form{
    display:grid !important;
    grid-template-columns:
      minmax(160px,1.05fr)
      minmax(220px,1.4fr)
      minmax(210px,1.15fr)
      minmax(140px,.7fr)
      minmax(170px,.8fr) !important;
    gap:10px !important;
    align-items:end !important;
  }

  .manage-staff-main .add-employee-form button{
    width:100% !important;
    margin:0 !important;
  }

  /* Dashboard viewer and employee selector sit side-by-side. */
  .manage-staff-main .dashboard-viewer-login-card{
    grid-column:span 8 !important;
    padding:14px 16px !important;
  }

  .manage-staff-main .employee-selector-card{
    grid-column:span 4 !important;
    padding:14px 16px !important;
  }

  .manage-staff-main .dashboard-viewer-login-card .compact-form{
    display:grid !important;
    grid-template-columns:
      minmax(160px,.9fr)
      minmax(220px,1.1fr)
      minmax(210px,1fr)
      minmax(170px,.85fr) !important;
    gap:10px !important;
    align-items:end !important;
  }

  .manage-staff-main .dashboard-viewer-login-card .compact-form button{
    width:100% !important;
    margin:0 !important;
  }

  .manage-staff-main .employee-selector-card .employee-selector-form,
  .manage-staff-main .employee-selector-card label,
  .manage-staff-main .employee-selector-card select{
    width:100% !important;
    max-width:none !important;
  }

  /* Selected employee controls use four panels across on a big monitor. */
  .manage-staff-main .selected-employee-card{
    grid-column:1 / -1 !important;
    padding:14px 16px !important;
  }

  .manage-staff-main .employee-settings-grid{
    display:grid !important;
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:10px !important;
  }

  .manage-staff-main .employee-settings-grid .card-inset{
    min-width:0 !important;
    height:100% !important;
    box-sizing:border-box !important;
  }

  /* The existing sickness + lone-worker pair remains a two-column row. */
  .manage-staff-main .admin-support-grid{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
    width:100% !important;
  }

  .manage-staff-main .admin-support-grid .card{
    margin:0 !important;
    min-width:0 !important;
  }

  /* Wide tables should use the monitor before scrolling. */
  .manage-staff-main .tablewrap,
  .timesheet-main .tablewrap,
  body main:not(.staff-clock-main):not(.vehicle-check-main) .tablewrap{
    width:100% !important;
    max-width:none !important;
  }

  .manage-staff-main .tablewrap table,
  .timesheet-main .tablewrap table,
  body main:not(.staff-clock-main):not(.vehicle-check-main) .tablewrap table{
    width:100% !important;
  }

  /* ---------------- TIMESHEETS ---------------- */

  .timesheet-main{
    width:calc(100% - 44px) !important;
    max-width:1780px !important;
  }

  .timesheet-main .card{
    max-width:none !important;
    width:100% !important;
    box-sizing:border-box !important;
  }

  /* ---------------- VEHICLES / OTHER ADMIN PAGES ---------------- */

  body main:not(.staff-clock-main):not(.vehicle-check-main) .admin-compact-grid{
    width:100% !important;
  }

  body main:not(.staff-clock-main):not(.vehicle-check-main) .card{
    box-sizing:border-box !important;
  }
}

/* On very large monitors give the app a little more room again. */
@media(min-width:1700px){
  body main:not(.staff-clock-main):not(.vehicle-check-main),
  .manage-staff-main,
  .timesheet-main,
  .workforce-footer{
    width:calc(100% - 56px) !important;
    max-width:1840px !important;
  }
}

/* Medium desktop/laptop: keep forms practical rather than forcing tiny columns. */
@media(min-width:900px) and (max-width:1199px){
  .manage-staff-main .add-employee-form{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .manage-staff-main .dashboard-viewer-login-card .compact-form{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .manage-staff-main .employee-settings-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

/* Existing phone layouts are deliberately preserved.
   Clock-in/out and Vehicle Check remain mobile-first. */


/* =========================================================
   MANAGE STAFF - WIDESCREEN CONTROL CENTRE REDESIGN
   Top-left: Employee account
   Top-right: Add employee
   ========================================================= */

.manage-staff-main{
  max-width:1780px !important;
}

.manage-staff-main > h1{
  margin-top:14px !important;
  margin-bottom:10px !important;
}

.manage-staff-main .admin-staff{
  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  gap:12px !important;
  align-items:start !important;
}

/* Base card spacing */
.manage-staff-main .admin-staff > .card,
.manage-staff-main .admin-staff > .admin-support-grid{
  margin:0 !important;
  min-width:0 !important;
}

/* TOP ROW
   Employee Account first on the left, Add Employee on the right. */
.manage-staff-main .staff-employee-selector-card{
  grid-column:span 4 !important;
  order:1 !important;
  padding:15px 16px !important;
  min-height:100% !important;
}

.manage-staff-main .staff-add-card{
  grid-column:span 8 !important;
  order:2 !important;
  padding:15px 16px !important;
  min-height:100% !important;
}

.manage-staff-main .staff-employee-selector-card h2,
.manage-staff-main .staff-add-card h2{
  margin-top:0 !important;
  margin-bottom:6px !important;
}

.manage-staff-main .staff-employee-selector-card .compact-copy{
  margin:0 0 10px !important;
}

.manage-staff-main .staff-employee-selector-card select{
  width:100% !important;
  max-width:none !important;
  min-height:42px !important;
}

/* Add employee is one clean line across the wider right-hand panel. */
.manage-staff-main .staff-add-card .add-employee-form{
  display:grid !important;
  grid-template-columns:
    minmax(135px,.9fr)
    minmax(210px,1.25fr)
    minmax(190px,1.05fr)
    minmax(135px,.72fr)
    minmax(155px,.8fr) !important;
  gap:9px !important;
  align-items:end !important;
}

.manage-staff-main .staff-add-card .add-employee-form label{
  margin:0 !important;
}

.manage-staff-main .staff-add-card .add-employee-form button{
  width:100% !important;
  margin:0 !important;
  min-height:42px !important;
}

/* SELECTED EMPLOYEE
   Becomes the main control strip immediately under the top row. */
.manage-staff-main .staff-selected-employee-card{
  grid-column:1 / -1 !important;
  order:3 !important;
  padding:14px 16px !important;
}

.manage-staff-main .selected-employee-head{
  margin-bottom:10px !important;
}

.manage-staff-main .employee-settings-grid{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:10px !important;
}

.manage-staff-main .employee-settings-grid .card-inset{
  min-width:0 !important;
  height:100% !important;
  box-sizing:border-box !important;
  padding:12px !important;
  border-radius:10px !important;
}

.manage-staff-main .employee-settings-grid .card-inset h3{
  margin-top:0 !important;
  margin-bottom:7px !important;
}

/* SECOND MANAGEMENT ROW
   Viewer login + sales/property safety sit together. */
.manage-staff-main .staff-viewer-card{
  grid-column:span 7 !important;
  order:4 !important;
  padding:14px 16px !important;
}

.manage-staff-main .staff-sales-safety-card{
  grid-column:span 5 !important;
  order:5 !important;
  padding:14px 16px !important;
}

.manage-staff-main .staff-viewer-card .compact-form{
  display:grid !important;
  grid-template-columns:
    minmax(140px,.8fr)
    minmax(210px,1.05fr)
    minmax(210px,1.05fr)
    minmax(160px,.8fr) !important;
  gap:9px !important;
  align-items:end !important;
}

.manage-staff-main .staff-viewer-card .compact-form button{
  width:100% !important;
  min-height:42px !important;
  margin:0 !important;
}

.manage-staff-main .viewer-login-status{
  margin-top:8px !important;
}

.manage-staff-main .staff-sales-safety-card .compact-copy{
  margin-top:4px !important;
  margin-bottom:10px !important;
}

.manage-staff-main .staff-sales-safety-card form.grid{
  display:grid !important;
  grid-template-columns:minmax(210px,1.1fr) minmax(150px,.7fr) minmax(165px,.8fr) !important;
  gap:9px !important;
  align-items:end !important;
}

.manage-staff-main .staff-sales-safety-card form.grid button{
  width:100% !important;
  min-height:42px !important;
  margin:0 !important;
}

/* OFFICE NOTIFICATION ROW */
.manage-staff-main .admin-support-grid{
  grid-column:1 / -1 !important;
  order:6 !important;
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:12px !important;
  width:100% !important;
}

.manage-staff-main .admin-support-grid .notification-group{
  padding:14px 16px !important;
  min-width:0 !important;
}

.manage-staff-main .admin-support-grid .compact-copy{
  margin-top:5px !important;
  margin-bottom:9px !important;
}

.manage-staff-main .admin-support-grid form.grid{
  display:grid !important;
  grid-template-columns:minmax(220px,1.2fr) minmax(160px,.8fr) !important;
  gap:9px !important;
  align-items:end !important;
}

.manage-staff-main .admin-support-grid form.grid button{
  width:100% !important;
  min-height:42px !important;
  margin:0 !important;
}

/* HOLIDAY / SICKNESS HISTORY */
.manage-staff-main .staff-holiday-card{
  grid-column:1 / -1 !important;
  order:7 !important;
  padding:14px 16px !important;
}

.manage-staff-main .staff-holiday-card .compact-copy{
  margin:4px 0 9px !important;
}

.manage-staff-main .staff-holiday-card .tablewrap{
  overflow-x:auto !important;
}

.manage-staff-main .staff-holiday-card table{
  width:100% !important;
  min-width:900px !important;
}

/* Inputs/buttons should line up cleanly across the control centre. */
.manage-staff-main input,
.manage-staff-main select,
.manage-staff-main button{
  box-sizing:border-box !important;
}

.manage-staff-main .compact-form label{
  min-width:0 !important;
}

/* Medium desktop: two-column approach without crushing forms. */
@media(min-width:900px) and (max-width:1299px){
  .manage-staff-main .staff-employee-selector-card{
    grid-column:span 5 !important;
  }

  .manage-staff-main .staff-add-card{
    grid-column:span 7 !important;
  }

  .manage-staff-main .staff-add-card .add-employee-form{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .manage-staff-main .employee-settings-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .manage-staff-main .staff-viewer-card,
  .manage-staff-main .staff-sales-safety-card{
    grid-column:1 / -1 !important;
  }

  .manage-staff-main .staff-viewer-card .compact-form{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

/* Mobile / narrow tablet: everything stacks naturally. */
@media(max-width:899px){
  .manage-staff-main .admin-staff{
    display:block !important;
  }

  .manage-staff-main .admin-staff > .card,
  .manage-staff-main .admin-support-grid{
    margin-bottom:12px !important;
  }

  .manage-staff-main .staff-add-card .add-employee-form,
  .manage-staff-main .staff-viewer-card .compact-form,
  .manage-staff-main .staff-sales-safety-card form.grid,
  .manage-staff-main .admin-support-grid,
  .manage-staff-main .admin-support-grid form.grid,
  .manage-staff-main .employee-settings-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
  }
}


/* RESTORE TWO-COLUMN WORKING LIST ON WIDESCREEN
   Applies to both full admin and view-only dashboards. */
@media(min-width:1200px){
  #working-now .dashboard-list{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    column-gap:34px !important;
    row-gap:0 !important;
  }

  #working-now .dashboard-list-row{
    width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  #working-now .dashboard-list-row:nth-child(1),
  #working-now .dashboard-list-row:nth-child(2){
    border-top:0 !important;
  }
}

@media(max-width:1199px){
  #working-now .dashboard-list{
    display:block !important;
  }
}


/* MANAGE STAFF - priorities + archive controls */

/* Sickness is intentionally prominent and sits above viewer/sales settings. */
.manage-staff-main .staff-sickness-card{
  grid-column:1 / -1 !important;
  order:4 !important;
  padding:14px 16px !important;
  border-left:4px solid #c28a18 !important;
  background:#fffdf6 !important;
}

.manage-staff-main .staff-sickness-card form.grid{
  display:grid !important;
  grid-template-columns:minmax(280px,1fr) minmax(190px,.35fr) !important;
  gap:10px !important;
  align-items:end !important;
}

.manage-staff-main .staff-sickness-card button{
  width:100% !important;
  min-height:42px !important;
}

.manage-staff-main .staff-viewer-card{
  order:5 !important;
}

.manage-staff-main .staff-sales-safety-card{
  order:6 !important;
}

/* Lone-worker office alerts gets its own row below viewer/sales. */
.manage-staff-main .staff-lone-worker-card{
  grid-column:1 / -1 !important;
  order:7 !important;
  padding:14px 16px !important;
}

.manage-staff-main .staff-lone-worker-card form.grid{
  display:grid !important;
  grid-template-columns:minmax(280px,1fr) minmax(190px,.35fr) !important;
  gap:10px !important;
  align-items:end !important;
}

.manage-staff-main .staff-lone-worker-card button{
  width:100% !important;
  min-height:42px !important;
}

.manage-staff-main .staff-archived-card{
  grid-column:1 / -1 !important;
  order:8 !important;
  padding:12px 16px !important;
}

.manage-staff-main .staff-holiday-card{
  order:9 !important;
}

/* Selected employee quick actions. */
.manage-staff-main .selected-employee-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.manage-staff-main .selected-employee-actions form{
  margin:0 !important;
}

.manage-staff-main .archive-button{
  background:#fff0ee !important;
  color:#9b2b22 !important;
  border:1px solid #c85f55 !important;
}

.manage-staff-main .archive-button:hover{
  background:#ffe3df !important;
}

/* Archived staff list */
.manage-staff-main .staff-archived-card > summary{
  cursor:pointer;
  list-style:none;
  padding:2px 0;
}

.manage-staff-main .staff-archived-card > summary::-webkit-details-marker{
  display:none;
}

.manage-staff-main .staff-archived-card > summary::before{
  content:"▸";
  display:inline-block;
  margin-right:7px;
  transition:transform .15s ease;
}

.manage-staff-main .staff-archived-card[open] > summary::before{
  transform:rotate(90deg);
}

@media(max-width:899px){
  .manage-staff-main .staff-sickness-card form.grid,
  .manage-staff-main .staff-lone-worker-card form.grid{
    grid-template-columns:1fr !important;
  }

  .manage-staff-main .selected-employee-actions{
    justify-content:flex-start;
  }

  .manage-staff-main .selected-employee-actions > *{
    width:100%;
  }

  .manage-staff-main .selected-employee-actions .button,
  .manage-staff-main .selected-employee-actions button{
    width:100% !important;
    text-align:center;
  }
}


/* MANAGE STAFF - final section order tidy
   Holiday & sickness moves into the prominent full-width slot.
   Sickness notifications and Lone worker office alerts sit side-by-side. */

.manage-staff-main .staff-holiday-card{
  grid-column:1 / -1 !important;
  order:4 !important;
}

.manage-staff-main .staff-viewer-card{
  order:5 !important;
}

.manage-staff-main .staff-sales-safety-card{
  order:6 !important;
}

/* Pair the two office notification settings together. */
.manage-staff-main .staff-sickness-card{
  grid-column:span 6 !important;
  order:7 !important;
}

.manage-staff-main .staff-lone-worker-card{
  grid-column:span 6 !important;
  order:8 !important;
}

.manage-staff-main .staff-archived-card{
  grid-column:1 / -1 !important;
  order:9 !important;
}

/* Make the paired notification cards compact and balanced. */
.manage-staff-main .staff-sickness-card,
.manage-staff-main .staff-lone-worker-card{
  padding:14px 16px !important;
  min-height:100% !important;
}

.manage-staff-main .staff-sickness-card form.grid,
.manage-staff-main .staff-lone-worker-card form.grid{
  display:grid !important;
  grid-template-columns:minmax(220px,1fr) minmax(170px,.42fr) !important;
  gap:9px !important;
  align-items:end !important;
}

.manage-staff-main .staff-sickness-card button,
.manage-staff-main .staff-lone-worker-card button{
  width:100% !important;
  min-height:42px !important;
}

@media(max-width:1050px){
  .manage-staff-main .staff-sickness-card,
  .manage-staff-main .staff-lone-worker-card{
    grid-column:1 / -1 !important;
  }
}

@media(max-width:899px){
  .manage-staff-main .staff-sickness-card form.grid,
  .manage-staff-main .staff-lone-worker-card form.grid{
    grid-template-columns:1fr !important;
  }
}


/* Temporary permanent-delete controls for clearing test records */
.danger-delete-button{
  background:#fff0ee !important;
  color:#9b2b22 !important;
  border:1px solid #c85f55 !important;
}
.danger-delete-button:hover{
  background:#ffdcd7 !important;
  border-color:#a93830 !important;
}


/* =========================================================
   TIMESHEETS - WIDESCREEN MANAGEMENT REDESIGN
   ========================================================= */

.timesheet-main{
  max-width:1780px !important;
}

.timesheet-main > h1{
  margin-top:14px !important;
  margin-bottom:10px !important;
}

.timesheet-control-bar{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:14px !important;
  align-items:end !important;
  padding:14px 16px !important;
  margin-bottom:12px !important;
}

.timesheet-control-form{
  display:grid !important;
  grid-template-columns:minmax(260px,1.2fr) minmax(180px,.65fr) minmax(160px,.55fr) !important;
  gap:10px !important;
  align-items:end !important;
}

.timesheet-control-form label{
  margin:0 !important;
}

.timesheet-control-form select,
.timesheet-control-form input,
.timesheet-control-form button{
  min-height:42px !important;
  box-sizing:border-box !important;
}

.timesheet-control-form button{
  width:100% !important;
}

.timesheet-control-actions{
  display:flex !important;
  align-items:end !important;
  justify-content:flex-end !important;
  gap:8px !important;
  flex-wrap:wrap !important;
}

.timesheet-control-actions .button,
.timesheet-control-actions button{
  min-height:42px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.employee-timesheet-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding:12px 16px !important;
  margin-bottom:10px !important;
  border:1px solid #d6e0e8 !important;
  border-radius:12px !important;
  background:#fff !important;
}

.timesheet-person-summary h2{
  margin:0 0 2px !important;
}

.timesheet-person-summary p{
  margin:0 !important;
}

.compact-timesheet{
  width:100% !important;
  overflow-x:auto !important;
}

.compact-timesheet table{
  width:100% !important;
  min-width:1180px !important;
}

.compact-timesheet th,
.compact-timesheet td{
  vertical-align:middle !important;
}

/* Cleaner correction panel */
.compact-timesheet details{
  min-width:0 !important;
}

.compact-timesheet details > summary{
  cursor:pointer !important;
  color:#1e5b7f !important;
  font-weight:800 !important;
  list-style:none !important;
  white-space:nowrap !important;
}

.compact-timesheet details > summary::-webkit-details-marker{
  display:none !important;
}

.compact-timesheet details > summary::before{
  content:"▸";
  display:inline-block;
  margin-right:6px;
  transition:transform .15s ease;
}

.compact-timesheet details[open] > summary::before{
  transform:rotate(90deg);
}

.timesheet-time-editor{
  display:grid !important;
  grid-template-columns:
    minmax(135px,.7fr)
    minmax(130px,.55fr)
    minmax(130px,.55fr)
    minmax(260px,1.25fr)
    minmax(150px,.65fr) !important;
  gap:9px !important;
  align-items:end !important;
  margin-top:8px !important;
  padding:10px !important;
  border:1px solid #d7e1e8 !important;
  border-radius:10px !important;
  background:#f8fafb !important;
}

.time-editor-date{
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  min-height:42px !important;
  padding:6px 10px !important;
  border:1px solid #d4dde4 !important;
  border-radius:8px !important;
  background:#fff !important;
  box-sizing:border-box !important;
}

.time-editor-date span{
  font-size:11px !important;
  color:#6b7983 !important;
}

.time-editor-date strong{
  font-size:13px !important;
}

.timesheet-time-editor label{
  margin:0 !important;
  min-width:0 !important;
}

.timesheet-time-editor input[type="time"],
.timesheet-time-editor input[type="text"],
.timesheet-time-editor input:not([type]){
  width:100% !important;
  min-height:42px !important;
  box-sizing:border-box !important;
}

.timesheet-time-editor button{
  width:100% !important;
  min-height:42px !important;
  margin:0 !important;
}

.time-editor-help{
  margin:5px 0 0 !important;
  font-size:11px !important;
  color:#71808a !important;
  line-height:1.35 !important;
}

.missing-finish-action .timesheet-time-editor{
  background:#fff8f6 !important;
  border-color:#e6b0a9 !important;
}

/* Employee overview rows use the width properly. */
.employee-timesheet-list{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:8px !important;
}

.employee-timesheet-row{
  min-width:0 !important;
}

/* Absence summary stays compact underneath the timesheet. */
.timesheet-main .absence-summary{
  margin-top:10px !important;
}

@media(max-width:1100px){
  .timesheet-control-bar{
    grid-template-columns:1fr !important;
  }

  .timesheet-control-actions{
    justify-content:flex-start !important;
  }

  .timesheet-time-editor{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .time-editor-date,
  .time-editor-reason{
    grid-column:auto !important;
  }
}

@media(max-width:760px){
  .timesheet-control-form,
  .timesheet-time-editor,
  .employee-timesheet-list{
    grid-template-columns:1fr !important;
  }

  .timesheet-control-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .timesheet-control-actions .button,
  .timesheet-control-actions button{
    width:100% !important;
  }
}


/* Timesheet selected-employee Close button */
.timesheet-head-actions{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

.timesheet-close-button{
  min-height:36px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding-left:16px !important;
  padding-right:16px !important;
}

@media(max-width:760px){
  .timesheet-head-actions{
    width:100% !important;
    justify-content:flex-start !important;
  }

  .timesheet-close-button{
    width:100% !important;
  }
}


/* Explicit Close control inside Edit times / Add finish time */
.time-editor-actions{
  display:grid !important;
  grid-template-columns:minmax(150px,1fr) auto !important;
  gap:8px !important;
  align-items:end !important;
}

.time-editor-actions > button{
  min-height:42px !important;
}

.timesheet-editor-close{
  min-width:90px !important;
}

@media(max-width:760px){
  .time-editor-actions{
    grid-template-columns:1fr !important;
  }

  .timesheet-editor-close{
    width:100% !important;
  }
}


/* TIMESHEETS - wider page + editor that actually fits on screen */
@media(min-width:1100px){
  .timesheet-main{
    width:calc(100% - 32px) !important;
    max-width:1900px !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }

  .compact-timesheet{
    overflow-x:visible !important;
  }

  .compact-timesheet table{
    width:100% !important;
    min-width:0 !important;
    table-layout:fixed !important;
  }

  .compact-timesheet th:nth-child(1),
  .compact-timesheet td:nth-child(1){width:7% !important;}

  .compact-timesheet th:nth-child(2),
  .compact-timesheet td:nth-child(2),
  .compact-timesheet th:nth-child(3),
  .compact-timesheet td:nth-child(3),
  .compact-timesheet th:nth-child(4),
  .compact-timesheet td:nth-child(4),
  .compact-timesheet th:nth-child(5),
  .compact-timesheet td:nth-child(5){width:5% !important;}

  .compact-timesheet th:nth-child(6),
  .compact-timesheet td:nth-child(6){width:7% !important;}

  .compact-timesheet th:nth-child(7),
  .compact-timesheet td:nth-child(7){width:12% !important;}

  .compact-timesheet th:nth-child(8),
  .compact-timesheet td:nth-child(8){width:44% !important;}

  .timesheet-time-editor{
    grid-template-columns:
      118px
      105px
      105px
      minmax(180px,1fr)
      220px !important;
    gap:7px !important;
    width:100% !important;
    box-sizing:border-box !important;
  }

  .time-editor-actions{
    grid-template-columns:minmax(120px,1fr) 82px !important;
    gap:6px !important;
    width:100% !important;
  }

  .timesheet-editor-close{
    min-width:0 !important;
    width:82px !important;
  }

  .compact-timesheet td{
    overflow:visible !important;
  }
}

@media(min-width:1500px){
  .timesheet-main{
    width:calc(100% - 44px) !important;
    max-width:1980px !important;
  }

  .compact-timesheet th:nth-child(8),
  .compact-timesheet td:nth-child(8){width:48% !important;}
}


/* =========================================================
   VEHICLE ADMIN - WIDESCREEN CONTROL CENTRE
   ========================================================= */

.vehicle-admin-main{
  width:calc(100% - 44px) !important;
  max-width:1820px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}

.vehicle-admin-main > h1{
  margin-top:14px !important;
  margin-bottom:10px !important;
}

.vehicle-admin-layout{
  display:grid !important;
  grid-template-columns:minmax(0,1.7fr) minmax(390px,.8fr) !important;
  gap:14px !important;
  align-items:start !important;
}

.vehicle-register-card{
  grid-column:1 !important;
  grid-row:1 !important;
  padding:15px 16px !important;
  margin:0 !important;
}

.vehicle-admin-side{
  grid-column:2 !important;
  grid-row:1 !important;
  display:grid !important;
  gap:12px !important;
  min-width:0 !important;
}

.vehicle-add-card,
.vehicle-notification-card{
  padding:14px 16px !important;
  margin:0 !important;
}

.vehicle-weekly-section{
  grid-column:1 / -1 !important;
  grid-row:2 !important;
  margin-top:2px !important;
}

.vehicle-section-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  margin-bottom:6px !important;
}

.vehicle-section-head h2{
  margin:1px 0 0 !important;
}

.vehicle-eyebrow{
  margin:0 !important;
  color:#8b6b22 !important;
  font-size:11px !important;
  font-weight:800 !important;
  text-transform:uppercase !important;
  letter-spacing:.07em !important;
}

.vehicle-section-copy{
  margin:0 0 10px !important;
  line-height:1.4 !important;
}

.vehicle-count-badge{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:34px !important;
  min-height:28px !important;
  padding:0 9px !important;
  border-radius:999px !important;
  background:#eef3f6 !important;
  color:#31546c !important;
  font-size:12px !important;
  font-weight:800 !important;
}

/* ADD VEHICLE */
.vehicle-add-form{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:9px !important;
}

.vehicle-add-form label{
  margin:0 !important;
  min-width:0 !important;
}

.vehicle-add-form input,
.vehicle-add-form select{
  width:100% !important;
  box-sizing:border-box !important;
  min-height:40px !important;
}

.vehicle-add-button{
  grid-column:1 / -1 !important;
  min-height:42px !important;
  width:100% !important;
  margin-top:2px !important;
}

/* NOTIFICATIONS */
.vehicle-notification-form{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:8px !important;
}

.vehicle-notification-form label{
  margin:0 !important;
}

.vehicle-notification-form input,
.vehicle-notification-form button{
  width:100% !important;
  min-height:40px !important;
  box-sizing:border-box !important;
}

/* VEHICLE REGISTER */
.vehicle-register-table{
  overflow-x:auto !important;
}

.vehicle-register-table table{
  width:100% !important;
  min-width:900px !important;
}

.vehicle-register-table th,
.vehicle-register-table td{
  vertical-align:top !important;
}

.vehicle-register-table th:nth-child(1),
.vehicle-register-table td:nth-child(1){width:11% !important;}

.vehicle-register-table th:nth-child(2),
.vehicle-register-table td:nth-child(2){width:15% !important;}

.vehicle-register-table th:nth-child(3),
.vehicle-register-table td:nth-child(3){width:15% !important;}

.vehicle-register-table th:nth-child(4),
.vehicle-register-table td:nth-child(4){width:39% !important;}

.vehicle-register-table th:nth-child(5),
.vehicle-register-table td:nth-child(5){width:9% !important;}

.vehicle-register-table th:nth-child(6),
.vehicle-register-table td:nth-child(6){width:11% !important;}

.vehicle-register-table .vehicle-compliance-grid{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:5px !important;
  min-width:0 !important;
}

.vehicle-register-table .vehicle-compliance-grid > div > span{
  font-size:10px !important;
}

.vehicle-register-table .compliance-badge{
  padding:5px 7px !important;
  font-size:11px !important;
}

.vehicle-status{
  display:inline-flex !important;
  align-items:center !important;
  min-height:27px !important;
  padding:0 9px !important;
  border-radius:999px !important;
  font-size:11px !important;
  font-weight:800 !important;
}

.vehicle-status.active{
  background:#e8f7ee !important;
  color:#17603a !important;
  border:1px solid #79bf94 !important;
}

.vehicle-status.inactive{
  background:#f1f4f6 !important;
  color:#5b6871 !important;
  border:1px solid #cbd6dd !important;
}

/* EDIT VEHICLE */
.vehicle-edit-details{
  position:relative !important;
}

.vehicle-edit-details > summary{
  cursor:pointer !important;
  list-style:none !important;
}

.vehicle-edit-details > summary::-webkit-details-marker{
  display:none !important;
}

.vehicle-edit-panel{
  margin-top:8px !important;
  padding:11px !important;
  min-width:520px !important;
  border:1px solid #d5dfe6 !important;
  border-radius:10px !important;
  background:#f8fafb !important;
}

.vehicle-edit-form{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:8px !important;
}

.vehicle-edit-form label{
  margin:0 !important;
}

.vehicle-edit-form input,
.vehicle-edit-form select,
.vehicle-edit-form button{
  width:100% !important;
  box-sizing:border-box !important;
}

.vehicle-edit-form button{
  grid-column:1 / -1 !important;
  min-height:40px !important;
}

.vehicle-edit-actions{
  display:grid !important;
  grid-template-columns:1fr 1fr !important;
  gap:8px !important;
  margin-top:8px !important;
}

.vehicle-edit-actions form,
.vehicle-edit-actions button{
  width:100% !important;
  margin:0 !important;
}

/* WEEKLY CHECKS */
.weekly-heading{
  align-items:end !important;
  margin-bottom:8px !important;
}

.weekly-heading > p{
  margin:0 !important;
  text-align:right !important;
}

.vehicle-week-folder{
  margin:0 0 9px !important;
  padding:0 !important;
  overflow:hidden !important;
}

.vehicle-week-folder > summary{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  padding:12px 14px !important;
  cursor:pointer !important;
  list-style:none !important;
  background:#f7f9fb !important;
  border-bottom:1px solid transparent !important;
}

.vehicle-week-folder[open] > summary{
  border-bottom-color:#dbe3e8 !important;
}

.vehicle-week-folder > summary::-webkit-details-marker{
  display:none !important;
}

.vehicle-week-folder > summary::before{
  content:"▸" !important;
  margin-right:7px !important;
  color:#31546c !important;
  font-weight:900 !important;
}

.vehicle-week-folder[open] > summary::before{
  content:"▾" !important;
}

.vehicle-week-summary{
  margin-left:auto !important;
  color:#5f6f79 !important;
  font-size:12px !important;
  font-weight:700 !important;
}

.vehicle-missing-week{
  display:inline-block !important;
  margin:10px 14px 4px !important;
  padding:8px 11px !important;
  border-radius:8px !important;
}

.vehicle-week-table{
  width:100% !important;
  overflow-x:auto !important;
  padding:6px 12px 12px !important;
  box-sizing:border-box !important;
}

.vehicle-week-table table{
  width:100% !important;
  min-width:1180px !important;
  table-layout:fixed !important;
}

.vehicle-week-table th:nth-child(1),
.vehicle-week-table td:nth-child(1){width:10% !important;}

.vehicle-week-table th:nth-child(2),
.vehicle-week-table td:nth-child(2){width:9% !important;}

.vehicle-week-table th:nth-child(3),
.vehicle-week-table td:nth-child(3){width:8% !important;}

.vehicle-week-table th:nth-child(4),
.vehicle-week-table td:nth-child(4){width:7% !important;}

.vehicle-week-table th:nth-child(5),
.vehicle-week-table td:nth-child(5){width:10% !important;}

.vehicle-week-table th:nth-child(6),
.vehicle-week-table td:nth-child(6){width:8% !important;}

.vehicle-week-table th:nth-child(7),
.vehicle-week-table td:nth-child(7){width:48% !important;}

.vehicle-week-table td{
  vertical-align:top !important;
}

.vehicle-week-notes{
  line-height:1.35 !important;
  margin-bottom:7px !important;
}

.vehicle-resolve-form{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 145px !important;
  gap:8px !important;
  margin-top:6px !important;
}

.vehicle-resolve-form input,
.vehicle-resolve-form button{
  min-height:38px !important;
  box-sizing:border-box !important;
  width:100% !important;
}

/* Don't touch employee vehicle check/mobile form. This is admin-only. */
@media(max-width:1150px){
  .vehicle-admin-layout{
    grid-template-columns:1fr !important;
  }

  .vehicle-register-card,
  .vehicle-admin-side,
  .vehicle-weekly-section{
    grid-column:1 !important;
    grid-row:auto !important;
  }

  .vehicle-admin-side{
    grid-template-columns:1fr 1fr !important;
  }
}

@media(max-width:760px){
  .vehicle-admin-main{
    width:auto !important;
  }

  .vehicle-admin-side{
    grid-template-columns:1fr !important;
  }

  .vehicle-add-form,
  .vehicle-edit-form,
  .vehicle-edit-actions,
  .vehicle-resolve-form{
    grid-template-columns:1fr !important;
  }

  .vehicle-edit-panel{
    min-width:0 !important;
  }

  .weekly-heading{
    display:block !important;
  }

  .weekly-heading > p{
    text-align:left !important;
    margin-top:4px !important;
  }
}
