/* ===========================
   dashboard.css (Dashboard – Allgemein)
   overflow-sicher + mobile-first (korrigiert)
   =========================== */

/* --- Globaler Overflow-Fix (wichtig beim Auslagern!) --- */
*,
*::before,
*::after{ box-sizing:border-box; }

html, body{
  max-width:100%;
  overflow-x:hidden;
}

img{
  max-width:100%;
  height:auto;
}

/* --- Scope-Safety --- */
.page-shell,
.page-shell *{
  box-sizing:border-box;
}

.page-shell img{
  max-width:100%;
  height:auto;
  display:block;
}

/* ===== ROLE VISIBILITY ===== */
.only-lead{ display:none !important; }
.page-shell[data-role="lead"] .only-lead{ display:block !important; }
.page-shell[data-role="lead"] .work-row.only-lead{ display:flex !important; }
.page-shell[data-role="lead"] .cal-event.only-lead{ display:flex !important; }

/* ===== LAYOUT ROOT ===== */
.page-shell{
  background:#f8fafc;
  padding:24px 0 64px;      /* WICHTIG: kein horizontales Padding -> hfm-container macht das */
  overflow-x:hidden;
  width:100%;
  max-width:100%;
}

.dash-wrap{
  width:100%;
  max-width:1120px;
  margin:0 auto;
  font-family:system-ui;
  color:#1f2937;
}

/* min-width:0 ist bei Flex/Grid oft der entscheidende Overflow-Fix */
.dash-wrap *{ min-width:0; }

.dash-grid{
  display:grid;
  grid-template-columns:1fr;   /* mobile-first */
  gap:16px;
  margin-top:20px;
  width:100%;
  max-width:100%;
}

.span-3{ grid-column:auto; }

.dash-panel{
  background:#fff;
  border-radius:20px;
  padding:16px;               /* mobile */
  box-shadow:0 12px 30px rgba(0,0,0,.06);
  width:100%;
  max-width:100%;
}

.calendar-card{
  margin-top:28px;
  background:#fff;
  border-radius:22px;
  padding:16px;               /* mobile */
  box-shadow:0 12px 30px rgba(0,0,0,.06);
  width:100%;
  max-width:100%;
}

.center{ text-align:center; }
.muted{ color:#6b7280; }

/* Desktop / große Screens */
@media (min-width: 900px){
  .page-shell{ padding:48px 0 80px; }

  .dash-grid{
    grid-template-columns:1fr 1fr 1fr;
    gap:24px;
    margin-top:32px;
  }

  .span-3{ grid-column:1 / -1; }
  .dash-panel{ padding:22px; }
  .calendar-card{ margin-top:56px; padding:22px; }
}

/* ===== HEADER / ROLE TOGGLE ===== */
.dash-header-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start; /* mobile */
  gap:12px;
  flex-wrap:wrap;
}
.dash-header-row > div{ min-width:0; }

.dash-header-row h1{ margin:0; }
.dash-header-row p{ margin:6px 0 0; }

@media (min-width: 700px){
  .dash-header-row{ align-items:flex-end; gap:16px; }
}

.role-toggle{
  background:#e5e7eb;
  border-radius:999px;
  padding:4px;
  display:flex;
  gap:4px;
  max-width:100%;
  flex-wrap:wrap; /* falls’s eng wird */
}
.role-toggle button{
  border:none;
  background:transparent;
  padding:6px 14px;
  font-size:.85rem;
  border-radius:999px;
  cursor:pointer;
  min-width:0;
  white-space:nowrap;
}
.role-toggle button.active{
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}
.role-toggle button:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}

/* ===== TEAM (KOMPAKT) ===== */
.team-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:nowrap;
  margin-bottom:10px;
}
.team-title{
  flex:1 1 auto;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:1.35rem; /* mobile etwas kleiner */
  line-height:1.15;
  margin:0;
}
@media (min-width: 900px){
  .team-title{ font-size:1.55rem; }
}

.team-open{
  flex:0 0 auto;
  border:none;
  background:#e5e7eb;
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  font-size:.85rem;
}
.team-open:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}

