/* ═══════════════════════════════════════════════════════════════════════════
   pages.css — Seitenspezifisches: Produktliste, Kalender, Charts, Tickets,
   Zeiterfassung, Suche, Notifications. Mobile-first.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Dashboard: Trend-Chart ── */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding-top: 8px;
}
.trend-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.trend-bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.trend-bar { width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height var(--t-med); }
.trend-bar.income  { background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep)); }
.trend-bar.expense { background: var(--surface-3); }
.trend-label { font-size: .64rem; color: var(--text-faint); white-space: nowrap; }
.trend-legend { display: flex; gap: 16px; margin-top: 10px; font-size: .72rem; color: var(--text-faint); }
.trend-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ── Feed / Termine ── */
.feed-item {
  display: flex;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .86rem;
}
.feed-item:last-child { border-bottom: none; }
.feed-icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: .95rem; }
.feed-body { flex: 1; min-width: 0; }
.feed-time { font-size: .7rem; color: var(--text-faint); }

/* ── Lager: Produktliste (Shopify-Style) ── */
.product-list { display: flex; flex-direction: column; gap: 8px; }
.product-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.product-row-img {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  overflow: hidden;
}
.product-row-img img { width: 100%; height: 100%; object-fit: cover; }
.product-row-info { min-width: 0; }
.product-row-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-row-sku { font-family: var(--font-mono); font-size: .7rem; color: var(--text-faint); }
.product-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.product-row-price { font-family: var(--font-mono); font-size: .85rem; color: var(--gold-bright); }
.product-row-bottom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 9px;
}
.inline-stock { display: flex; align-items: center; gap: 8px; }
.inline-stock-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dim);
  display: grid; place-items: center;
  transition: all var(--t-fast);
}
.inline-stock-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.inline-stock-val { font-family: var(--font-mono); font-size: .9rem; min-width: 34px; text-align: center; }

@media (min-width: 768px) {
  .product-row { grid-template-columns: 48px minmax(180px, 2fr) auto auto auto auto; }
  .product-row-bottom { grid-column: auto; border-top: none; padding-top: 0; display: contents; }
}

/* ── Bild-Upload-Zone ── */
.img-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.img-drop:hover, .img-drop.dragover { border-color: var(--gold); color: var(--gold-bright); background: var(--gold-alpha-08); }
.img-drop img { max-height: 130px; margin: 0 auto 8px; border-radius: 8px; }
.img-drop .img-remove {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: var(--radius-pill);
  background: var(--red-dim);
  color: var(--red);
  font-weight: 700;
}

/* ── Kalender ── */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-title { font-family: var(--font-display); font-size: 1.15rem; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow { text-align: center; font-size: .64rem; color: var(--text-faint); text-transform: uppercase; padding: 4px 0; }
.cal-cell {
  min-height: 52px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px;
  font-size: .72rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.cal-cell:hover { border-color: var(--border-strong); }
.cal-cell.other { opacity: .35; }
.cal-cell.today { border-color: var(--gold); box-shadow: var(--glow-gold); }
.cal-cell .cal-day { font-weight: 600; }
.cal-dot {
  border-radius: 4px;
  background: var(--gold-alpha-25);
  color: var(--gold-bright);
  font-size: .58rem;
  padding: 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-more { font-size: .58rem; color: var(--text-faint); }
@media (min-width: 768px) { .cal-cell { min-height: 86px; font-size: .78rem; } .cal-dot { font-size: .66rem; } }

/* ── Tickets ── */
.ticket-thread { display: flex; flex-direction: column; gap: 10px; }
.msg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  font-size: .88rem;
}
.msg.msg-out  { border-left: 3px solid var(--gold); }
.msg.msg-note { border-left: 3px solid var(--amber); background: var(--amber-dim); }
.msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; color: var(--text-faint); margin-bottom: 6px; flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-body img { max-height: 240px; border-radius: 8px; margin-top: 8px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: .74rem;
  margin: 4px 4px 0 0;
}

/* ── Zeiterfassung ── */
.clock-display {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  text-align: center;
  color: var(--gold-bright);
  letter-spacing: .04em;
  padding: 8px 0;
}
.time-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.time-cell {
  min-height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px;
  font-size: .68rem;
  text-align: center;
  cursor: pointer;
}
.time-cell .h { font-family: var(--font-mono); color: var(--green); font-size: .64rem; }
.time-cell.today { border-color: var(--gold); }

/* ── Suche ── */
#search-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 8, 5, .75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
  padding: calc(var(--safe-top) + 10px) 12px 12px;
}
#search-overlay.open { display: flex; }
.search-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.search-bar .input { flex: 1; background: var(--surface); }
.search-cancel { color: var(--gold-bright); font-weight: 600; font-size: .9rem; padding: 0 6px; min-height: 44px; }
.search-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 11px;
}
.search-result:hover { border-color: var(--gold); }
.search-result .sr-icon { font-size: 1.05rem; }
.search-result .sr-sub { font-size: .72rem; color: var(--text-faint); }
.search-hint { display: none; }

@media (min-width: 768px) {
  #search-overlay { padding: 12vh 24px 24px; align-items: center; }
  #search-overlay .search-inner { width: 100%; max-width: 560px; display: flex; flex-direction: column; min-height: 0; }
  .search-cancel { display: none; }
  .search-hint { display: block; text-align: center; color: var(--text-faint); font-size: .72rem; margin-top: 10px; }
  .search-hint kbd {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: .68rem;
  }
}

/* ── Notification-Panel ── */
#notif-panel {
  position: fixed;
  z-index: 90;
  inset: calc(var(--topbar-h) + var(--safe-top) + 6px) 10px auto 10px;
  max-height: 65dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: none;
  padding: 8px;
}
#notif-panel.open { display: block; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  cursor: pointer;
}
.notif-item:hover { background: var(--gold-alpha-08); }
.notif-item.unread { background: var(--gold-alpha-08); box-shadow: inset 2px 0 0 var(--gold); }
@media (min-width: 768px) {
  #notif-panel { left: auto; right: 24px; width: 360px; }
}

/* ── Team / Roster ── */
.roster-row { display: flex; align-items: center; gap: 12px; }
.roster-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.roster-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Invoice-Positionen ── */
.inv-items { display: flex; flex-direction: column; gap: 8px; }
.inv-item-row {
  display: grid;
  grid-template-columns: 1fr 64px 86px 34px;
  gap: 6px;
  align-items: center;
}
.inv-item-row .input { min-height: 42px; padding: 8px 10px; }
.inv-total {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--gold-bright);
  padding-top: 10px;
}

/* ── Settings / 2FA QR ── */
.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: var(--radius); width: fit-content; margin: 0 auto 12px; }

/* ── Donut/Balken-Canvas ── */
canvas.chart { width: 100%; max-width: 100%; }
