:root{
  --bg:#eef3f2;
  --ink:#142326;
  --muted:#69797c;
  --card:#fff;
  --line:#d8e1df;
  --brand:#0d6b58;
  --brand2:#0a5445;
  --danger:#b3261e;
  --header:#102a2f;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--ink);
}

body.authPending header,
body.authPending main{
  visibility:hidden;
}

.wrap{
  width:min(1180px,calc(100% - 28px));
  margin:auto;
}

header{
  background:var(--header);
  color:#fff;
  padding:14px 0;
  position:sticky;
  top:0;
  z-index:20;
}

.topbar,
.sectionHead,
.hero,
.actions,
.topActions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.small,
.status{
  font-size:13px;
  color:var(--muted);
}

header .small{
  color:#c4d5d2;
}

.app{
  padding:22px 0 50px;
}

.hero{
  background:linear-gradient(120deg,#102a2f,#16443e);
  color:#fff;
  border-radius:20px;
  padding:28px;
  margin-bottom:18px;
}

.hero h2{
  margin:5px 0 8px;
  font-size:clamp(25px,4vw,40px);
}

.hero p{
  margin:0;
  color:#d7e4e1;
}

.eyebrow{
  font-size:12px;
  letter-spacing:.15em;
  color:#9fd6c8;
}

.card,
.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 10px 30px #173c3520;
  padding:18px;
}

.sectionHead h3{
  margin:0;
}

.btn{
  appearance:none;
  border:1px solid #c6d2d0;
  background:#fff;
  color:var(--ink);
  border-radius:10px;
  padding:10px 14px;
  font:inherit;
  font-weight:650;
  cursor:pointer;
}

.btn:hover{
  border-color:#9fb3af;
}

.btn.primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.btn.danger{
  background:#fff0ef;
  border-color:#ecc3bf;
  color:var(--danger);
}

.list{
  display:grid;
  gap:10px;
  margin-top:15px;
}

.item{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(120px,1fr) minmax(110px,.7fr) auto;
  gap:12px;
  align-items:center;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fbfdfc;
}

.item strong{
  display:block;
}

.badge{
  display:inline-block;
  border-radius:999px;
  padding:5px 9px;
  background:#edf4f2;
  font-size:12px;
}

.badge.compact{
  padding:3px 7px;
  font-size:10px;
  white-space:nowrap;
}

/* =========================================================
   WOCHENANSICHT
   ========================================================= */

.dispoHead{
  align-items:flex-start;
}

.dispoActions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.viewSwitch{
  display:inline-flex;
  border:1px solid #c6d2d0;
  border-radius:11px;
  padding:3px;
  background:#f6f9f8;
}

.viewSwitch .btn{
  border:0;
  padding:7px 12px;
  background:transparent;
  box-shadow:none;
}

.viewSwitch .btn.active{
  background:var(--brand);
  color:#fff;
}

.weekLabel{
  margin-top:4px;
  font-weight:650;
}

.weekToolbar{
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  margin:16px 0 14px;
}

.weekView{
  overflow-x:auto;
  padding-bottom:4px;
}

.weekGrid{
  display:grid;
  grid-template-columns:repeat(7,minmax(145px,1fr));
  gap:8px;
  min-width:1050px;
}

.weekDay{
  min-width:0;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8fbfa;
  overflow:hidden;
}

.weekDay.today{
  border:2px solid var(--brand);
}

.weekDayHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:10px 11px;
  border-bottom:1px solid var(--line);
  background:#eef5f3;
  text-transform:capitalize;
}

.weekDay.today .weekDayHead{
  background:#e4f3ef;
}

.weekDayHead strong{
  font-size:13px;
}

.weekDayHead span{
  font-size:12px;
  color:var(--muted);
}

.weekDayBody{
  display:grid;
  align-content:start;
  gap:7px;
  min-height:280px;
  padding:8px;
}

.weekEmpty{
  color:#98a6a8;
  font-size:12px;
  text-align:center;
  padding:20px 6px;
}

.weekEvent{
  width:100%;
  appearance:none;
  text-align:left;
  border:1px solid #cbdad7;
  border-left:4px solid var(--brand);
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  padding:9px;
  cursor:pointer;
  font:inherit;
  display:grid;
  gap:4px;
}

.weekEvent:hover{
  border-color:#9eb8b2;
  box-shadow:0 4px 12px #173c3518;
}

.weekEvent.status-active{
  border-left-color:#1687a7;
}