.team-stats{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:8px 0 14px;
  max-width:100%;
}
.stat-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  font-size:.85rem;
  font-weight:700;
  border:1px solid rgba(0,0,0,.06);
  background:#f8fafc;
  max-width:100%;
}
.stat-chip strong{ font-variant-numeric:tabular-nums; }
.stat-chip .dot{ width:10px; height:10px; border-radius:50%; display:inline-block; background:#d1d5db; }
.stat-chip.on .dot{ background:#22c55e; }
.stat-chip.pause .dot{ background:#f59e0b; }
.stat-chip.off .dot{ background:#9ca3af; }
.stat-chip.all .dot{ background:#3b82f6; }

.people-grid{
  display:grid;
  gap:12px;
  list-style:none;
  padding:0;
  margin:0;
  max-width:100%;
}

/* mobile-first: 2 Spalten */
.people-grid--compact{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px){
  .people-grid--compact{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1050px){
  .people-grid--compact{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
}

.person{ text-align:center; font-size:.8rem; min-width:0; }
.person img{
  width:52px; height:52px; border-radius:50%;
  padding:3px; background:#e5e7eb;
}
.person.on img{ background:#22c55e; }
.person.pause img{ background:#f59e0b; }
.person.off img{ background:#9ca3af; }

.person .name{
  display:block;
  margin-top:6px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.person.is-hidden{ display:none; }

.person-more{
  display:flex;
  justify-content:center;
  align-items:center;
}
.more-btn{
  width:58px;
  height:58px;
  border-radius:50%;
  border:1px dashed rgba(0,0,0,.18);
  background:#f8fafc;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
}
.more-num{ font-weight:900; font-size:1rem; }
.more-btn .name{ margin-top:4px; font-size:.75rem; color:#6b7280; }
.more-btn:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}

.team-meta{ margin-top:12px; font-size:.75rem; color:#6b7280; }

/* ===== STEMPLUHR ===== */
.stamp-button{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  margin:18px auto 12px;
  width:min(220px, 100%);   /* mobile safe */
  padding:22px;

  border-radius:24px;
  border:none;
  cursor:pointer;

  text-decoration:none;
  color:#fff;

  background:#9ca3af;
}
.stamp-button.on,
.stamp-button.running{ background:#22c55e; }
.stamp-button.pause{ background:#f59e0b; }
.stamp-button.off{ background:#9ca3af; }

.stamp-button .label{ display:block; font-weight:700; }
.stamp-button .time{
  display:block;
  font-size:1.7rem;
  margin-top:6px;
  font-variant-numeric:tabular-nums;
}
.stamp-button:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:3px;
}
.stamp-sub{ font-size:.85rem; color:#6b7280; }

/* ===== LIVE WORK BARS ===== */
.panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.panel-head > *{ min-width:0; }

.panel-sub{ display:flex; align-items:center; gap:8px; font-size:.85rem; }
.pill{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  font-weight:600;
  font-size:.75rem;
}

.work-legend{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:8px 0 16px;
  font-size:.85rem;
}
.legend-item{ display:flex; align-items:center; gap:8px; color:#6b7280; }
.legend-dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.legend-dot.blue{ background:#3b82f6; }
.legend-dot.green{ background:#22c55e; }
.legend-dot.orange{ background:#f59e0b; }
.legend-dot.gray{ background:#d1d5db; }

.work-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:14px;
  max-width:100%;
}

/* mobile-first: column */
.work-row{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;

  padding:12px 14px;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid rgba(0,0,0,.04);
  max-width:100%;
}

.work-who{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  width:100%;
}
.work-who img{
  width:44px; height:44px; border-radius:50%;
  background:#e5e7eb;
  flex:0 0 auto;
}

.work-meta{ min-width:0; }
.work-meta strong{ display:block; line-height:1.1; }
.work-task{
  font-size:.9rem;
  color:#6b7280;
  margin-top:2px;
  white-space:normal;
  overflow-wrap:anywhere;
}

.work-when{
  display:flex;
  justify-content:space-between;
  gap:14px;
  font-size:.85rem;
  color:#111827;
  min-width:0;
  width:100%;
}
.work-when .muted{ margin-right:6px; }

.work-bar{
  height:14px;
  border-radius:999px;
  overflow:hidden;
  background:#e5e7eb;
  display:flex;
  width:100%;
  min-width:0;
}
.seg{ height:100%; display:block; }
.seg.blue{ background:#3b82f6; }
.seg.green{ background:#22c55e; }
.seg.orange{ background:#f59e0b; }
.seg.gray{ background:#d1d5db; }

.work-foot{ margin-top:12px; font-size:.85rem; }

/* Desktop: wieder row */
@media (min-width: 900px){
  .work-row{ flex-direction:row; align-items:center; gap:16px; }
  .work-who{ width:auto; }
  .work-when{ width:auto; justify-content:flex-start; }
  .work-bar{ flex:1; }
}

/* ===== CALENDAR ===== */
.cal-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
}
.cal-top > *{ min-width:0; }

.cal-title strong{ display:block; font-size:1.15rem; }
.cal-title span{ display:block; margin-top:2px; font-size:.85rem; }

.cal-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.cal-btn{
  border:none;
  background:#e5e7eb;
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  font-size:.85rem;
}
.cal-btn.primary{
  background:#2563eb;
  color:#fff;
  cursor:not-allowed;
  opacity:.85;
}
.cal-btn:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}

.cal-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  margin:14px 0 18px;
  max-width:100%;
}
.week-nav{
  border:none;
  background:#e5e7eb;
  width:36px;
  height:36px;
  border-radius:50%;
  font-size:1.2rem;
  cursor:not-allowed;
  opacity:.7;
}
.cal-nav-center{ font-size:.85rem; }

/* mobile-first: 2 Spalten */
.cal-days{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-bottom:14px;
  width:100%;
  max-width:100%;
}
@media (min-width: 900px){
  .cal-days{ grid-template-columns:repeat(5, minmax(0, 1fr)); }
}

.cal-day{
  border:1px solid rgba(0,0,0,.06);
  background:#f8fafc;
  border-radius:18px;
  padding:12px;
  text-align:left;
  cursor:pointer;
  transition:transform .08s ease, box-shadow .08s ease, background .08s ease;
  max-width:100%;
}
.cal-day:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(0,0,0,.06);
}
.cal-day.active{
  background:#eef2ff;
  border-color:rgba(37,99,235,.25);
}
.cal-day .wd{ display:block; font-weight:800; }
.cal-day .date{ display:block; font-size:1.25rem; font-weight:900; margin-top:2px; }
.cal-day .mini{ display:block; font-size:.8rem; margin-top:2px; }

.busy{
  display:block;
  height:8px;
  border-radius:999px;
  background:#e5e7eb;
  overflow:hidden;
  margin-top:10px;
}
.busy-fill{
  display:block;
  height:100%;
  background:#2563eb;
  border-radius:999px;
  opacity:.75;
}

.cal-allday{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
  max-width:100%;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  font-size:.85rem;
  font-weight:700;
  background:#f1f5f9;
  border:1px solid rgba(0,0,0,.06);
  max-width:100%;
}
.chip.green{ background:rgba(34,197,94,.10); border-color:rgba(34,197,94,.25); }
.chip.blue{ background:rgba(59,130,246,.10); border-color:rgba(59,130,246,.25); }
.chip.orange{ background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.25); }

/* mobile-first: 1 Spalte */
.cal-split{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  width:100%;
  max-width:100%;
}
@media (min-width: 900px){
  .cal-split{ grid-template-columns:1.2fr .8fr; }
}

.cal-events{
  background:#f8fafc;
  border:1px solid rgba(0,0,0,.06);
  border-radius:18px;
  padding:14px;
  min-height:160px;
  max-width:100%;
}
.cal-empty{
  display:none;
  padding:10px 6px;
  font-size:.9rem;
}

.cal-event{
  display:flex;
  gap:12px;
  padding:12px;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(0,0,0,.05);
  margin-bottom:10px;
  align-items:flex-start;
  max-width:100%;
}
.cal-event:last-child{ margin-bottom:0; }

.cal-event.green{ border-left:6px solid #22c55e; }
.cal-event.blue{ border-left:6px solid #3b82f6; }
.cal-event.orange{ border-left:6px solid #f59e0b; }

.cal-time{
  min-width:62px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#e5e7eb;
  font-weight:900;
  font-size:.85rem;
}
.cal-body{ flex:1; min-width:0; }
.cal-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.cal-sub{ margin-top:3px; font-size:.85rem; overflow-wrap:anywhere; }

.tag{
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border-radius:999px;
  font-size:.75rem;
  font-weight:900;
  background:#f1f5f9;
  border:1px solid rgba(0,0,0,.06);
  max-width:100%;
}
.tag.green{ background:rgba(34,197,94,.10); border-color:rgba(34,197,94,.25); }
.tag.blue{ background:rgba(59,130,246,.10); border-color:rgba(59,130,246,.25); }
.tag.orange{ background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.25); }

.cal-side{ display:flex; flex-direction:column; gap:12px; max-width:100%; }

.cal-side-card{
  background:#fff;
  border:1px solid rgba(0,0,0,.06);
  border-radius:18px;
  padding:14px;
  box-shadow:0 10px 22px rgba(0,0,0,.04);
  max-width:100%;
}
.cal-side-card p{ margin:8px 0 0; font-size:.9rem; overflow-wrap:anywhere; }

.cal-events .cal-event.is-off{ display:none !important; }

/* ===== MODALS (gemeinsam) ===== */
body.no-scroll{ overflow:hidden; }
.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;
}

/* ===== TEAM MODAL ===== */
.team-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
  max-width:100%;
}
.team-modal.is-open{ display:block; }

.team-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.55);
}

.team-modal__panel{
  position:absolute;
  right:18px;
  top:18px;
  bottom:18px;
  width:min(520px, calc(100% - 36px));
  background:#fff;
  border-radius:22px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  max-width:calc(100% - 36px);
}

/* Extra-sicher für sehr schmale Screens */
@media (max-width: 520px){
  .team-modal__panel{
    left:18px;
    right:18px;
    width:auto;
  }
}

.team-modal__head{
  padding:16px 18px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.team-modal__close{
  border:none;
  background:#e5e7eb;
  width:36px;
  height:36px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}
.team-modal__controls{
  padding:14px 18px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  border-bottom:1px solid rgba(0,0,0,.06);
  background:#f8fafc;
}
.team-search input{
  width:240px;
  max-width:100%;
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  padding:10px 12px;
  font-weight:600;
  outline:none;
}
.team-search input:focus{
  border-color:rgba(37,99,235,.35);
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}
.team-filter{
  display:flex;
  gap:8px;
  background:#e5e7eb;
  padding:4px;
  border-radius:999px;
  flex-wrap:wrap;
  max-width:100%;
}
.team-filter button{
  border:none;
  background:transparent;
  padding:7px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  font-size:.85rem;
}
.team-filter button.active{
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.10);
}
.team-modal__list{
  padding:14px 12px 12px;
  overflow:auto;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:100%;
}
.team-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,.06);
  background:#fff;
  max-width:100%;
}
.team-item__who{ display:flex; align-items:center; gap:10px; min-width:0; }
.team-item img{
  width:40px; height:40px;
  border-radius:50%;
  background:#e5e7eb;
  flex:0 0 auto;
}
.team-item__sub{ font-size:.85rem; overflow-wrap:anywhere; }
.team-item__badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:.8rem;
  border:1px solid rgba(0,0,0,.06);
  background:#f8fafc;
  white-space:nowrap;
}
.team-item__badge .dot{
  width:10px; height:10px; border-radius:50%;
  background:#d1d5db;
}
.team-item__badge.on .dot{ background:#22c55e; }
.team-item__badge.pause .dot{ background:#f59e0b; }
.team-item__badge.off .dot{ background:#9ca3af; }

.team-empty{ padding:10px 6px; font-size:.9rem; }
.team-modal__foot{
  padding:12px 18px 14px;
  border-top:1px solid rgba(0,0,0,.06);
  background:#f8fafc;
  font-size:.85rem;
}

/* ===== STAMP MODAL ===== */
.stamp-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:10000;
  max-width:100%;
}
.stamp-modal.is-open{ display:block; }

.stamp-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.55);
}
.stamp-modal__panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(560px, calc(100% - 36px));
  max-height:calc(100% - 36px);
  background:#fff;
  border-radius:22px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  max-width:calc(100% - 36px);
}
.stamp-modal__head{
  padding:16px 18px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.stamp-modal__close{
  border:none;
  background:#e5e7eb;
  width:36px;
  height:36px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}
.stamp-modal__content{
  padding:16px 18px 10px;
  overflow:auto;
}
.stamp-modal__hero{
  background:#f8fafc;
  border:1px solid rgba(0,0,0,.06);
  border-radius:18px;
  padding:14px;
  text-align:center;
  margin-bottom:14px;
}
.stamp-modal__hero .badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:.85rem;
  background:#e5e7eb;
}
.stamp-modal__hero .bigtime{
  margin-top:8px;
  font-size:2rem;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}

.stamp-form{ margin:12px 0; }
.field .label{
  display:block;
  font-weight:800;
  font-size:.85rem;
  margin-bottom:6px;
}
.field .input{
  width:100%;
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  padding:10px 12px;
  font-weight:600;
  outline:none;
}
.field .input:focus{
  border-color:rgba(37,99,235,.35);
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}


/* --- Kompatibilität: BEM-Varianten (im Dashboard verwendet) --- */
.field__label{
  display:block;
  font-weight:800;
  font-size:.85rem;
  margin-bottom:6px;
}
.field__input{
  width:100%;
  height:44px;
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  padding:10px 12px;
  font-weight:600;
  outline:none;
  background:#fff;
}
.field__input:focus{
  border-color:rgba(37,99,235,.35);
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

.stamp-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  margin-top:10px;
}
.act-btn{
  border:none;
  background:#e5e7eb;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  font-size:.9rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.act-btn.primary{ background:#22c55e; color:#fff; }
.act-btn.danger{ background:#ef4444; color:#fff; }
.act-btn:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}
@media (max-width: 520px){
  .stamp-actions{ justify-content:stretch; }
  .act-btn{ flex:1 1 auto; }
}

.stamp-hint{ margin-top:10px; font-size:.9rem; }
.stamp-modal__foot{
  padding:12px 18px 14px;
  border-top:1px solid rgba(0,0,0,.06);
  background:#f8fafc;
  font-size:.85rem;
}

/* ==========================
   STAMPUHR – Ergänzungen
   ========================== */

.stamp-button .start{
  display:block;
  margin-top:6px;
  font-size:.85rem;
  opacity:.92;
}

.stamp-modal__hero .startline{
  margin-top:6px;
  font-size:.9rem;
}

.stamp-manual{
  margin-top:14px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background:rgba(0,0,0,.08);
  overflow:hidden;
}

.stamp-manual__summary{
  cursor:pointer;
  padding:10px 12px;
  list-style:none;
  font-weight:600;
  user-select:none;
}

.stamp-manual__summary::-webkit-details-marker{ display:none; }

.stamp-manual__summary::after{
  content:"▾";
  float:right;
  opacity:.7;
}

.stamp-manual[open] .stamp-manual__summary::after{
  content:"▴";
}

.stamp-manual__body{
  padding:12px;
  border-top:1px solid rgba(255,255,255,.10);
}

.stamp-form--manual{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}

@media (max-width: 520px){
  .stamp-form--manual{ grid-template-columns: 1fr; }
}

.stamp-manual__actions{
  display:flex;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}


/* --------------------------------------------
   Header Actions (auto role, no toggle needed)
-------------------------------------------- */
.dash-header-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.dash-header-actions{
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
  text-align:right;
}

.presence-top .presence-quick{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.presence-top .presence-hint{
  margin-top:6px;
}
/* ============================================================
   PERSON ACTIONS (Teamlead) – click menu via <details>/<summary>
   ============================================================ */

/* Make sure menus can overflow grid items + stable anchor for absolute trigger */
.people-grid .person{
  overflow: visible;
  position: relative;
}

.people-grid .person .person-avatar{
  position: relative;
  display: inline-block;
  line-height: 0;
}

.person-actions{
  position:absolute;
  top:6px;
  right:6px;
  z-index:3;
}

/* the "…" button */
.person-actions > summary{
  list-style:none;
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.10);
  background:rgba(255,255,255,.92);
  box-shadow:0 8px 18px rgba(15,23,42,.08);
  cursor:pointer;
  user-select:none;
  font-weight:900;
  letter-spacing:.02em;
}
.person-actions > summary:focus{ outline:none; }
.person-actions > summary:focus-visible{
  outline:2px solid rgba(37,99,235,.45);
  outline-offset:2px;
}

/* hide default marker */
.person-actions > summary::-webkit-details-marker{ display:none; }
.person-actions > summary::marker{ content:""; }



/* show ellipsis even if <summary> is empty */
.person-actions__btn::before{
  content:"⋯";
  font-size:18px;
  line-height:1;
}

.person-actions[open] > summary{
  background:#fff;
  border-color:rgba(0,0,0,.16);
  box-shadow:0 12px 28px rgba(15,23,42,.14);
}

/*
  Dropdown menu positioning:
  - Menu is placed using JS with `position:fixed` so it cannot be clipped
    by containers and can be clamped inside the viewport.
  - JS also toggles `.is-flipped` when the menu is rendered above the trigger.
*/
.person-actions__menu{
  position:fixed;
  top:0;
  left:0;
  min-width:260px;
  max-width:320px;
  padding:8px;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(0,0,0,.10);
  box-shadow:0 18px 45px rgba(15,23,42,.18);
  transform-origin:top right;
  animation:personMenuIn .12s ease-out;
  z-index:1000;
  visibility:hidden; /* becomes visible after JS positioned it */
}

/* little arrow */
.person-actions__menu::before{
  content:"";
  position:absolute;
  top:-8px;
  right:12px;
  width:14px;
  height:14px;
  background:#fff;
  border-left:1px solid rgba(0,0,0,.10);
  border-top:1px solid rgba(0,0,0,.10);
  transform:rotate(45deg);
}

/* If menu is shown above the trigger, move arrow to the bottom */
.person-actions__menu.is-flipped::before{
  top: auto;
  bottom: -8px;
  transform: rotate(225deg);
}

@keyframes personMenuIn{
  from{ opacity:0; transform:translateY(-4px) scale(.98); }
  to  { opacity:1; transform:translateY(0) scale(1); }
}


.person-actions__item{
  width:100%;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:none;
  background:transparent;
  cursor:pointer;
  text-align:left;
  font:inherit;
}


.person-actions__ico{
  width:22px;
  flex:0 0 22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
}

.person-actions__item:hover{ background:#f1f5f9; }
.person-actions__item:active{ transform:translateY(1px); }
.person-actions__item .sub{ font-size:.85rem; opacity:.75; }

.person-actions__item.danger{ color:#b91c1c; }
.person-actions__item.danger:hover{ background:rgba(185,28,28,.07); }

.person-actions__sep{
  height:1px;
  margin:6px 8px;
  background:rgba(15,23,42,.10);
  border-radius:999px;
}

/* Keep menu inside viewport on very small screens */
@media (max-width: 420px){
  .person-actions__menu{
    min-width: 220px;
    max-width: calc(100vw - 36px);
  }
}

/* Optional: actions for modal rows (future JS) */
.team-item{ position:relative; overflow:visible; }
.team-item-actions{
  position:relative;
  margin-left:10px;
  flex:0 0 auto;
}
.team-item-actions > summary{
  list-style:none;
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  cursor:pointer;
}
.team-item-actions > summary::-webkit-details-marker{ display:none; }
.team-item-actions > summary::marker{ content:""; }
.team-item-actions__menu{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:260px;
  padding:8px;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(0,0,0,.10);
  box-shadow:0 18px 45px rgba(15,23,42,.18);
  z-index:50;
}


/* Urlaub & Abwesenheit: keine Bullets */
.absence-list{
  list-style:none;
  margin:0;
  padding:0;
}

/* Anwesenheit-Buttons: aktiv markieren */
.presence-quick .act-btn.is-active{
  background:#2563eb;
  color:#fff;
}
/* ============================================================
   MOBILE CENTERING FIXES
   (nachträglich: bessere Mittigkeit in der Handysicht)
   ============================================================ */

/* Header + Presence in der Handysicht mittig */
@media (max-width: 700px){
  .dash-header-row{
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .dash-header-row > div{
    width: 100%;
    text-align: center;
  }

  .dash-header-actions{
    width: 100%;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .presence-top .presence-quick{
    justify-content: center;
  }

  .presence-top .presence-hint{
    text-align: center;
  }
}

/* Team-Panel: Titel/Button/Chips mittig + besseres Wrapping */
@media (max-width: 520px){
  .team-head{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .team-title{
    white-space: normal;      /* statt Ellipsis -> auf mobile lieber umbrechen */
    text-align: center;
  }

  .team-open{
    width: 100%;
    max-width: 240px;
  }

  .team-stats{
    justify-content: center;
  }
}

/* Work-Panel: Überschrift/Legende/Zeiten in der Handysicht mittiger */
@media (max-width: 520px){
  .panel-head{
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .work-legend{
    justify-content: center;
  }

  .work-who{
    justify-content: center;
  }

  .work-when{
    justify-content: center;
  }
}

/* Kalender: Kopf + Actions mittig auf mobile */
@media (max-width: 520px){
  .cal-top{
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cal-actions{
    justify-content: center;
  }

  .cal-allday{
    justify-content: center;
  }
}

/* ===== TEAM PREVIEW PAGER (Karussell mit ▲/▼) ===== */
.team-pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
}
.team-pager__btn{
  flex:0 0 auto;
  border:none;
  background:#e5e7eb;
  width:38px;
  height:30px;
  border-radius:10px;
  cursor:pointer;
  font-weight:900;
  line-height:1;
}
.team-pager__btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
.team-pager__info{
  flex:1 1 auto;
  text-align:center;
  font-weight:800;
  font-size:.85rem;
  color:#6b7280;
}
/* Safety: falls noch irgendwo der alte "+X mehr" erzeugt wird */
.person-more{ display:none !important; }

/* ================= MODAL: PASSWORT RESET (Dashboard) ================= */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  /* Zentrierung */
  padding: 24px 16px;
}
.modal.is-open{
  display: grid;
  place-items: center;
}

.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(2px);
}

.modal__dialog{
  position: relative;
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.30);
  overflow: hidden;
  transform: translateY(6px);
  animation: modalIn .14s ease-out forwards;

  /* ✅ FIX: nie höher als Viewport + innerer Scroll (mobile-first) */
  display:flex;
  flex-direction:column;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
}

@keyframes modalIn{
  to{ transform: translateY(0); }
}

.modal__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.modal__head-text{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.modal__title{
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.15;
}

.modal__subtitle{
  font-size: .92rem;
  opacity: .75;
}

.modal__close{
  background: transparent;
  border: 0;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 10px;
}
.modal__close:hover{
  background: rgba(0,0,0,.05);
}

.modal__body{
  padding: 16px 20px 18px;
  display: grid;
  gap: 12px;

  /* ✅ FIX: Body scrollt im Dialog */
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal__note{
  font-size: .9rem;
  opacity: .75;
}

.modal__actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.modal__msg{
  font-size: .95rem;
  min-height: 1.2em;
}
.modal__msg.ok{ color: #137333; }
.modal__msg.bad{ color: #b3261e; }

/* ✅ Inputs im Modal wertiger */
#modal-reset-password .field__input,
#modal-reset-password .field .input{
  width: 100%;
  height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17,24,39,.03);
  border: 1px solid rgba(17,24,39,.14);
  font-size: 15px;
  font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

#modal-reset-password .field__input:focus,
#modal-reset-password .field .input:focus{
  outline: none;
  background: #fff;
  border-color: rgba(17,24,39,.55);
  box-shadow: 0 0 0 4px rgba(17,24,39,.10);
}
/* =============================
   Modal: Mitarbeiter bearbeiten
   ============================= */
.modal__dialog--wide{
  width: min(980px, 100%);
}

#modal-edit-member .modal__body{
  gap: 14px;
}

#modal-edit-member .em-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

#modal-edit-member .em-section{
  background: rgba(17,24,39,.02);
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 16px;
  padding: 14px 14px 10px;
}

#modal-edit-member .em-title{
  margin: 0 0 10px;
  font-size: .98rem;
  font-weight: 850;
}

#modal-edit-member .em-fields{
  display: grid;
  gap: 12px;
}

#modal-edit-member .em-fields--2{
  grid-template-columns: 1fr;
}

#modal-edit-member .em-span-2{
  grid-column: 1 / -1;
}

@media (min-width: 820px){
  #modal-edit-member .em-grid{ grid-template-columns: 1fr 1fr; }
  #modal-edit-member .em-fields--2{ grid-template-columns: 1fr 1fr; }
}

#modal-edit-member .field__label{
  display:block;
  font-size:.86rem;
  opacity:.75;
  margin-bottom:6px;
  font-weight:650;
}

#modal-edit-member .field__input{
  width:100%;
  height:46px;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(17,24,39,.03);
  border: 1px solid rgba(17,24,39,.14);
  font-size:15px;
  font-weight:600;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

#modal-edit-member .field__input:focus{
  outline:none;
  background:#fff;
  border-color: rgba(17,24,39,.55);
  box-shadow: 0 0 0 4px rgba(17,24,39,.10);
}

#modal-edit-member .field__input[type="file"]{
  height:auto;
  padding:12px;
  font-weight:550;
}

/* Switch */
#modal-edit-member .em-switch-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 6px 0 2px;
}

#modal-edit-member .em-switch{
  display:inline-flex;
  align-items:center;
  gap:10px;
  user-select:none;
}

#modal-edit-member .em-switch input{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
}

#modal-edit-member .em-switch__track{
  position:relative;
  width:54px;
  height:30px;
  border-radius:999px;
  background: rgba(17,24,39,.18);
  border: 1px solid rgba(17,24,39,.18);
  transition: background .16s ease, border-color .16s ease;
  flex: 0 0 auto;
}

#modal-edit-member .em-switch__track::after{
  content:"";
  position:absolute;
  top:50%;
  left:3px;
  width:24px;
  height:24px;
  border-radius:999px;
  background:#fff;
  transform: translateY(-50%);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  transition: transform .16s ease;
}

#modal-edit-member .em-switch input:checked + .em-switch__track{
  background:#16a34a;
  border-color: rgba(22,163,74,.55);
}

#modal-edit-member .em-switch input:checked + .em-switch__track::after{
  transform: translate(24px, -50%);
}

#modal-edit-member .em-switch__text{
  font-weight:750;
  font-size:.92rem;
  opacity:.85;
}

/* Unlimited => datetimes optisch disabled */
#modal-edit-member.is-unlimited #em-gueltig-von,
#modal-edit-member.is-unlimited #em-gueltig-bis{
  opacity:.55;
  background: rgba(17,24,39,.02);
}



