/* =====================================================================
   Marschplan — Hauptstylesheet
   Design-Sprache: fahnenschwingergruppe.de
   DM Sans + Forum, sehr minimalistisch
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Forum&display=swap');

:root {
  --ink:        #151616;
  --ink-soft:   #232529;
  --gray-1:     #65696F;
  --gray-2:     #737880;
  --gray-3:     #aaa6a0;
  --line:       #E5E3DE;
  --line-soft:  #F0EDE7;
  --bg-soft:    #F6F6F6;
  --bg-softer:  #F1F0F0;
  --bg:         #FFFFFF;

  --ok:         #2D6020;
  --ok-bg:      #F1F6EC;
  --warn:       #8B6F1A;
  --warn-bg:    #FBF3DE;
  --err:        #8B1A1A;
  --err-bg:     #F8E5E5;
  --info:       #3A5A78;
  --info-bg:    #EEF1F5;

  --serif:      'Forum', 'Cormorant Garamond', Georgia, serif;
  --sans:       'DM Sans', system-ui, -apple-system, sans-serif;

  --radius:     2px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: 0.3px; margin: 0 0 14px 0; line-height: 1.2; }
h1 { font-size: 38px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; font-family: var(--sans); font-weight: 500; }
h4 { font-size: 17px; font-family: var(--sans); font-weight: 500; }
p  { margin: 0 0 14px 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-softer);
  padding: 1px 6px;
  border-radius: 2px;
}

.muted   { color: var(--gray-1); }
.small   { font-size: 13px; }
.center  { text-align: center; }
.right   { text-align: right; }

/* ============================================================
   PUBLIC LAYOUT
   ============================================================ */
.public-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.public-topbar {
  border-bottom: 1px solid var(--line);
  padding: 24px 28px;
}
.public-topbar .inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.public-topbar .logo { width: 44px; height: 44px; }
.public-topbar .brand-name { font-family: var(--serif); font-size: 22px; line-height: 1; }
.public-topbar .brand-sub { font-size: 12px; color: var(--gray-1); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }

.public-content { flex: 1; padding: 50px 24px; display: flex; justify-content: center; }
.public-card { width: 100%; max-width: 760px; }

.public-footer {
  border-top: 1px solid var(--line);
  padding: 22px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-1);
}

.lead { font-size: 17px; color: var(--gray-1); margin-bottom: 32px; }

/* ============================================================
   FORM (public + admin)
   ============================================================ */
.field { margin-bottom: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }

label.field-label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 6px; color: var(--ink); letter-spacing: 0.02em;
}
.required::after { content: " *"; color: var(--err); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=tel], input[type=time], input[type=date], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21,22,22,0.06);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field-hint { font-size: 12px; color: var(--gray-1); margin-top: 5px; }

.field-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.field-check input[type=checkbox] { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--ink); }
.field-check label { cursor: pointer; }

/* ============================================================
   SECTIONS (Schritte im Formular)
   ============================================================ */
.section {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
}
.section h2 {
  font-size: 20px; margin: 0 0 4px 0;
  display: flex; align-items: center; gap: 12px;
}
.section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-family: var(--serif); font-size: 15px;
}
.section .hint { color: var(--gray-1); font-size: 13.5px; margin-bottom: 18px; }

/* ============================================================
   DAY/SLOT WAHL
   ============================================================ */
.day-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--bg);
}
.day-block.disabled { background: var(--bg-soft); opacity: .6; }
.day-block .day-name { font-weight: 500; font-size: 15px; margin-bottom: 8px; }
.day-block .day-date { color: var(--gray-1); font-size: 12px; font-weight: 400; margin-left: 6px; }

