:root{font-family:system-ui,Arial,sans-serif;color:#e9eef8;background:#101927}*{box-sizing:border-box}body{margin:0}header{display:flex;align-items:center;gap:1rem;justify-content:space-between;background:#1d2a3d;padding:1.1rem max(1rem,calc((100vw - 1100px)/2));border-bottom:3px solid #e7ae36}main{max-width:1100px;margin:2rem auto;padding:0 1rem}.panel,section section{background:#1d2a3d;padding:1.4rem;border-radius:12px}#auth{max-width:480px;margin:5vh auto}h1,h2{margin-top:0}form{display:grid;gap:12px;margin-bottom:1rem}label{display:grid;gap:5px}input,select{padding:12px;border:1px solid #64748b;border-radius:7px;background:#f8fafc;color:#111827;width:100%}button{border:0;border-radius:7px;background:#e7ae36;color:#101927;padding:11px 15px;font-weight:700;cursor:pointer}button:hover{filter:brightness(1.1)}button:disabled{opacity:.5}nav{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:1rem}.item{background:#26364d;padding:12px;border-radius:8px;margin:10px 0;overflow-wrap:anywhere}.item button{margin:4px}#message{color:#ffda87;min-height:1.5rem}a{color:#ffda87}#who{margin-left:auto}@media(max-width:650px){header{flex-wrap:wrap}main{margin:1rem auto}}

/* Edit Branch form */
.branch-edit-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #b99b52;
  border-radius: 10px;
  background: #14233a;
}

.branch-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #ffffff;
}

.branch-edit-form input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border: 1px solid #64748b;
  border-radius: 6px;
}

.branch-edit-form button {
  cursor: pointer;
  padding: 10px 16px;
}

/* Edit Branch action buttons */
.branch-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.branch-edit-actions button {
  width: 160px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .branch-edit-actions {
    flex-direction: column;
  }

  .branch-edit-actions button {
    width: 100%;
  }
}

/* Import template downloads */
#downloadTemplates {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #52627a;
}

#downloadTemplates h3 {
  margin-bottom: 8px;
}

#downloadTemplates .branch-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#downloadTemplates button {
  width: auto;
  min-width: 135px;
}

/* Branch navigation buttons */
.branch-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.branch-navigation a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  background: #1769aa;
}

.branch-navigation a:last-child {
  background: #168a49;
}

.branch-navigation a:hover {
  filter: brightness(1.15);
}


/* Vehicle run sheet redesign — scoped to the driver workspace */
#runsheets.run-page{background:transparent;padding:0;color:#eef5f0}
#runsheets[hidden],#vehicleRunPanel[hidden],#runSheetExportTools[hidden]{display:none!important}
.run-page .run-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;background:linear-gradient(115deg,#124b36,#19704d);border:1px solid #37785a;border-radius:16px;padding:27px 30px;margin-bottom:16px;box-shadow:0 12px 32px #0002}
.run-page .run-eyebrow,.run-page .run-kicker{font-size:.73rem;font-weight:800;letter-spacing:.11em;color:#99e1b8}
.run-page .run-hero h2{font-size:clamp(1.55rem,3vw,2.15rem);margin:7px 0}
.run-page .run-hero p{margin:0;color:#e0f2e6}
.run-page .run-hero-mark{font-size:3.2rem;color:#b4e5c6;opacity:.8}
.run-page .run-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}
.run-page .run-metric{background:#203145;border:1px solid #3a5262;border-radius:12px;padding:17px 20px;display:grid;gap:7px}
.run-page .run-metric span{font-size:.83rem;color:#b7c8d0}.run-page .run-metric strong{font-size:1.18rem;overflow-wrap:anywhere}
.run-page .run-section{background:#1d2a3d;border:1px solid #34495b;border-radius:14px;padding:22px 24px;margin:0 0 16px}
.run-page .run-section-heading{display:flex;justify-content:space-between;margin-bottom:17px}
.run-page .run-section-heading h3{margin:5px 0;font-size:1.27rem}
.run-page .run-section-heading p{margin:5px 0 0;color:#bccbd5;font-size:.92rem}
.run-page .run-week-controls{display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.run-page .run-week-controls label{flex:1;min-width:200px}.run-page .run-week-controls button{min-height:45px}
.run-page button{background:#23945f;color:#fff;min-height:42px;transition:filter .15s}
.run-page button:focus-visible,.run-page input:focus-visible,.run-page select:focus-visible,.run-page textarea:focus-visible{outline:3px solid #a7e8c0;outline-offset:2px}
.run-page .run-week-list{margin-top:13px}.run-page .run-week-list button{background:#2c4853;border:1px solid #4a7667;text-align:left}
.run-page .run-selected{color:#b5e4c7;font-size:.9rem;margin-top:10px}
.run-page .run-fieldset{border:1px solid #40556a;border-radius:12px;padding:17px;margin:0 0 17px;min-width:0}
.run-page .run-fieldset legend{font-weight:800;padding:0 9px;color:#d7efe1}
.run-page .run-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.run-page .run-full{grid-column:1/-1}
.run-page .run-location-card{padding:15px;background:#26384b;border-radius:10px;display:grid;gap:12px}
.run-page .run-location-card h4{margin:0;color:#b9e7ce}
.run-page label{font-weight:600;font-size:.91rem;gap:7px}
.run-page input,.run-page select,.run-page textarea{width:100%;min-width:0;background:#f9fbfa;color:#12211c;border-color:#b9c8c1;font:inherit}
.run-page textarea{padding:12px;border:1px solid #b9c8c1;border-radius:7px;resize:vertical}
.run-page .run-primary{width:100%;font-size:1rem;background:#1c9b62}
.run-page .run-export-actions{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}
.run-page .run-export-actions button{background:#e7ae36;color:#132317}
.run-page .run-email-row{display:flex;align-items:end;gap:12px;flex-wrap:wrap}
.run-page .run-email-row label{flex:1;min-width:220px}
.run-page #runSheetEmailStatus{min-height:1.2em;color:#c6e8d3}
.run-page #vehicleRunsList{display:grid;gap:12px}
.run-page #vehicleRunsList>.panel{margin:0;background:#26384b;border:1px solid #42576a;padding:18px;border-radius:11px}
.run-page #vehicleRunsList h4{font-size:1.06rem;margin:0 0 12px;color:#b6e9c8}
.run-page #vehicleRunsList p{margin:7px 0;overflow-wrap:anywhere}
.run-page #vehicleRunsList button{margin-top:10px}
.run-page #vehicleRunsList button+button{background:#73434a}
@media(max-width:700px){.run-page .run-overview{grid-template-columns:1fr}.run-page .run-form-grid{grid-template-columns:1fr}.run-page .run-hero{padding:20px}.run-page .run-hero-mark{display:none}.run-page .run-section{padding:17px}.run-page .run-week-controls button,.run-page .run-email-row button{width:100%}.run-page .run-export-actions button{flex:1}}
@media print{header,nav,#branches,#contacts,#admin{display:none!important}.run-page .run-section{break-inside:avoid}}