/* ================= MODAL: STUNDEN PLANEN (Sollstunden / Tagesplan) =================
   Ziel: gleiche Wertigkeit wie andere Dashboard-Dialoge.
   Markup kommt aus dashboard.html + dashboard.js (Klassen: ph-*)
   ================================================================================ */

#modal-plan-hours .modal__body{
  gap:14px; /* etwas luftiger als default */
}

/* Actions in diesem Modal immer sichtbar (ohne das Verhalten anderer Modals zu ändern) */
#modal-plan-hours .modal__actions{
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 14px;
}

/* ---------- Overview (Monatsliste) ---------- */
#modal-plan-hours .ph-list{
  display:grid;
  gap:10px;
  margin-top:12px;
}

#modal-plan-hours .ph-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:16px;
  background: rgba(17,24,39,.02);
  border: 1px solid rgba(17,24,39,.08);
}

#modal-plan-hours .ph-label{
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 850;
  color:#111827;
  font-size:.92rem;
}

#modal-plan-hours .ph-input{
  width: 140px;
  height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(17,24,39,.03);
  border: 1px solid rgba(17,24,39,.14);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}

#modal-plan-hours .ph-input:focus{
  outline: none;
  background:#fff;
  border-color: rgba(17,24,39,.55);
  box-shadow: 0 0 0 4px rgba(17,24,39,.10);
}

