:root {
  --bg: #eef3f8;
  --bg-soft: #f7f9fc;
  --card: rgba(255,255,255,.82);
  --card-strong: rgba(255,255,255,.94);
  --text: #101828;
  --muted: rgba(16,24,40,.62);
  --accent: #0a84ff;
  --accent-ink: #075ea8;
  --accent-soft: rgba(10,132,255,.12);
  --bad: #ff453a;
  --ok: #34c759;
  --line: rgba(15,23,42,.10);
  --line-strong: rgba(15,23,42,.16);
  --shadow: 0 24px 60px rgba(15,23,42,.10), 0 2px 10px rgba(15,23,42,.05);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}
*, *::before, *::after{ box-sizing:border-box; }
body{
  margin:0;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(10,132,255,.11), transparent 28%),
    radial-gradient(circle at top right, rgba(52,199,89,.08), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 24%, #edf2f8 100%);
  color:var(--text);
  overflow-anchor:none;
  line-height:1.45;
}
/* Prevent mobile scroll jump when DOM above viewport updates (e.g., switching Heute/Gestern) */
.wrap, #dayTableWrap, #monthTableWrap { overflow-anchor:none; }

.employee-month-panel {
  margin-top: 14px;
}
.employee-month-head,
.employee-month-sum,
.employee-month-day-toggle,
.employee-month-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.employee-month-head {
  align-items: flex-start;
  margin-bottom: 12px;
}
.employee-month-head h3 {
  margin: 0 0 3px;
  font-size: 18px;
}
.employee-month-sum {
  padding: 10px 12px;
  color: var(--text);
  background: rgba(37, 99, 235, .08);
  border-radius: 10px;
  margin-bottom: 10px;
}
.employee-month-sum strong {
  font-size: 17px;
}
.employee-month-list {
  border-top: 1px solid var(--line);
}
.employee-month-day {
  border-bottom: 1px solid var(--line);
}
.employee-month-day-toggle,
.employee-month-entry {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}
.employee-month-day-toggle {
  padding: 11px 8px;
  background: transparent;
}
.employee-month-day-toggle:hover,
.employee-month-day-toggle:focus-visible {
  background: rgba(11, 18, 32, .04);
}
.employee-month-day-toggle:focus-visible,
.employee-month-entry:focus-visible {
  outline: 3px solid rgba(10, 132, 255, .28);
  outline-offset: 2px;
}
.employee-month-day-date {
  font-weight: 800;
}
.employee-month-day-total,
.employee-month-entry-action,
.employee-month-entry-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.employee-month-chevron {
  font-size: 18px;
  transition: transform 180ms ease-out;
}
.employee-month-day-toggle[aria-expanded="true"] .employee-month-chevron {
  transform: rotate(180deg);
}
.employee-month-entries {
  padding: 0 8px 10px;
}
.employee-month-entry {
  padding: 9px 10px;
  margin-top: 6px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.employee-month-entry:hover,
.employee-month-entry:focus-visible {
  border-color: var(--accent);
}
.employee-month-entry-main {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}
.employee-month-entry-action {
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
  color: var(--accent-ink);
  white-space: nowrap;
}
.employee-month-entry-action span {
  font-size: 12px;
  font-weight: 800;
}
.employee-month-empty {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 520px) {
  .employee-month-day-date {
    max-width: 70%;
  }
  .employee-month-entry {
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .employee-month-chevron {
    transition: none;
  }
}
.wrap{ max-width:1120px; margin:0 auto; padding:20px 18px 28px; padding-top:92px; }
.row{ display:flex; gap:12px; flex-wrap:wrap; }
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.grow{ flex:1; min-width: 280px; }
h1{ margin:6px 0 12px; font-size:22px; letter-spacing:-.02em; }
h2{ margin:0 0 10px; font-size:13px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
label{ font-size:12px; color:var(--muted); display:block; margin:8px 0 4px; font-weight:700; }
input, select, textarea{
  width:100%;
  padding:13px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.92);
  color:var(--text);
  font-size:16px;
  font-family:inherit;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder{ color:rgba(16,24,40,.42); }
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color:rgba(10,132,255,.42);
  box-shadow:0 0 0 4px rgba(10,132,255,.12);
  background:#fff;
}
input[type="checkbox"], input[type="radio"]{ width:auto; padding:0; border:0; background:transparent; accent-color: var(--accent); }
textarea{ resize:vertical; min-height:108px; }
button{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.72);
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  transition: transform .05s ease, filter .12s ease, border-color .12s ease, box-shadow .12s ease;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
button:active{ transform: translateY(1px) scale(0.99); filter: brightness(0.96); }
button:hover{ border-color:var(--line-strong); }
button.primary{ background: linear-gradient(180deg, #39a0ff 0%, var(--accent) 100%); border-color: rgba(0,0,0,0); color:#fff; box-shadow: 0 14px 28px rgba(10,132,255,.22); }
button.danger{ background: rgba(255,69,58,.10); border-color: rgba(255,69,58,.22); color: #b42318; }
button:disabled{ opacity:.55; cursor:not-allowed; }
#btnSync:disabled{ opacity:.55; }

/* Employee main buttons */
#btnStart, #btnPause, #btnEnd{ font-size:17px; padding:14px 18px; border-radius:14px; min-width: 120px; }
#runningInfo{ font-size:15px; padding:10px 12px; border-color: rgba(79,124,255,.35); background: rgba(79,124,255,.12); min-width: 210px; max-width:100%; flex-wrap:wrap; font-variant-numeric: tabular-nums; }
#runningInfo .running-start{ flex-basis:100%; color:var(--text); font-weight:700; }
.pill{ display:inline-flex; align-items:center; gap:8px; padding:7px 11px; border-radius:999px; border:1px solid rgba(11,18,32,.08); color:var(--muted); font-size:12px; background: rgba(255,255,255,.72); backdrop-filter: blur(12px); }
.pill b{ color:var(--text); }
#activeWorkersWrap{ padding:10px 12px; border:1px solid rgba(11,18,32,.10); border-radius:16px; background: rgba(10,132,255,.06); }
#activeWorkers{ display:flex; flex-direction:column; gap:6px; align-items:stretch; }
#activeWorkers .pill{ width:100%; border-radius:12px; justify-content:space-between; background: rgba(255,255,255,.65); }
#activeWorkers .pill .left{ display:inline-flex; gap:8px; align-items:center; min-width:0; }
#activeWorkers .pill .left b{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width: 55vw; }
#activeWorkers .pill .right{ white-space:nowrap; }
table{ width:100%; border-collapse: collapse; }
thead th{ position: sticky; top: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); z-index:2; }
th, td{ text-align:left; border-bottom:1px solid rgba(11,18,32,.08); padding:10px 6px; font-size:12px; }

/* Row action menu (admin) */
.rowActWrap{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.rowMenu{ position:absolute; right:0; top: calc(100% + 6px); min-width: 180px; background: rgba(255,255,255,.98); border:1px solid rgba(11,18,32,.16); border-radius:14px; padding:6px; box-shadow: 0 18px 50px rgba(0,0,0,.16); z-index:50; }
/* When opened, we float the menu to the viewport to avoid clipping inside overflow containers */
.rowMenu.floating{ position:fixed; right:auto; top:auto; }
.rowMenu.hidden{ display:none; }
.rowMenu button{ width:100%; text-align:left; padding:10px 10px; border-radius:12px; background: rgba(11,18,32,.04); border:1px solid rgba(11,18,32,.10); font-weight:800; }
.rowMenu button.danger{ background: rgba(255,59,48,.12); border-color: rgba(255,59,48,.24); color:#a5120b; }
.rowMenu button + button{ margin-top:6px; }
th{ color:var(--muted); font-weight:700; }
.muted{ color:var(--muted); }
.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.grid2 > div{ min-width:0; }
@media(max-width:720px){ .grid2{ grid-template-columns:1fr; } }
@media(max-width:480px){
  #dayTableWrap, #monthTableWrap{ min-height: 120px !important; max-height: 40vh !important; }
}
.topbar{
  position:sticky;
  top:0;
  z-index:25;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 0 18px;
  margin-bottom:6px;
  backdrop-filter: blur(16px);
}

/* Tabs (admin) */
.tabs{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.tab{ padding:8px 10px; border-radius:999px; border:1px solid var(--line); background: rgba(11,18,32,.04); font-weight:850; font-size:13px; }
.tab.active{ background: rgba(10,132,255,.12); border-color: rgba(10,132,255,.28); color: #0a4fa3; }

/* Admin day picker responsiveness */
#dayPicker{ display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
#dayPicker .dp-field{ flex: 1 1 520px; min-width: 260px; }
#dayPicker .dp-actions{ flex-basis:100%; display:flex; gap:8px; flex-wrap:wrap; }
#dayPicker .dp-actions button{ white-space: nowrap; }
#dayPicker select{ width:100%; }
#day{ width:100%; }
.day-calendar{ margin-top:12px; }
.day-calendar-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.day-calendar-head button{ padding:6px 10px; border-radius:10px; }
.day-calendar-month{ font-weight:900; }
.day-calendar-weekdays, .day-calendar-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:4px; }
.day-calendar-weekdays{ margin-bottom:4px; color:#667085; font-size:12px; text-align:center; }
.day-calendar-grid button{ padding:7px 0; border-radius:10px; font-size:13px; }
.day-calendar-grid button.empty{ visibility:hidden; pointer-events:none; }
.day-calendar-grid button.active{ background:rgba(10,132,255,.14); border-color:rgba(10,132,255,.34); color:#0a4fa3; font-weight:900; }

/* Segmented control */
.seg{ display:inline-flex; border:1px solid var(--line); border-radius:999px; overflow:hidden; background: rgba(11,18,32,.04); }
.seg button{ border:0; border-right:1px solid var(--line); background:transparent; padding:8px 12px; border-radius:0; font-weight:850; font-size:13px; }
.seg button:last-child{ border-right:0; }
.seg button.active{ background: rgba(10,132,255,.14); color:#0a4fa3; }

/* Compact table */
.compact th, .compact td{ padding:8px 6px; font-size:12px; }

.badge{ display:inline-flex; align-items:center; padding:2px 8px; border-radius:999px; font-weight:850; font-size:11px; border:1px solid rgba(11,18,32,.12); background: rgba(11,18,32,.04); }
.badge.ok{ background: rgba(52,199,89,.12); border-color: rgba(52,199,89,.25); color:#1f6f37; }
.badge.warn{ background: rgba(255,149,0,.14); border-color: rgba(255,149,0,.28); color:#7a4a00; }
.badge.bad{ background: rgba(255,59,48,.12); border-color: rgba(255,59,48,.24); color:#a5120b; }

/* Group header rows (admin Today) */
.groupRow td{ padding:10px 6px; }
.groupRow{ background: rgba(11,18,32,.02); }
.groupRow .gwrap{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.groupRow .gname{ font-weight:950; }
.groupRow .gsums{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:flex-end; }
.groupRow .gsums .pill{ font-size:12px; padding:5px 9px; }
.groupRow .gtoggle{ padding:6px 10px; border-radius:999px; font-size:13px; }
.groupRow .running{ font-variant-numeric: tabular-nums; }

/* Responsive tweaks for admin group headers */
@media (max-width: 860px){
  .groupRow .gwrap{ gap:8px; }
  .groupRow .gsums{ justify-content:flex-start; }
  .groupRow .gsums .pill{ font-size:11px; padding:4px 8px; }
  .groupRow .gtoggle{ font-size:12px; padding:6px 9px; }
}
@media (max-width: 520px){
  .groupRow td{ padding:8px 4px; }
  .groupRow .gsums .pill{ font-size:10.5px; padding:4px 7px; }
}

/* Toast is fixed so it doesn't push the layout (prevents jumping) */
.toast{ position:fixed; top:12px; left:12px; right:12px; max-width:980px; margin:0 auto; z-index:10000; padding:12px 14px; border-radius:16px; border:1px solid rgba(11,18,32,.12); background:rgba(255,255,255,.90); backdrop-filter: blur(14px); font-weight:900; box-shadow: var(--shadow); }
.toast.ok{ border-color: rgba(52,199,89,.25); background: rgba(52,199,89,.12); }
.toast.bad{ border-color: rgba(255,59,48,.24); background: rgba(255,59,48,.12); }
.toast.big{ font-size:16px; padding:14px 16px; }
.hidden{ display:none; }
a{ color: var(--accent); }
.small{ font-size:12px; }
.tag-ok{ color: var(--ok); }
.tag-bad{ color: var(--bad); }
/* Keep this field available for password managers without affecting layout */
.pm-helper{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  opacity:0 !important;
  pointer-events:none !important;
}
#deviceModeSetup .deviceModeOptions{ display:grid; gap:8px; margin-top:8px; }
#deviceModeSetup .dmOption{ display:flex; align-items:flex-start; gap:10px; margin:0; color:var(--text); }
#deviceModeSetup .dmOption input{ margin-top:2px; flex:0 0 auto; }
#deviceModeSetup .dmOption span{ display:block; line-height:1.3; color:var(--text); }

.notifyRow{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-bottom:1px solid rgba(11,18,32,.08); }
.notifyRow:last-child{ border-bottom:0; }
.notifyTitle{ font-weight:800; font-size:13px; line-height:1.3; }
.notifyDesc{ margin-top:2px; line-height:1.3; }
.switch{ position:relative; display:inline-block; width:48px; height:28px; flex:0 0 auto; }
.switch input{ opacity:0; width:0; height:0; }
.switch .slider{
  position:absolute;
  inset:0;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(11,18,32,.16);
  transition:all .2s ease;
}
.switch .slider:before{
  content:'';
  position:absolute;
  left:2px;
  top:2px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.2);
  transition:transform .2s ease;
}
.switch input:checked + .slider{
  background:#22c55e;
  border-color:#16a34a;
}
.switch input:checked + .slider:before{ transform:translateX(20px); }
.switch input:disabled + .slider{ opacity:.5; }

.choiceOverlayCard{ width:min(620px, 94vw); max-height:min(78vh, 780px); overflow:auto; }
.choiceTitle{ font-size:17px; font-weight:900; line-height:1.35; }
.choiceSub{ margin-top:6px; }
.choiceList{ margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.choiceBtn{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(11,18,32,.04);
  color:var(--text);
  font-weight:800;
  line-height:1.3;
}
.choiceBtn small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-weight:600;
}
.heroCard{ position:relative; overflow:hidden; }
.heroCard::before{
  content:'';
  position:absolute;
  inset:-30% auto auto -10%;
  width:260px;
  height:260px;
  border-radius:50%;
  background: radial-gradient(circle, rgba(10,132,255,.16), rgba(10,132,255,0));
  pointer-events:none;
}
.heroTitle{ margin-top:6px; font-size:24px; font-weight:900; letter-spacing:-.03em; }
.heroLead{ margin-top:6px; max-width:44ch; color:var(--muted); font-size:14px; }
.heroSteps{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.heroSteps .pill{ font-weight:700; color:var(--text); }
.fieldHint{ margin-top:6px; font-size:12px; color:var(--muted); line-height:1.4; }
.adminActionGrid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:10px;
  margin-top:12px;
}
.adminActionBtn{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:6px;
  min-height:86px;
  padding:14px;
  text-align:left;
  background:rgba(255,255,255,.74);
}
.adminActionBtn strong{ font-size:14px; }
.adminActionBtn span{ font-size:12px; color:var(--muted); line-height:1.4; font-weight:700; }
.sheetOverlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.46);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9998;
}
.sheetCard{
  width:min(640px, 94vw);
  max-height:min(86vh, 860px);
  overflow:auto;
}
.formContext{
  display:grid;
  gap:2px;
  margin-top:12px;
  padding:10px 12px;
  border-radius:8px;
  background:rgba(10,132,255,.10);
  color:var(--text);
}
.formContextLabel{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  line-height:1.3;
}
.formContextValue{
  font-size:16px;
  font-weight:900;
  line-height:1.35;
}
.formGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}
.formGrid .full{ grid-column:1 / -1; }
.sheetActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  margin-top:16px;
}
@media(max-width:720px){
  .formGrid{ grid-template-columns:1fr; }
}
