:root {
  --primary: #1565C0;
  --accent: #FDD835;
  --bg: #F4F6F9;
  --white: #fff;
  --radius-sm: 6px;
  --radius-md: 8px;
}

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

body {
  font-family: system-ui, Arial, sans-serif;
  background: var(--bg);
  color: #222;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
header .logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
header .logo span { color: var(--accent); }
header nav a {
  color: var(--white);
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
  opacity: 0.85;
}
header nav a:hover, header nav a.active { opacity: 1; color: var(--accent); }
#btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  margin-left: 16px;
}

/* Layout */
main { max-width: 1100px; margin: 32px auto; padding: 0 16px; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 { font-size: 18px; margin-bottom: 16px; color: var(--primary); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px;
  text-align: center;
}
.stat .label { font-size: 13px; color: #666; margin-bottom: 8px; }
.stat .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat.warn .value { color: #e65100; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--bg); color: #555; font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 2px solid #e0e0e0; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
tr:hover td { background: #f8f9ff; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; color: #444; margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccd;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

/* Login */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-box {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-box h1 { font-size: 22px; color: var(--primary); margin-bottom: 4px; }
.login-box .sub { font-size: 13px; color: #888; margin-bottom: 24px; }

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #323232;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
#toast.show { opacity: 1; }

/* Status Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-neu { background: #e3f2fd; color: #1565c0; }
.badge-bestätigt { background: #e8f5e9; color: #2e7d32; }
.badge-in_bearbeitung { background: #fff3e0; color: #e65100; }
.badge-erledigt { background: #f3e5f5; color: #6a1b9a; }
.badge-offen { background: #fce4ec; color: #c62828; }
.badge-bezahlt { background: #e8f5e9; color: #2e7d32; }

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Responsive */
@media (max-width: 640px) {
  header { padding: 0 12px; }
  header nav a { display: none; }
  main { margin: 16px auto; }
}