#modal-plan-hours .ph-open{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background:#e5e7eb;
  cursor:pointer;
  font-weight: 900;
  font-size: 1.2rem;
  line-height: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}

#modal-plan-hours .ph-open:hover{
  transform: translateY(-1px);
  background:#dbe2ea;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}

#modal-plan-hours .ph-open:focus-visible{
  outline:2px solid rgba(37,99,235,.35);
  outline-offset:2px;
}

@media (max-width: 520px){
  #modal-plan-hours .ph-row{ padding:10px; }
  #modal-plan-hours .ph-input{ width: 120px; }
  #modal-plan-hours .ph-open{ width: 40px; height: 40px; }
}

/* ---------- Month (Tagessicht) ---------- */
#modal-plan-hours .ph-month-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

#modal-plan-hours .ph-month-title{
  flex:1 1 auto;
  min-width:0;
}

#modal-plan-hours .ph-month-toolbar{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin: 6px 0 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(17,24,39,.02);
  border: 1px solid rgba(17,24,39,.08);
}

#modal-plan-hours .ph-month-toolbar .field{
  display:flex;
  flex-direction:column;
  gap:6px;
  width: min(320px, 100%);
}

#modal-plan-hours #planHoursDefaultValue{
  width: 100%;
}

#modal-plan-hours .ph-month-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top: 10px;
}


