/* ==========================================================================
   HeYbamme – Design-System „Salbei & Koralle“
   Aufbau: Tokens → Base → App-Shell → Komponenten → Seiten → Motion
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */
:root {
  --hb-font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hb-font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

  --hb-sidebar: #1F3D36;
  --hb-sidebar-ink: #DCE8E3;
  --hb-sidebar-muted: #8FB0A6;
  --hb-sidebar-w: 264px;

  --hb-primary: #3E7C6B;
  --hb-primary-600: #2C5F52;
  --hb-primary-700: #234C42;
  --hb-primary-100: #D3E6DF;
  --hb-primary-50: #E8F1EE;
  --hb-primary-light: #6FAE99;

  --hb-accent: #EE7F68;
  --hb-accent-600: #C94F38;
  --hb-accent-100: #FAD5CC;
  --hb-accent-50: #FDEDE8;

  --hb-bg: #F6F7F4;
  --hb-surface: #FFFFFF;
  --hb-surface-2: #FAFBF9;
  --hb-surface-3: #EEF1EE;
  --hb-border: #E3E8E4;
  --hb-border-strong: #D2DBD6;

  --hb-ink: #18211F;
  --hb-muted: #5F6B67;
  --hb-subtle: #7F8B86;

  --hb-success: #2E8B57;
  --hb-success-ink: #1F6B42;
  --hb-success-50: #E6F4EC;
  --hb-warning: #E0A33B;
  --hb-warning-ink: #8A5A0F;
  --hb-warning-50: #FDF4E3;
  --hb-danger: #D64545;
  --hb-danger-ink: #A92E2E;
  --hb-danger-50: #FBEAEA;
  --hb-info: #3B82C4;
  --hb-info-ink: #2A5F92;
  --hb-info-50: #E8F1FA;

  /* Diagrammfarben (CVD-validiert, nur für Datenmarken) */
  --hb-chart-income: #0A78A8;
  --hb-chart-expense: #E0664C;

  --hb-radius-sm: 10px;
  --hb-radius: 14px;
  --hb-radius-lg: 16px;
  --hb-radius-xl: 22px;

  --hb-shadow-sm: 0 1px 2px rgba(24, 33, 31, 0.04), 0 1px 3px rgba(24, 33, 31, 0.06);
  --hb-shadow-md: 0 4px 12px rgba(24, 33, 31, 0.06), 0 12px 32px rgba(24, 33, 31, 0.08);
  --hb-shadow-lg: 0 12px 24px rgba(24, 33, 31, 0.08), 0 24px 56px rgba(24, 33, 31, 0.12);
  --hb-ring: 0 0 0 4px rgba(62, 124, 107, 0.16);

  /* Bootstrap-Mapping */
  --bs-body-font-family: var(--hb-font-sans);
  --bs-body-font-size: 0.9375rem;
  --bs-body-color: var(--hb-ink);
  --bs-body-bg: var(--hb-bg);
  --bs-emphasis-color: var(--hb-ink);
  --bs-secondary-color: var(--hb-muted);
  --bs-tertiary-color: var(--hb-subtle);
  --bs-border-color: var(--hb-border);
  --bs-border-radius: var(--hb-radius-sm);
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: var(--hb-radius);
  --bs-primary: #3E7C6B;
  --bs-primary-rgb: 62, 124, 107;
  --bs-success: #2E8B57;
  --bs-success-rgb: 46, 139, 87;
  --bs-danger: #D64545;
  --bs-danger-rgb: 214, 69, 69;
  --bs-warning: #E0A33B;
  --bs-warning-rgb: 224, 163, 59;
  --bs-info: #3B82C4;
  --bs-info-rgb: 59, 130, 196;
  --bs-link-color: var(--hb-primary-600);
  --bs-link-color-rgb: 44, 95, 82;
  --bs-link-hover-color: var(--hb-primary-700);
  --bs-link-hover-color-rgb: 35, 76, 66;
  --bs-focus-ring-color: rgba(62, 124, 107, 0.25);
  --bs-highlight-bg: var(--hb-accent-50);
}

/* --- 2. Base & Typografie ------------------------------------------------ */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 420px at 85% -160px, rgba(62, 124, 107, 0.08), transparent 70%),
    radial-gradient(800px 380px at 10% -200px, rgba(238, 127, 104, 0.07), transparent 70%),
    var(--hb-bg);
  background-repeat: no-repeat;
  color: var(--hb-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--hb-font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: inherit;
}

.display-serif,
.page-title {
  font-family: var(--hb-font-display);
  font-weight: 400;
  letter-spacing: -0.005em;
}

a {
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--hb-primary);
  outline-offset: 2px;
}

::selection {
  background: var(--hb-primary-100);
  color: var(--hb-ink);
}

.text-muted { color: var(--hb-muted) !important; }
.text-subtle { color: var(--hb-subtle) !important; }
.tabular { font-variant-numeric: tabular-nums; }
.fw-semibold { font-weight: 600 !important; }
.amount-pos { color: var(--hb-success-ink); }
.amount-neg { color: var(--hb-danger-ink); }

/* --- 3. App-Shell -------------------------------------------------------- */

/* Marke */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.brand .logo-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand__word {
  font-family: var(--hb-font-display);
  font-size: 1.65rem;
  line-height: 1;
  color: #fff;
}

.brand__word b {
  font-weight: 400;
  color: var(--hb-accent);
}

.brand--compact .logo-mark {
  width: 28px;
  height: 28px;
}

.brand--compact .brand__word {
  font-size: 1.4rem;
  color: var(--hb-ink);
}

.brand--compact .brand__word b {
  color: var(--hb-primary);
}

