/* ═══════════════════════════════════════════════════
   SmartPony ERP – Custom CSS (Mockup-Angleichung)
   Ergänzt Tailwind um spezifische Mockup-Styles
   ═══════════════════════════════════════════════════ */

:root {
  --pony-50:  #fdf8f4;
  --pony-100: #f5ede6;
  --pony-200: #e8d8c8;
  --pony-300: #d4b89a;
  --pony-400: #c89670;
  --pony-500: #c8622a;
  --pony-600: #a85020;
  --pony-700: #7a3a18;
  --pony-800: #5c2c12;
  --pony-900: #3d2c1e;
}

/* ── Global ── */
* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--pony-50);
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

/* ── Main Content Container ── */
.main-content {
  max-width: 32rem; /* max-w-lg = 512px */
  margin: 0 auto;
}

/* ── Desktop Sidebar (hidden on mobile) ── */
.desktop-sidebar { display: none; }

/* ── Participant Avatar Dots (Mockup-Style) ── */
.avatar-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  border: 2px solid white;
  flex-shrink: 0;
}
.avatar-dot-lg {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.avatar-stack {
  display: flex;
}
.avatar-stack .avatar-dot { margin-right: -8px; }
.avatar-stack .avatar-dot:last-child { margin-right: 0; }

/* Avatar Farben (rotierend) */
.avatar-c1 { background: #e8956d; }
.avatar-c2 { background: #7bb8a0; }
.avatar-c3 { background: #9b8fc8; }
.avatar-c4 { background: #d4a944; }
.avatar-c5 { background: #e06a8c; }
.avatar-c6 { background: #5ca0d4; }

/* ── Billing-Type Chips (Mockup-Style) ── */
.chip-billing {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border-width: 1.5px;
  border-style: solid;
  line-height: 1.4;
}
.chip-einzeln   { border-color: #3a6fd8; color: #3a6fd8; background: #e8f0ff; }
.chip-block     { border-color: #9b5fc8; color: #9b5fc8; background: #f0e8ff; }
.chip-abo       { border-color: #2da06a; color: #2da06a; background: #e6f7f0; }
.chip-frei      { border-color: #a0897a; color: #a0897a; background: var(--pony-100); }

/* ── Status Badges ── */
.badge-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-geplant      { background: #fff3e8; color: var(--pony-500); }
.badge-durchgefuehrt { background: #e6f7f0; color: #2da06a; }
.badge-abgesagt     { background: #fff0ee; color: #e05a4a; }
.badge-abgerechnet  { background: #e6f7f0; color: #2da06a; }

/* ── Payment Pill ── */
.pay-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}
.pay-bezahlt { background: #e6f7f0; color: #2da06a; }
.pay-offen   { background: #fff0ee; color: #e05a4a; }

/* ── Offiziell/Intern Badges ── */
.badge-offiziell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--pony-500);
}
.badge-intern {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #b0a090;
}

/* ── Filter Chips (Finanzen) ── */
.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.filter-chip.active-all     { background: var(--pony-900); color: white; }
.filter-chip.active-off     { background: #e6f7f0; color: #2da06a; }
.filter-chip.active-intern  { background: var(--pony-100); color: var(--pony-500); }
.filter-chip.active-income  { background: #dcfce7; color: #16a34a; }
.filter-chip.active-expense { background: #fee2e2; color: #dc2626; }
.filter-chip.inactive       { background: #f5f5f5; color: #999; }

/* ── Course Card (Mockup-Detailliert) ── */
.course-card {
  background: white;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--pony-100);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.1s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.course-card:active { transform: scale(0.98); }

.course-card .divider {
  height: 1px;
  background: var(--pony-100);
  margin: 10px 0;
}

/* ── Summary Cards (Dashboard) ── */
.summary-card {
  flex: 1;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  border: 1px solid var(--pony-200);
  background: linear-gradient(135deg, #f9f2ec, #f5e8da);
}
.summary-card.highlight {
  background: linear-gradient(135deg, var(--pony-500), #e8956d);
  border-color: transparent;
  color: white;
}
.summary-card .s-value {
  font-size: 22px;
  font-weight: 800;
}
.summary-card .s-label {
  font-size: 11px;
  margin-top: 2px;
}
.summary-card.highlight .s-value { color: white; }
.summary-card.highlight .s-label { color: rgba(255,255,255,0.8); }

/* ── Finance Header Card (Dark) ── */
.finance-card {
  background: linear-gradient(135deg, var(--pony-900), #6b4a35);
  border-radius: 20px;
  padding: 20px;
  color: white;
}

/* ── Schnellaktion-Buttons ── */
.quick-action {
  flex: 1;
  background: var(--pony-100);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s;
  text-decoration: none;
  display: block;
}
.quick-action:active { transform: scale(0.96); }
.quick-action .qa-icon { font-size: 24px; margin-bottom: 4px; }
.quick-action .qa-label { font-size: 12px; font-weight: 600; color: var(--pony-500); }

/* ── Anwesenheits-Checkbox (Mockup-Style) ── */
.check-attendance {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid var(--pony-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  background: white;
}
.check-attendance.checked {
  background: #2da06a;
  border-color: #2da06a;
  color: white;
}

/* ── Attendee Card (Mockup-Style) ── */
.attendee-card {
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--pony-100);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  transition: all 0.15s;
}
.attendee-card.present {
  border-color: #7bb8a0;
  background: #f4fdf8;
}

/* ── Kurs-Header (Gradient) ── */
.kurs-header-gradient {
  background: linear-gradient(135deg, var(--pony-500), #e8956d);
  color: white;
}

/* ── Primary Button (Gradient) ── */
.btn-pony {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--pony-500), #e8956d);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 98, 42, 0.35);
  transition: transform 0.1s;
}
.btn-pony:active { transform: scale(0.98); }

.btn-green {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2da06a, #5dc892);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(45, 160, 106, 0.35);
  transition: transform 0.1s;
}
.btn-green:active { transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 13px;
  background: var(--pony-100);
  color: var(--pony-500);
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

/* ── Segmented Control (Einnahme/Ausgabe) ── */
.segmented {
  display: flex;
  background: var(--pony-100);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.seg-option {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #a07060;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
}
.seg-option.active {
  background: white;
  color: var(--pony-500);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Toggle Switch (Offiziell) ── */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--pony-200);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-switch.on { background: var(--pony-500); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch.on::after { transform: translateX(20px); }

/* ── Offiziell-Box (Buchungsformular) ── */
.offiziell-box {
  background: var(--pony-50);
  border-radius: 16px;
  padding: 16px;
  border: 1.5px solid var(--pony-200);
}

/* ── Transaction Item (Finanzen) ── */
.tx-item {
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--pony-100);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.tx-item.intern {
  border-color: var(--pony-200);
  background: var(--pony-50);
}

.tx-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.tx-icon-income { background: #e6f7f0; }
.tx-icon-expense { background: #fff0ee; }
.tx-icon-intern { background: #fff5e8; }

/* ── Form Input (Mockup-Style) ── */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--pony-200);
  border-radius: 14px;
  font-size: 15px;
  color: var(--pony-900);
  background: var(--pony-50);
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--pony-500);
  background: white;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #a07060;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
}

/* ── Kurstyp Selection Grid ── */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.type-card {
  background: var(--pony-50);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.type-card.selected {
  border-color: var(--pony-500);
  background: #fff5f0;
}
.type-card .type-icon { font-size: 28px; margin-bottom: 6px; }
.type-card .type-name { font-size: 13px; font-weight: 600; color: var(--pony-900); }
.type-card .type-detail { font-size: 11px; color: #a07060; margin-top: 2px; }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--pony-100);
  display: flex;
  padding: 8px 0 env(safe-area-inset-bottom, 16px);
  z-index: 50;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  text-decoration: none;
}
.nav-item .nav-icon { font-size: 22px; }
.nav-item .nav-label { font-size: 10px; font-weight: 500; color: #c0a898; }
.nav-item.active .nav-label { color: var(--pony-500); font-weight: 700; }

/* ── Animations ── */
.fade-in { animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Empty State ── */
.empty-state {
  background: white;
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  border: 1px solid var(--pony-100);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 16px; font-weight: 700; color: var(--pony-900); margin-bottom: 4px; }
.empty-state .empty-text { font-size: 14px; color: #a0897a; }


/* ═══════════════════════════════════════════════════
   DESKTOP / LAPTOP LAYOUT (≥ 1024px)
   ═══════════════════════════════════════════════════ */

@media (min-width: 1024px) {
  /* Body: kein bottom-padding mehr */
  body { padding-bottom: 0; }

  /* Bottom-Nav verstecken */
  .bottom-nav { display: none !important; }

  /* Sidebar anzeigen */
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: white;
    border-right: 1px solid var(--pony-100);
    z-index: 50;
    padding: 20px 0;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--pony-100);
    margin-bottom: 12px;
  }
  .sidebar-brand-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--pony-900);
  }

  .sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--pony-400);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
  }
  .sidebar-item:hover {
    background: var(--pony-50);
    color: var(--pony-700);
  }
  .sidebar-item.active {
    background: var(--pony-100);
    color: var(--pony-500);
    font-weight: 700;
  }
  .sidebar-icon { font-size: 18px; width: 24px; text-align: center; }

  .sidebar-footer {
    padding: 12px 10px 0;
    border-top: 1px solid var(--pony-100);
    margin-top: 8px;
  }

  /* Haupt-Inhalt nach rechts verschieben */
  .main-content {
    margin-left: 220px;
    max-width: 900px;
    padding: 0 24px;
  }

  /* ── Finanzen: Desktop-Tabelle ── */
  .tx-table-desktop { display: table !important; }
  .tx-list-mobile   { display: none !important; }

  /* ── Kurse: Grid-Layout ── */
  .course-grid-desktop {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 0;
  }
  .course-grid-desktop .course-card {
    margin: 0 !important;
  }
}

/* ── Finanzen Desktop-Tabelle ── */
.tx-table-desktop {
  display: none; /* versteckt auf mobile */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--pony-100);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.tx-table-desktop th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pony-400);
  background: var(--pony-50);
  border-bottom: 1px solid var(--pony-100);
  cursor: pointer;
  user-select: none;
}
.tx-table-desktop th:hover { color: var(--pony-700); }
.tx-table-desktop td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--pony-900);
  border-bottom: 1px solid var(--pony-50);
  vertical-align: middle;
}
.tx-table-desktop tr:last-child td { border-bottom: none; }
.tx-table-desktop tr:hover td { background: var(--pony-50); }
.tx-table-desktop tr.intern td { color: var(--pony-300); }
.tx-table-desktop .amount-positive { color: #2da06a; font-weight: 700; }
.tx-table-desktop .amount-negative { color: #e05a4a; font-weight: 700; }

/* ── Statistik Charts ── */
.stat-card {
  background: white;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--pony-100);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.stat-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--pony-900);
  margin-bottom: 16px;
}
.stat-bar {
  height: 24px;
  border-radius: 6px;
  transition: width 0.5s ease-out;
}
.stat-bar-income { background: linear-gradient(90deg, #2da06a, #5dc892); }
.stat-bar-expense { background: linear-gradient(90deg, #e05a4a, #ff8a80); }
