/* ============================================================
   Hausmanager – Component Styles (theme-agnostic via vars)
   ============================================================ */

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--hm-font-sans, var(--hm-font-sans));
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  font-size: var(--hm-text-md, 0.9375rem);
  line-height: var(--hm-leading-normal, 1.5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--hm-dur) var(--hm-ease-out),
              color var(--hm-dur) var(--hm-ease-out);
}

/* ─── Bootstrap Overrides ─────────────────────────────────── */
.text-muted { color: var(--ink-600) !important; }
.bg-light    { background: var(--surface-2) !important; color: var(--ink-900) !important; }
.border      { border-color: var(--border) !important; }
.border-bottom { border-color: var(--border) !important; }
.border-top  { border-color: var(--border) !important; }
.fw-bold     { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.font-monospace {
  font-family: 'JetBrains Mono', monospace !important;
  font-variant-numeric: tabular-nums;
}
.tracking-wide { letter-spacing: 0.05em; }

h1, h2, h3, h4, h5, h6 {
  color: var(--ink-900);
  letter-spacing: var(--hm-tracking-tight, -0.02em);
  font-weight: 700;
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── App Layout ──────────────────────────────────────────── */
.bg-gradient-tech { background: var(--bg) !important; }

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Auth (login / register) shell – fills the viewport height without
   competing with .app-layout's min-height. */
.auth-shell {
  min-height: calc(100vh - 1rem);
  width: 100%;
}

/* Defensive: keep Bootstrap modals invisible even if the bundled CSS
   from the CDN fails to load. Bootstrap toggles this away when opening
   the modal. */
.modal:not(.show) {
  display: none !important;
}
.content-frame {
  flex-grow: 1;
  margin-bottom: var(--hm-bottom-nav-h, 70px);
  max-width: var(--hm-container, 1280px);
  width: 100%;
  align-self: center;
}

/* ─── Navigation ──────────────────────────────────────────── */
.app-nav.glass-nav {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-hair);
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--hm-bottom-nav-h, 70px);
  z-index: 1000;
}

.nav-container { flex-direction: row; }

.nav-item {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  color: var(--ink-400);
  text-decoration: none;
  padding: 0.5rem;
  transition: color var(--hm-dur) var(--hm-ease-out);
  flex: 1;
}

/* Desktop sidebar: group labels */
.nav-group-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-200);
  padding: 0.6rem 0.5rem 0.1rem;
  user-select: none;
}
.nav-item i { font-size: 1.25rem; margin-bottom: 3px; }
.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-item:hover  { color: var(--ink-900); }
.nav-item.active {
  color: var(--primary);
}
.nav-item.active i { transform: translateY(-2px); }

/* Hero (+) FAB */
.nav-item.hero-btn {
  background: var(--gradient-brand) !important;
  border-radius: 50%;
  width: 56px; height: 56px;
  flex: 0 0 auto;
  transform: translateY(-20px);
  box-shadow: var(--shadow-md);
  border: 4px solid var(--surface) !important;
  justify-content: center;
}
.nav-item.hero-btn i   { font-size: 1.5rem; margin-bottom: 0; color: var(--primary-ink) !important; }
.nav-item.hero-btn .nav-label { display: none; }

/* ── Desktop breakpoint ──────────────────────────────────── */
@media (min-width: 992px) {
  :root { --hm-sidebar-w: 200px; }

  body:not(.is-anon) .app-layout {
    padding-inline-start: 200px;
  }
  .content-frame {
    margin-bottom: 0;
    margin-left: 0;
    padding: 1.5rem 2rem;
    min-width: 0;
  }
  .app-nav.glass-nav {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 200px;
    height: 100vh;
    border-top: none;
    border-right: 1px solid var(--border-hair);
  }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.6rem;
    flex: 0 0 auto;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
  }
  .app-nav .nav-item i { font-size: 1rem; margin-bottom: 0; min-width: 18px; }
  .app-nav .nav-label { font-size: 0.8rem; display: block !important; }
  .nav-item.hero-btn {
    transform: none;
    border-radius: var(--radius-btn) !important;
    width: 100%;
    height: auto;
    margin: 0 0 0.5rem 0;
    justify-content: flex-start;
  }
  .nav-item.hero-btn .nav-label { display: block !important; }
  .nav-item.active {
    background: var(--primary-subtle);
  }

  /* Content max-width cap on widescreen */
  .content-inner { max-width: var(--hm-container, 1280px); margin: 0 auto; }
}