.weekEvent.status-done{
  border-left-color:#6d7d80;
  opacity:.78;
}

.weekEvent.status-cancelled{
  border-left-color:#b3261e;
  opacity:.62;
}

.weekEvent.priority-high{
  box-shadow:inset 0 0 0 1px #e9c46a;
}

.weekEvent.priority-urgent{
  box-shadow:inset 0 0 0 2px #d77b72;
}

.weekEventTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:5px;
}

.weekEventTime{
  font-size:11px;
  font-weight:800;
  color:var(--brand2);
}

.weekEvent strong{
  font-size:13px;
  line-height:1.25;
}

.weekEventCustomer,
.weekEventMeta,
.weekEventTeam{
  display:block;
  font-size:11px;
  line-height:1.3;
}

.weekEventCustomer{
  font-weight:650;
}

.weekEventMeta,
.weekEventTeam{
  color:var(--muted);
}

.weekMeta{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}

.conflictSummary{
  appearance:none;
  border:1px solid #e0a29d;
  background:#fff0ef;
  color:#8f211b;
  border-radius:999px;
  padding:5px 9px;
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.conflictSummary:hover{
  border-color:#b3261e;
  background:#ffe8e5;
}

.weekEvent.has-conflict{
  border-color:#d98e87;
  border-left-color:#b3261e;
  background:#fff8f7;
  box-shadow:inset 0 0 0 1px #efc3bf;
}

.weekEventConflict{
  display:block;
  margin-top:3px;
  border-radius:7px;
  padding:5px 6px;
  background:#ffe4e1;
  color:#92261f;
  font-size:10px;
  font-weight:800;
  line-height:1.25;
}

.conflictPulse{
  animation:conflictPulse .6s ease-in-out 3;
}

@keyframes conflictPulse{
  0%,100%{
    transform:scale(1);
  }
  50%{
    transform:scale(1.025);
  }
}

/* =========================================================
   LOGIN / FORMULARE
   ========================================================= */

.login{
  position:fixed;
  inset:0;
  z-index:100;
  background:radial-gradient(circle at top,#1c544b,#102a2f 55%,#0c2024);
  display:grid;
  place-items:center;
  padding:20px;
}

.login.hidden{
  display:none;
}

.loginbox{
  width:min(410px,100%);
  background:#fff;
  border-radius:22px;
  padding:28px;
}

.loginbox h1{
  margin:0;
}

.loginbox p{
  margin:4px 0 22px;
  color:var(--muted);
}

label{
  display:grid;
  gap:6px;
  font-size:13px;
  font-weight:650;
  color:#33474a;
}

.loginbox label{
  margin-bottom:14px;
}

input,
select,
textarea{
  width:100%;
  border:1px solid #cbd7d4;
  border-radius:10px;
  padding:11px 12px;
  font:inherit;
  color:var(--ink);
  background:#fff;
}

textarea{
  resize:vertical;
}

.loginbox .btn{
  width:100%;
  margin-top:4px;
}

.overlay{
  position:fixed;
  inset:0;
  background:#0b1d21b8;
  z-index:60;
  display:grid;
  place-items:center;
  padding:18px;
  overflow:auto;
}

.overlay.hidden,
.hidden{
  display:none!important;
}

.panel{
  width:min(760px,100%);
  max-height:92vh;
  overflow:auto;
}

.panel.wide{
  width:min(900px,100%);
}

.formGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin:14px 0;
}

.formGrid .full{
  grid-column:1/-1;
}

.formSection{
  border-top:1px solid var(--line);
  margin-top:18px;
  padding-top:4px;
}

.formSection h4{
  margin:14px 0 2px;
}

.employeePicker{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  border:1px solid #cbd7d4;
  border-radius:10px;
  padding:10px;
  min-height:45px;
  background:#fff;
}

.employeeChoice{
  display:flex;
  align-items:center;
  gap:7px;
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 10px;
  font-weight:600;
}

.employeeChoice input{
  width:auto;
  margin:0;
}

.moreDetails{
  border-top:1px solid var(--line);
  margin:18px 0;
  padding-top:14px;
}

.moreDetails summary{
  cursor:pointer;
  font-weight:750;
  color:var(--brand);
}

.actions{
  justify-content:flex-start;
}

.userList{
  display:grid;
  gap:8px;
  margin-top:18px;
}

.userRow{
  display:grid;
  grid-template-columns:1.3fr 1.5fr .7fr .6fr;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  align-items:center;
}

/* =========================================================
   MONATSANSICHT
   ========================================================= */

.monthView{
  overflow:auto;
  margin-top:12px;
}

.monthWeekdays{
  display:grid;
  grid-template-columns:repeat(7,minmax(135px,1fr));
  min-width:945px;
  border:1px solid var(--line);
  border-bottom:0;
  border-radius:14px 14px 0 0;
  overflow:hidden;
  background:#edf4f2;
}

.monthWeekdays span{
  padding:8px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  border-right:1px solid var(--line);
}

.monthWeekdays span:last-child{
  border-right:0;
}

.monthGrid{
  display:grid;
  grid-template-columns:repeat(7,minmax(135px,1fr));
  min-width:945px;
  border-left:1px solid var(--line);
  border-top:1px solid var(--line);
}

.monthDay{
  min-height:135px;
  background:#fff;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:7px;
}

.monthDay.outside{
  background:#f7f9f8;
  color:#8b989a;
}

.monthDay.today{
  box-shadow:inset 0 0 0 2px var(--brand);
}

.monthDayHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:800;
  margin-bottom:6px;
}