.logo-mark__leaf { fill: var(--lm-leaf, #3E7C6B); }
.logo-mark__heart { fill: var(--lm-heart, #EE7F68); }
.logo-mark__vein { stroke: var(--lm-vein, #fff); opacity: 0.6; }

/* Sidebar */
.app-sidebar {
  --bs-offcanvas-width: 284px;
  --bs-offcanvas-bg: var(--hb-sidebar);
  --bs-offcanvas-color: var(--hb-sidebar-ink);
  --lm-leaf: var(--hb-primary-light);
  color: var(--hb-sidebar-ink);
}

.app-sidebar .offcanvas-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1rem 1rem;
}

@media (max-width: 991.98px) {
  .app-sidebar.offcanvas-lg {
    background:
      radial-gradient(120% 50% at 0% 0%, rgba(111, 174, 153, 0.2), transparent 60%),
      radial-gradient(90% 40% at 100% 100%, rgba(238, 127, 104, 0.14), transparent 60%),
      var(--hb-sidebar);
  }
}

@media (min-width: 992px) {
  .app-sidebar-wrap {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: var(--hb-sidebar-w);
    background:
      radial-gradient(120% 45% at 0% 0%, rgba(111, 174, 153, 0.2), transparent 60%),
      radial-gradient(90% 35% at 100% 100%, rgba(238, 127, 104, 0.14), transparent 60%),
      var(--hb-sidebar);
  }

  .app-sidebar {
    height: 100%;
  }

  .app-sidebar .offcanvas-body {
    height: 100%;
    overflow-y: auto;
    padding: 1.4rem 1rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  }

  .has-shell .app-main {
    padding-left: var(--hb-sidebar-w);
  }
}

.sidebar-brand {
  padding: 0 0.5rem;
}

.sidebar-cta {
  width: 100%;
  margin: 1.4rem 0 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section {
  margin: 1.1rem 0 0.35rem;
  padding: 0 0.75rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hb-sidebar-muted);
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.75rem;
  border-radius: var(--hb-radius-sm);
  color: var(--hb-sidebar-ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
  width: 1.25rem;
  font-size: 1.08rem;
  text-align: center;
  color: var(--hb-sidebar-muted);
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-link:hover i {
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.sidebar-link.active i {
  color: var(--hb-accent);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--hb-accent);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem;
  border-radius: var(--hb-radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user__meta {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-user__meta strong,
.sidebar-user__meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__meta strong {
  font-size: 0.85rem;
  color: #fff;
}

.sidebar-user__meta span {
  font-size: 0.72rem;
  color: var(--hb-sidebar-muted);
}

.sidebar-user .btn-icon {
  color: var(--hb-sidebar-muted);
}

.sidebar-user .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Topbar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 64px;
  padding: 0 1.5rem;
  background: rgba(246, 247, 244, 0.8);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-topbar.is-scrolled {
  border-bottom-color: var(--hb-border);
  box-shadow: 0 1px 0 rgba(24, 33, 31, 0.02);
}

.topbar-date {
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hb-muted);
}

.topbar-date i {
  color: var(--hb-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.avatar-btn {
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transition: box-shadow 0.15s ease;
}

.avatar-btn:hover,
.avatar-btn[aria-expanded="true"] {
  box-shadow: 0 0 0 3px var(--hb-primary-100);
}

/* Inhalt */
.app-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1.75rem 3rem;
}

@media (max-width: 991.98px) {
  .app-topbar {
    padding: 0 1rem;
  }

  .app-content {
    padding: 1rem 1rem calc(110px + env(safe-area-inset-bottom));
  }
}

/* Bottom-Navigation (mobil) */
.app-bottomnav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: 64px;
  padding: 0 0.25rem;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border: 1px solid var(--hb-border);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(24, 33, 31, 0.14);
}

.bottomnav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.35rem 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--hb-subtle);
  text-decoration: none;
}

.bottomnav-link i {
  font-size: 1.25rem;
  line-height: 1;
}

.bottomnav-link.active {
  color: var(--hb-primary-600);
}

.bottomnav-fab {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--hb-accent-600);
  color: #fff;
  font-size: 1.45rem;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(201, 79, 56, 0.38);
  transform: translateY(-14px);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.bottomnav-fab:hover,
.bottomnav-fab:focus-visible {
  color: #fff;
  background: #B5452F;
}

.bottomnav-fab:active {
  transform: translateY(-12px) scale(0.96);
}

/* --- 4. Buttons ---------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: 0.875rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: 0.55rem;
  --bs-btn-border-radius: var(--hb-radius-sm);
  --bs-btn-focus-box-shadow: var(--hb-ring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

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

.btn-sm {
  --bs-btn-font-size: 0.8125rem;
  --bs-btn-padding-x: 0.75rem;
  --bs-btn-padding-y: 0.38rem;
  --bs-btn-border-radius: 8px;
}

.btn-lg {
  --bs-btn-font-size: 0.95rem;
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-padding-y: 0.72rem;
  --bs-btn-border-radius: 12px;
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--hb-primary);
  --bs-btn-border-color: var(--hb-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--hb-primary-600);
  --bs-btn-hover-border-color: var(--hb-primary-600);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--hb-primary-700);
  --bs-btn-active-border-color: var(--hb-primary-700);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--hb-primary);
  --bs-btn-disabled-border-color: var(--hb-primary);
  box-shadow: 0 1px 2px rgba(24, 33, 31, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--hb-accent-600);
  --bs-btn-border-color: var(--hb-accent-600);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #B5452F;
  --bs-btn-hover-border-color: #B5452F;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #A13D29;
  --bs-btn-active-border-color: #A13D29;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--hb-accent-600);
  --bs-btn-disabled-border-color: var(--hb-accent-600);
  --bs-btn-focus-box-shadow: 0 0 0 4px rgba(238, 127, 104, 0.25);
  box-shadow: 0 6px 16px rgba(201, 79, 56, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-soft {
  --bs-btn-color: var(--hb-primary-600);
  --bs-btn-bg: var(--hb-primary-50);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--hb-primary-700);
  --bs-btn-hover-bg: var(--hb-primary-100);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--hb-primary-700);
  --bs-btn-active-bg: var(--hb-primary-100);
  --bs-btn-active-border-color: transparent;
}

.btn-outline-secondary,
.btn-light,
.btn-secondary {
  --bs-btn-color: var(--hb-ink);
  --bs-btn-bg: var(--hb-surface);
  --bs-btn-border-color: var(--hb-border-strong);
  --bs-btn-hover-color: var(--hb-ink);
  --bs-btn-hover-bg: var(--hb-surface-2);
  --bs-btn-hover-border-color: #BFCAC4;
  --bs-btn-active-color: var(--hb-ink);
  --bs-btn-active-bg: var(--hb-surface-3);
  --bs-btn-active-border-color: #BFCAC4;
  --bs-btn-disabled-color: var(--hb-subtle);
  --bs-btn-disabled-bg: var(--hb-surface-2);
  --bs-btn-disabled-border-color: var(--hb-border);
  box-shadow: 0 1px 2px rgba(24, 33, 31, 0.05);
}

.btn-outline-primary {
  --bs-btn-color: var(--hb-primary-600);
  --bs-btn-border-color: var(--hb-primary);
  --bs-btn-hover-color: var(--hb-primary-700);
  --bs-btn-hover-bg: var(--hb-primary-50);
  --bs-btn-hover-border-color: var(--hb-primary);
  --bs-btn-active-color: var(--hb-primary-700);
  --bs-btn-active-bg: var(--hb-primary-100);
  --bs-btn-active-border-color: var(--hb-primary);
}

.btn-danger {
  --bs-btn-color: #fff;
  --bs-btn-bg: #C53B3B;
  --bs-btn-border-color: #C53B3B;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #AD3030;
  --bs-btn-hover-border-color: #AD3030;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #962828;
  --bs-btn-active-border-color: #962828;
  --bs-btn-focus-box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.22);
}

.btn-outline-danger {
  --bs-btn-color: var(--hb-danger-ink);
  --bs-btn-border-color: rgba(214, 69, 69, 0.45);
  --bs-btn-hover-color: var(--hb-danger-ink);
  --bs-btn-hover-bg: var(--hb-danger-50);
  --bs-btn-hover-border-color: var(--hb-danger);
  --bs-btn-active-color: var(--hb-danger-ink);
  --bs-btn-active-bg: #F6D8D8;
  --bs-btn-active-border-color: var(--hb-danger);
}

.btn-glass {
  --bs-btn-color: #fff;
  --bs-btn-bg: rgba(255, 255, 255, 0.1);
  --bs-btn-border-color: rgba(255, 255, 255, 0.2);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.18);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255, 255, 255, 0.24);
  --bs-btn-active-border-color: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--hb-radius-sm);
  background: transparent;
  color: var(--hb-muted);
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-icon:hover {
  background: var(--hb-surface-3);
  color: var(--hb-ink);
}

.btn-icon--sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.btn-icon--bordered {
  border-color: var(--hb-border);
  background: var(--hb-surface);
}

.btn-icon--primary:hover {
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
}

.btn-icon--danger:hover {
  background: var(--hb-danger-50);
  color: var(--hb-danger-ink);
}

.btn .spinner-border {
  --bs-spinner-width: 0.9rem;
  --bs-spinner-height: 0.9rem;
  --bs-spinner-border-width: 0.15em;
}

/* --- 5. Formulare -------------------------------------------------------- */
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hb-ink);
}

.form-label .req {
  margin-left: 0.15rem;
  color: var(--hb-accent-600);
}

.form-control,
.form-select {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  color: var(--hb-ink);
  background-color: var(--hb-surface);
  border: 1px solid var(--hb-border-strong);
  border-radius: var(--hb-radius-sm);
  box-shadow: 0 1px 2px rgba(24, 33, 31, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select {
  padding-right: 2.25rem;
}

.form-control:hover,
.form-select:hover {
  border-color: #BDC9C3;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--hb-primary);
  box-shadow: var(--hb-ring);
}

.form-control::placeholder {
  color: #A3ADA8;
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background-color: var(--hb-surface-2);
  color: var(--hb-muted);
}

textarea.form-control {
  min-height: 104px;
  line-height: 1.5;
}

.form-control-sm,
.form-select-sm {
  min-height: 36px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.form-text {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--hb-subtle);
}

.form-check-input {
  border-color: #BFCAC4;
}

.form-check-input:checked {
  background-color: var(--hb-primary);
  border-color: var(--hb-primary);
}

.form-check-input:focus {
  border-color: var(--hb-primary);
  box-shadow: var(--hb-ring);
}

.form-switch .form-check-input {
  width: 2.5em;
  height: 1.35em;
  margin-top: 0.1em;
}

.form-switch .form-check-input:focus:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2397bfb2'/%3e%3c/svg%3e");
}

.form-check-label {
  font-weight: 500;
}

.form-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  background: var(--hb-surface-2);
}

.form-switch-card .form-check {
  margin: 0;
  padding-left: 2.9em;
}

.errorlist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hb-danger-ink);
}

.alert .errorlist {
  margin: 0;
  color: inherit;
}

.form-field.has-error .form-control,
.form-field.has-error .form-select {
  border-color: var(--hb-danger);
}

.form-field.has-error .form-control:focus,
.form-field.has-error .form-select:focus {
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.15);
}

.input-icon {
  position: relative;
}

.input-icon > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hb-subtle);
  pointer-events: none;
}

