/* SuperZeit Prototyp — mobile-first */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --ink: #1b1d29;
  --ink-soft: #6b7080;
  --line: #e6e8ee;
  --bg: #f4f5f8;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 1px 3px rgba(20, 22, 40, .06), 0 4px 16px rgba(20, 22, 40, .05);
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior: none;
}

/* ===== Login ===== */
#screen-login {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #eef0ff 0%, var(--bg) 55%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 32px 24px 24px;
}
.brand { text-align: center; margin-bottom: 28px; }
.brand-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  background: var(--primary); color: #fff; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.brand-name span { color: var(--primary); }
.brand-sm { font-size: 19px; }
.brand-tenant { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.login-hint { text-align: center; color: var(--ink-soft); font-size: 12px; margin-top: 16px; }

/* ===== Felder & Buttons ===== */
.field { display: block; margin-bottom: 14px; flex: 1; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fafbfc;
  color: var(--ink); appearance: none;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 14px; cursor: pointer;
  transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: #eef0f5; color: var(--ink); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 11px; }
.btn-green { background: var(--green); color: #fff; }
.btn-red-ghost { background: var(--red-bg); color: var(--red); }

/* ===== App-Rahmen ===== */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 12px;
  background: rgba(244, 245, 248, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.role-chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.role-chip.admin { border-color: var(--primary); color: var(--primary); background: #eef0ff; }

#main {
  flex: 1; width: 100%; max-width: 480px; margin: 0 auto;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 96px);
}
.tab-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 4px; }
.tab-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 18px; }

/* ===== Karten ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h4 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.card-amber { background: var(--amber-bg); border: 1.5px solid #fde8c0; box-shadow: none; }
.card-amber h4 { color: var(--amber); }

/* ===== Stempeluhr ===== */
.clock-wrap { text-align: center; padding: 26px 18px 22px; }
.clock-date { color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.clock-btn {
  width: 170px; height: 170px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  margin: 0 auto 18px; font-family: inherit;
  transition: transform .1s;
}
.clock-btn:active { transform: scale(.96); }
.clock-btn .big { font-size: 34px; }
.clock-btn .lbl { font-size: 15px; font-weight: 700; }
.clock-start { background: var(--green); color: #fff; box-shadow: 0 10px 30px rgba(22, 163, 74, .35); }
.clock-running { background: var(--card); color: var(--ink); border: 6px solid var(--green) !important; box-shadow: 0 10px 30px rgba(22, 163, 74, .2); }
.clock-paused  { background: var(--card); color: var(--ink); border: 6px solid var(--amber) !important; box-shadow: 0 10px 30px rgba(217, 119, 6, .2); }
.clock-done { background: #eef0f5; color: var(--ink-soft); }
.clock-timer { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.clock-state { font-size: 13px; font-weight: 700; color: var(--green); }
.clock-state.paused { color: var(--amber); }
.clock-actions { display: flex; gap: 10px; justify-content: center; }

.clock-stats { display: flex; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; }
.clock-stat { flex: 1; text-align: center; }
.clock-stat .v { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.clock-stat .k { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

/* ===== Listen / Zeilen ===== */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 15px; }
.row-sub { color: var(--ink-soft); font-size: 13px; margin-top: 1px; }
.row-end { text-align: right; flex-shrink: 0; }
.row-end .v { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; }
.row-end .k { font-size: 12px; color: var(--ink-soft); }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-gray { background: #eef0f5; color: var(--ink-soft); }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-blue { background: #eef0ff; color: var(--primary); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.dot-gray { background: #c6cad4; }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }

/* ===== Woche ===== */
.week-bar { height: 10px; border-radius: 999px; background: #e9ebf1; overflow: hidden; margin: 10px 0 6px; }
.week-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.week-legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.week-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

.day-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ===== Urlaub ===== */
.vac-hero { display: flex; align-items: center; gap: 20px; }
.vac-ring { width: 108px; height: 108px; flex-shrink: 0; position: relative; }
.vac-ring svg { transform: rotate(-90deg); }
.vac-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.vac-ring .num b { font-size: 28px; font-weight: 800; line-height: 1; }
.vac-ring .num s { font-size: 11px; color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.vac-facts { flex: 1; }
.vac-facts .row { padding: 7px 0; }

/* ===== Konto ===== */
.saldo-big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.saldo-big.pos { color: var(--green); }
.saldo-big.neg { color: var(--red); }

.model-grid { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px 12px; font-size: 14px; }
.model-grid .d { font-weight: 700; color: var(--ink-soft); }
.model-grid .t { font-variant-numeric: tabular-nums; }
.model-grid .p { color: var(--ink-soft); font-size: 13px; }

/* ===== Bottom-Nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(env(safe-area-inset-bottom) + 8px);
}
.nav-item {
  flex: 1; max-width: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  padding: 6px 0; border-radius: 12px; position: relative;
}
.nav-item .nav-ico { font-size: 19px; line-height: 1; }
.nav-item.active { color: var(--primary); }
.badge {
  position: absolute; top: 0; right: 18%;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ===== Sheets ===== */
#overlay { position: fixed; inset: 0; background: rgba(20, 22, 40, .45); z-index: 40; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  max-width: 480px; margin: 0 auto;
  animation: sheetUp .22s ease-out;
  max-height: 86dvh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 4px auto 16px; }
.sheet h3 { font-size: 19px; font-weight: 800; margin-bottom: 16px; }
.sheet-row { display: flex; gap: 12px; }
.hint-box {
  background: #eef0ff; color: var(--primary-dark);
  font-size: 13.5px; font-weight: 600;
  border-radius: 12px; padding: 12px 14px; margin: 4px 0 16px;
}

/* ===== Toast ===== */
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 104px);
  transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; z-index: 60;
  max-width: 88vw; text-align: center;
  animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Desktop-Vorschau: Handy-Rahmen andeuten */
@media (min-width: 720px) {
  body { background: #e8eaf0; }
  #app { max-width: 430px; margin: 0 auto; background: var(--bg); box-shadow: 0 0 60px rgba(20,22,40,.15); }
  .bottom-nav { max-width: 430px; margin: 0 auto; }
}