/* ─── Cards ───────────────────────────────────────────────── */
.glass-card {
  background: var(--surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--border-hair) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: border-color var(--hm-dur) var(--hm-ease-out),
              box-shadow var(--hm-dur) var(--hm-ease-out);
}
.glass-card.hover-lift:hover,
.glass-card.hover-elevate:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
  border-color: var(--border) !important;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-btn);
  padding: 0.625rem 1.25rem;
  transition: transform var(--hm-dur-fast) var(--hm-ease-out),
              box-shadow var(--hm-dur-fast) var(--hm-ease-out),
              background var(--hm-dur-fast) var(--hm-ease-out);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.btn:active { transform: translateY(0) !important; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn.rounded-pill { border-radius: var(--radius-pill) !important; }

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-ink) !important;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  color: var(--primary-ink) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: var(--primary-ink) !important;
}
.btn-outline-secondary {
  color: var(--ink-600) !important;
  border-color: var(--border) !important;
  background: var(--surface);
}
.btn-outline-secondary:hover {
  background: var(--surface-2) !important;
  color: var(--ink-900) !important;
  border-color: var(--border-strong) !important;
}
.btn-success {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}
.btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover, .btn-danger:focus {
  background: color-mix(in srgb, var(--danger) 85%, #000) !important;
  border-color: color-mix(in srgb, var(--danger) 85%, #000) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--danger) 35%, transparent);
}
.btn-outline-danger {
  color: var(--danger) !important;
  border-color: var(--danger-border) !important;
  background: transparent !important;
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
  transform: translateY(-1px);
}
.btn-outline-danger:active { transform: translateY(0) !important; }

/* Danger hover on link-style buttons */
.btn-link.text-danger, .btn-sm.btn-link.text-danger {
  color: var(--danger) !important;
  text-decoration: none;
  background: transparent !important;
  border: none;
  padding: 0;
}
.btn-link.text-danger:hover { color: color-mix(in srgb, var(--danger) 75%, #000) !important; }

.btn-warning {
  background: var(--warning) !important;
  border-color: var(--warning) !important;
  color: #fff !important;
  box-shadow: var(--shadow-xs);
}
.btn-warning:hover, .btn-warning:focus {
  background: color-mix(in srgb, var(--warning) 85%, #000) !important;
  border-color: color-mix(in srgb, var(--warning) 85%, #000) !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.btn-outline-warning {
  color: var(--warning) !important;
  border-color: var(--warning-border) !important;
  background: transparent !important;
}
.btn-outline-warning:hover, .btn-outline-warning:focus {
  background: var(--warning-bg) !important;
  border-color: var(--warning) !important;
  color: var(--warning) !important;
  transform: translateY(-1px);
}
.btn-outline-warning:active { transform: translateY(0) !important; }

/* btn-outline-success */
.btn-outline-success {
  color: var(--success) !important;
  border-color: var(--success-border) !important;
  background: transparent !important;
}
.btn-outline-success:hover {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
  transform: translateY(-1px);
}
.btn-outline-success:active { transform: translateY(0) !important; }

/* btn-outline-dark → neutral secondary style */
.btn-outline-dark {
  color: var(--ink-700) !important;
  border-color: var(--border-strong) !important;
  background: var(--surface) !important;
}
.btn-outline-dark:hover {
  background: var(--surface-2) !important;
  color: var(--ink-900) !important;
  border-color: var(--border-strong) !important;
}

/* btn-link neutral (text-muted) */
.btn-link, .btn-link.text-muted {
  color: var(--ink-400) !important;
  text-decoration: none;
}
.btn-link:hover, .btn-link.text-muted:hover { color: var(--ink-700) !important; }

/* Checked state for btn-group outlines */
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + label.btn-outline-primary {
  background: var(--primary) !important;
  color: var(--primary-ink) !important;
  border-color: var(--primary) !important;
}
.btn-check:checked + .btn-outline-warning,
.btn-check:checked + label.btn-outline-warning {
  background: var(--warning) !important;
  color: #fff !important;
  border-color: var(--warning) !important;
}
.btn-check:checked + .btn-outline-success,
.btn-check:checked + label.btn-outline-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}

/* ─── Forms ───────────────────────────────────────────────── */
.form-control,
.form-select,
.form-control-glass,
.form-select.form-control-glass {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-input) !important;
  padding: 0.75rem 1rem;
  color: var(--ink-900);
  font-family: inherit;
  transition: border-color var(--hm-dur) var(--hm-ease-out),
              box-shadow var(--hm-dur) var(--hm-ease-out);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.form-control:focus, .form-select:focus {
  background: var(--surface) !important;
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-focus) !important;
  outline: none;
  color: var(--ink-900);
}
.form-control::placeholder { color: var(--ink-400); }
.form-label {
  color: var(--ink-600);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.form-text { color: var(--ink-400); font-size: 0.75rem; }

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.35em 0.75em;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}
.bg-success-subtle  { background: var(--success-bg)  !important; color: var(--success) !important; border: 1px solid var(--success-border) !important; }
.bg-warning-subtle  { background: var(--warning-bg)  !important; color: var(--warning) !important; border: 1px solid var(--warning-border) !important; }
.bg-danger-subtle   { background: var(--danger-bg)   !important; color: var(--danger)  !important; border: 1px solid var(--danger-border)  !important; }
.bg-info-subtle     { background: var(--info-bg)     !important; color: var(--info)    !important; border: 1px solid var(--info-border)    !important; }
.bg-primary-subtle  { background: var(--primary-subtle) !important; color: var(--primary-dark) !important; }
.bg-secondary-subtle { background: var(--surface-2)  !important; color: var(--ink-600) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-primary { color: var(--primary-dark) !important; }
.text-muted   { color: var(--ink-400)  !important; }
.text-dark    { color: var(--ink-900)  !important; }

/* ─── Status dots ─────────────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot-success  { background: var(--success); }
.status-dot-warning  { background: var(--warning); }
.status-dot-info     { background: var(--info); }
.status-dot-secondary { background: var(--ink-300); }

/* ─── Stat tiles ──────────────────────────────────────────── */
.stat-icon {
  width: 48px; height: 48px;
  display: inline-flex !important;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
}
.bg-blue-light   { background: var(--primary-subtle) !important; }
.bg-green-light  { background: var(--success-bg) !important; }
.bg-orange-light { background: var(--accent-subtle) !important; }
.stat-icon.text-primary { color: var(--primary-dark) !important; }
.stat-icon.text-success { color: var(--success) !important; }
.stat-icon.text-warning { color: var(--accent) !important; }

/* ─── Tables ──────────────────────────────────────────────── */
.custom-table thead { background: var(--surface-2) !important; }
.custom-table th {
  color: var(--ink-400);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-top: 1rem; padding-bottom: 1rem;
}
.custom-table td { padding-top: 1.1rem; padding-bottom: 1.1rem; color: var(--ink-900); }
.custom-table tbody tr { border-bottom: 1px solid var(--border-hair); transition: background 0.15s; }
.custom-table tbody tr:hover { background: var(--surface-2) !important; }
.custom-table tbody tr:last-child { border-bottom: none; }

/* Date badge */
.custom-table .badge.bg-light {
  background: var(--surface-2) !important;
  color: var(--ink-700) !important;
  border: 1px solid var(--border) !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.custom-alert-warning,
.alert-warning {
  background: var(--warning-bg) !important;
  border: 1px solid var(--warning-border) !important;
  color: var(--ink-900) !important;
}
.custom-alert-warning .text-warning { color: var(--warning) !important; }

/* ─── Modals ──────────────────────────────────────────────── */
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  color: var(--ink-900);
}
.modal-footer { border-top: 1px solid var(--border); }
.modal-backdrop { background: rgba(0,0,0,.45); }

/* ─── Toasts ──────────────────────────────────────────────── */
.toast {
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-lg);
  border: none;
}
.text-bg-success { background: var(--success) !important; color: #fff !important; }
.text-bg-danger  { background: var(--danger)  !important; color: #fff !important; }
.text-bg-warning { background: var(--accent)  !important; color: var(--primary-ink) !important; }
.text-bg-info    { background: var(--info)    !important; color: #fff !important; }

/* ─── Budget ring / conic-gradient ───────────────────────── */
[style*="conic-gradient"] {
  background: conic-gradient(
    var(--primary) var(--pct, 0%),
    var(--surface-2) 0
  ) !important;
}

/* ─── Progress bars ───────────────────────────────────────── */
.progress { background: var(--surface-2); border-radius: var(--radius-pill); }
.progress-bar { background: var(--primary); }
.progress-bar.bg-danger { background: var(--danger) !important; }
.progress-bar.bg-warning { background: var(--warning) !important; }
.progress-bar.bg-success { background: var(--success) !important; }

/* ─── Upload zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--gradient-hero);
  transition: border-color var(--hm-dur) var(--hm-ease-out),
              background var(--hm-dur) var(--hm-ease-out);
}
.upload-zone:hover { border-color: var(--primary); }

/* ─── Gewerk card border accents ──────────────────────────── */
.glass-card.border-top-danger  { border-top: 4px solid var(--danger)  !important; }
.glass-card.border-top-primary { border-top: 4px solid var(--primary) !important; }
.glass-card.border-top-success { border-top: 4px solid var(--success) !important; }

/* ─── Skonto pulse ────────────────────────────────────────── */
@keyframes hm-pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 50%, transparent); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}
.skonto-pulse { animation: hm-pulse-danger 1.6s ease-in-out infinite; }

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ─── Selection ───────────────────────────────────────────── */
::selection { background: var(--primary-subtle); color: var(--ink-900); }

/* ─── Hover effects ───────────────────────────────────────── */
.hover-elevate:hover { transform: translateY(-3px); }
.hover-lift:hover { transform: translateY(-2px); }

/* ─── Border utility ──────────────────────────────────────── */
.border-top-danger  { border-top-color: var(--danger)  !important; }
.border-top-primary { border-top-color: var(--primary) !important; }

/* ─── Vergabe left-border override ───────────────────────── */
.glass-card[style*="border-left"] {
  border-left-width: 4px !important;
  border-left-style: solid !important;
}

/* ─── Theme switcher UI (Settings page) ───────────────────── */
.theme-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color var(--hm-dur) var(--hm-ease-out),
              box-shadow var(--hm-dur) var(--hm-ease-out);
  padding: 1rem;
  text-align: center;
}
.theme-option:hover { border-color: var(--primary); }
.theme-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.theme-swatch {
  width: 40px; height: 40px;
  border-radius: 10px;
  margin: 0 auto 0.5rem;
  display: flex; align-items: center; justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE REDESIGN — Keyframes, Bottom Nav, More-Sheet, Camera
   ═══════════════════════════════════════════════════════════ */

@keyframes hmFadeIn   { from { opacity: 0 }  to { opacity: 1 } }
@keyframes hmSlideUp  { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes hmSpin     { to   { transform: rotate(360deg) } }
@keyframes hmScan {
  0%   { top: 0%;   opacity: 0 }
  10%  { opacity: 1 }
  90%  { opacity: 1 }
  100% { top: 100%; opacity: 0 }
}
@keyframes hmBudgetRing {
  from { stroke-dashoffset: var(--hm-ring-full, 0) }
  to   { stroke-dashoffset: var(--hm-ring-target, 0) }
}

/* ── Typography helpers ──────────────────────────────────── */
.hm-eyebrow {
  font-family: var(--hm-font-sans);
  font-size: var(--hm-text-eyebrow);
  font-weight: 700;
  letter-spacing: var(--hm-tracking-wide);
  text-transform: uppercase;
  color: var(--ink-400);
}
.hm-mono {
  font-family: var(--hm-font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── HM Badge ────────────────────────────────────────────── */
.hm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid transparent;
}
.hm-badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.hm-badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.hm-badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-border); }
.hm-badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-border); }
.hm-badge-neutral { background: var(--surface-2);  color: var(--ink-600); border-color: var(--border); }
.hm-badge-primary { background: var(--primary-subtle); color: var(--primary-dark); border-color: var(--primary-subtle); }

/* ── Mobile Bottom Nav (replaces old d-lg-none nav) ─────── */
@media (max-width: 991px) {
  /* Hide old nav, show new one */
  .hm-legacy-mobile-nav { display: none !important; }

  .hm-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--border-hair);
    z-index: 1040;
  }
  .hm-bottom-nav-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 84px 1fr 1fr;
    align-items: center;
    height: 58px;
  }
  .hm-nav-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    background: transparent; border: none; padding: 6px 0;
    color: var(--ink-400);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--hm-dur-fast) var(--hm-ease-out);
    -webkit-tap-highlight-color: transparent;
  }
  .hm-nav-btn:hover, .hm-nav-btn.active { color: var(--primary-dark); }
  .hm-nav-btn i   { font-size: 18px; }
  .hm-nav-btn span { font-size: 10.5px; font-weight: 500; }
  .hm-nav-btn.active span { font-weight: 700; }

  .hm-nav-fab-col {
    display: flex; justify-content: center; position: relative;
  }
  .hm-camera-fab {
    width: 64px; height: 64px; border-radius: 32px;
    background: var(--gradient-brand);
    border: none;
    box-shadow: 0 8px 22px rgba(198,168,117,0.45), 0 2px 6px rgba(60,40,20,0.18);
    color: var(--primary-ink);
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: -22px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--hm-dur-fast) var(--hm-ease-out),
                box-shadow var(--hm-dur-fast) var(--hm-ease-out);
  }
  .hm-camera-fab:active {
    transform: scale(0.94);
    box-shadow: 0 4px 12px rgba(198,168,117,0.3);
  }
  .hm-camera-fab i { font-size: 22px; }
}