.input-icon > .form-control {
  padding-left: 2.4rem;
}

.input-suffix {
  position: relative;
}

.input-suffix > span {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hb-subtle);
  pointer-events: none;
}

.input-suffix > .form-control {
  padding-right: 2.6rem;
}

.page-narrow {
  max-width: 920px;
  margin-inline: auto;
}

.page-narrow--sm {
  max-width: 640px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0.25rem 0 1.5rem;
}

@media (max-width: 991.98px) {
  .form-actions--sticky {
    position: sticky;
    bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 5;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-lg);
    box-shadow: var(--hb-shadow-md);
  }

  .form-actions--sticky .btn {
    flex: 1;
  }
}

/* --- 6. Karten & Abschnitte ---------------------------------------------- */
.card {
  --bs-card-border-color: var(--hb-border);
  --bs-card-border-radius: var(--hb-radius-lg);
  --bs-card-inner-border-radius: calc(var(--hb-radius-lg) - 1px);
  --bs-card-bg: var(--hb-surface);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 1rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-y: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  box-shadow: var(--hb-shadow-sm);
}

.hb-card {
  position: relative;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-sm);
}

.hb-card + .hb-card {
  margin-top: 1.25rem;
}

.hb-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--hb-border);
}

.hb-card__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}

.hb-card__title i {
  color: var(--hb-primary);
}

.hb-card__title .count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--hb-surface-3);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--hb-muted);
}

.hb-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hb-primary-600);
  text-decoration: none;
}

.hb-card__link:hover {
  color: var(--hb-primary-700);
  text-decoration: underline;
}

.hb-card__body {
  padding: 1.25rem;
}

.hb-card__body--tight {
  padding: 0.5rem 0.75rem 0.75rem;
}

.hb-card__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--hb-border);
  background: var(--hb-surface-2);
  border-radius: 0 0 var(--hb-radius-lg) var(--hb-radius-lg);
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--hb-border);
}

.section-head__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
  font-size: 1.12rem;
  font-weight: 700;
}

.section-head__icon--accent {
  background: var(--hb-accent-50);
  color: var(--hb-accent-600);
}

.section-head__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.section-head__text {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--hb-muted);
}

.section-head__aside {
  margin-left: auto;
  align-self: center;
}

