* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f4f5;
  color: #1c1c1e;
}

/* ---- Login ---- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #1c1c1e;
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.login-card h1 {
  font-size: 20px;
  margin: 0 0 24px;
  color: #1c1c1e;
}
.login-card h1 span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: #71717a;
  margin-top: 2px;
}
.login-card label { display: block; font-size: 12px; font-weight: 600; color: #71717a; margin-bottom: 6px; text-transform: uppercase; }
.login-card input {
  width: 100%; padding: 12px; border: 1px solid #e4e4e7; border-radius: 10px;
  font-size: 16px; margin-bottom: 16px; background: #fafafa;
}
.login-card button {
  width: 100%; padding: 14px; border: none; border-radius: 10px;
  background: #F58D91; color: white; font-size: 16px; font-weight: 700; cursor: pointer;
}
.error { color: #dc2626; font-size: 13px; margin-top: 10px; text-align: center; }

/* ---- App ---- */
header.app-header {
  background: #1c1c1e;
  color: white;
  padding: 16px;
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
}
header.app-header h1 { font-size: 16px; margin: 0; }
header.app-header .brand { color: #F58D91; font-weight: 800; }
header.app-header button {
  background: transparent; border: 1px solid #71717a; color: #d4d4d8;
  padding: 6px 10px; border-radius: 8px; font-size: 12px;
}

.week-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: white; padding: 10px 16px; border-bottom: 1px solid #e4e4e7;
  position: sticky; top: 56px; z-index: 9;
}
.week-nav button { background: #f4f4f5; border: none; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.week-nav .week-label { font-weight: 700; font-size: 14px; }

.tabs { display: flex; background: white; border-bottom: 1px solid #e4e4e7; position: sticky; top: 104px; z-index: 8; }
.tab { flex: 1; text-align: center; padding: 12px 0; font-size: 13px; font-weight: 500; color: #71717a; border-bottom: 2px solid transparent; }
.tab.active { color: #1c1c1e; border-bottom: 2px solid #F58D91; }

.content { padding: 16px; max-width: 520px; margin: 0 auto; }

.card { background: white; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

label.field-label { display: block; font-size: 12px; font-weight: 600; color: #71717a; margin-bottom: 6px; text-transform: uppercase; }
input, select, textarea {
  width: 100%; padding: 12px; border: 1px solid #e4e4e7; border-radius: 10px;
  font-size: 16px; margin-bottom: 14px; background: #fafafa; font-family: inherit;
}
textarea { resize: vertical; min-height: 50px; }
.row { display: flex; gap: 10px; }
.row > div { flex: 1; }

button.btn-primary { width: 100%; padding: 14px; border: none; border-radius: 10px; background: #1c1c1e; color: white; font-size: 16px; font-weight: 700; cursor: pointer; }
button.btn-secondary { width: 100%; padding: 12px; border: none; border-radius: 10px; background: #e4e4e7; color: #1c1c1e; font-size: 14px; font-weight: 600; margin-top: 8px; cursor: pointer; }
button.btn-pdf { width: 100%; padding: 14px; border: none; border-radius: 10px; background: #F58D91; color: white; font-size: 16px; font-weight: 700; cursor: pointer; }
button.btn-danger { background: #fee2e2; color: #dc2626; font-size: 12px; padding: 6px 10px; width: auto; border: none; border-radius: 8px; }

.entry { border-bottom: 1px solid #f0f0f0; padding: 12px 0; }
.entry:last-child { border-bottom: none; }
.entry-top { display: flex; justify-content: space-between; align-items: baseline; }
.entry-project { font-weight: 700; font-size: 14px; }
.entry-hours { font-weight: 700; font-size: 14px; }
.entry-date { font-size: 12px; color: #a1a1aa; margin-bottom: 4px; }
.entry-desc { font-size: 13px; color: #3f3f46; white-space: pre-wrap; }
.entry-actions { margin-top: 8px; }

.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.summary-row:last-child { border-bottom: none; }
.summary-total { font-weight: 700; }

.empty { text-align: center; color: #a1a1aa; padding: 30px 0; font-size: 14px; }

.new-project-row { display: flex; gap: 8px; }
.new-project-row input { margin-bottom: 0; }
.new-project-row button { width: auto; padding: 12px 16px; font-size: 20px; background:#1c1c1e; color:white; border:none; border-radius:10px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #1c1c1e; color: white; padding: 12px 20px; border-radius: 30px;
  font-size: 14px; transition: transform 0.3s ease; z-index: 100;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.timer-display {
  font-size: 40px; font-weight: 800; text-align: center; letter-spacing: 1px;
  margin: 6px 0 4px; color: #1c1c1e; font-variant-numeric: tabular-nums;
}
.timer-project-label { text-align: center; font-size: 13px; color: #71717a; margin-bottom: 14px; }
#timer-card { border: 2px solid #F58D91; }

.mode-switch { display: flex; gap: 8px; margin-bottom: 16px; }
.mode-btn {
  flex: 1; padding: 10px; border: 1px solid #e4e4e7; border-radius: 10px;
  background: #f4f4f5; color: #71717a; font-size: 14px; font-weight: 600; cursor: pointer;
}
.mode-btn.active { background: #1c1c1e; color: white; border-color: #1c1c1e; }

.tree-day {
  border-bottom: 1px solid #f0f0f0; padding: 12px 0;
}
.tree-day:last-child { border-bottom: none; }
.tree-day-top {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.day-label { font-weight: 700; font-size: 14px; }
.group-label { font-weight: 600; font-size: 13px; }
.group-hours { font-weight: 700; font-size: 14px; }
.group-chevron { font-size: 11px; color: #a1a1aa; margin-left: 6px; transition: transform 0.2s; display: inline-block; }
.tree-day.expanded > .tree-day-top .group-chevron { transform: rotate(90deg); }
.tree-group.expanded > .tree-group-top .group-chevron { transform: rotate(90deg); }

.tree-day-detail {
  display: none; margin-top: 10px; padding-left: 10px; border-left: 2px solid #e4e4e7;
}
.tree-day.expanded > .tree-day-detail { display: block; }

.tree-group { padding: 8px 0; cursor: pointer; }
.tree-group-top { display: flex; justify-content: space-between; align-items: center; }
.tree-group-detail {
  display: none; margin-top: 8px; padding-left: 10px; border-left: 2px solid #f0f0f0;
}
.tree-group.expanded > .tree-group-detail { display: block; }

.sub-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0 6px 10px; font-size: 13px; color: #3f3f46;
}
.sub-entry-time { color: #a1a1aa; font-size: 12px; margin-left: 6px; }

.pdf-week-range { font-size: 13px; color: #71717a; margin-top: 8px; }

.stat-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.stat-row:last-child { border-bottom: none; }
.stat-key { font-weight: 600; }
.stat-detail { font-size: 12px; color: #71717a; margin-top: 2px; }

.ferien-big { font-size: 32px; font-weight: 800; text-align: center; margin: 8px 0; }
.ferien-sub { text-align: center; font-size: 13px; color: #71717a; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 20px; border: 1px solid #e4e4e7;
  background: #f4f4f5; color: #3f3f46; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip.active { background: #1c1c1e; color: white; border-color: #1c1c1e; }
.stat-range-label { margin-top: 10px; font-size: 12px; color: #71717a; }

.stat-summary-row { display: flex; justify-content: space-between; text-align: center; }
.stat-summary-item { flex: 1; }
.stat-summary-value { font-size: 22px; font-weight: 800; color: #1c1c1e; }
.stat-summary-label { font-size: 11px; color: #71717a; text-transform: uppercase; margin-top: 2px; }

.chart-wrap { position: relative; height: 220px; margin-bottom: 10px; }

.stat-project-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.stat-project-row:last-child { border-bottom: none; }
.stat-project-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; flex-shrink: 0; }
.stat-project-name { display: flex; align-items: center; }
