:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --text: #161a17;
  --muted: #667069;
  --border: #dce2dc;
  --accent: #147a5c;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(21, 30, 24, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
}

.page {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 28px 0;
}

.narrow {
  width: min(100% - 32px, 420px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.brand {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 48px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  background: var(--panel);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-bottom: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: #e8eee9;
  color: var(--text);
}

.button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
}

.button.danger {
  background: var(--danger);
}

.error {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #fae7e5;
  color: var(--danger);
  font-weight: 750;
}

.notice,
.warning {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 750;
}

.notice {
  background: #e7f4ee;
  color: #126348;
}

.notice.muted {
  background: #eef1ee;
  color: var(--muted);
}

.warning {
  background: #fff2d8;
  color: #8a5100;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}

.tabs a {
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.stack {
  margin-bottom: 16px;
}

/* ─── Timer / Erfassen ────────────────────────────────────────────────── */

.timer-card {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.timer-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.timer-meta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.timer-display {
  font-size: clamp(52px, 14vw, 84px);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  margin: 14px 0 20px;
}

.note-field {
  width: 100%;
  min-height: 72px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
}

.note-field:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-large {
  min-height: 58px;
  font-size: 18px;
}

.full-width {
  width: 100%;
}

.note-cell {
  color: var(--muted);
  font-size: 13px;
  max-width: 280px;
  white-space: normal;
  word-break: break-word;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef1ee;
  color: var(--muted);
  font-weight: 850;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill.running {
  background: #e7f4ee;
  color: var(--accent);
}

.status-pill.paused {
  background: #fff2d8;
  color: #8a5100;
}

.status-pill.approved {
  background: #e7f4ee;
  color: var(--accent);
}

.status-pill.needs_correction {
  background: #fff2d8;
  color: #8a5100;
}

.status-pill.submitted {
  background: #edf1ff;
  color: #2f4b9a;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.stats div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9faf8;
}

.stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stats strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.val-old { color: var(--danger); font-size: 13px; }
.val-new { color: var(--accent); font-size: 13px; }

.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

.filter-row select {
  width: auto;
  min-height: 40px;
  margin-bottom: 0;
}

.filter-label {
  font-weight: 800;
  color: var(--text);
}

.report-table td,
.report-table th {
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}

.row-weekend td {
  background: #f9faf8;
  color: var(--muted);
}

.row-total td {
  border-top: 2px solid var(--border);
  padding-top: 12px;
}

.warn-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head {
    flex-direction: column;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions,
  .actions form,
  .actions .button {
    width: 100%;
  }
}