/* Wenn die Monatsansicht als Kalender gerendert wird (ph-cal),
   darf der Container NICHT in 2 Spalten splitten. */
#modal-plan-hours .ph-month-grid.ph-month-grid--calendar{
  display:block;
}
@media (min-width: 860px){
  #modal-plan-hours .ph-month-grid.ph-month-grid--calendar{
    grid-template-columns: 1fr; /* Safety, falls grid irgendwo reinwirkt */
  }
}

/* auf größeren Screens 2 Spalten, damit’s nicht „endlos“ wirkt */
@media (min-width: 860px){
  #modal-plan-hours .ph-month-grid{
    grid-template-columns: 1fr 1fr;
  }
}


/* ---------- Month Mobile (Tagespläne) ---------- */
#modal-plan-hours #planHoursMonthMobile{ display:none; }
#modal-plan-hours #planHoursMonthGrid{ display:block; }

@media (max-width: 740px){
  /* Desktop-Kalender/Tools auf Mobile ausblenden (Desktop bleibt unangetastet) */
  #modal-plan-hours #planHoursMonthGrid{ display:none; }
  #modal-plan-hours #planHoursMonthTools{ display:none; }
  #modal-plan-hours #planHoursMonthMobile{ display:block; }

  #modal-plan-hours .ph-mcal-week{
    border: 1px solid rgba(17,24,39,.08);
    background: #fff;
    border-radius: 18px;
    padding: 12px;
    margin-top: 10px;
  }

  #modal-plan-hours .ph-mcal-week__head{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:10px;
    margin-bottom: 10px;
  }

  #modal-plan-hours .ph-mcal-days{
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  #modal-plan-hours .ph-mcal-item{
    position: relative;
  }

  #modal-plan-hours .ph-mcal-day{
    width: 100%;
    border: 1px solid rgba(17,24,39,.10);
    border-radius: 14px;
    padding: 10px 8px;
    background: rgba(17,24,39,.02);
    text-align:left;
    cursor: pointer;
  }

  #modal-plan-hours .ph-mcal-day.is-active{
    background: rgba(37,99,235,.08);
    border-color: rgba(37,99,235,.25);
  }

  #modal-plan-hours .ph-mcal-day.is-today{
    outline: 2px solid rgba(37,99,235,.35);
  }

  #modal-plan-hours .ph-mcal-day.is-off{
    opacity: .85;
  }

  #modal-plan-hours .ph-mcal-day__top{
    display:flex;
    justify-content:space-between;
    font-weight: 800;
    line-height: 1.1;
  }

  #modal-plan-hours .ph-mcal-dow{
    font-size: 12px;
    opacity: .75;
  }

  #modal-plan-hours .ph-mcal-dom{
    font-size: 14px;
  }

  #modal-plan-hours .ph-mcal-day__val{
    margin-top: 6px;
    font-weight: 900;
    font-size: 14px;
  }

  /* Bottom sheet */
  #modal-plan-hours .ph-sheet[hidden]{ display:none; }
  #modal-plan-hours .ph-sheet{
    position: fixed;
    inset: 0;
    z-index: 9999;
  }
  #modal-plan-hours .ph-sheet__backdrop{
    position:absolute;
    inset:0;
    background: rgba(0,0,0,.35);
  }
  #modal-plan-hours .ph-sheet__panel{
    position:absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px 18px 0 0;
    background: #fff;
    padding: 14px 14px 18px;
    box-shadow: 0 -20px 40px rgba(0,0,0,.18);
  }
  #modal-plan-hours .ph-sheet__title{
    font-weight: 900;
    font-size: 16px;
    margin-bottom: 10px;
  }
  #modal-plan-hours .ph-sheet__row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(17,24,39,.08);
  }
  #modal-plan-hours .ph-sheet__row:first-of-type{
    border-top: 0;
  }
  #modal-plan-hours .ph-sheet__input{
    width: 140px;
    max-width: 45vw;
  }
  #modal-plan-hours .ph-sheet__actions{
    display:flex;
    gap: 10px;
    justify-content:flex-end;
    margin-top: 12px;
  }
}

/* Eine Tageszeile */
#modal-plan-hours .ph-day{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:16px;
  background:#fff;
  border: 1px solid rgba(0,0,0,.08);
}

#modal-plan-hours .ph-day.is-today{
  background:#eef2ff;
  border-color: rgba(37,99,235,.25);
}

#modal-plan-hours .ph-day-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex:1 1 auto;
}

/* Checkbox moderner + gut klickbar */
#modal-plan-hours .ph-day-left input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor:pointer;
}

#modal-plan-hours .ph-day-label{
  font-weight: 800;
  font-size: .95rem;
  white-space:nowrap;
}

#modal-plan-hours .ph-day .ph-input{
  width: 120px;
}

#modal-plan-hours .ph-day .ph-input:disabled{
  opacity: .55;
  cursor: not-allowed;
  background: rgba(17,24,39,.02);
}

/* Kleine Screens: Inputs sollen nicht zu schmal sein */
@media (max-width: 420px){
  #modal-plan-hours .ph-day{ padding:10px; }
  #modal-plan-hours .ph-day .ph-input{ width: 110px; }
}


/* =======================================================================
   Stunden planen – Kalender-Layout (Monats-Tagessicht)
   ======================================================================= */


#modal-plan-hours .ph-cal{
  display:block;
  overflow-x:auto;
  padding-bottom: 6px;
}

/* 8 Spalten: KW | Mo..So (Wochensumme steht in der KW-Kachel) */
#modal-plan-hours .ph-cal-head,
#modal-plan-hours .ph-cal-week{
  display:grid;
  grid-template-columns: 72px repeat(7, 1fr);
  gap: 10px;
  min-width: 860px;
}

#modal-plan-hours .ph-cal-head{
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  padding: 6px 0 10px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}

#modal-plan-hours .ph-cal-hcell{
  text-align:center;
  font-weight: 800;
  font-size: .9rem;
  color: rgba(17,24,39,.75);
  letter-spacing: .02em;
  align-self:center;
}

#modal-plan-hours .ph-cal-hcell--kw{
  text-align:left;
  padding-left: 8px;
}

#modal-plan-hours .ph-cal-hcell.is-weekend{
  color: rgba(17,24,39,.35);
}

#modal-plan-hours .ph-cal-body{
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding-top: 10px;
  min-width: 860px;
}

#modal-plan-hours .ph-cal-week{
  align-items: stretch;
}

#modal-plan-hours .ph-cal-week.is-current-week{
  position: relative;
}
#modal-plan-hours .ph-cal-week.is-current-week::before{
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 99px;
  background: rgba(37,99,235,.6);
}

#modal-plan-hours .ph-cal-kw{
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 16px;
  background: rgba(17,24,39,.02);
  padding: 12px 10px;
  font-weight: 900;
  color: rgba(17,24,39,.70);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:2px;
}

#modal-plan-hours .ph-cal-kw-top{
  font-weight: 900;
  line-height: 1.1;
}

#modal-plan-hours .ph-cal-kw-sum{
  font-size: .78rem;
  font-weight: 800;
  color: rgba(17,24,39,.55);
  line-height: 1.1;
}

#modal-plan-hours .ph-cal-active{
  display: none !important; /* Checkbox bleibt für POST, ist aber nicht Teil der UX */
}

#modal-plan-hours .ph-cal-cell{
  position: relative;
  border: 1px solid rgba(17,24,39,.08);
  border-radius: 16px;
  background: #fff;
  padding: 12px 12px 10px;
  min-height: 92px;

  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}

#modal-plan-hours .ph-cal-cell.is-weekend{
  background: rgba(17,24,39,.015);
}

#modal-plan-hours .ph-cal-cell.is-holiday{
  background: rgba(220,38,38,.03);
  border-color: rgba(220,38,38,.16);
}

#modal-plan-hours .ph-cal-cell.is-out{
  background: rgba(17,24,39,.02);
  border-style: dashed;
  opacity: .55;
}

#modal-plan-hours .ph-cal-cell.is-today{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}

#modal-plan-hours .ph-cal-daynum{
  position:absolute;
  top: 10px;
  right: 12px;
  font-weight: 900;
  font-size: .95rem;
  color: rgba(17,24,39,.70);
}

#modal-plan-hours .ph-cal-top{
  position:absolute;
  top: 10px;
  left: 12px;
  display:flex;
  align-items:center;
  gap: 8px;
}

#modal-plan-hours .ph-cal-check{
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
  cursor: pointer;
}

#modal-plan-hours .ph-cal-input{
  width: 100%;
  text-align: right;
  font-weight: 800;
  padding: 10px 12px;
}

#modal-plan-hours .ph-cal-input:disabled{
  opacity: .55;
  cursor: not-allowed;
  background: rgba(17,24,39,.02);
}

#modal-plan-hours .ph-cal-holiday{
  position:absolute;
  left: 12px;
  bottom: 10px;
  max-width: calc(100% - 24px);
  font-size: .72rem;
  font-weight: 800;
  color: rgba(220,38,38,.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Out-of-month placeholder */
#modal-plan-hours .ph-cal-ghost{
  height: 40px;
}

/* Optional: wenn du Sa/So komplett ausblenden willst (Mo–Fr Only), aktivieren:
#modal-plan-hours .ph-cal-head,
#modal-plan-hours .ph-cal-week{ grid-template-columns: 72px repeat(5, 1fr); min-width: 680px; }
#modal-plan-hours .ph-cal-body{ min-width: 760px; }
#modal-plan-hours .ph-cal-hcell.is-weekend,
#modal-plan-hours .ph-cal-cell.is-weekend{ display:none; }
*/


/* ------------------------------------------------------------------------------------
   Kalender: kompakter + Bulk-Markierung (Mo-So / Woche / Werktage / Wochenende)
------------------------------------------------------------------------------------ */
#planHoursMonthTools.ph-cal-tools{
  display:flex;
  gap:12px;
  align-items:flex-end;
  justify-content:space-between;
  padding:10px 12px;
  margin:10px 0 12px;
  border:1px solid var(--border, rgba(0,0,0,.08));
  border-radius:14px;
  background:rgba(255,255,255,.75);
  backdrop-filter:saturate(120%) blur(6px);
}

#planHoursMonthTools .ph-cal-tools__left{ flex: 1 1 auto; min-width: 420px; }
#planHoursMonthTools .ph-cal-tools__right{ flex: 0 0 auto; min-width: 260px; }

#planHoursMonthTools .ph-cal-tools__title{
  font-weight:700;
  margin-bottom:6px;
}
#planHoursMonthTools .ph-cal-tools__btnrow{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-bottom:6px;
}
#planHoursMonthTools .ph-cal-tools__btnrow--dow{ margin-bottom:0; }

#planHoursMonthTools .ph-cal-tools__count{
  margin-left:6px;
  font-weight:600;
  opacity:.8;
}

#planHoursMonthTools .ph-cal-tools__hint{
  font-size:12px;
  margin-top:6px;
}

#planHoursMonthTools .ph-cal-tools__field{ display:block; }
#planHoursMonthTools .ph-cal-tools__label{ display:block; font-size:12px; margin-bottom:6px; }
#planHoursMonthTools .ph-cal-tools__apply{ display:flex; gap:8px; align-items:center; }

#planHoursMonthTools .ph-cal-tools__input{
  width:120px;
  height:36px;
  border-radius:12px;
  border:1px solid var(--border, rgba(0,0,0,.12));
  padding:0 10px;
}

.ph-tool{
  border:1px solid var(--border, rgba(0,0,0,.12));
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  background:#fff;
  cursor:pointer;
  line-height:1;
}
.ph-tool:hover{ filter:brightness(.98); }
.ph-tool--primary{
  background: var(--primary, #22c55e);
  color:#fff;
  border-color: transparent;
}

@media (max-width: 900px){
  #planHoursMonthTools.ph-cal-tools{
    flex-direction:column;
    align-items:stretch;
  }
  #planHoursMonthTools .ph-cal-tools__left,
  #planHoursMonthTools .ph-cal-tools__right{
    min-width: 0;
  }
}

/* kompakter Kalender */
.ph-cal .ph-cal-head{
  position:sticky;
  top:0;
  z-index:3;
  background: linear-gradient(to bottom, rgba(255,255,255,.98), rgba(255,255,255,.90));
  backdrop-filter:saturate(120%) blur(6px);
}
.ph-cal .ph-cal-hcell{
  padding:10px 8px;
  font-size:13px;
}
.ph-cal .ph-cal-week{
  gap:10px;
  padding:8px 0;
}
.ph-cal .ph-cal-kw{
  padding:10px 10px;
  font-size:13px;
  cursor:pointer;
  user-select:none;
}
.ph-cal .ph-cal-cell{
  min-height:64px;
  padding:8px;
  border-radius:12px;
}
.ph-cal .ph-cal-top{ gap:8px; }
.ph-cal .ph-cal-input{
  height:30px;
  border-radius:10px;
  padding:0 8px;
  font-size:12.5px;
}
.ph-cal .ph-cal-check{ width:16px; height:16px; }