/* --- 7. Seitenkopf -------------------------------------------------------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin: 0.5rem 0 1.5rem;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hb-primary);
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  line-height: 1.05;
  color: var(--hb-ink);
}

.page-title em {
  font-style: italic;
  color: var(--hb-accent-600);
}

.page-subtitle {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--hb-muted);
}

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

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--hb-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--hb-primary-600);
}

@media (max-width: 575.98px) {
  .page-actions {
    width: 100%;
  }

  .page-actions > .btn {
    flex: 1;
  }
}

/* --- 8. KPI-Kacheln ------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1199.98px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .kpi-grid {
    gap: 0.75rem;
  }

  .kpi-grid--3 {
    grid-template-columns: 1fr;
  }
}

.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 1.1rem 1.2rem;
  color: inherit;
  text-decoration: none;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.kpi:hover {
  color: inherit;
  transform: translateY(-2px);
  border-color: var(--hb-border-strong);
  box-shadow: var(--hb-shadow-md);
}

.kpi__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 0.65rem;
  border-radius: 11px;
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
  font-size: 1.1rem;
}

.kpi__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hb-muted);
}

.kpi__value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--hb-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi__value small {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--hb-muted);
  letter-spacing: 0;
}

.kpi__meta {
  font-size: 0.8rem;
  color: var(--hb-muted);
}

.kpi__arrow {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--hb-subtle);
  transition: transform 0.2s ease, color 0.2s ease;
}

a.kpi:hover .kpi__arrow {
  transform: translate(2px, -2px);
  color: var(--hb-primary);
}

.kpi--accent .kpi__icon {
  background: var(--hb-accent-50);
  color: var(--hb-accent-600);
}

.kpi--amber .kpi__icon {
  background: var(--hb-warning-50);
  color: var(--hb-warning-ink);
}

.kpi--danger .kpi__icon {
  background: var(--hb-danger-50);
  color: var(--hb-danger-ink);
}

.kpi--danger.is-alert {
  border-color: rgba(214, 69, 69, 0.3);
  background: linear-gradient(180deg, var(--hb-surface) 40%, var(--hb-danger-50));
}

.kpi--feature {
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(238, 127, 104, 0.32), transparent 55%),
    linear-gradient(160deg, #2C5F52, var(--hb-sidebar));
}

.kpi--feature .kpi__icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.kpi--feature .kpi__label,
.kpi--feature .kpi__meta,
.kpi--feature .kpi__arrow {
  color: #CFE2DB;
}

.kpi--feature .kpi__value {
  color: #fff;
}

a.kpi--feature:hover {
  color: #fff;
  border-color: transparent;
}

a.kpi--feature:hover .kpi__arrow {
  color: #fff;
}

@media (max-width: 575.98px) {
  .kpi {
    padding: 0.9rem;
  }

  .kpi__icon {
    width: 34px;
    height: 34px;
    margin-bottom: 0.45rem;
  }

  .kpi__value {
    font-size: 1.45rem;
  }
}

/* --- 9. Tabellen ---------------------------------------------------------- */
.table-wrap {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-sm);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.hb-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--hb-ink);
  --bs-table-border-color: var(--hb-border);
  --bs-table-hover-bg: rgba(62, 124, 107, 0.045);
  --bs-table-hover-color: var(--hb-ink);
  margin: 0;
  font-size: 0.875rem;
  vertical-align: middle;
}

.hb-table > :not(caption) > * > * {
  padding: 0.8rem 1rem;
  border-bottom-color: var(--hb-border);
}

.hb-table > thead > tr > th {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  background: var(--hb-surface-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hb-subtle);
  white-space: nowrap;
}

.hb-table > tbody > tr:last-child > * {
  border-bottom: 0;
}

.hb-table > tfoot > tr > * {
  background: var(--hb-surface-2);
  border-top: 1px solid var(--hb-border);
  border-bottom: 0;
  font-weight: 700;
}

.hb-table tr[data-href] {
  cursor: pointer;
}

.hb-table--compact > :not(caption) > * > * {
  padding: 0.55rem 0.85rem;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cell-title {
  font-weight: 600;
  color: var(--hb-ink);
  text-decoration: none;
}

a.cell-title:hover {
  color: var(--hb-primary-600);
}

.cell-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--hb-muted);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.2rem;
}

.date-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 48px;
  border-radius: 12px;
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
  line-height: 1;
}

.date-block__day {
  font-size: 1.1rem;
  font-weight: 700;
}

.date-block__month {
  margin-top: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-block--future {
  background: var(--hb-accent-50);
  color: var(--hb-accent-600);
}

.search-empty td {
  padding: 2.5rem 1rem !important;
  text-align: center;
  color: var(--hb-muted);
}

@media (max-width: 767.98px) {
  .table-wrap--stack {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .hb-table--stack > thead {
    display: none;
  }

  .hb-table--stack,
  .hb-table--stack > tbody,
  .hb-table--stack > tfoot,
  .hb-table--stack > tbody > tr,
  .hb-table--stack > tfoot > tr,
  .hb-table--stack > tbody > tr > td,
  .hb-table--stack > tfoot > tr > td {
    display: block;
    width: 100%;
  }

  .hb-table--stack > tbody > tr,
  .hb-table--stack > tfoot > tr {
    margin-bottom: 0.75rem;
    padding: 0.3rem 0;
    background: var(--hb-surface);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-lg);
    box-shadow: var(--hb-shadow-sm);
  }

  .hb-table--stack > :not(caption) > * > * {
    padding: 0.42rem 1rem;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .hb-table--stack td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: right;
  }

  .hb-table--stack td[data-label]::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hb-subtle);
    text-align: left;
  }

  .hb-table--stack td.cell-primary {
    padding-top: 0.75rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--hb-border) !important;
  }

  .hb-table--stack td.cell-actions {
    margin-top: 0.3rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--hb-border) !important;
  }

  .hb-table--stack .row-actions {
    justify-content: flex-end;
  }

  .hb-table--stack .hide-stack {
    display: none !important;
  }
}

