/* ─── Reset & Base ──────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface2: #2c2c2e;
  --surface3: #3a3a3c;
  --label: #f5f5f7;
  --label2: #636366;
  --label3: #48484a;
  --accent: #0a84ff;
  --green: #30d158;
  --separator: rgba(255,255,255,0.08);
  --radius: 18px;
  --tab-height: 84px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior: none;
}

.hidden { display: none !important; }

/* ─── Views ─────────────────────────────────────────────────────────────────── */

.view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px calc(var(--tab-height) + 16px);
  min-height: 100vh;
}

/* ─── Nav ───────────────────────────────────────────────────────────────────── */

nav {
  width: 100%;
  max-width: 640px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.nav-logo {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-mode {
  display: flex;
  background: var(--surface);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--surface2);
}

.nav-mode-btn {
  padding: 6px 13px;
  border-radius: 100px;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--label2);
  background: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-mode-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ─── Segment control ───────────────────────────────────────────────────────── */

.segment {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  padding: 2px;
  width: 100%;
  max-width: 640px;
  margin-bottom: 48px;
  border: 1px solid var(--surface2);
}

.seg-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--label2);
  cursor: pointer;
  transition: all 0.2s;
}

.seg-btn.active {
  background: var(--surface2);
  color: var(--label);
}

/* ─── Ring section ──────────────────────────────────────────────────────────── */

.ring-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48px;
}

#ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin-bottom: 40px;
}

.ring-svg {
  width: 220px;
  height: 220px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--surface);
  stroke-width: 12;
}

#ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 628;
  stroke-dashoffset: 628;
  transition: stroke-dashoffset 0.9s linear;
}

.ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#timer-time {
  font-size: 54px;
  font-weight: 200;
  letter-spacing: -3px;
  color: var(--label);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#timer-phase {
  font-size: 12px;
  color: var(--label2);
  margin-top: 6px;
  letter-spacing: 0.2px;
}

/* ─── Pure Focus ring ───────────────────────────────────────────────────────── */

#pure-ring {
  width: 220px;
  height: 220px;
  margin-bottom: 40px;
}

.pure-svg {
  width: 220px;
  height: 220px;
  transform: rotate(-90deg);
}

.pure-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 628;
  stroke-dashoffset: 628; /* startet leer */
  transition: stroke-dashoffset 1s linear;
}

/* ─── Module Picker ─────────────────────────────────────────────────────────── */

.module-picker-wrap {
  width: 100%;
  max-width: 640px;
  margin-bottom: 20px;
  overflow: hidden;
}

.module-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 4px;
  scrollbar-width: none;
  justify-content: center;
  flex-wrap: wrap;
}
.module-chips::-webkit-scrollbar { display: none; }

.module-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--surface2);
  background: var(--surface);
  color: var(--label2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.module-chip:hover { border-color: var(--surface3); background: var(--surface2); }
.module-chip.active {
  color: #fff;
  border-color: transparent;
}
.module-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Kein Modul chip */
.module-chip.none-chip.active {
  background: var(--surface2);
  border-color: var(--surface3);
  color: var(--label);
}

/* ─── Module Stats heute ─────────────────────────────────────────────────────── */

.module-stats {
  width: 100%;
  max-width: 640px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.module-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 12px;
  padding: 12px 16px;
}

.module-stat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.module-stat-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--label);
}

.module-stat-bar-wrap {
  flex: 2;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}

.module-stat-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.module-stat-time {
  font-size: 13px;
  color: var(--label2);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ─── Module Week Card (Statistiken) ─────────────────────────────────────────── */

.module-week-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  padding: 24px;
  margin-top: 16px;
}

.module-week-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--separator);
}
.module-week-row:last-child { border-bottom: none; }

.module-week-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.module-week-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.module-week-bar-wrap {
  flex: 2;
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.module-week-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.module-week-time {
  font-size: 13px;
  color: var(--label2);
  min-width: 40px;
  text-align: right;
}

.module-week-empty {
  font-size: 13px;
  color: var(--label2);
  padding: 8px 0;
  text-align: center;
}

/* ─── Module Settings ────────────────────────────────────────────────────────── */

.module-settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--separator);
}

.module-settings-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.module-settings-name {
  flex: 1;
  font-size: 15px;
  color: var(--label);
}

.module-delete-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--surface3);
  color: var(--label2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.module-delete-btn:hover { background: #ff453a; color: #fff; }

.module-add-row {
  gap: 12px;
  padding: 12px 16px !important;
  min-height: 52px;
}

.module-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--label);
  padding: 8px 0;
  min-height: 36px;
}
.module-input::placeholder { color: var(--label2); }

.module-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.module-add-btn:hover { background: #0070d8; }
.module-add-btn:active { transform: scale(0.92); background: #005ec4; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.btns {
  display: flex;
  justify-content: center;
}

.btn-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(10, 132, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-circle:hover {
  background: #0070d8;
  box-shadow: 0 10px 36px rgba(10, 132, 255, 0.5);
}

.btn-circle:active {
  transform: scale(0.93);
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
}

/* ─── Stats ─────────────────────────────────────────────────────────────────── */

.stats {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}

.stat-card.clickable {
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.stat-card.clickable:hover  { background: var(--surface2); }
.stat-card.clickable:active { transform: scale(0.96); }

.stat-num {
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -1.5px;
  color: var(--label);
  line-height: 1;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.stat-num.accent { color: var(--accent); }

.stat-label {
  font-size: 12px;
  color: var(--label2);
  font-weight: 400;
}

/* ─── Sheet ──────────────────────────────────────────────────────────────────── */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sheet-overlay.visible { opacity: 1; pointer-events: all; }

.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
  padding-bottom: 48px;
}
.sheet.visible { transform: translateY(0); }

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--separator);
}

.sheet-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.sheet-count { font-size: 13px; color: var(--label2); }

.sheet-entry {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--separator);
  gap: 12px;
}
.sheet-entry:last-child { border-bottom: none; }

.sheet-entry-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.sheet-entry-name { flex: 1; font-size: 15px; }

.sheet-entry-dur {
  font-size: 13px;
  color: var(--label2);
  margin-right: 6px;
}

.sheet-entry-time {
  font-size: 13px;
  color: var(--label3);
  font-variant-numeric: tabular-nums;
}

.sheet-entry-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: #fff;
  flex-shrink: 0;
  margin-left: 6px;
}

/* ─── Tab Bar ────────────────────────────────────────────────────────────────── */

.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tab-height);
  background: rgba(28,28,30,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--separator);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 10px;
  z-index: 50;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  flex: 1;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
  transition: opacity 0.15s;
}
.tab-item:active { opacity: 0.6; }

.tab-icon { font-size: 22px; line-height: 1; opacity: 0.35; }
.tab-item.active .tab-icon { opacity: 1; }

.tab-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--label2);
}
.tab-item.active .tab-label { color: var(--accent); }

/* ─── To-Do View ────────────────────────────────────────────────────────────── */

.todo-quick-input {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  margin-bottom: 24px;
  gap: 0;
}

.todo-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.todo-quick-field {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--label);
  padding: 4px 0;
}
.todo-quick-field::placeholder { color: var(--label2); }

.todo-quick-submit {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.todo-quick-submit:hover { background: #0070d8; }
.todo-quick-submit:active { transform: scale(0.9); }

.todo-module-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 2px;
  border-top: 1px solid var(--separator);
  margin-top: 8px;
  scrollbar-width: none;
}
.todo-module-row::-webkit-scrollbar { display: none; }
.todo-module-row:empty { display: none; }

/* kleiner Chip für todo-input */
.todo-mod-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1.5px solid var(--surface2);
  background: var(--surface2);
  color: var(--label2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
  font-family: inherit;
}
.todo-mod-chip.active {
  color: #fff;
  border-color: transparent;
}

/* Modul-Tag auf Todo-Item */
.todo-module-tag {
  font-size: 11px;
  font-weight: 500;
  margin-top: 3px;
}

/* ─── Heute-Badge (Prüfungen) ─────────────────────────────────────────────── */

.pruef-heute-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  background: #ff453a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ─── Auth-Sektion ────────────────────────────────────────────────────────── */

.auth-logged-out {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 12px;
}

.auth-hint {
  font-size: 13px;
  color: var(--label2);
  text-align: center;
}

.btn-google {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--surface3);
  background: var(--surface2);
  color: var(--label);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  justify-content: center;
}
.btn-google:hover { background: var(--surface3); }

.auth-logged-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}

.auth-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface3);
}

