/* ============================================================
   SnapSite HQ - Components
   The shared vocabulary every module MUST use. Look lives here;
   modules only wire data. Do not invent new card markup.
   ============================================================ */

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: var(--sp-4);
  box-shadow: var(--shadow);
  position: relative;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}
.card.tap { cursor: pointer; }
.card.tap:active { transform: scale(0.985); border-color: var(--hairline-2); }
.card.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, var(--gold-glow), transparent 55%);
  opacity: 0.7;
}
.card-title { font-size: var(--t-h2); font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: var(--t-sm); color: var(--ink-3); }

/* ---------- Stat card (numbers with meaning) ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: var(--sp-4);
  min-width: 0;
}
.stat .label {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--ink-3); font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.stat .value {
  font-family: var(--font-num); font-size: 26px; font-weight: 600;
  letter-spacing: -0.02em; margin-top: 8px; line-height: 1;
}
.stat .value.sm { font-size: 20px; }
.stat .delta { font-size: var(--t-xs); margin-top: 6px; font-family: var(--font-num); }
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--crit); }
.stat.feature { background: linear-gradient(160deg, #16140d, var(--surface) 60%); border-color: var(--gold-line); }
.stat.feature .value { color: var(--gold-soft); }

/* mini sparkbar */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 10px; }
.spark > i { flex: 1; background: var(--hairline-2); border-radius: 2px; min-height: 3px; display: block; }
.spark > i.hot { background: var(--gold); }

/* ---------- Status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--neutral-bg); color: var(--neutral);
  border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill.no-dot::before { display: none; }
.pill.ok      { background: var(--ok-bg);      color: var(--ok); }
.pill.warn    { background: var(--warn-bg);    color: var(--warn); }
.pill.crit    { background: var(--crit-bg);    color: var(--crit); }
.pill.info    { background: var(--info-bg);    color: var(--info); }
.pill.gold    { background: var(--gold-glow);  color: var(--gold-soft); }
.pill.lg { font-size: var(--t-sm); padding: 6px 12px; }

/* priority dot */
.prio { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--neutral); }
.prio.normal { background: var(--info); }
.prio.wichtig, .prio.high { background: var(--warn); }
.prio.kritisch, .prio.critical { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.prio.niedrig, .prio.low { background: var(--ink-4); }

/* ---------- List row ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r); margin-bottom: var(--sp-2);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}
.list-row.tap:active { transform: scale(0.99); border-color: var(--hairline-2); }
.list-row .lr-main { min-width: 0; flex: 1; }
.list-row .lr-title { font-weight: 550; font-size: var(--t-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-sub { font-size: var(--t-sm); color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .lr-end { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list-row .lr-amt { font-family: var(--font-num); font-weight: 600; }

/* avatar / monogram */
.mono-av {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
  background: linear-gradient(150deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--hairline); color: var(--ink-2);
  font-family: var(--font-mark); letter-spacing: 0.02em;
}
.mono-av.gold { color: var(--gold-soft); border-color: var(--gold-line); background: linear-gradient(150deg, #17140c, var(--surface-2)); }

/* checkbox (tasks) */
.check {
  width: 24px; height: 24px; border-radius: 8px; flex: 0 0 auto;
  border: 1.5px solid var(--hairline-2); background: var(--surface-3);
  display: grid; place-items: center; transition: all var(--dur-fast) var(--ease);
}
.check svg { width: 13px; height: 13px; opacity: 0; transform: scale(0.6); transition: all var(--dur-fast) var(--ease); color: #0a0a0a; }
.check.done { background: var(--gold); border-color: var(--gold); }
.check.done svg { opacity: 1; transform: scale(1); }

/* progress bar */
.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width var(--dur) var(--ease); }
.bar.thin { height: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 var(--sp-5); border-radius: var(--r);
  font-weight: 600; font-size: var(--t-body);
  background: var(--surface-2); border: 1px solid var(--hairline-2); color: var(--ink);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast);
}
.btn:active { transform: scale(0.97); }
.btn.block { width: 100%; }
.btn.gold { background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep)); color: #120e04; border-color: var(--gold-deep); font-weight: 700; }
.btn.ghost { background: transparent; border-color: var(--hairline); color: var(--ink-2); }
.btn.danger { background: var(--crit-bg); border-color: rgba(209,122,110,0.35); color: var(--crit); }
.btn.sm { height: 38px; padding: 0 14px; font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* chip toggle group (filters / status select) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); }
.chip {
  padding: 8px 14px; border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 550;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--ink-2);
  white-space: nowrap; transition: all var(--dur-fast) var(--ease);
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--gold-glow); border-color: var(--gold-line); color: var(--gold-soft); }
.chip .c-count { color: var(--ink-4); margin-left: 4px; font-family: var(--font-num); font-size: var(--t-xs); }