/* --- 10. Pills, Chips, Avatare ------------------------------------------ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: var(--hb-surface-3);
  color: var(--hb-muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill--plain::before {
  display: none;
}

.pill--offen { background: var(--hb-warning-50); color: var(--hb-warning-ink); }
.pill--ueberfaellig { background: var(--hb-danger-50); color: var(--hb-danger-ink); }
.pill--bezahlt { background: var(--hb-success-50); color: var(--hb-success-ink); }
.pill--storniert { background: var(--hb-surface-3); color: var(--hb-subtle); text-decoration: line-through; }
.pill--einnahme { background: var(--hb-success-50); color: var(--hb-success-ink); }
.pill--ausgabe { background: var(--hb-accent-50); color: #A8412C; }
.pill--primary { background: var(--hb-primary-50); color: var(--hb-primary-600); }
.pill--accent { background: var(--hb-accent-50); color: var(--hb-accent-600); }
.pill--info { background: var(--hb-info-50); color: var(--hb-info-ink); }

.pill--live {
  background: var(--hb-accent-600);
  color: #fff;
}

.pill--live::before {
  background: #fff;
  animation: hb-pulse-dot 1.6s ease-in-out infinite;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--hb-ink);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip i {
  color: var(--hb-primary);
}

a.chip:hover {
  border-color: var(--hb-primary-100);
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--hb-surface-3);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hb-ink);
}

.avatar {
  --size: 36px;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--av-bg, #E1EEE9);
  color: var(--av-fg, #2C5F52);
  font-size: calc(var(--size) * 0.36);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
}

.avatar--sm { --size: 30px; }
.avatar--lg { --size: 64px; }
.avatar--xl { --size: 84px; }

.avatar--tone-1 { --av-bg: #DDEDE7; --av-fg: #2C5F52; }
.avatar--tone-2 { --av-bg: #FBE1D9; --av-fg: #A8412C; }
.avatar--tone-3 { --av-bg: #E1EBF7; --av-fg: #2F5F94; }
.avatar--tone-4 { --av-bg: #FAEDD3; --av-fg: #855A12; }
.avatar--tone-5 { --av-bg: #ECE5F6; --av-fg: #5E4596; }
.avatar--tone-6 { --av-bg: #DDF0EF; --av-fg: #1F6E6B; }

.avatar--ring {
  box-shadow: 0 0 0 4px var(--hb-surface), 0 6px 18px rgba(24, 33, 31, 0.12);
}

/* --- 11. Toolbar & Segment-Control --------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-sm);
}

.toolbar .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hb-subtle);
}

.toolbar__field {
  flex: 0 1 170px;
  min-width: 130px;
}

.toolbar__search {
  flex: 1 1 220px;
  margin-left: auto;
}

.toolbar__actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 575.98px) {
  .toolbar__field {
    flex: 1 1 calc(50% - 0.375rem);
  }

  .toolbar__search {
    flex-basis: 100%;
  }
}

.nav-segmented {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  background: #E8ECE8;
  border-radius: 12px;
  scrollbar-width: none;
}

.nav-segmented .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--hb-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-segmented .nav-link:hover {
  color: var(--hb-ink);
}

.nav-segmented .nav-link.active {
  background: var(--hb-surface);
  color: var(--hb-ink);
  box-shadow: 0 1px 2px rgba(24, 33, 31, 0.08), 0 2px 6px rgba(24, 33, 31, 0.06);
}

.nav-segmented .nav-link .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hb-danger);
}

/* --- 12. Leere Zustände, Bestätigungen, Infos, Agenda --------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2.25rem 1.25rem;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 0.5rem;
  border-radius: 18px;
  background: var(--hb-primary-50);
  color: var(--hb-primary);
  font-size: 1.5rem;
}

.empty-state__title {
  margin: 0;
  font-weight: 700;
  color: var(--hb-ink);
}

.empty-state__text {
  max-width: 38ch;
  margin: 0 0 0.6rem;
  font-size: 0.875rem;
  color: var(--hb-muted);
}

.empty-state--compact {
  padding: 1.25rem 1rem;
}

.empty-state--compact .empty-state__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.2rem;
}

.confirm-card {
  max-width: 540px;
  margin: 2rem auto;
  padding: 2.25rem 1.75rem 1.75rem;
  text-align: center;
}

.confirm-card__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  background: var(--hb-danger-50);
  color: var(--hb-danger-ink);
  font-size: 1.75rem;
}

.confirm-card--warning .confirm-card__icon {
  background: var(--hb-warning-50);
  color: var(--hb-warning-ink);
}

.confirm-card--info .confirm-card__icon {
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
}

.confirm-card__title {
  margin: 0 0 0.5rem;
  font-family: var(--hb-font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.1;
}

.confirm-card__text {
  margin: 0 auto;
  max-width: 42ch;
  color: var(--hb-muted);
}

.confirm-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
  margin: 1.4rem 0 0;
  padding: 1rem 1.1rem;
  text-align: left;
  font-size: 0.875rem;
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
}

.confirm-summary dt {
  font-weight: 600;
  color: var(--hb-muted);
}

.confirm-summary dd {
  margin: 0;
  font-weight: 600;
  color: var(--hb-ink);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}

.info-item {
  padding: 0.7rem 0.9rem;
  border-radius: var(--hb-radius-sm);
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border);
}

.info-item__label {
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--hb-subtle);
}

.info-item__value {
  font-weight: 600;
  color: var(--hb-ink);
  overflow-wrap: anywhere;
}

.info-item.is-empty {
  background: transparent;
  border-style: dashed;
}

.info-item.is-empty .info-item__value {
  font-weight: 400;
  color: var(--hb-subtle);
}

.info-item--wide {
  grid-column: 1 / -1;
}

.prose-box {
  padding: 0.9rem 1rem;
  border-radius: var(--hb-radius-sm);
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border);
  white-space: pre-line;
}

/* Agenda (Tages-Timeline) */
.agenda {
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda__item {
  display: grid;
  grid-template-columns: 54px 22px minmax(0, 1fr);
  column-gap: 0.6rem;
}

.agenda__time {
  padding-top: 0.85rem;
  text-align: right;
  line-height: 1.2;
}

.agenda__time strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.agenda__time span {
  font-size: 0.72rem;
  color: var(--hb-subtle);
}

.agenda__rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.agenda__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hb-border);
}

.agenda__item:first-child .agenda__rail::before {
  top: 1.35rem;
}

.agenda__item:last-child .agenda__rail::before {
  bottom: auto;
  height: 1.35rem;
}

.agenda__item:only-child .agenda__rail::before {
  display: none;
}

.agenda__dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: 1.1rem;
  border-radius: 50%;
  background: var(--hb-surface);
  border: 2px solid var(--hb-primary);
}

.agenda__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
  padding: 0.8rem 0.9rem;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.agenda__card:hover {
  border-color: var(--hb-primary-100);
  box-shadow: var(--hb-shadow-sm);
}

.agenda__body {
  flex: 1 1 140px;
  min-width: 0;
}

.agenda__name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--hb-ink);
  text-decoration: none;
}

.agenda__name:hover {
  color: var(--hb-primary-600);
}

.agenda__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--hb-muted);
}

.agenda__actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.agenda__item.is-past .agenda__dot {
  background: var(--hb-primary-100);
  border-color: var(--hb-primary-100);
}

.agenda__item.is-past .agenda__card {
  background: var(--hb-surface-2);
}

.agenda__item.is-past .agenda__time,
.agenda__item.is-past .agenda__name {
  color: var(--hb-muted);
}

.agenda__item.is-now .agenda__dot,
.agenda__item.is-next .agenda__dot {
  background: var(--hb-accent);
  border-color: var(--hb-accent);
  box-shadow: 0 0 0 5px rgba(238, 127, 104, 0.2);
}

.agenda__item.is-now .agenda__card {
  border-color: rgba(238, 127, 104, 0.5);
  background: linear-gradient(90deg, var(--hb-accent-50), var(--hb-surface) 70%);
}

.agenda__item.is-next .agenda__card {
  border-color: rgba(238, 127, 104, 0.35);
}

@media (max-width: 575.98px) {
  .agenda__item {
    grid-template-columns: 44px 16px minmax(0, 1fr);
    column-gap: 0.4rem;
  }

  .agenda__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    border-top: 1px dashed var(--hb-border);
    padding-top: 0.5rem;
  }
}

/* Kompakte Listen */
.mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--hb-radius-sm);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

a.mini-item:hover {
  color: inherit;
  background: var(--hb-surface-2);
}

.mini-item__body {
  flex: 1;
  min-width: 0;
}

.mini-item__title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hb-ink);
}

.mini-item__sub {
  display: block;
  font-size: 0.78rem;
  color: var(--hb-muted);
}