.monthDayHead small{
  font-size:9px;
  color:var(--brand);
}

.monthDayBody{
  display:grid;
  gap:4px;
}

.monthEvent{
  appearance:none;
  width:100%;
  border:1px solid #cdd9d6;
  border-left:3px solid var(--brand);
  background:#f9fcfb;
  border-radius:7px;
  padding:5px 6px;
  text-align:left;
  cursor:pointer;
  font:inherit;
  display:grid;
  gap:1px;
}

.monthEvent span{
  font-size:9px;
  color:var(--muted);
  font-weight:700;
}

.monthEvent strong{
  font-size:10px;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.monthEvent.priority-high{
  border-left-color:#d07a00;
}

.monthEvent.priority-urgent{
  border-left-color:#b3261e;
}

.monthMore{
  font-size:10px;
  color:var(--muted);
  padding:2px 4px;
}

/* =========================================================
   MITARBEITER-HANDYANSICHT
   ========================================================= */

.workerDashboard{
  padding-bottom:30px;
}

.workerIntro{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  background:linear-gradient(120deg,#102a2f,#16443e);
  color:#fff;
  border-radius:20px;
  padding:24px;
  margin-bottom:16px;
}

.workerIntro h2{
  margin:5px 0 7px;
}

.workerIntro p{
  margin:0;
  color:#d7e4e1;
}

.workerItems{
  display:grid;
  gap:14px;
}

.workerEmpty{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:24px;
  text-align:center;
  color:var(--muted);
}

.workerCard{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:17px;
  box-shadow:0 8px 24px #173c3514;
}

.workerCard.past{
  opacity:.78;
}

.workerCardTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.workerCardTop h3{
  margin:4px 0 0;
  font-size:20px;
}

.workerDate{
  font-size:13px;
  font-weight:800;
  color:var(--brand);
}

.workerLine{
  padding:5px 0;
  font-size:14px;
}

.workerDescription{
  margin:10px 0;
  padding:10px;
  border-radius:10px;
  background:#f3f7f6;
  white-space:pre-wrap;
}

.workerSafety{
  margin:10px 0;
  padding:10px;
  border-radius:10px;
  background:#fff4df;
  border:1px solid #ecd7a6;
}

.workerFeedback{
  display:grid;
  gap:3px;
  margin-top:12px;
  padding:10px;
  border-radius:10px;
  background:#f3f5f5;
}

.workerFeedback small{
  color:var(--muted);
}

.workerFeedback.feedbackDone{
  background:#eaf7f1;
}

.workerFeedback.feedbackImpossible{
  background:#fff0ef;
}

.workerFeedback.feedbackAbsent{
  background:#fff7e8;
}

.workerActions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:13px;
}

.workerAction{
  appearance:none;
  border:0;
  border-radius:11px;
  padding:12px 8px;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}

.workerAction.done{
  background:#0d6b58;
  color:#fff;
}

.workerAction.impossible{
  background:#b3261e;
  color:#fff;
}

.workerAction.absent{
  background:#e8aa2b;
  color:#25200f;
}

.feedbackPanel{
  width:min(520px,100%);
}

.feedbackPrompt{
  color:var(--muted);
}

.adminFeedbackBox{
  border-top:1px solid var(--line);
  margin:18px 0 0;
  padding-top:14px;
}

.adminFeedbackBox h4{
  margin:0 0 8px;
}

.adminFeedbackRow{
  display:grid;
  grid-template-columns:1.2fr .9fr 1.5fr auto;
  gap:8px;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  margin-top:6px;
  align-items:center;
  font-size:13px;
}

.adminFeedbackRow.feedbackDone{
  background:#eaf7f1;
}

.adminFeedbackRow.feedbackImpossible{
  background:#fff0ef;
}

.adminFeedbackRow.feedbackAbsent{
  background:#fff7e8;
}

/* =========================================================
   ADMIN-WARNZEICHEN
   ========================================================= */

.adminWarning{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  margin-right:6px;
  border-radius:50%;
  background:#b3261e;
  color:#fff;
  font-size:13px;
  font-weight:900;
  line-height:1;
  vertical-align:middle;
  box-shadow:0 1px 4px #b3261e45;
}

.monthEvent .adminWarning{
  width:16px;
  height:16px;
  margin-right:3px;
  font-size:10px;
}

/* =========================================================
   ADMIN: AUSGEFÜHRTE AUFTRÄGE GRÜN
   ========================================================= */

.item.admin-completed,
.weekEvent.admin-completed,
.monthEvent.admin-completed{
  background:#e7f6ed;
  border-color:#83c99d;
}

.item.admin-completed{
  box-shadow:inset 4px 0 0 #27834a;
}

.weekEvent.admin-completed{
  border-left-color:#27834a;
  box-shadow:inset 0 0 0 1px #a9d9b9;
}

.monthEvent.admin-completed{
  border-left-color:#27834a;
  background:#e7f6ed;
}

.weekEvent.admin-completed.has-conflict{
  border-color:#d98e87;
}

/* =========================================================
   GOOGLE MAPS BUTTON MITARBEITER
   ========================================================= */

.workerLocationBox{
  margin:10px 0;
  padding:11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f7faf9;
}

.mapsButton{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:46px;
  margin-top:8px;
  padding:10px 14px;
  border-radius:10px;
  background:#fff;
  border:1px solid #b9cbc7;
  color:var(--brand);
  text-decoration:none;
  font-weight:800;
  text-align:center;
}

.mapsButton:focus{
  outline:3px solid #0d6b5835;
  outline-offset:2px;
}

@media(hover:hover) and (pointer:fine){
  .mapsButton:hover{
    background:#edf6f3;
    border-color:var(--brand);
  }
}

/* =========================================================
   GOOGLE PLACES
   WICHTIG:
   Das Google-Widget selbst wird bewusst nur äußerlich
   dimensioniert. Keine inneren Google-Elemente verändern,
   damit die Autovervollständigung funktioniert.
   ========================================================= */

gmp-place-autocomplete{
  display:block;
  width:100%;
  box-sizing:border-box;
  font:inherit;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width:900px){
  .weekGrid{
    grid-template-columns:repeat(7,minmax(190px,1fr));
    min-width:1380px;
  }
}

@media(max-width:760px){

  .hero,
  .sectionHead,
  .topbar{
    align-items:flex-start;
  }

  .hero{
    flex-direction:column;
  }

  .item{
    grid-template-columns:1fr;
  }

  .formGrid{
    grid-template-columns:1fr;
  }

  .formGrid .full{
    grid-column:auto;
  }

  .userRow{
    grid-template-columns:1fr;
  }

  .topActions{
    flex-wrap:wrap;
  }

  .wrap{
    width:min(100% - 18px,1180px);
  }

  .dispoHead{
    flex-direction:column;
  }

  .dispoActions{
    width:100%;
    justify-content:space-between;
  }

  .weekToolbar{
    justify-content:flex-start;
  }

  .weekToolbar .btn{
    flex:1 1 auto;
  }

  .workerIntro{
    padding:18px;
    flex-direction:column;
  }

  .workerIntro .btn{
    width:100%;
  }

  .workerCard{
    padding:14px;
  }

  .workerCardTop{
    flex-direction:column;
  }

  .workerActions{
    grid-template-columns:1fr;
  }

  .workerAction{
    min-height:48px;
    font-size:15px;
  }

  .adminFeedbackRow{
    grid-template-columns:1fr;
  }

  .monthWeekdays,
  .monthGrid{
    min-width:770px;
    grid-template-columns:repeat(7,minmax(110px,1fr));
  }
/* Beide Hauptbuttons exakt gleich gross */
.heroActions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.heroActions .heroActionBtn {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  height: 46px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  flex: 0 0 170px !important;
}