/* ---------- Forms (sheet bodies) ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--sp-4); }
.field > label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 600; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 13px var(--sp-4);
  background: var(--surface-3); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  color: var(--ink); font-size: var(--t-body); transition: border-color var(--dur-fast);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--gold-line); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237E7B74' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.field-row { display: flex; gap: var(--sp-3); }
.field-row > .field { flex: 1; }

/* ---------- Sheet (bottom modal) ---------- */
.sheet-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(3,3,4,0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.sheet-scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  max-width: var(--maxw); margin: 0 auto;
  background: var(--surface-2);
  border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg);
  border-top: 1px solid var(--hairline-2);
  box-shadow: var(--shadow-lg);
  max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform var(--dur) var(--ease-out);
  padding-bottom: var(--safe-bot);
}
.sheet.in { transform: translateY(0); }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: var(--hairline-2); margin: 10px auto 4px; flex: 0 0 auto; }
.sheet-head { padding: var(--sp-3) var(--sp-5) var(--sp-2); display: flex; align-items: center; gap: var(--sp-3); }
.sheet-head h3 { font-size: var(--t-h1); font-weight: 600; letter-spacing: -0.02em; flex: 1; }
.sheet-body { padding: var(--sp-3) var(--sp-5) var(--sp-5); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: var(--sp-3) var(--sp-5) var(--sp-5); border-top: 1px solid var(--hairline); display: flex; gap: var(--sp-3); flex: 0 0 auto; }

/* action sheet list (quick add) */
.action-list { display: flex; flex-direction: column; gap: 2px; }
.action-item {
  display: flex; align-items: center; gap: var(--sp-4); padding: 15px var(--sp-3);
  border-radius: var(--r-sm); transition: background var(--dur-fast);
}
.action-item:active { background: var(--surface-3); }
.action-item .ai-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--hairline); color: var(--gold-soft); }
.action-item .ai-ic svg { width: 19px; height: 19px; }
.action-item .ai-tx { font-weight: 550; }
.action-item .ai-sub { font-size: var(--t-sm); color: var(--ink-3); }

/* ---------- FAB ---------- */
.fab {
  position: fixed; z-index: 60; right: max(16px, calc(50% - var(--maxw)/2 + 16px));
  bottom: calc(var(--nav-h) + var(--safe-bot) + 16px);
  width: 58px; height: 58px; border-radius: 20px;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep));
  color: #120e04; display: grid; place-items: center;
  box-shadow: 0 12px 28px -8px rgba(200,162,75,0.5), var(--shadow);
  transition: transform var(--dur-fast) var(--ease);
}
.fab:active { transform: scale(0.9) rotate(45deg); }
.fab svg { width: 26px; height: 26px; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  max-width: var(--maxw); margin: 0 auto;
  height: calc(var(--nav-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(11,11,14,0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--hairline);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--ink-4); font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  transition: color var(--dur-fast); position: relative;
}
.nav-item svg { width: 22px; height: 22px; transition: transform var(--dur-fast) var(--ease); }
.nav-item.on { color: var(--gold-soft); }
.nav-item.on svg { transform: translateY(-1px); }
.nav-item.on::after {
  content: ""; position: absolute; top: 6px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px var(--gold);
}
.nav-item:active { color: var(--ink-2); }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: var(--sp-8) var(--sp-5);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  position: relative;
}
.empty::before {
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 180px; height: 180px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--gold-glow), transparent 62%); opacity: 0.7;
}
.empty .e-ic {
  width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; position: relative;
  background: linear-gradient(150deg, #16140d, var(--surface)); border: 1px solid var(--gold-line); color: var(--gold-soft);
}
.empty .e-ic svg { width: 28px; height: 28px; }
.empty h4 { font-size: var(--t-h2); font-weight: 600; position: relative; }
.empty p { font-size: var(--t-sm); color: var(--ink-3); max-width: 30ch; position: relative; line-height: 1.55; }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 92px; border-radius: var(--r); margin-bottom: var(--sp-3); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bot) + 16px); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: calc(var(--maxw) - 32px);
  background: var(--surface-2); border: 1px solid var(--hairline-2);
  border-radius: var(--r-pill); padding: 11px 18px; font-size: var(--t-sm); font-weight: 550;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  transform: translateY(16px); opacity: 0; transition: all var(--dur) var(--ease-out);
}
.toast.in { transform: translateY(0); opacity: 1; }
.toast .t-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.toast.ok .t-dot { background: var(--ok); }
.toast.crit .t-dot { background: var(--crit); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--hairline); margin: var(--sp-4) 0; }
.kv { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-3); font-size: var(--t-sm); }
.kv .v { font-weight: 550; text-align: right; }
.tag { font-size: var(--t-xs); padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-weight: 600; }