.mini-item__end {
  flex: none;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.mini-item__chevron {
  color: var(--hb-subtle);
  transition: transform 0.15s ease, color 0.15s ease;
}

a.mini-item:hover .mini-item__chevron {
  color: var(--hb-primary);
  transform: translateX(2px);
}

.time-tag {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 52px;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  background: var(--hb-surface-3);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hb-ink);
}

.day-label {
  padding: 0.85rem 0.5rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hb-subtle);
}

.day-label:first-child {
  padding-top: 0.25rem;
}

/* --- 13. Overlays: Dropdown, Toasts, Tooltips, Alerts -------------------- */
.dropdown-menu {
  --bs-dropdown-border-color: var(--hb-border);
  --bs-dropdown-border-radius: 14px;
  --bs-dropdown-inner-border-radius: 13px;
  --bs-dropdown-padding-x: 0.35rem;
  --bs-dropdown-padding-y: 0.35rem;
  --bs-dropdown-item-padding-x: 0.75rem;
  --bs-dropdown-item-padding-y: 0.5rem;
  --bs-dropdown-item-border-radius: 9px;
  --bs-dropdown-font-size: 0.875rem;
  --bs-dropdown-link-color: var(--hb-ink);
  --bs-dropdown-link-hover-color: var(--hb-ink);
  --bs-dropdown-link-hover-bg: var(--hb-surface-3);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: var(--hb-primary);
  --bs-dropdown-header-color: var(--hb-subtle);
  --bs-dropdown-divider-bg: var(--hb-border);
  --bs-dropdown-box-shadow: var(--hb-shadow-lg);
  min-width: 14rem;
  box-shadow: var(--bs-dropdown-box-shadow);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
}

.dropdown-item i {
  width: 1.1rem;
  color: var(--hb-subtle);
  text-align: center;
}

.dropdown-item:active i {
  color: #fff;
}

.dropdown-item.text-danger i {
  color: inherit;
}

.dropdown-header {
  font-size: 0.72rem;
  line-height: 1.35;
}

.dropdown-header strong {
  display: block;
  font-size: 0.85rem;
  color: var(--hb-ink);
}

.toast-stack {
  position: fixed;
  top: 76px;
  right: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(390px, calc(100vw - 2rem));
}

.hb-toast {
  --tone: var(--hb-info);
  --bs-toast-max-width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.85rem 0.85rem 0.85rem 1rem;
  font-size: 0.875rem;
  color: var(--hb-ink);
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-left: 4px solid var(--tone);
  border-radius: 12px;
  box-shadow: var(--hb-shadow-lg);
}

.hb-toast:not(.show) {
  display: none;
}

.hb-toast__icon {
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--tone);
}

.hb-toast__body {
  flex: 1;
  padding-top: 0.05rem;
}

.hb-toast .btn-close {
  flex: none;
  margin-top: 0.1rem;
  font-size: 0.7rem;
}

.hb-toast--success { --tone: var(--hb-success); }
.hb-toast--danger { --tone: var(--hb-danger); }
.hb-toast--warning { --tone: var(--hb-warning); }
.hb-toast--info,
.hb-toast--debug { --tone: var(--hb-info); }

@media (max-width: 575.98px) {
  .toast-stack {
    top: auto;
    right: 0.75rem;
    left: 0.75rem;
    bottom: calc(90px + env(safe-area-inset-bottom));
    width: auto;
  }
}

.tooltip {
  --bs-tooltip-bg: var(--hb-ink);
  --bs-tooltip-font-size: 0.75rem;
  --bs-tooltip-border-radius: 7px;
  --bs-tooltip-padding-x: 0.6rem;
  --bs-tooltip-padding-y: 0.3rem;
}

.alert {
  --bs-alert-border-radius: 12px;
  --bs-alert-padding-x: 1rem;
  --bs-alert-padding-y: 0.8rem;
  font-size: 0.875rem;
}

.alert-danger { --bs-alert-bg: var(--hb-danger-50); --bs-alert-border-color: rgba(214, 69, 69, 0.25); --bs-alert-color: var(--hb-danger-ink); }
.alert-warning { --bs-alert-bg: var(--hb-warning-50); --bs-alert-border-color: rgba(224, 163, 59, 0.35); --bs-alert-color: var(--hb-warning-ink); }
.alert-success { --bs-alert-bg: var(--hb-success-50); --bs-alert-border-color: rgba(46, 139, 87, 0.25); --bs-alert-color: var(--hb-success-ink); }
.alert-info { --bs-alert-bg: var(--hb-info-50); --bs-alert-border-color: rgba(59, 130, 196, 0.25); --bs-alert-color: var(--hb-info-ink); }

.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--hb-radius);
  border: 1px solid var(--hb-border);
  background: var(--hb-surface-2);
  font-size: 0.875rem;
  color: var(--hb-muted);
}

.callout > i {
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--hb-primary);
}

.callout strong {
  color: var(--hb-ink);
}

.callout--warning {
  background: var(--hb-warning-50);
  border-color: rgba(224, 163, 59, 0.35);
  color: var(--hb-warning-ink);
}

.callout--warning > i {
  color: var(--hb-warning-ink);
}

.callout--danger {
  background: var(--hb-danger-50);
  border-color: rgba(214, 69, 69, 0.25);
  color: var(--hb-danger-ink);
}

.callout--danger > i {
  color: var(--hb-danger-ink);
}

/* --- 14. Dashboard ------------------------------------------------------- */
.dash-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: 1.25rem;
  padding: 2rem 2rem 1.75rem;
  overflow: hidden;
  color: #fff;
  border-radius: var(--hb-radius-xl);
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(238, 127, 104, 0.3), transparent 60%),
    radial-gradient(60% 100% at 0% 100%, rgba(111, 174, 153, 0.32), transparent 60%),
    var(--hb-sidebar);
  box-shadow: var(--hb-shadow-md);
}

.dash-hero__mark {
  position: absolute;
  right: -36px;
  bottom: -54px;
  z-index: -1;
  width: 250px;
  height: 250px;
  opacity: 0.09;
  --lm-leaf: #fff;
  --lm-heart: #fff;
  --lm-vein: var(--hb-sidebar);
}

.dash-hero__eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #A9CFC2;
}

.dash-hero__title {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--hb-font-display);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 400;
  line-height: 1.04;
  color: #fff;
}

.dash-hero__title em {
  color: #F7AA98;
}

.dash-hero__lead {
  max-width: 52ch;
  margin: 0;
  color: #CFE2DB;
}

.dash-hero__lead strong {
  color: #fff;
}

.dash-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 575.98px) {
  .dash-hero {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .dash-hero__actions {
    width: 100%;
  }

  .dash-hero__actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.dash-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dash-stack > .hb-card + .hb-card {
  margin-top: 0;
}

@media (max-width: 1199.98px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- 15. Profil- & Detailköpfe ------------------------------------------- */
.profile-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: 1.6rem;
  overflow: hidden;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-xl);
  background: linear-gradient(135deg, var(--hb-primary-50), var(--hb-surface) 60%);
  box-shadow: var(--hb-shadow-sm);
}

.profile-hero::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -70px;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238, 127, 104, 0.18), transparent 70%);
}