/* ── More-Sheet ──────────────────────────────────────────── */
.hm-more-backdrop {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(0,0,0,0.4);
  animation: hmFadeIn 200ms var(--hm-ease-out);
  display: none;
}
.hm-more-backdrop.open { display: block; }
.hm-more-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top-left-radius: 24px; border-top-right-radius: 24px;
  padding: 0 16px 100px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
  animation: hmSlideUp 280ms var(--hm-ease-out);
  max-height: 85vh; overflow-y: auto;
}
.hm-more-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--ink-300);
  margin: 12px auto 16px;
}
.hm-more-item {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 14px 12px;
  background: transparent; border: none; border-bottom: 1px solid var(--border-hair);
  cursor: pointer; text-align: left; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.hm-more-item:last-child { border-bottom: none; }
.hm-more-item:hover { background: var(--surface-2); }
.hm-more-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-subtle); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hm-more-label  { font-size: 14.5px; font-weight: 700; color: var(--ink-900); }
.hm-more-desc   { font-size: 11.5px; color: var(--ink-600); margin-top: 1px; }

/* ── Camera Overlay ──────────────────────────────────────── */
.hm-camera-overlay {
  position: fixed; inset: 0; z-index: 1060;
  background: #000;
  display: none; flex-direction: column;
  animation: hmFadeIn 220ms var(--hm-ease-out);
}
.hm-camera-overlay.open { display: flex; }
.hm-scan-line {
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(180deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 14px var(--primary);
  animation: hmScan 1.4s ease-in-out infinite;
  pointer-events: none;
}
.hm-scan-corner {
  position: absolute; width: 26px; height: 26px;
  border-color: #fff; border-style: solid; border-width: 0;
}
.hm-scan-corner.tl { top:0; left:0;  border-top-width:3px; border-left-width:3px;  border-top-left-radius:8px; }
.hm-scan-corner.tr { top:0; right:0; border-top-width:3px; border-right-width:3px; border-top-right-radius:8px; }
.hm-scan-corner.bl { bottom:0; left:0;  border-bottom-width:3px; border-left-width:3px;  border-bottom-left-radius:8px; }
.hm-scan-corner.br { bottom:0; right:0; border-bottom-width:3px; border-right-width:3px; border-bottom-right-radius:8px; }

/* ── Swipeable row ───────────────────────────────────────── */
.hm-swipeable { position: relative; overflow: hidden; }
.hm-swipe-bg {
  position: absolute; top: 0; bottom: 0; width: 80px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  color: #fff; font-size: 10px; font-weight: 700;
}
.hm-swipe-bg.left  { right: 0; background: var(--success); }
.hm-swipe-bg.right { left: 0;  background: var(--info); }
.hm-swipe-content {
  position: relative; background: var(--surface);
  transition: transform 220ms var(--hm-ease-out);
  touch-action: pan-y;
  will-change: transform;
}
.hm-swipe-content.dragging { transition: none; }

/* ── Pull-to-refresh ─────────────────────────────────────── */
.hm-ptr-indicator {
  position: absolute; top: -50px; left: 0; right: 0; height: 50px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-dark);
  transition: top 220ms var(--hm-ease-out);
  z-index: 5;
}
.hm-ptr-indicator.pulling { transition: none; }
.hm-ptr-spin { animation: hmSpin 0.9s linear infinite; }