.next-action {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--gold-glow); border: 1px solid var(--gold-line); border-radius: var(--r-sm);
  font-size: var(--t-sm);
}
.next-action .na-ic { color: var(--gold-soft); flex: 0 0 auto; }
.next-action b { color: var(--gold-soft); font-weight: 600; }

/* ---------- Icon badge (focal, used in hero + headers) ---------- */
.ic-badge {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--surface-3); border: 1px solid var(--hairline);
}
.ic-badge.gold {
  background: linear-gradient(150deg, #1c160b, var(--surface-2));
  border-color: var(--gold-line); color: var(--gold-soft);
  box-shadow: inset 0 0 20px rgba(200,162,75,0.10);
}

/* ---------- Hero priority card (Home focal point) ---------- */
.hero-prio {
  position: relative; width: 100%; text-align: left; overflow: hidden;
  padding-left: 22px;
  background:
    radial-gradient(130% 90% at 0% 0%, rgba(200,162,75,0.10), transparent 55%),
    linear-gradient(158deg, #16120a 0%, var(--surface) 62%);
  border-color: var(--gold-line);
}
.hero-prio .hero-accent {
  position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  box-shadow: 0 0 14px var(--gold-glow);
}
.hero-now {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--gold-soft);
  background: var(--gold-glow); border: 1px solid var(--gold-line);
  padding: 4px 9px; border-radius: var(--r-pill);
}
.hero-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.28; }
.hero-cta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--hairline);
  color: var(--ink-3); font-size: 12px; letter-spacing: 0.02em;
}

/* ---------- Depth lift: subtle top highlight on every surface ---------- */
.card, .stat, .list-row {
  background-image: linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0) 38%);
}
.stat .label svg { width: 13px; height: 13px; opacity: 0.65; }
.stat.feature { box-shadow: var(--shadow), 0 0 36px -16px var(--gold-glow); }

/* ---------- Sparkline footer for feature stat ---------- */
.stat .micro-bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; margin-top: 12px; opacity: 0.9; }
.stat .micro-bars > i { flex: 1; min-height: 3px; border-radius: 2px; background: var(--hairline-2); }
.stat.feature .micro-bars > i { background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep)); opacity: 0.55; }
.stat.feature .micro-bars > i.peak { opacity: 1; }