.profile-hero__main {
  flex: 1 1 260px;
  min-width: 0;
}

.profile-hero__name {
  margin: 0;
  font-family: var(--hb-font-display);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.05;
}

.profile-hero__sub {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--hb-muted);
}

.profile-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.profile-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-sm);
}

.stat-strip--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-strip__item {
  padding: 0.95rem 1.2rem;
  min-width: 0;
}

.stat-strip__item + .stat-strip__item {
  border-left: 1px solid var(--hb-border);
}

.stat-strip__label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hb-subtle);
}

.stat-strip__value {
  margin-top: 0.1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hb-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767.98px) {
  .stat-strip,
  .stat-strip--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-strip__item:nth-child(odd) {
    border-left: 0;
  }

  .stat-strip__item:nth-child(n + 3) {
    border-top: 1px solid var(--hb-border);
  }
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.5rem 0.6rem 1.75rem;
  border-radius: var(--hb-radius-sm);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.timeline__item:hover {
  color: inherit;
  background: var(--hb-surface-2);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hb-border);
}

.timeline > li:first-child .timeline__item::before {
  top: 50%;
}

.timeline > li:last-child .timeline__item::before {
  bottom: 50%;
}

.timeline > li:only-child .timeline__item::before {
  display: none;
}

.timeline__item::after {
  content: "";
  position: absolute;
  left: calc(0.55rem - 4px);
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--hb-surface);
  border: 2px solid var(--hb-primary);
}

.timeline__item.is-past::after {
  background: var(--hb-primary-100);
  border-color: var(--hb-primary-100);
}

.timeline__item.is-future::after {
  border-color: var(--hb-accent);
}

/* --- 16. Kalender (FullCalendar) ----------------------------------------- */
.calendar-card {
  padding: 1.1rem;
}

.calendar-card .fc {
  --fc-border-color: var(--hb-border);
  --fc-page-bg-color: var(--hb-surface);
  --fc-neutral-bg-color: var(--hb-surface-2);
  --fc-today-bg-color: rgba(238, 127, 104, 0.07);
  --fc-event-bg-color: var(--hb-primary);
  --fc-event-border-color: var(--hb-primary);
  --fc-event-text-color: #fff;
  --fc-now-indicator-color: var(--hb-accent-600);
  --fc-highlight-color: rgba(62, 124, 107, 0.1);
  --fc-list-event-hover-bg-color: var(--hb-primary-50);
  --fc-small-font-size: 0.78rem;
  font-size: 0.875rem;
}

.calendar-card .fc a {
  color: inherit;
  text-decoration: none;
}

.calendar-card .fc .fc-toolbar.fc-header-toolbar {
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.calendar-card .fc .fc-toolbar-title {
  font-family: var(--hb-font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--hb-ink);
}

.calendar-card .fc .fc-button {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: none;
  color: var(--hb-ink);
  background: var(--hb-surface);
  border: 1px solid var(--hb-border-strong);
  border-radius: 9px;
  box-shadow: none;
}

.calendar-card .fc .fc-button:hover {
  color: var(--hb-ink);
  background: var(--hb-surface-2);
  border-color: #BFCAC4;
}

.calendar-card .fc .fc-button:focus,
.calendar-card .fc .fc-button:focus-visible {
  box-shadow: var(--hb-ring) !important;
}

.calendar-card .fc .fc-button:disabled {
  opacity: 0.45;
}

.calendar-card .fc .fc-button-primary:not(:disabled).fc-button-active,
.calendar-card .fc .fc-button-primary:not(:disabled):active {
  color: #fff;
  background: var(--hb-primary);
  border-color: var(--hb-primary);
}

.calendar-card .fc .fc-button-group > .fc-button {
  border-radius: 0;
}

.calendar-card .fc .fc-button-group > .fc-button:first-child {
  border-radius: 9px 0 0 9px;
}

.calendar-card .fc .fc-button-group > .fc-button:last-child {
  border-radius: 0 9px 9px 0;
}

.calendar-card .fc .fc-today-button {
  margin-left: 0.5rem;
}

.calendar-card .fc-theme-standard .fc-scrollgrid {
  border-radius: 12px;
  overflow: hidden;
}

.calendar-card .fc .fc-col-header-cell-cushion {
  padding: 0.6rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hb-subtle);
}

.calendar-card .fc .fc-col-header-cell {
  background: var(--hb-surface-2);
}

.calendar-card .fc .fc-daygrid-day-number {
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hb-muted);
}

.calendar-card .fc .fc-day-today .fc-daygrid-day-number {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin: 0.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--hb-accent-600);
  color: #fff;
}

.calendar-card .fc .fc-day-other .fc-daygrid-day-top {
  opacity: 0.45;
}

.calendar-card .fc .fc-day-sat,
.calendar-card .fc .fc-day-sun {
  background: rgba(238, 241, 238, 0.45);
}

.calendar-card .fc .fc-daygrid-day:not(.fc-day-other):hover {
  cursor: pointer;
  background: rgba(62, 124, 107, 0.04);
}

.calendar-card .fc .fc-daygrid-event {
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
}

.calendar-card .fc .fc-daygrid-block-event .fc-event-time {
  font-weight: 700;
}

.calendar-card .fc .fc-timegrid-event {
  border-radius: 8px;
  padding: 2px 4px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(24, 33, 31, 0.12);
}

.calendar-card .fc .fc-event.is-past {
  background: var(--hb-primary-100);
  border-color: var(--hb-primary-100);
}

.calendar-card .fc .fc-event.is-past,
.calendar-card .fc .fc-event.is-past .fc-event-main,
.calendar-card .fc .fc-event.is-past .fc-event-time,
.calendar-card .fc .fc-event.is-past .fc-event-title {
  color: var(--hb-primary-700);
}

.calendar-card .fc .fc-list-event.is-past {
  background: transparent;
}

.calendar-card .fc .fc-list-event.is-past .fc-list-event-title,
.calendar-card .fc .fc-list-event.is-past .fc-list-event-time {
  color: var(--hb-muted);
}

.calendar-card .fc .fc-daygrid-more-link {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hb-primary-600);
}

.calendar-card .fc .fc-daygrid-week-number,
.calendar-card .fc .fc-timegrid-axis-cushion {
  font-size: 0.68rem;
  color: var(--hb-subtle);
  background: transparent;
}

.calendar-card .fc .fc-timegrid-slot-label-cushion {
  font-size: 0.74rem;
  color: var(--hb-subtle);
}

.calendar-card .fc .fc-list {
  border-radius: 12px;
  overflow: hidden;
}