/* Auswahl-Markierung */
.ph-cal .ph-cal-cell.is-selected{
  outline:2px solid rgba(59,130,246,.55);
  box-shadow:0 0 0 4px rgba(59,130,246,.12);
}
.ph-cal .ph-cal-week.is-week-selected .ph-cal-kw{
  background: rgba(59,130,246,.10);
  border-color: rgba(59,130,246,.25);
}



/* --- Override: Kein sichtbares '…' über dem Avatar; Klick erfolgt über Avatar/Details --- */
.person-actions{
  top:0;
  right:0;
  left:0;
  bottom:0;
}
.person-actions > summary{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background:transparent;
  border:0;
  box-shadow:none;
}
.person-actions__btn::before{ content:""; }



/* =============================================================================
   PlanHours Kalender – UX Vereinfachung
   - Standardwert-Panel ausblenden (Default wird über "Stunden pro Tag" gesteuert)
   - kompaktere Zellen
============================================================================= */
#modal-plan-hours .ph-month-toolbar{
  display:none !important;
}

/* kompakter Kalender */
#modal-plan-hours .ph-cal-cell{
  padding: 10px 10px 8px;
  min-height: 76px;
  border-radius: 14px;
}
#modal-plan-hours .ph-cal-daynum{
  top: 8px;
  right: 10px;
  font-size: .9rem;
}
#modal-plan-hours .ph-cal-input{
  padding: 6px 10px;
  border-radius: 12px;
}

/* Tools rechts: zwei Felder (pro Tag + Gesamt) */
#planHoursMonthTools .ph-cal-tools__right{
  min-width: 320px;
}
#planHoursMonthTools .ph-cal-tools__field{
  margin-bottom: 8px;
}
#planHoursMonthTools .ph-cal-tools__field:last-child{
  margin-bottom: 0;
}


/* Monatsübersicht: Wert nur anzeigen (kein editierbares Feld) */
#modal-plan-hours .ph-value{
  min-width: 96px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#modal-plan-hours .ph-row{
  display:flex;
  align-items:center;
  gap: 12px;
}

#modal-plan-hours .ph-label{
  flex: 1 1 auto;
  font-weight: 700;
}

#modal-plan-hours .ph-open{
  margin-left: 0;
}



/* =======================================================================
   MOBILE v4 – Stunden planen (Kalender) wirklich ohne Horizontal-Scroll
   Desktop bleibt unverändert, weil alles nur <= 720px gilt.
   ======================================================================= */
@media (max-width: 720px){

  /* Modal darf auf iOS nicht breiter als der sichtbare Bereich sein */
  #modal-plan-hours.modal{
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  #modal-plan-hours .modal__dialog{
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  /* Body: kein X-Overflow, kompakter */
  #modal-plan-hours .modal__body{
    overflow-x: hidden !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Footer Buttons: untereinander (sonst drückt iOS gern in X) */
  #modal-plan-hours .modal__actions{
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  #modal-plan-hours .modal__actions .act-btn{
    width: 100% !important;
    justify-content: center;
  }

  /* Tools: keine min-widths, sondern sauber umbrechen */
  #planHoursMonthTools.ph-cal-tools{
    flex-direction: column;
    align-items: stretch;
  }
  #planHoursMonthTools .ph-cal-tools__left,
  #planHoursMonthTools .ph-cal-tools__right{
    min-width: 0 !important;
    width: 100% !important;
  }
  #planHoursMonthTools .ph-cal-tools__btnrow{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  #planHoursMonthTools .ph-cal-tools__btnrow::-webkit-scrollbar{ display:none; }

  /* Kalender: komplett weg von min-width 860 + overflow-x */
  #modal-plan-hours .ph-cal{
    overflow-x: hidden !important;
    padding-bottom: 0 !important;
  }
  #modal-plan-hours .ph-cal-body{
    min-width: 0 !important;
    width: 100% !important;
  }
  #modal-plan-hours .ph-cal-head{ display:none !important; }

  /* Jede Woche als Card, Tage als 2-Spalten Grid */
  #modal-plan-hours .ph-cal-week{
    min-width: 0 !important;
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;

    padding: 10px !important;
    margin: 0 0 12px !important;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    background: rgba(255,255,255,.70);
  }

  /* KW Kopf über volle Breite */
  #modal-plan-hours .ph-cal-kw{
    grid-column: 1 / -1 !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;

    padding: 10px 12px !important;
    border-radius: 14px !important;
  }

  /* Tageskachel kompakter + schrumpfbar */
  #modal-plan-hours .ph-cal-cell{
    min-width: 0 !important;
    padding: 10px 10px 8px !important;
    min-height: 84px !important;
  }

  /* Weekday-Label (aus JS: data-dow-label) */
  #modal-plan-hours .ph-cal-cell::before{
    content: attr(data-dow-label);
    position: absolute;
    top: 10px;
    left: 12px;
    font-weight: 850;
    font-size: 12px;
    opacity: .72;
  }

  /* Checkbox/Top-Leiste ausblenden – wir markieren per Tap auf Zelle */
  #modal-plan-hours .ph-cal-top{ display:none !important; }

  #modal-plan-hours .ph-cal-daynum{
    top: 10px !important;
    right: 10px !important;
    font-size: .9rem !important;
  }

  #modal-plan-hours .ph-cal-input{
    height: 40px;
    font-size: 16px; /* verhindert iOS-Zoom */
    border-radius: 12px;
    margin-top: 22px;
  }

  #modal-plan-hours .ph-cal-holiday{
    left: 10px;
    bottom: 8px;
    max-width: calc(100% - 20px);
  }
}

/* Ultra-klein: 1 Spalte */
@media (max-width: 380px){
  #modal-plan-hours .ph-cal-week{
    grid-template-columns: minmax(0,1fr) !important;
  }
  #modal-plan-hours .ph-cal-kw{
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}


/* ------------------------------------------------------------
   Mobile Monatskalender Tools (aufgeräumt)
------------------------------------------------------------ */
@media (max-width: 740px){
  /* Tool-Box: weniger „Kästchen“, mehr klare Gruppen */
  #modal-plan-hours .ph-mcal-tools{
    margin: 8px 0 12px;
    padding: 10px;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 18px;
    background: #fff;
  }

  /* Buttons im Modal etwas kompakter (nur Mobile) */
  #modal-plan-hours .ph-tool{
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 15px;
    line-height: 1;
  }

  /* Kopfzeile: Auswahl + Count + Help + Löschen */
  #modal-plan-hours .ph-mcal-bar{
    display:flex;
    align-items:center;
    gap: 8px;
    flex-wrap: wrap;
  }

  #modal-plan-hours .ph-mcal-count{
    margin-left: auto;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
  }

  #modal-plan-hours .ph-mcal-help{
    width: 36px;
    height: 36px;
    padding: 0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  /* Presets als kompakte Gruppe */
  #modal-plan-hours .ph-mcal-presets{
    display:flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
  }

  /* Apply-Blöcke: Label + Row (Input/Button) */
  #modal-plan-hours .ph-mcal-applygrid{
    margin-top: 10px;
    display:grid;
    gap: 10px;
  }

  #modal-plan-hours .ph-mcal-apply label{
    display:block;
    font-size: 12px;
    font-weight: 750;
    color: #6b7280;
    margin: 0 0 6px;
  }

  #modal-plan-hours .ph-mcal-applyrow{
    display:flex;
    gap: 8px;
    align-items:center;
  }

  #modal-plan-hours .ph-mcal-tools__input{
    flex: 1;
    min-width: 120px;
    height: 40px;
    font-size: 16px; /* verhindert iOS-Zoom */
    border-radius: 14px;
  }

  /* Hinweis einklappbar */
  #modal-plan-hours .ph-mcal-hint{
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(17,24,39,.08);
    font-size: 12px;
    line-height: 1.25;
  }

  /* Auswahl-Markierung */
  #modal-plan-hours .ph-mcal-day.is-selected{
    outline: 3px solid rgba(37,99,235,.35);
    outline-offset: 0;
  }

  /* Wenn Auswahlmodus aktiv: Toggle optisch hervorheben */
  #modal-plan-hours .ph-mcal-tools.is-selecting [data-mcal-toggle]{
    background: rgba(37,99,235,.10);
    border-color: rgba(37,99,235,.25);
  }
}