/* ============================================================
   Charts (charts.js)
   ============================================================ */
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 4px 0; background: none; }
.funnel-row:active { opacity: 0.7; }
.funnel-label { width: 92px; flex: 0 0 auto; font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-track { flex: 1; height: 22px; background: var(--surface-3); border-radius: 7px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 7px; background: linear-gradient(90deg, rgba(200,162,75,0.32), var(--gold-deep)); transition: width 700ms var(--ease-out); }
.funnel-bar.crit { background: linear-gradient(90deg, rgba(209,122,110,0.28), var(--crit)); }
.funnel-meta { flex: 0 0 auto; display: flex; align-items: baseline; gap: 8px; min-width: 78px; justify-content: flex-end; }
.funnel-count { font-size: var(--t-body); font-weight: 600; }
.funnel-val { font-size: var(--t-xs); color: var(--ink-3); }

.trend-chart { width: 100%; }
.trend-labels { display: flex; margin-top: 6px; }
.trend-labels span { flex: 1; text-align: center; font-size: 9px; color: var(--ink-4); font-family: var(--font-num); }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-3); }
.chart-legend .lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend .lg.income i { background: var(--gold); }
.chart-legend .lg.expense i { background: var(--crit); opacity: 0.5; }

.chart-bars { display: flex; align-items: flex-end; gap: 5px; }
.cb-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.cb-bar { width: 100%; max-width: 16px; border-radius: 3px 3px 0 0; background: var(--hairline-2); transition: height 600ms var(--ease-out); }
.cb-bar.peak { background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep)); }
.cb-label { font-size: 9px; color: var(--ink-4); font-family: var(--font-num); }

/* ============================================================
   Kalender / Buchung (calendar.js)
   ============================================================ */
/* segmented control (Tag / Monat / Liste) */
.cal-seg { display: flex; gap: 2px; background: var(--surface-3); border: 1px solid var(--hairline); border-radius: 12px; padding: 3px; margin-top: 4px; }
.cal-seg button { flex: 1; height: 34px; border-radius: 9px; background: none; color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; transition: background var(--dur-fast), color var(--dur-fast); }
.cal-seg button.on { background: var(--gold-glow); color: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
.cal-seg button:active { transform: scale(0.97); }

/* nav row (Monatspfeile / Tagespfeile + Heute) */
.cal-nav { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.cal-nav-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.cal-nav-grow { flex: 1; }
.cal-today-btn { height: 32px; padding: 0 14px; border-radius: var(--r-pill); background: var(--gold-glow); border: 1px solid var(--gold-line); color: var(--gold-soft); font-weight: 600; font-size: var(--t-sm); }
.cal-today-btn:active { transform: scale(0.96); }
.icon-btn.sm { width: 32px; height: 32px; }

/* month grid */
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 14px; }
.cal-weekdays span { text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-3); padding-bottom: 8px; }
.cal-grid-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; touch-action: pan-y; }
.cal-cell { aspect-ratio: 1 / 1.12; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 7px; background: none; border-radius: 10px; }
.cal-cell:active { background: var(--surface); }
.cal-cell .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-family: var(--font-num); font-size: 15px; font-weight: 500; color: var(--ink); }
.cal-cell.dim .n { color: var(--ink-4); }
.cal-cell.today .n { background: var(--gold); color: #120e04; font-weight: 700; box-shadow: 0 0 12px var(--gold-glow); }
.cal-cell.sel:not(.today) .n { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold-soft); }
.cal-cell.sel.today .n { box-shadow: 0 0 0 2px var(--gold-line), 0 0 12px var(--gold-glow); }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }

/* selected-day list under the month grid */
.cal-sel-list { margin-top: 18px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.cal-sel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-sel-head > span { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.cal-add-mini { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-glow); border: 1px solid var(--gold-line); color: var(--gold-soft); }
.cal-add-mini:active { transform: scale(0.92); }
.cal-sel-empty { font-size: var(--t-sm); padding: 14px 2px; }

/* all-day row (day view) */
.cal-allday { display: flex; gap: 10px; padding: 8px 0 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 8px; }
.cal-allday-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-4); padding-top: 6px; width: 54px; flex: 0 0 auto; text-align: right; padding-right: 8px; }
.cal-allday-chip { background: var(--surface-2); border: 1px solid var(--hairline-2); border-left: 3px solid var(--gold); border-radius: 8px; padding: 5px 10px; font-size: var(--t-sm); font-weight: 600; color: var(--ink); }