.calendar-card .fc .fc-list-day-cushion {
  background: var(--hb-surface-2);
  font-weight: 700;
}

.calendar-card .fc .fc-list-event-dot {
  border-color: var(--hb-primary);
}

.calendar-card .fc .fc-popover {
  border-color: var(--hb-border);
  border-radius: 12px;
  box-shadow: var(--hb-shadow-lg);
  overflow: hidden;
}

.calendar-card .fc .fc-popover-header {
  padding: 0.5rem 0.75rem;
  background: var(--hb-surface-2);
  font-weight: 700;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--hb-muted);
}

.calendar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--hb-ink);
}

.calendar-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--hb-primary);
}

.calendar-legend__swatch--past {
  background: var(--hb-primary-100);
}

.calendar-legend__swatch--today {
  border-radius: 50%;
  background: var(--hb-accent-600);
}

@media (max-width: 767.98px) {
  .calendar-card {
    padding: 0.75rem;
  }

  .calendar-card .fc .fc-toolbar.fc-header-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .calendar-card .fc .fc-toolbar-chunk:nth-child(2) {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  .calendar-card .fc .fc-toolbar-title {
    font-size: 1.45rem;
  }
}

/* --- 17. Rechnung erstellen ---------------------------------------------- */
.invoice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 1.25rem;
}

.invoice-layout > .invoice-main > .hb-card + .hb-card {
  margin-top: 1.25rem;
}

.invoice-aside {
  position: sticky;
  top: 84px;
}

@media (max-width: 1199.98px) {
  .invoice-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .invoice-aside {
    position: static;
  }
}

.invoice-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.invoice-metric {
  padding: 0.8rem 1rem;
  border-radius: var(--hb-radius);
  background: var(--hb-surface-2);
  border: 1px solid var(--hb-border);
}

.invoice-metric > span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hb-subtle);
}

.invoice-metric > strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--hb-ink);
}

.invoice-table .hb-table > :not(caption) > * > * {
  padding: 0.55rem 0.6rem;
}

.invoice-table .hb-table > thead > tr > th:first-child,
.invoice-table .hb-table > tbody > tr > td:first-child {
  padding-left: 1rem;
}

.invoice-table .hb-table td:last-child {
  width: 1%;
  padding-right: 0.85rem;
}

.invoice-static-row > td {
  background: rgba(62, 124, 107, 0.04);
}

.invoice-static-row .pill {
  margin-top: 0.3rem;
}

.invoice-discount {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--hb-radius);
  border: 1px dashed var(--hb-border-strong);
  background: var(--hb-surface-2);
}

.invoice-discount .form-field {
  flex: 0 1 280px;
}

.invoice-discount p {
  flex: 1 1 220px;
  margin: 0;
  font-size: 0.85rem;
  color: var(--hb-muted);
}

.summary-card {
  padding: 1.4rem;
  color: #fff;
  border-radius: var(--hb-radius-xl);
  background:
    radial-gradient(110% 90% at 100% 0%, rgba(238, 127, 104, 0.3), transparent 60%),
    var(--hb-sidebar);
  box-shadow: var(--hb-shadow-md);
}

.summary-card__label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #A9CFC2;
}

.summary-card__value {
  margin: 0.3rem 0 0.15rem;
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.summary-card__hint {
  margin: 0;
  font-size: 0.8rem;
  color: #CFE2DB;
}

.summary-card__rows {
  margin: 1.1rem 0 1.25rem;
  padding: 0.9rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
  font-size: 0.85rem;
}

.summary-card__rows li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  color: #CFE2DB;
}

.summary-card__rows li strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.summary-card .btn {
  width: 100%;
}

.summary-card .btn + .btn {
  margin-top: 0.5rem;
}

/* --- 18. Finanzen -------------------------------------------------------- */
.money-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.money-strip__item {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-lg);
  box-shadow: var(--hb-shadow-sm);
}

.money-strip__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--hb-primary-50);
  color: var(--hb-primary-600);
}

.money-strip__icon--income { background: var(--hb-success-50); color: var(--hb-success-ink); }
.money-strip__icon--expense { background: var(--hb-accent-50); color: var(--hb-accent-600); }
.money-strip__icon--warning { background: var(--hb-warning-50); color: var(--hb-warning-ink); }
.money-strip__icon--danger { background: var(--hb-danger-50); color: var(--hb-danger-ink); }

.money-strip__label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hb-subtle);
}

.money-strip__value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hb-ink);
  white-space: nowrap;
}

/* Monatsbalken: ein gemeinsamer Maßstab, Werte stehen als Text daneben */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.8rem;
  color: var(--hb-muted);
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-legend__swatch--income { background: var(--hb-chart-income); }
.chart-legend__swatch--expense { background: var(--hb-chart-expense); }

.month-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.month-bars__bar {
  height: 8px;
  min-width: 0;
  border-radius: 0 4px 4px 0;
}

.month-bars__bar[style*="width: 0%"],
.month-bars__bar[style*="width:0%"] {
  display: none;
}

.month-bars__bar--income { background: var(--hb-chart-income); }
.month-bars__bar--expense { background: var(--hb-chart-expense); }

.month-bars__track {
  display: block;
  height: 8px;
}

.uva-zahllast {
  background: var(--hb-accent-50) !important;
}

/* Upload */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 3.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--hb-surface-2);
  border: 2px dashed var(--hb-border-strong);
  border-radius: var(--hb-radius-lg);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  background: var(--hb-primary-50);
  border-color: var(--hb-primary);
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
  border-radius: 20px;
  background: var(--hb-surface);
  color: var(--hb-primary);
  font-size: 1.7rem;
  box-shadow: var(--hb-shadow-sm);
}

.dropzone__title {
  margin: 0;
  font-weight: 700;
  color: var(--hb-ink);
}

.dropzone__text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--hb-muted);
}

.dropzone__file {
  margin-top: 0.6rem;
}

.import-row--duplicate > td {
  background: var(--hb-warning-50) !important;
}

.import-row--error > td {
  background: var(--hb-danger-50) !important;
}

/* --- 19. Motion ---------------------------------------------------------- */
@keyframes hb-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hb-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: no-preference) {
  .app-content > * {
    animation: hb-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .app-content > *:nth-child(2) { animation-delay: 0.04s; }
  .app-content > *:nth-child(3) { animation-delay: 0.08s; }
  .app-content > *:nth-child(4) { animation-delay: 0.12s; }
  .app-content > *:nth-child(5) { animation-delay: 0.16s; }
  .app-content > *:nth-child(n + 6) { animation-delay: 0.2s; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .app-sidebar-wrap,
  .app-topbar,
  .app-bottomnav,
  .toast-stack,
  .page-actions,
  .toolbar {
    display: none !important;
  }

  .has-shell .app-main {
    padding-left: 0;
  }

  body {
    background: #fff;
  }
}
