:root {
  --bg-page: #eef2f7;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #6b7280;

  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --purple: #6366f1;
  --green: #22c55e;

  --radius-lg: 1.25rem;
  --radius-md: 1rem;
  --shadow-card: 0 10px 40px rgba(15, 23, 42, 0.08);

  --gap: 1.25rem;
}

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

body {
  margin: 0;
  background: var(--bg-page);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 1180px;
  margin: 2rem auto 3.5rem;
  padding: 0 1.25rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.topbar-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.topbar-title span {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge-admin {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.section-card {
  background: var(--surface);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-card);
  margin-top: 1.5rem;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.25rem 1.4rem 0.5rem;
}

.section-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

/* Ergänzung für SVG-basierte Icons (Lucide) */
.section-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: var(--primary);
}


.section-title {
  font-weight: 700;
}

.section-body {
  padding: 1.25rem 1.4rem 1.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-weight: 600;
  font-size: 0.85rem;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  background: #fff;
  outline: none;
  height: 44px;
}

textarea {
  height: auto;
  min-height: 90px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 0.9rem;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
}

.summary-box {
  background: rgba(37, 99, 235, 0.04);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

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

.btn-back {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: .5rem;
  color: var(--primary);
  font-size: .85rem;
  cursor: pointer;
}
.btn-back:hover {
  background: rgba(37,99,235,0.15);
}
.btn-back svg {
  width: 16px;
  height: 16px;
}
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entry-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
}

.entry-meta {
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  gap: 1rem;
}

.entry-notes {
  font-size: 0.8rem;
  color: #374151;
  margin-top: .25rem;
  white-space: pre-wrap;
}

.entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .5rem;
}

.btn-small {
  background: rgba(37,99,235,0.1);
  color: var(--primary);
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: .4rem;
  padding: .25rem .6rem;
  font-size: .75rem;
  cursor: pointer;
}
.btn-small:hover {
  background: rgba(37,99,235,0.2);
}
.entries-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.entries-table th, .entries-table td {
  border: 1px solid #e5e7eb;
  padding: .4rem .6rem;
  font-size: .85rem;
  text-align: left;
  vertical-align: middle;
}

.entries-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
}

.entries-table tr:nth-child(even) {
  background: #fdfdfd;
}

.entries-table tr:hover {
  background: rgba(37,99,235,0.05);
}

.btn-small {
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  color: var(--primary);
  border-radius: .4rem;
  padding: .25rem .6rem;
  font-size: .75rem;
  cursor: pointer;
}
.btn-small:hover {
  background: rgba(37,99,235,0.15);
}

#customRange {
  align-items: center;
}
#customRange label {
  font-size: .85rem;
  color: #374151;
}
#rangeSelect {
  padding: .25rem .5rem;
  border: 1px solid #d1d5db;
  border-radius: .4rem;
  font-size: .85rem;
}
/* === ZeitApp – kompakte Nav & Login im Menü ============================== */

:root{
  --za-bg: #ffffff;
  --za-surface: #f6f7f9;
  --za-border: #e5e7eb;
  --za-text: #111827;
  --za-muted: #6b7280;
  --za-primary: #111827;        /* dunkler Button */
  --za-primary-contrast: #ffffff;
  --za-hover: #f1f3f5;
  --za-shadow: 0 6px 24px rgba(0,0,0,.08);
  --za-radius: 14px;
}

.app-nav{
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .9rem;
  background: var(--za-bg);
  border-bottom: 1px solid var(--za-border);
}

.app-brand{
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--za-text);
  text-decoration: none;
}

.app-nav-toggle{
  background: var(--za-bg);
  border: 1px solid var(--za-border);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.app-nav-toggle:hover{ background: var(--za-surface); }
.app-nav-toggle:active{ transform: scale(.98); }
.app-nav-toggle svg{ width: 22px; height: 22px; }

.app-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 10px;
  display: none;
  min-width: 280px;
  background: var(--za-bg);
  border: 1px solid var(--za-border);
  border-radius: var(--za-radius);
  box-shadow: var(--za-shadow);
  padding: .4rem;
  list-style: none;
}
.app-menu.open{ display: block; }

.menu-item{
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .7rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--za-text);
}
.menu-item:hover{ background: var(--za-hover); }
.menu-item svg{ width: 18px; height: 18px; }

.menu-sep{
  height: 1px;
  margin: .35rem .25rem;
  background: var(--za-border);
  list-style: none;
}

/* --- Login im Menü: flach & kompakt --- */
.nav-login{
  padding: .35rem .35rem .5rem;
  display: grid;
  gap: .45rem;
}

.auth-status{
  text-align: center;
  font-size: .85rem;
  color: var(--za-muted);
  margin-top: .15rem;
}

.login-form{
  display: grid;
  gap: .35rem;
}

.field{
  position: relative;
  display: grid;
}
.field .field-icon{
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--za-muted);
  pointer-events: none;
}
.field input{
  appearance: none;
  width: 100%;
  border: 1px solid var(--za-border);
  border-radius: 10px;
  padding: .5rem .75rem .5rem 2.1rem; /* Platz für Icon */
  font-size: .95rem;
  background: var(--za-surface);
  color: var(--za-text);
  outline: none;
}
.field input::placeholder{ color: #9aa1ab; }
.field input:focus{
  border-color: #c6cad0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17,24,39,.06);
}

.row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.remember{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  color: var(--za-muted);
}

/* Buttons – flach, App-Style */
.btn{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 10px;
  border: 1px solid var(--za-border);
  padding: .5rem .75rem;
  background: #fff;
  color: var(--za-text);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.btn:hover{ background: var(--za-hover); }
.btn:active{ transform: translateY(1px); }
.btn svg{ width: 18px; height: 18px; }

.btn-sm{ padding: .4rem .6rem; border-radius: 9px; }
.btn-primary{
  background: var(--za-primary);
  border-color: var(--za-primary);
  color: var(--za-primary-contrast);
}
.btn-primary:hover{ filter: brightness(1.05); }
.btn-ghost{
  background: transparent;
  border-color: transparent;
  color: var(--za-muted);
}
.btn-ghost:hover{ background: var(--za-hover); color: var(--za-text); }