/* list view (Apple List) */
.cal-list { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.cal-list-day { display: flex; gap: 12px; }
.cal-list-date { width: 48px; flex: 0 0 auto; text-align: center; padding-top: 6px; }
.cal-list-date .wd { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-list-date .dn { display: block; font-family: var(--font-num); font-size: 22px; font-weight: 600; line-height: 1.15; }
.cal-list-date .mo { display: block; font-size: 10px; color: var(--ink-4); }
.cal-list-date.today .wd { color: var(--gold-soft); }
.cal-list-date.today .dn { width: 30px; height: 30px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #120e04; font-size: 15px; box-shadow: 0 0 12px var(--gold-glow); }
.cal-list-events { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.cal-day { position: relative; }
.cal-grid { position: relative; width: 100%; }
.cal-hour { position: absolute; left: 0; right: 0; height: 56px; border-top: 1px solid var(--hairline); }
.cal-hour .cal-hl { position: absolute; left: 0; top: -7px; width: 46px; text-align: right; padding-right: 8px; font-size: 10px; font-family: var(--font-num); color: var(--ink-4); }
.cal-hour .cal-slot { position: absolute; left: 54px; right: 0; top: 0; height: 100%; background: none; border-radius: 6px; }
.cal-hour .cal-slot:active { background: var(--gold-glow); }
.cal-now { position: absolute; left: 48px; right: 0; height: 0; border-top: 2px solid var(--gold); z-index: 3; box-shadow: 0 0 8px var(--gold-glow); }
.cal-now::before { content: ""; position: absolute; left: 0; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.cal-event {
  position: absolute; z-index: 2; text-align: left; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--hairline-2); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 5px 8px; box-shadow: var(--shadow);
  touch-action: none; /* vertikales Ziehen verschiebt den Block, statt zu scrollen */
}
.cal-event:active { transform: scale(0.98); }
.cal-event.conflict { border-color: var(--warn); }
.cal-event.dragging { opacity: 0.92; z-index: 5; box-shadow: 0 12px 28px -8px rgba(0,0,0,0.7); transform: none; }

/* sanftes Gleiten beim Monatswechsel */
@keyframes calSlideNext { from { transform: translateX(26px); opacity: 0.25; } to { transform: none; opacity: 1; } }
@keyframes calSlidePrev { from { transform: translateX(-26px); opacity: 0.25; } to { transform: none; opacity: 1; } }
.cal-grid-month.slide-next { animation: calSlideNext 240ms var(--ease-out); }
.cal-grid-month.slide-prev { animation: calSlidePrev 240ms var(--ease-out); }
.cal-event .ce-title { font-size: var(--t-sm); font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event .ce-time { font-size: 10px; color: var(--ink-3); font-family: var(--font-num); margin-top: 2px; }

/* Aufziehen: Geister-Block beim Halten+Ziehen auf der Timeline */
.cal-creating { position: absolute; left: 54px; right: 4px; z-index: 4; pointer-events: none;
  background: var(--gold-bg, rgba(200,162,75,0.16)); border: 1.5px dashed var(--gold);
  border-radius: 8px; box-shadow: 0 6px 18px -8px rgba(0,0,0,0.6); }
.cal-creating .cc-time { font-family: var(--font-num); font-size: 11px; font-weight: 600; color: var(--gold-soft); padding: 3px 6px; }

/* Dokumente: Posten-Editor im Anlege-Sheet */
.doc-item { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.doc-item .input { min-height: 42px; }
.di-sum { font-family: var(--font-num); }

/* ============================================================
   Cockpit (home.js)
   ============================================================ */
.briefing {
  font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--hairline);
  display: flex; gap: 10px; align-items: flex-start;
}
.briefing .b-ic { color: var(--gold-soft); flex: 0 0 auto; margin-top: 1px; }
.briefing b { color: var(--ink); font-weight: 600; }

.live-clock { font-family: var(--font-num); font-size: var(--t-sm); color: var(--ink-2); display: flex; align-items: center; gap: 7px; letter-spacing: 0.02em; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulseDot 2.4s var(--ease) infinite; }
@keyframes pulseDot { 0%,100% { opacity: 0.45; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }

/* Alert center */
.alert-card { border-color: rgba(209,122,110,0.28); background: linear-gradient(160deg, rgba(209,122,110,0.06), var(--surface) 60%); }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--hairline); width: 100%; text-align: left; background: none; }
.alert-row:last-child { border-bottom: none; }
.alert-row:active { opacity: 0.7; }
.alert-row .a-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-3); }
.alert-row.crit .a-ic { color: var(--crit); background: var(--crit-bg); }
.alert-row.warn .a-ic { color: var(--warn); background: var(--warn-bg); }
.alert-row.info .a-ic { color: var(--info); background: var(--info-bg); }
.alert-row .a-main { flex: 1; min-width: 0; }
.alert-row .a-title { font-size: var(--t-body); font-weight: 550; }
.alert-row .a-sub { font-size: var(--t-xs); color: var(--ink-3); margin-top: 1px; }
.alert-row .a-count { font-family: var(--font-num); font-weight: 600; font-size: var(--t-body); }

/* MRR goal card */
.goal-card { display: flex; align-items: center; gap: 18px; }
.goal-card .g-body { flex: 1; min-width: 0; }
.goal-card .g-head { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.13em; color: var(--ink-3); font-weight: 600; }
.goal-card .g-val { font-family: var(--font-num); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; }
.goal-card .g-val .g-target { color: var(--ink-3); font-size: 14px; }
.goal-card .g-rest { font-size: var(--t-sm); color: var(--ink-3); margin-top: 6px; }

/* Ambient hero orb */
.hero-prio .hero-orb {
  position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
  pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--gold-glow), transparent 64%);
  animation: orbBreath 6s var(--ease) infinite;
}
.hero-prio > *:not(.hero-orb) { position: relative; z-index: 1; }
@keyframes orbBreath { 0%,100% { opacity: 0.5; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.06); } }