.auth-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.auth-user-info { flex: 1; }
.auth-user-name  { font-size: 15px; font-weight: 500; }
.auth-user-email { font-size: 12px; color: var(--label2); margin-top: 1px; }

.btn-logout {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: var(--surface3);
  color: var(--label2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-logout:hover { background: #ff453a; color: #fff; }

.todo-list {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 13px;
  padding: 14px 16px;
  transition: background 0.15s;
  cursor: default;
}
.todo-item + .todo-item { border-radius: 13px; margin-top: 6px; }

.todo-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--surface3);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.todo-check:hover { border-color: var(--accent); }
.todo-check.checked {
  background: var(--green);
  border-color: var(--green);
}
.todo-check.checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.todo-text {
  flex: 1;
  font-size: 15px;
  color: var(--label);
  line-height: 1.4;
  word-break: break-word;
}
.todo-text.done {
  color: var(--label2);
  text-decoration: line-through;
  text-decoration-color: var(--label3);
}

.todo-delete {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--label3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.todo-item:hover .todo-delete { opacity: 1; }
.todo-delete:hover { color: #ff453a; }

/* Erledigte Sektion */
.todo-done-section {
  width: 100%;
  max-width: 640px;
  margin-top: 16px;
}

.todo-done-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--label2);
  cursor: pointer;
  user-select: none;
}

.todo-done-count {
  background: var(--surface2);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--label2);
}

.todo-done-list {
  opacity: 0.6;
}

/* ─── Prüfungen View ─────────────────────────────────────────────────────────── */

.pruef-header {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.pruef-add-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(10,132,255,0.35);
  transition: transform 0.15s, background 0.15s;
  flex-shrink: 0;
}
.pruef-add-btn:hover { background: #0070d8; }
.pruef-add-btn:active { transform: scale(0.92); }

.pruef-list {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Prüfungs-Karte ─────────────────────────────────────────────────────────── */

.pruef-card {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}
.pruef-card:active { transform: scale(0.99); }

.pruef-card-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.pruef-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pruef-card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--label);
}

.pruef-card-module {
  font-size: 12px;
  font-weight: 500;
  margin-top: 3px;
}

.pruef-delete-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--surface2);
  color: var(--label2);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  margin-left: 8px;
  margin-top: 2px;
}
.pruef-delete-btn:hover { background: #ff453a; color: #fff; }

.pruef-countdown {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.pruef-countdown-num {
  font-size: 42px;
  font-weight: 200;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pruef-countdown-unit {
  font-size: 16px;
  font-weight: 400;
  color: var(--label2);
}

.pruef-countdown-sep {
  font-size: 24px;
  font-weight: 200;
  color: var(--label2);
  margin: 0 2px;
}

.pruef-card-date {
  font-size: 12px;
  color: var(--label2);
}

/* Vergangenheit / bald */
.pruef-card.done { opacity: 0.45; }
.pruef-card.urgent .pruef-countdown-num { color: #ff453a; }
.pruef-card.soon .pruef-countdown-num { color: #ff9f0a; }

/* ─── Leer-State ─────────────────────────────────────────────────────────────── */

.pruef-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 10px;
  width: 100%;
}

.pruef-empty-icon { font-size: 52px; }
.pruef-empty-text { font-size: 17px; font-weight: 600; color: var(--label); }
.pruef-empty-sub  { font-size: 14px; color: var(--label2); text-align: center; }

/* ─── Prüfung-Sheet Form ─────────────────────────────────────────────────────── */

.sheet-close-btn {
  background: var(--surface2);
  border: none;
  color: var(--label2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pruef-form {
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pruef-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pruef-form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--label2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pruef-form-input {
  background: var(--surface2);
  border: 1px solid var(--surface3);
  border-radius: 12px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--label);
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  color-scheme: dark;
}
.pruef-form-input:focus { border-color: var(--accent); }
.pruef-form-input::placeholder { color: var(--label2); }

.pruef-save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
  transition: background 0.15s, transform 0.1s;
}
.pruef-save-btn:hover { background: #0070d8; }
.pruef-save-btn:active { transform: scale(0.98); }

/* ─── Statistiken ────────────────────────────────────────────────────────────── */

.view-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.6px;
  width: 100%;
  max-width: 640px;
  margin-bottom: 28px;
}

.stat-summary {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.chart-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  padding: 24px;
}

.chart-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 24px;
}

#stat-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  gap: 8px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar-val {
  font-size: 9px;
  color: var(--label2);
  min-height: 12px;
  text-align: center;
}

.bar-track {
  width: 100%;
  height: 80px;
  background: var(--surface2);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  background: var(--label3);
  border-radius: 6px;
  min-height: 3px;
  transition: height 0.4s ease;
}
.bar-fill.today { background: var(--accent); }

.bar-label {
  font-size: 10px;
  color: var(--label2);
  font-weight: 500;
}
.bar-label.today { color: var(--accent); }

/* ─── Einstellungen ──────────────────────────────────────────────────────────── */

.settings-section-label {
  font-size: 12px;
  color: var(--label2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  max-width: 640px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.settings-group {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  overflow: hidden;
  margin-bottom: 28px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--separator);
  font-size: 15px;
}
.settings-row:last-child { border-bottom: none; }

.settings-row-label { color: var(--label); }
.settings-row-value { font-size: 13px; color: var(--label2); }

/* Sound picker */
.sound-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--separator);
  border-top: 1px solid var(--separator);
}

.sound-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.sound-option:hover { background: var(--surface2); }
.sound-option.active { background: rgba(10,132,255,0.12); }

.sound-icon { font-size: 22px; }

.sound-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--label2);
}
.sound-option.active .sound-name { color: var(--accent); }

