:root {
  --primary: #085ca8;
  --primary-dark: #064a87;
  --accent: #c9a227;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e3e7ec;
  --text: #1b2430;
  --muted: #64707c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Roboto", -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1, h2, .brand-name { font-family: "Fraunces", Georgia, serif; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-size: 19px; font-weight: 600; color: var(--primary); }
.brand-sub { font-size: 13px; color: var(--muted); }

.account { position: relative; }
.account-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--primary);
  cursor: pointer;
}
.account-btn[hidden] { display: none; }
.account-btn[aria-expanded="true"] { background: var(--bg); }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 180px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(27, 36, 48, 0.08);
}
#user-name { margin: 0 0 8px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
#logout-form button, #sync-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
#sync-btn:disabled { opacity: 0.6; cursor: wait; text-decoration: none; }

footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 24px 18px;
  color: var(--muted);
  font-size: 12px;
}

.login-body { display: grid; place-items: center; }
.login-card {
  width: min(420px, calc(100% - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 24px;
}
.login-card h1 { margin: 4px 0 8px; font-size: 28px; font-weight: 600; }
.login-lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.login-error { margin: 0 0 14px; color: #9b2c2c; font-size: 14px; }
.login-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14px;
}
.login-btn:hover { background: var(--primary-dark); }

main { flex: 1; padding: 20px 24px 40px; max-width: 1200px; margin: 0 auto; width: 100%; }

.widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.widget h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.widget-sub { font-family: "Roboto", sans-serif; font-size: 12px; font-weight: 400; color: var(--muted); }

.widget-list {
  display: flex;
  flex-direction: column;
  max-height: 230px;
  overflow-y: auto;
}
.widget-list .empty { color: var(--muted); font-style: italic; font-size: 13px; padding: 4px 2px; }

/* Geburtstage */
.bday-section {
  margin: 10px 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.bday-section:first-child { margin-top: 2px; }
.bday-section-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
  padding: 4px 4px 2px;
}
.bday-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.bday-row:last-child { border-bottom: none; }
.bday-date {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bday-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.person-link, a.person-link:hover, a.person-link:visited, a.person-link:active {
  color: inherit;
  text-decoration: none;
}
.bday-right { display: flex; align-items: center; gap: 6px; }
.bday-when {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.bday-when.today { background: var(--accent); color: #fff; }
.bday-when.tomorrow { background: #fbe9c6; color: #7a5d10; }
.bday-age { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Proben */
.rehearsal-row {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.rehearsal-row:last-child { border-bottom: none; }
.rehearsal-title { font-weight: 500; }
.rehearsal-location { color: var(--muted); font-size: 12px; }
.rehearsal-when { color: var(--primary); font-weight: 600; font-size: 12px; white-space: nowrap; text-align: right; }
.rehearsal-time { color: #000; font-weight: 400; }

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tabs button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-family: "Roboto", sans-serif;
  color: var(--text);
}

.tabs button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

#people-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

#people-table .empty { color: var(--muted); font-style: italic; font-size: 13px; padding: 10px 12px; }

.tabulator { border: none; font-family: "Roboto", sans-serif; font-size: 13px; }
.tabulator .tabulator-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.tabulator .tabulator-col { background: var(--bg); }
.tabulator-row.tabulator-row-even { background: #fafbfc; }

@media (max-width: 800px) {
  header, footer { padding-left: 14px; padding-right: 14px; }
  header { padding-top: 12px; padding-bottom: 12px; }
  main { padding: 12px 12px 28px; }
  .widgets { grid-template-columns: 1fr; }

  .bday-row { grid-template-columns: 64px 1fr; row-gap: 2px; }
  .bday-name { white-space: normal; }
  .bday-right { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }

  .rehearsal-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .rehearsal-when { text-align: left; }

  .person {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.35;
  }
  .person:last-child { border-bottom: none; }
  .person:nth-child(even) { background: #fafbfc; }
  .person-name { font-weight: 500; }
  .person-name strong { font-weight: 700; }
  .person-role { color: var(--primary); font-size: 12px; font-weight: 600; }
  .person-addr { font-size: 13px; }
  .person-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .person-meta a { color: var(--primary); text-decoration: none; }
}