/* ============================================================
   Toast with Undo (ui.js toastUndo)
   ============================================================ */
.toast .t-undo {
  margin-left: 6px; color: var(--gold-soft); font-weight: 700; font-size: var(--t-sm);
  padding: 4px 8px; border-radius: var(--r-pill); border: 1px solid var(--gold-line); background: var(--gold-glow);
}
.toast .t-undo:active { transform: scale(0.94); }

/* ============================================================
   Date quick-chips inside formSheet
   ============================================================ */
.date-chips { display: flex; gap: 7px; margin-top: 8px; }
.date-chips .chip { padding: 6px 12px; font-size: var(--t-xs); }

/* ============================================================
   Command bar (search.js)
   ============================================================ */
.cmd-input-wrap { position: relative; margin-bottom: var(--sp-3); }
.cmd-input-wrap .cmd-ic { position: absolute; left: 14px; top: 14px; color: var(--ink-3); }
.cmd-input { padding-left: 44px !important; height: 52px; font-size: 16px; }
.cmd-group-label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-4); font-weight: 600; margin: var(--sp-3) 2px 6px; }
.cmd-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); width: 100%; text-align: left; background: none; }
.cmd-row:active { background: var(--surface-3); }
.cmd-row .cmd-r-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-3); border: 1px solid var(--hairline); color: var(--ink-2); }
.cmd-row .cmd-r-ic.gold { color: var(--gold-soft); border-color: var(--gold-line); }
.cmd-row .cmd-r-main { flex: 1; min-width: 0; }
.cmd-row .cmd-r-title { font-weight: 550; font-size: var(--t-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-row .cmd-r-sub { font-size: var(--t-xs); color: var(--ink-3); }

/* ============================================================
   Topbar search action + sort menu
   ============================================================ */
.sort-menu { display: flex; flex-direction: column; gap: 2px; }
.sort-opt { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: var(--r-sm); width: 100%; text-align: left; background: none; font-size: var(--t-body); }
.sort-opt:active { background: var(--surface-3); }
.sort-opt.on { color: var(--gold-soft); }
.sort-opt .so-check { margin-left: auto; color: var(--gold-soft); opacity: 0; }
.sort-opt.on .so-check { opacity: 1; }

/* stale dot for clients */
.stale-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 7px var(--crit); flex: 0 0 auto; }

/* count-up spin guard: keep tabular */
.countup { font-variant-numeric: tabular-nums; }

/* ============================================================
   Swipe rows (ui.js swipeRow)
   ============================================================ */
.swipe-wrap { position: relative; margin-bottom: var(--sp-2); overflow: hidden; border-radius: var(--r); }
.swipe-wrap .swipe-fg { margin-bottom: 0 !important; will-change: transform; touch-action: pan-y; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-radius: var(--r); opacity: 0; pointer-events: none; }
.swipe-bg.go-right { background: linear-gradient(90deg, var(--ok-bg), transparent 60%); }
.swipe-bg.go-left { background: linear-gradient(270deg, var(--crit-bg), transparent 60%); }
.swipe-act { display: grid; place-items: center; }
.swipe-act.right { color: var(--ok); }
.swipe-act.left { color: var(--crit); }

/* ============================================================
   Pull to refresh (router.js)
   ============================================================ */
.ptr { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: center; padding-top: calc(var(--safe-top) + 10px); pointer-events: none; z-index: 5; transform: translateY(-6px); opacity: 0; transition: opacity 150ms, transform 150ms; }
.ptr.show { opacity: 1; transform: translateY(0); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--hairline-2); border-top-color: var(--gold); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* inline loading row (after slow fetch) */
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; color: var(--ink-3); font-size: var(--t-sm); }

