/* ============================================
   LaLuna Schedule - Design System
   ============================================ */

:root {
  --bg: #f4efe8;
  --accent: #dea84a;
  --text-dark: #1c1d1d;
  --white: #ffffff;
  --error: #c44536;
  --success: #4a7c59;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 16px rgba(28, 29, 29, 0.08);
}

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

body {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ===== Header / Logo ===== */
.site-header {
  display: flex;
  justify-content: center;
  padding: 32px 0 8px;
}

.site-header img {
  height: 120px;
  object-fit: contain;
}

.page-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

.subtitle {
  text-align: center;
  color: var(--text-dark);
  opacity: 0.7;
  font-size: 0.92rem;
  margin-top: -20px;
  margin-bottom: 28px;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

/* ===== Forms ===== */
label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-dark);
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e0d4;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-dark);
  transition: border-color 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(222, 168, 74, 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--white);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-danger {
  background: var(--error);
}

.btn-small {
  width: auto;
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-row .btn {
  width: auto;
  flex: 1;
}

/* ===== Messages ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
  font-weight: 500;
}

.alert-error {
  background: #fbe9e6;
  color: var(--error);
  border: 1px solid #f0c4bc;
}

.alert-success {
  background: #e9f3ea;
  color: var(--success);
  border: 1px solid #c0dcc5;
}

.alert-info {
  background: #fbf3e2;
  color: #8a6418;
  border: 1px solid #efd9a8;
}

/* ===== Availability Grid (Calendar style) ===== */
.grid-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: var(--white);
}

.avail-grid {
  display: grid;
  grid-template-columns: 70px repeat(7, minmax(80px, 1fr));
  gap: 2px;
  min-width: 680px;
  user-select: none;
}

.grid-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.8rem;
  border-radius: 4px;
}

.grid-head {
  font-weight: 700;
  color: var(--text-dark);
  background: var(--bg);
  padding: 10px 4px;
  position: sticky;
  top: 0;
}

.grid-hour-label {
  font-weight: 600;
  color: var(--text-dark);
  opacity: 0.6;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 6px;
  transform: translateY(-6px);
}

.grid-hour-first {
  transform: none;
  padding-top: 4px;
}

.grid-slot {
  background: #f0ebe2;
  cursor: pointer;
  height: 34px;
  border: 1px solid #ffffff;
  transition: background 0.1s;
}

.grid-slot:hover {
  background: #e6dcc8;
}

.grid-slot.selected {
  background: var(--accent);
}

.grid-slot.locked {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== Admin Table ===== */
table.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

table.admin-table th,
table.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #ece4d6;
  font-size: 0.9rem;
}

table.admin-table th {
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
}

table.admin-table tr:hover {
  background: #fbf7f0;
}

table.admin-table input[type="number"] {
  padding: 6px 10px;
  width: 90px;
}

/* ===== Badge ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-open {
  background: #e9f3ea;
  color: var(--success);
}

.badge-locked {
  background: #fbe9e6;
  color: var(--error);
}

.badge-published {
  background: #fbf3e2;
  color: #8a6418;
}

/* ===== Top nav for admin ===== */
.admin-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-nav .logo-small {
  height: 120px;
}

.admin-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 5px 13px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  background: var(--bg);
  transition: background .15s, color .15s;
  line-height: 1.4;
}

.admin-nav-links a:hover {
  background: rgba(222,168,74,.18);
  color: var(--text-dark);
}

.admin-nav-links a.nav-aktiv {
  background: var(--accent);
  color: #fff;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.small-text { font-size: 0.82rem; opacity: 0.7; }

@media (max-width: 640px) {
  /* ===== Logo ===== */
  .site-header { padding: 16px 0 4px; }
  .site-header img { height: 80px; }
  .admin-nav .logo-small { height: 80px; }

  /* ===== Layout ===== */
  .container, .container-narrow { padding: 14px 12px 40px; }

  /* ===== Typography ===== */
  .page-title { font-size: 1.1rem; margin-bottom: 16px; }
  .subtitle { font-size: 0.85rem; }

  /* ===== Cards ===== */
  .card { padding: 14px 12px; border-radius: 12px; margin-bottom: 14px; overflow-x: auto; }

  /* ===== Admin Nav ===== */
  .admin-nav { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-nav-links { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; }
  .admin-nav-links a { font-size: 0.78rem; padding: 4px 10px; }

  /* ===== Inline-Grid-Formulare → einzelne Spalte (außer Plan-Builder-Raster) ===== */
  [style*="grid-template-columns"]:not(#builderGrid):not(#daySummaryRow) {
    grid-template-columns: 1fr !important;
  }

  /* ===== Tabellen scrollbar ===== */
  table.admin-table { min-width: 920px; }

  /* ===== Filter-Bar ===== */
  .filter-bar { flex-direction: column; }
  .filter-bar > div { min-width: unset !important; flex: unset !important; }

  /* ===== Button-Reihe ===== */
  .btn-row { flex-direction: column; }
  .btn-row .btn { flex: unset; width: 100%; }

  /* ===== Formulareingaben ===== */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  select { padding: 12px 14px; font-size: 0.95rem; }

  .btn { padding: 12px 20px; font-size: 0.95rem; }

  /* ===== Tages-Zusammenfassung: Breite durch Inhalt + einzeilige Einträge ===== */
  .day-summary-row { width: max-content; }
  .ds-entry { white-space: nowrap; }

  /* ===== Plan-Grid-Karte: seitliches Padding entfernen (kein weißer Rand beim Scrollen) ===== */
  .card:has(.builder-grid-wrapper) {
    padding-left: 0;
    padding-right: 0;
  }
}