/* ── Mobile Dashboard ────────────────────────────────────── */
@media (max-width: 991px) {
  /* Push content above fixed bottom nav */
  body:not(.is-anon) .content-frame { padding-bottom: 100px !important; }

  /* Hero card */
  .hm-hero-card {
    background: var(--surface);
    border: 1px solid var(--border-hair);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 20px 18px 22px;
    margin-bottom: 12px;
    position: relative; overflow: hidden;
  }
  .hm-hero-watermark {
    position: absolute; right: -28px; bottom: -50px;
    font-size: 200px; opacity: 0.04;
    color: var(--primary); pointer-events: none;
  }
  .hm-hero-amount {
    font-family: var(--hm-font-sans);
    font-weight: 800; font-size: 30px;
    letter-spacing: -0.03em; color: var(--ink-900);
    line-height: 1.05;
  }

  /* Budget SVG ring */
  .hm-budget-ring-circle {
    transition: stroke-dashoffset 600ms cubic-bezier(.2,.7,.2,1);
  }

  /* Skonto warning */
  .hm-skonto-banner {
    background: linear-gradient(135deg, var(--danger-bg) 0%, var(--warning-bg) 100%);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-card);
    padding: 12px 14px; margin-bottom: 12px;
    display: flex; align-items: center; gap: 12px;
    cursor: pointer; text-decoration: none;
  }
  .hm-skonto-icon {
    width: 38px; height: 38px; border-radius: 19px;
    background: var(--warning); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }

  /* Bento mini stats */
  .hm-bento-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 12px;
  }
  .hm-mini-stat {
    background: var(--surface);
    border: 1px solid var(--border-hair);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 12px;
  }
  .hm-mini-icon {
    width: 28px; height: 28px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
  }

  /* Top Gewerke horizontal scroll */
  .hm-gewerke-scroll {
    display: flex; gap: 8px;
    overflow-x: auto; padding-bottom: 4px;
    margin-inline: -16px; padding-inline: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hm-gewerke-scroll::-webkit-scrollbar { display: none; }
  .hm-gewerk-chip {
    background: var(--surface);
    border: 1px solid var(--border-hair);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 10px 12px; min-width: 130px; flex-shrink: 0;
  }
  .hm-gewerk-bar {
    height: 4px; background: var(--surface-2);
    border-radius: 2px; overflow: hidden; margin-top: 6px;
  }
  .hm-gewerk-bar-fill {
    height: 100%; background: var(--primary); border-radius: 2px;
  }

  /* Rechnung rows */
  .hm-rech-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-hair);
    background: var(--surface);
  }
  .hm-rech-row:last-child { border-bottom: none; }
  .hm-rech-icon {
    width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }

  /* Section header */
  .hm-section-header {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0 2px 8px;
  }
  .hm-section-title { font-size: 14px; font-weight: 700; color: var(--ink-900); }
  .hm-section-link {
    background: transparent; border: none; padding: 0;
    color: var(--primary-dark); font-size: 12px; font-weight: 600; cursor: pointer;
    text-decoration: none;
  }

  /* Greeting row */
  .hm-greeting { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink-900); }
  .hm-bell-btn {
    width: 38px; height: 38px; border-radius: 19px;
    background: var(--surface); border: 1px solid var(--border-hair);
    color: var(--ink-700); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }

  /* Filter chips */
  .hm-filter-chips {
    display: flex; gap: 6px; overflow-x: auto;
    margin-bottom: 14px; margin-inline: -16px; padding-inline: 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .hm-filter-chips::-webkit-scrollbar { display: none; }
  .hm-chip {
    padding: 6px 12px;
    background: var(--surface); color: var(--ink-700);
    border: 1px solid var(--border);
    border-radius: 999px; font-size: 12px; font-weight: 600;
    white-space: nowrap; cursor: pointer; flex-shrink: 0;
    transition: background var(--hm-dur-fast), color var(--hm-dur-fast);
  }
  .hm-chip.active {
    background: var(--primary); color: var(--primary-ink);
    border-color: var(--primary);
  }
}