/* ============================================================
   KI-Assistent chat (assistant.js)
   ============================================================ */
.chat-log { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-bottom: 84px; }
.chat-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user { align-self: flex-end; background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep)); color: #120e04; border-bottom-right-radius: 5px; font-weight: 500; }
.chat-msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--hairline); border-bottom-left-radius: 5px; }
.chat-msg.sys { align-self: stretch; max-width: 100%; background: var(--surface); border: 1px dashed var(--gold-line); color: var(--ink-2); text-align: center; font-size: 13px; }
.chat-act { align-self: flex-start; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--gold-soft); padding: 3px 4px; }
.chat-act svg { color: var(--ok); }
.chat-msg.typing { display: flex; gap: 5px; align-items: center; }
.chat-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); display: inline-block; animation: typingDot 1.2s infinite; }
.chat-msg.typing i:nth-child(2) { animation-delay: 0.18s; }
.chat-msg.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingDot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-composer {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bot)); z-index: 66;
  max-width: var(--maxw); margin: 0 auto; padding: 10px 12px;
  display: flex; gap: 8px; align-items: flex-end;
  background: rgba(11,11,14,0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
}
.chat-composer .input { flex: 1; }
.chat-send { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; display: grid; place-items: center; background: linear-gradient(160deg, var(--gold-soft), var(--gold-deep)); color: #120e04; }
.chat-send:active { transform: scale(0.93); }

/* ============================================================
   Celebrate (ui.js celebrate) - quiet luxe win moment
   ============================================================ */
.celebrate-ring {
  position: fixed; top: 42%; left: 50%; z-index: 96; pointer-events: none;
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 2px solid var(--gold); opacity: 0.9;
  animation: celebRing 900ms cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes celebRing { to { transform: scale(9); opacity: 0; border-width: 0.5px; } }
.celebrate-star {
  position: fixed; top: 42%; left: 50%; z-index: 96; pointer-events: none;
  margin: -16px 0 0 -16px; color: var(--gold-soft);
  animation: celebStar 1000ms var(--ease-out) forwards;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}
@keyframes celebStar { 0% { transform: scale(0.3); opacity: 0; } 35% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1) translateY(-10px); opacity: 0; } }

/* ============================================================
   PWA install hint (app.js)
   ============================================================ */
.install-hint {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-bot) + 14px);
  max-width: calc(var(--maxw) - 24px); margin: 0 auto; z-index: 75;
  background: var(--surface-2); border: 1px solid var(--gold-line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 13px 14px; display: flex; align-items: center; gap: 12px;
  transform: translateY(16px); opacity: 0; transition: all var(--dur) var(--ease-out);
}
.install-hint.in { transform: translateY(0); opacity: 1; }
.install-hint .ih-ic { color: var(--gold-soft); flex: 0 0 auto; }
.install-hint .ih-tx { flex: 1; min-width: 0; }
.install-hint .ih-tx b { font-weight: 600; font-size: var(--t-sm); }
.install-hint .ih-tx span { display: block; font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.install-hint .ih-x { color: var(--ink-3); padding: 6px; flex: 0 0 auto; }