/* ============================
   Stunden anschauen (Modal) – Desktop-first UI
   ============================ */
#modal-view-hours .modal__dialog{ max-width: 1100px; }

#modal-view-hours .vh-grid{
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1fr;
  gap: 14px;
}

#modal-view-hours .vh-card{
  background:#fff;
  border:1px solid rgba(17,24,39,.10);
  border-radius: 18px;
  padding: 14px 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,.04);
}

#modal-view-hours .vh-card__title{
  font-weight: 950;
  font-size: 1.0rem;
  margin-bottom: 2px;
}

#modal-view-hours .vh-card__sub{
  font-size: .92rem;
  margin-bottom: 12px;
}

#modal-view-hours .vh-field{ margin-bottom: 12px; }
#modal-view-hours .vh-label{
  display:block;
  font-size: .82rem;
  font-weight: 800;
  margin-bottom: 6px;
  opacity: .85;
}

#modal-view-hours .vh-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

#modal-view-hours .vh-select,
#modal-view-hours .vh-input{
  width:100%;
  border: 1px solid rgba(17,24,39,.14);
  border-radius: 12px;
  background: rgba(17,24,39,.03);
  padding: 10px 12px;
  font-weight: 800;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

#modal-view-hours .vh-select:focus,
#modal-view-hours .vh-input:focus{
  background:#fff;
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 4px rgba(37,99,235,.16);
}

#modal-view-hours .vh-chipline{ display:flex; gap:10px; }
#modal-view-hours .vh-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.20);
  background: rgba(37,99,235,.10);
  font-weight: 900;
}

#modal-view-hours .vh-hint{ font-size:.86rem; padding: 10px 0 0; }

#modal-view-hours .vh-mode{
  display:grid;
  gap: 10px;
}

#modal-view-hours .vh-mode__opt{
  display:flex;
  gap:10px;
  align-items: stretch;
  cursor:pointer;
}

#modal-view-hours .vh-mode__opt input{ margin-top: 6px; }
#modal-view-hours .vh-mode__box{
  flex: 1;
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.10);
  background: rgba(17,24,39,.02);
  padding: 12px 12px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease, background .12s ease;
}
#modal-view-hours .vh-mode__opt:hover .vh-mode__box{
  transform: translateY(-1px);
  border-color: rgba(37,99,235,.22);
  box-shadow: 0 14px 34px rgba(0,0,0,.05);
}
#modal-view-hours .vh-mode__title{ font-weight: 950; display:block; }
#modal-view-hours .vh-mode__desc{ font-size:.88rem; display:block; margin-top: 2px; }

#modal-view-hours input[type="radio"]:checked + .vh-mode__box{
  border-color: rgba(37,99,235,.35);
  background: rgba(37,99,235,.06);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

#modal-view-hours .vh-actions{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
#modal-view-hours .vh-actions__right{ display:flex; gap:10px; }
#modal-view-hours .vh-msg{ font-size:.9rem; }

#modal-view-hours .vh-result-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#modal-view-hours .vh-result-title{
  font-weight: 950;
  font-size: 1.08rem;
}
#modal-view-hours .vh-result-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

#modal-view-hours .vh-kpis{
  display:grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
#modal-view-hours .vh-kpi{
  border-radius: 16px;
  border: 1px solid rgba(17,24,39,.10);
  background: #fff;
  padding: 12px 12px;
  box-shadow: 0 10px 26px rgba(0,0,0,.04);
}
#modal-view-hours .vh-kpi__label{ font-size:.78rem; opacity:.75; font-weight: 800; }
#modal-view-hours .vh-kpi__value{ font-size: 1.05rem; font-weight: 950; margin-top: 4px; font-variant-numeric: tabular-nums; }

#modal-view-hours .vh-table-wrap{
  border-radius: 18px;
  border: 1px solid rgba(17,24,39,.10);
  background: #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,.06);
  overflow:auto;
  max-height: 55vh;
}
#modal-view-hours .vh-table{
  width:100%;
  border-collapse: collapse;
  font-size: .92rem;
}
#modal-view-hours .vh-table thead th{
  position: sticky;
  top: 0;
  background: rgba(17,24,39,.02);
  border-bottom: 1px solid rgba(17,24,39,.08);
  text-align:left;
  padding: 10px 10px;
  font-weight: 950;
}
#modal-view-hours .vh-table tbody td{
  border-bottom: 1px solid rgba(17,24,39,.06);
  padding: 10px 10px;
}
#modal-view-hours .vh-table tbody tr:hover{
  background: rgba(17,24,39,.02);
}

/* Desktop-only: bei schmalen Screens Layout stapeln */
@media (max-width: 980px){
  #modal-view-hours .vh-grid{ grid-template-columns: 1fr; }
  #modal-view-hours .vh-kpis{ grid-template-columns: 1fr 1fr; }
}


/* View Hours: keep values on one line */
#modal-view-hours .vh-table th,
#modal-view-hours .vh-table td{
  white-space: nowrap;
}
#modal-view-hours .vh-table td{
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
#modal-view-hours .vh-section-row td{
  background: rgba(17,24,39,.03);
  font-weight: 950;
}
@media print{
  #modal-view-hours .vh-table th,
  #modal-view-hours .vh-table td{
    white-space: nowrap !important;
  }
}


/* Hide redundant footer close button in Stunden anschauen modal */
#vhBackToTop{display:none !important;}


/* =========================
   Stunden anschauen – Mobile Cards (Version A)
   Desktop bleibt Tabelle
   ========================= */
.vh-cards{ display:none; }
.vh-rowcard{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.vh-rowcard__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.vh-rowcard__date{
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .2px;
}
.vh-rowcard__chips{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.vh-chip{
  display:inline-flex;
  align-items:baseline;
  gap:4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.vh-chip b{ font-variant-numeric: tabular-nums; }

.vh-rowcard__time{
  margin-top: 6px;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  opacity: .9;
}
.vh-rowcard__activity{
  margin-top: 6px;
  font-size: 13px;
  opacity: .9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vh-rowcard__grid{
  margin-top: 8px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.vh-metric{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.03);
}
.vh-metric span{
  font-size: 12px;
  opacity: .75;
}
.vh-metric b{
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* mobile behaviour */
@media (max-width: 740px){
  .vh-table-wrap{ display:none; }
  .vh-cards{ display:block; }

  /* KPIs kompakter */
  .vh-kpis{
    display:grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .vh-kpi{
    padding: 10px 12px;
    border-radius: 14px;
  }
  .vh-kpi__value{
    font-size: 18px;
  }
  .vh-kpi__label{
    font-size: 12px;
  }

  /* Actions oben kompakter */
  .vh-result-actions .btn{
    padding: 8px 10px;
    font-size: 13px;
  }
}


/* ================= Stunden abbauen (Modal) ================= */

#modal-reduce-hours .modal__dialog{
  width: min(520px, 100%);
}

.rh-kpis{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 520px){
  .rh-kpis{
    grid-template-columns: 1.2fr 1fr 1fr;
    align-items: start;
  }
}

.rh-kpi{
  padding: 12px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.02);
}

.rh-kpi__label{
  font-size: 12px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.rh-kpi__value{
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  word-break: break-word;
}

#rhAfter.danger{
  color: #b42318;
}

.rh-form{
  display: grid;
  gap: 12px;
}

.rh-field{
  display: grid;
  gap: 6px;
}

.rh-label{
  font-size: 13px;
  font-weight: 600;
}

.rh-input,
.rh-textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  background: #fff;
}

.rh-input:focus,
.rh-textarea:focus{
  border-color: rgba(0,0,0,.32);
}

.rh-hint{
  font-size: 12px;
}
