/* Bavarian-Starlights-Admin — schlichtes Mini-UI im Editorial-Stil der Website
   (Creme/Navy/Gold, Systemfonts, grosse Klickflaechen). Ein Stylesheet, kein Framework.
   Farb-Token uebernommen aus site/src/styles/global.css (Editorial-Redesign 2026). */

:root {
  --navy-900: #0e1a3c;
  --navy-800: #132352;
  --navy-700: #1c2f66;
  --gold-500: #c9a227;
  --gold-300: #e8c766;
  --gold-text: #8a6816;
  --cream: #faf7ef;
  --cream-deep: #f3ecda;
  --white: #ffffff;
  --ink: #1c1c1c;
  --line: #e3dcc9;
  --danger: #a3311f;
  --danger-bg: #fbeae6;
  --success: #2f6b3e;
  --success-bg: #e9f4ea;
  --radius-sm: 10px;
  --radius-md: 16px;
  --shadow-md: 0 8px 24px rgba(14, 26, 60, 0.12), 0 2px 6px rgba(14, 26, 60, 0.06);
  --shadow-lg: 0 20px 48px rgba(14, 26, 60, 0.24);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, 'Noto Sans', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 112.5%; /* 18px Basis */
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
}

h1,
h2 {
  font-family: var(--font-sans);
  color: var(--navy-900);
  margin: 0 0 0.6em;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h1 span {
  color: var(--gold-text);
  font-weight: 500;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

button,
input,
textarea {
  font: inherit;
}

/* ── Buttons: grosse Klickflaechen (>=44px) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary {
  background: var(--navy-900);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-800);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--navy-900);
  border-color: var(--line);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--navy-700);
  background: var(--cream-deep);
}

/* ── Formulare ── */
label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.35rem;
  color: var(--navy-900);
}

input[type='text'],
input[type='password'],
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}

textarea {
  min-height: 6rem;
  resize: vertical;
  font-family: inherit;
}

input:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  margin: 1rem 0;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
}

/* ── Hinweise / Feedback ── */
.hint {
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--navy-800);
}

.feedback.is-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.feedback.is-error,
.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

/* ============ Login-Seite ============ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card .subtitle {
  display: block;
  font-size: 0.95rem;
  color: var(--gold-text);
  font-weight: 500;
  margin-top: 0.2rem;
}

.login-card button[type='submit'] {
  width: 100%;
  margin-top: 1.5rem;
  background: var(--navy-900);
  color: var(--white);
}

/* ============ Dashboard ============ */
.topbar {
  background: var(--navy-900);
  color: var(--white);
}

.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar h1 {
  color: var(--white);
  font-size: 1.25rem;
  margin: 0;
}

.topbar h1 span {
  color: var(--gold-300);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-right #me-user {
  color: var(--gold-300);
  font-weight: 600;
}

.topbar .btn-ghost {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.topbar .btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  display: grid;
  gap: 1.5rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.termine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.termin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.termin-row.is-cancelled {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.termin-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.termin-date {
  font-weight: 700;
  color: var(--navy-900);
}

.termin-meta {
  font-size: 0.9rem;
  color: var(--navy-800);
}

.termin-row.is-cancelled .status {
  color: var(--danger);
  font-weight: 700;
}

.termine-list .loading,
.termine-list .empty {
  padding: 1rem;
  color: var(--navy-800);
  list-style: none;
}

/* ── Automatische Posts ── */
.posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.post-row {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  display: grid;
  gap: 0.5rem;
}

.post-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.post-anlass {
  font-weight: 700;
  color: var(--navy-900);
}

.post-meta {
  font-size: 0.9rem;
  color: var(--navy-800);
}

.post-meta .status {
  font-weight: 700;
}

.post-meta .status.is-done {
  color: var(--success);
}

.post-meta .status.is-skipped {
  color: var(--danger);
}

.post-meta .status.is-planned {
  color: var(--gold-text);
}

.post-preview summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-800);
}

.post-preview pre {
  margin: 0.6rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
}

.posts-list .loading,
.posts-list .empty {
  padding: 1rem;
  color: var(--navy-800);
  list-style: none;
}

.termin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Absage-Dialog ── */
dialog {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  max-width: 440px;
  width: calc(100% - 2rem);
}

dialog::backdrop {
  background: rgba(14, 26, 60, 0.55);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 520px) {
  .termin-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Tabs ── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line, #e3dcc9); margin-bottom: 1.2rem; flex-wrap: wrap; }
.tab {
  appearance: none; background: none; border: none; cursor: pointer;
  padding: .7rem 1.1rem; font: inherit; font-weight: 600;
  color: #6a6a6a; border-bottom: 3px solid transparent; margin-bottom: -2px;
  min-height: 44px;
}
.tab:hover { color: var(--navy-900, #0e1a3c); }
.tab[aria-selected="true"] { color: var(--navy-900, #0e1a3c); border-bottom-color: var(--gold-500, #c9a227); }
.tab:focus-visible { outline: 3px solid #6a5100; outline-offset: 2px; border-radius: 4px; }