/* Toggle */
.toggle {
  width: 50px; height: 30px;
  border-radius: 15px;
  background: var(--surface3);
  position: relative;
  cursor: pointer;
  border: none;
  transition: background 0.25s;
  flex-shrink: 0;
}
.toggle.on { background: var(--green); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle.on::after { left: 23px; }

/* ─── PWA / iOS Safe Area ───────────────────────────────────────────────────── */

body {
  padding-top: env(safe-area-inset-top);
}

.tab-bar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  height: calc(var(--tab-height) + env(safe-area-inset-bottom));
}

.view {
  padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + 16px);
}

/* ─── Tagesziel Card ─────────────────────────────────────────────────────────── */

.tagesziel-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 16px;
}

.tagesziel-left {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.tagesziel-ring-svg {
  width: 60px;
  height: 60px;
  transform: rotate(-90deg);
}

.tagesziel-track {
  fill: none;
  stroke: var(--surface3);
  stroke-width: 5;
}

.tagesziel-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
  transition: stroke-dashoffset 0.5s ease;
}

.tagesziel-fill.done {
  stroke: var(--green);
}

.tagesziel-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--label);
}

.tagesziel-info {
  flex: 1;
}

.tagesziel-label {
  font-size: 13px;
  color: var(--label2);
  margin-bottom: 4px;
}

.tagesziel-sub {
  font-size: 15px;
  font-weight: 600;
  color: var(--label);
}

.tagesziel-edit-btn {
  background: var(--surface2);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Tagesziel Picker */

.tagesziel-picker {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.tagesziel-option {
  background: var(--surface2);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--label);
  padding: 14px 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.tagesziel-option.active {
  border-color: var(--accent);
  background: rgba(10,132,255,0.15);
  color: var(--accent);
}

/* ─── Modul-Verlauf Linienchart ──────────────────────────────────────────────── */

#modul-verlauf-chart {
  width: 100%;
  overflow-x: auto;
}

#modul-verlauf-chart svg {
  width: 100%;
  height: 160px;
}

.modul-verlauf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.modul-verlauf-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--label2);
}

.modul-verlauf-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Drag & Drop Todos ──────────────────────────────────────────────────────── */

.todo-item {
  touch-action: none;
  user-select: none;
}

.todo-item.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.todo-item.drag-over {
  border-top: 2px solid var(--accent);
}

.todo-drag-handle {
  color: var(--label3);
  font-size: 16px;
  padding: 0 6px 0 0;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}

/* Tagesziel custom input */
.tagesziel-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.tagesziel-custom-input {
  width: 72px;
  background: var(--surface2);
  border: 1.5px solid var(--surface3);
  border-radius: 12px;
  color: var(--label);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  padding: 12px 8px;
  -webkit-appearance: none;
  appearance: none;
}

.tagesziel-custom-input:focus {
  outline: none;
  border-color: var(--accent);
}

.tagesziel-custom-label {
  font-size: 15px;
  color: var(--label2);
  font-weight: 500;
  margin-right: 8px;
}