.slot-row { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-pill {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.slot-pill input { display: none; }
.slot-pill:hover { border-color: var(--gray-2); }
.slot-pill.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.slot-pill.disabled {
  background: var(--bg-soft);
  color: var(--gray-3);
  border-color: var(--line-soft);
  cursor: not-allowed;
  text-decoration: line-through;
}
.slot-pill.disabled:hover { border-color: var(--line-soft); }

.smart-hint {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  padding: 10px 14px;
  font-size: 13.5px;
  margin: 10px 0 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.priority-pill {
  display: inline-block;
  background: var(--ink); color: #fff;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.priority-pill.secondary { background: var(--gray-2); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.btn:hover { background: #000; border-color: #000; color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--bg); color: var(--ink); border-color: var(--line);
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--gray-1); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover { background: #6f1414; border-color: #6f1414; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-ghost { background: transparent; border: none; color: var(--gray-1); padding: 11px 0; text-decoration: underline; }
.btn-ghost:hover { color: var(--ink); }

.actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line);
}
.actions.right-only { justify-content: flex-end; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; border-left: 3px solid; }
.alert-info { background: var(--info-bg); border-left-color: var(--info); }
.alert-ok   { background: var(--ok-bg);   border-left-color: var(--ok); }
.alert-warn { background: var(--warn-bg); border-left-color: var(--warn); }
.alert-err  { background: var(--err-bg);  border-left-color: var(--err); }

.badge {
  display: inline-block; padding: 2px 9px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 12px;
}
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err  { background: var(--err-bg);  color: var(--err); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gray { background: var(--bg-soft); color: var(--gray-1); }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px; background: #1c1a18; color: #cfc7b8;
  padding: 20px 0; flex-shrink: 0; min-height: 100vh; position: sticky; top: 0;
}
.admin-sidebar .brand { padding: 0 22px 16px; border-bottom: 1px solid #2a2724; }
.admin-sidebar .brand-name { font-family: var(--serif); color: #fff; font-size: 19px; line-height: 1.2; }
.admin-sidebar .brand-sub { color: #897f6e; font-size: 12px; margin-top: 4px; }

.admin-sidebar ul { list-style: none; padding: 0; margin: 14px 0; }
.admin-sidebar .label-section {
  padding: 10px 22px 6px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #6a6253;
}
.admin-sidebar a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 22px; color: #cfc7b8;
  text-decoration: none; font-size: 14px;
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: #2a2724; color: #fff; }
.admin-sidebar a.active { background: #2a2724; color: #fff; border-left-color: #fff; font-weight: 500; }
.admin-sidebar a .pill {
  background: #41382e; color: #c8b793; font-size: 11px;
  padding: 0 7px; border-radius: 9px; font-weight: 500;
}

.admin-main { flex: 1; padding: 28px 36px 60px; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 16px;
}
.admin-topbar h1 { font-size: 28px; margin: 0; }
.admin-topbar .crumb { color: var(--gray-1); font-size: 13px; }

.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { font-size: 15px; font-family: var(--sans); font-weight: 600; margin: 0; }
.panel-body { padding: 16px 18px; }

/* ============================================================
   TABLES
   ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gray-1); font-weight: 500; background: var(--bg-soft);
}
.table tr:hover td { background: var(--bg-softer); }
.table .actions-cell { white-space: nowrap; text-align: right; }
.table-compact th, .table-compact td { padding: 6px 10px; font-size: 13px; }

/* ============================================================
   STAT-KACHELN
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.stat-card {
  background: var(--bg); border: 1px solid var(--line);
  padding: 18px; border-radius: var(--radius);
}
.stat-num { font-family: var(--serif); font-size: 36px; line-height: 1; color: var(--ink); }
.stat-label {
  font-size: 11px; color: var(--gray-1);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 5px;
}
.stat-foot { font-size: 12px; color: var(--gray-1); margin-top: 8px; }

/* ============================================================
   TIMELINE / SCHEDULE
   ============================================================ */
.entry {
  background: var(--bg); border: 1px solid var(--line);
  display: grid; grid-template-columns: 75px 1fr auto;
  gap: 14px; padding: 10px 14px; margin-bottom: 4px;
  align-items: center; font-size: 14px;
  border-radius: var(--radius);
}
.entry .time {
  font-family: var(--serif); font-size: 17px; color: var(--ink); font-weight: 400;
}
.entry .name { font-weight: 500; }
.entry .addr { font-size: 12px; color: var(--gray-1); }
.entry .meta { font-size: 11px; color: var(--gray-1); margin-top: 3px; }
.entry.fixed { background: var(--warn-bg); border-color: rgba(139,111,26,0.4); }
.entry.fixed .time { color: var(--warn); }
.entry.locked { border-left: 3px solid var(--ink); }

.travel-gap { text-align: center; color: var(--gray-1); font-size: 11px; padding: 2px 0; font-style: italic; }

/* ============================================================
   DONE / WIZARD / MISC
   ============================================================ */
.done-mark { font-family: var(--serif); font-size: 64px; text-align: center; margin-bottom: 14px; color: var(--ok); }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 2px;
  font-size: 11px; background: var(--bg-soft); color: var(--gray-1);
}

.flash-stack { margin-bottom: 18px; }

.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input { flex: 1; }
.search-bar select { width: auto; }

/* Print */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .admin-sidebar, .admin-topbar, .actions, .public-topbar, .public-footer { display: none; }
  .admin-main { padding: 0; }
  .panel, .entry { border: 1px solid #ccc; }
}
