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

:root {
  --bg: #1a1a2e;
  --bg2: #16213e;
  --bg3: #0f3460;
  --accent: #e94560;
  --accent2: #533483;
  --text: #eee;
  --text2: #aaa;
  --success: #4ecca3;
  --card: #16213e;
  --input-bg: #0f3460;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: var(--bg2);
  z-index: 200;
  transition: left 0.3s ease;
  padding: 60px 0 20px;
  box-shadow: 4px 0 20px rgba(0,0,0,0.5);
}

.sidebar.open { left: 0; }

.sidebar-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  display: none;
}

.sidebar-overlay.open { display: block; }

.sidebar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 24px;
  cursor: pointer;
}

.sidebar a, .sidebar button.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.sidebar a:hover, .sidebar button.nav-btn:hover {
  background: rgba(255,255,255,0.05);
}

.nav-icon { font-size: 20px; width: 28px; text-align: center; }

.header-timer {
  font-size: 16px;
  font-weight: 600;
  color: var(--success);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Main content */
.container { padding: 20px; max-width: 500px; margin: 0 auto; }

/* Home screen */
.home-screen { text-align: center; padding-top: 60px; }

.days-since {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  border: 2px solid rgba(255,255,255,0.08);
}

.days-since-number {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
}

.days-since-label {
  font-size: 14px;
  color: var(--text2);
  margin-top: 4px;
}

.days-good { border-color: var(--success); }
.days-good .days-since-number { color: var(--success); }

.days-ok { border-color: #f0a500; }
.days-ok .days-since-number { color: #f0a500; }

.days-warn { border-color: var(--accent); }
.days-warn .days-since-number { color: var(--accent); }

.next-workout-label {
  font-size: 14px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.next-workout-name {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.next-workout-type {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 40px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-start:active { transform: scale(0.96); }

.last-workout-info {
  margin-top: 40px;
  color: var(--text2);
  font-size: 14px;
}

.choose-other {
  margin-top: 32px;
}

.choose-other-label {
  font-size: 14px;
  color: var(--text2);
  display: block;
  margin-bottom: 12px;
}

.choose-other-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-other {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-other:active { background: var(--bg3); }

/* Workout screen */
.workout-header {
  text-align: center;
  margin-bottom: 24px;
}

.workout-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.workout-header .workout-date {
  color: var(--text2);
  font-size: 14px;
  margin-top: 4px;
}

.exercise-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.exercise-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.exercise-last {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.exercise-last span { color: var(--success); font-weight: 500; }

.weight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.weight-row label {
  font-size: 13px;
  color: var(--text2);
  width: 60px;
  flex-shrink: 0;
}

.weight-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 16px;
  text-align: center;
  outline: none;
}

.weight-input:focus {
  border-color: var(--accent);
}

.reps-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reps-row label {
  font-size: 13px;
  color: var(--text2);
  width: 60px;
  flex-shrink: 0;
}

.rep-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 8px;
  font-size: 16px;
  text-align: center;
  outline: none;
  width: 0;
}

.rep-input:focus { border-color: var(--accent); }

.btn-save {
  width: 100%;
  background: var(--success);
  color: var(--bg);
  border: none;
  padding: 16px;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.1s;
}

.btn-save:active { transform: scale(0.97); }

/* History */
.history-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.history-item:hover { background: var(--bg3); }

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.history-item-type {
  font-weight: 700;
  font-size: 16px;
}

.history-item-date {
  color: var(--text2);
  font-size: 13px;
}

.history-item-exercises {
  color: var(--text2);
  font-size: 13px;
  margin-top: 4px;
}

.history-detail-exercise {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.history-detail-exercise .ex-name {
  font-weight: 600;
  margin-bottom: 6px;
}

.history-detail-exercise .ex-data {
  color: var(--text2);
  font-size: 14px;
}

.btn-back {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 20px;
}

/* Progress */
.progress-exercise {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.progress-exercise h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.chart-container {
  height: 200px;
  position: relative;
}

/* Section title */
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text2);
  padding: 40px 0;
}

/* Badge */
.workout-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.badge-a { background: #e94560; color: white; }
.badge-b { background: #4ecca3; color: #1a1a2e; }
.badge-c { background: #533483; color: white; }

/* Responsive tweaks */
@media (min-width: 500px) {
  .container { padding: 24px; }
}

/* Input number spinners entfernen */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }
