/* ===========================================================
   saintbnb — Account dashboard (guest + host)
   Depends on app.css for tokens (beige palette)
   =========================================================== */

.dash { min-height: 100vh; background: var(--surface-alt); }

/* Top bar */
.dash-top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(17,17,17,0.92);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-top: env(safe-area-inset-top, 0px);
}
.dash-top .brand { color: #fff; }
.dash-top-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dash-role-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: rgba(244,243,239,0.9); padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
/* Gastgeber: deutlich hervorgehoben (gefüllt statt dezent) */
.dash-role-badge.is-host {
  background: var(--primary); border-color: var(--primary-dark); color: #fff;
}
.dash-top-right { display: flex; align-items: center; gap: 12px; }
.dash-logout { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244,243,239,0.7); }
.dash-logout:hover { color: #fff; }

/* ===== Modus-Umschalter Gast ↔ Gastgeber (Airbnb-Stil) ===== */
.role-switch {
  display: inline-flex; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; padding: 3px;
}
.role-switch button {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: transparent; border: 0; border-radius: 999px;
  padding: 6px 13px; font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
  color: rgba(244,243,239,0.75); white-space: nowrap; transition: background .15s, color .15s;
}
.role-switch button .ic { font-size: 13px; }
.role-switch button:hover { color: #fff; }
.role-switch button.on { background: var(--primary); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }

/* Bestätigungs-Toast beim Moduswechsel */
.mode-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: #111; color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 9500;
}
.mode-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  /* Auf kleinen Screens nur Icons zeigen, damit die Kopfzeile nicht überläuft */
  .role-switch button span:not(.ic) { display: none; }
  .role-switch button { padding: 7px 11px; }
}

/* Layout */
.dash-body { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
/* Grid-Kinder dürfen schmaler als ihr Inhalt werden → kein horizontales Überlaufen */
.dash-body > main { min-width: 0; }

/* Sidebar */
.dash-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.dash-navitem {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  cursor: pointer; border: 1px solid transparent;
}
.dash-navitem .ic { font-size: 18px; width: 22px; text-align: center; }
.dash-navitem:hover { background: var(--surface); }
.dash-navitem.on { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.dash-navitem.host-only { }

@media (max-width: 860px) {
  .dash-body { grid-template-columns: minmax(0, 1fr); }
  .dash-side { min-width: 0; position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .dash-side::-webkit-scrollbar { display: none; }
  .dash-navitem { white-space: nowrap; flex-shrink: 0; }
  .dash-navitem .lbl { display: inline; }
}

/* Panels */
.dash-panel { display: none; }
.dash-panel.on { display: block; animation: fadeUp 0.3s ease-out both; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.dash-card h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.02em; }
.dash-card .sub { font-size: 14px; color: var(--text-2); margin: 0 0 22px; }
.dash-card h3 { font-size: 15px; font-weight: 700; margin: 22px 0 12px; }

.dash-h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 20px; }

/* Forms */
.f-row { display: flex; gap: 14px; }
.f-row > * { flex: 1; }
.f-field { margin-bottom: 16px; }
.f-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.f-field input, .f-field select, .f-field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px;
  font-size: 15px; font-family: inherit; color: var(--text); background: white;
}
.f-field input:focus, .f-field select:focus, .f-field textarea:focus { outline: none; border-color: var(--primary); }
.f-field textarea { min-height: 90px; resize: vertical; }
.f-field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.f-prefix { position: relative; }
.f-prefix span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-weight: 600; }
.f-prefix input { padding-left: 30px; }

.btn-save { background: var(--primary); color: white; padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; border: 0; cursor: pointer; }
.btn-save:hover { background: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid var(--primary-border); padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-soft:hover { background: var(--primary-soft); }
.saved-toast { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 14px; font-weight: 600; margin-left: 12px; opacity: 0; transition: opacity 0.2s; }
.saved-toast.show { opacity: 1; }

/* Avatar */
.avatar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.avatar-big { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-border); background: var(--surface-warm); }
.avatar-up { font-size: 14px; font-weight: 600; color: var(--primary-dark); cursor: pointer; }

/* Amenities */
.amen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.amen-chip { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 13px; cursor: pointer; user-select: none; }
.amen-chip.on { border-color: var(--primary); background: var(--surface-warm); color: var(--primary-dark); font-weight: 600; }
@media (max-width: 600px) { .amen-grid { grid-template-columns: 1fr 1fr; } .f-row { flex-direction: column; } }

/* Photo uploader */
.photo-drop { border: 2px dashed var(--primary-border); border-radius: 16px; padding: 28px; text-align: center; cursor: pointer; background: var(--surface-warm); transition: background 0.15s; }
.photo-drop:hover { background: var(--primary-soft); }
.photo-drop .ic { font-size: 32px; }
.photo-drop .t { font-weight: 700; margin-top: 8px; }
.photo-drop .s { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.photo-item { position: relative; aspect-ratio: 1.2/1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .cover-tag { position: absolute; bottom: 6px; left: 6px; background: var(--primary); color: white; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; }
.photo-item .rm { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.6); color: white; border: 0; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 600px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: white; font-size: 18px; cursor: pointer; }
.cal-nav:hover { background: var(--surface-warm); }
.cal-month { font-size: 17px; font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding-bottom: 4px; }
.cal-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 14px; cursor: pointer; border: 1px solid var(--border-light); }
.cal-cell.empty { border: 0; cursor: default; }
.cal-cell.past { color: var(--text-muted); background: var(--surface-alt); cursor: not-allowed; }
.cal-cell.available:hover { border-color: var(--primary); }
.cal-cell.blocked { background: #FFEDE6; color: var(--primary-dark); text-decoration: line-through; border-color: var(--primary-border); }
.cal-cell.booked { background: #111; color: #fff; border-color: #111; cursor: not-allowed; font-weight: 700; }
.cal-cell.today { font-weight: 800; border-color: var(--text); }
.cal-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.cal-legend .dot { display: inline-block; width: 13px; height: 13px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }

/* Sync */
.sync-platform { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; }
.sync-logo { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: white; flex-shrink: 0; }
.sync-logo.airbnb { background: #FF5A5F; }
.sync-logo.booking { background: #003580; }
.sync-logo.vrbo { background: #245ABC; }
.sync-logo.ical { background: var(--primary); }
.sync-info { flex: 1; min-width: 0; }
.sync-info .nm { font-weight: 700; font-size: 15px; }
.sync-info .st { font-size: 13px; color: var(--text-2); }
.sync-info input { width: 100%; margin-top: 6px; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; font-family: inherit; }
.sync-status { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.sync-status.off { background: var(--surface-alt); color: var(--text-muted); }
.sync-status.on { background: #E4EFE4; color: var(--success); }
.export-box { display: flex; gap: 8px; margin-top: 10px; }
.export-box input { flex: 1; min-width: 0; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; background: var(--surface-alt); color: var(--text-2); font-family: ui-monospace, monospace; }
.info-note { background: var(--surface-warm); border: 1px solid var(--primary-border); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: var(--text-2); line-height: 1.55; margin-top: 4px; }
.info-note b { color: var(--primary-dark); }

/* Empty states */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty-state .ic { font-size: 40px; }
.empty-state .t { font-weight: 700; font-size: 17px; color: var(--text); margin-top: 10px; }
.empty-state .s { font-size: 14px; margin-top: 4px; }

/* Fee preview box */
.fee-box { background: var(--surface-warm); border: 1px solid var(--primary-border); border-radius: 14px; padding: 16px 18px; margin: 18px 0 4px; }
.fee-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--primary-dark); margin-bottom: 10px; }
.fee-r { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--text-2); }
.fee-r span:last-child { font-weight: 600; color: var(--text); }
.fee-r.total { border-top: 1px solid var(--primary-border); margin-top: 6px; padding-top: 10px; font-weight: 700; }
.fee-r.total span { color: var(--text); font-weight: 800; }
.fee-r.you span:last-child { color: var(--success); font-weight: 800; }
.fee-r.plat span:last-child { color: var(--primary-dark); font-weight: 800; }

/* Payout status */
.payout-status { display: flex; align-items: center; gap: 16px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.payout-status-ic { font-size: 30px; }
.payout-status-t { font-weight: 700; font-size: 16px; }
.payout-status-s { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.fee-explain { display: flex; flex-direction: column; gap: 2px; }
.fee-explain-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.fee-explain-row:last-child { border-bottom: 0; }
.fee-explain-row span { color: var(--text-2); }
.fee-explain-row b { color: var(--text); text-align: right; }

/* Profilfoto-Editor */
.crop-modal { position: fixed; inset: 0; z-index: 9700; background: rgba(17,17,17,.72); display: flex; align-items: center; justify-content: center; padding: 20px; }
.crop-modal[hidden] { display: none; }
.crop-box { background: var(--surface); border-radius: 20px; padding: 24px; width: 100%; max-width: 360px; box-shadow: var(--shadow-lg); text-align: center; }
.crop-box h3 { margin: 0 0 4px; font-size: 18px; font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; }
.crop-hint { margin: 0 0 16px; font-size: 13px; color: var(--text-2); }
.crop-stage { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #111; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
/* max-width/-height: none überschreibt die globale img-Regel (img{max-width:100%}),
   sonst wird das Bild auf die Bühnenbreite gedeckelt und füllt den Rahmen nicht. */
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; max-height: none; transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; box-shadow: 0 0 0 9999px rgba(17,17,17,.45); border-radius: 50%; }
.crop-zoom { width: 100%; margin: 18px 0 8px; accent-color: var(--primary); }
.crop-actions { display: flex; gap: 10px; }
.crop-actions .btn-soft, .crop-actions .btn-save { flex: 1; }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 44px; height: 26px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.2s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform 0.2s; box-shadow: var(--shadow-sm); }
.toggle input:checked + .track { background: var(--primary); }
.toggle input:checked + .track::after { transform: translateX(18px); }

/* ===== Postfach (Inbox) ===== */
.dash-navitem { position: relative; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Hinweis-Banner: neue Anfragen / Buchungen / Bestätigungen nach dem Login */
.dash-alert {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: linear-gradient(180deg, #FFF3EE 0%, #FFE9E0 100%);
  border: 1px solid var(--primary-border); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.dash-alert:hover { border-color: var(--primary); }
.dash-alert-ic { font-size: 20px; line-height: 1; }
.dash-alert-txt { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.dash-alert-x {
  flex-shrink: 0; background: transparent; border: 0; cursor: pointer;
  color: var(--primary-dark); opacity: 0.55; font-size: 15px; padding: 4px 6px; line-height: 1;
}
.dash-alert-x:hover { opacity: 1; }
.inbox { display: grid; grid-template-columns: 320px 1fr; min-height: 540px; }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 70vh; }
.conv {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .15s;
}
.conv:hover { background: var(--surface-alt); }
.conv.on { background: var(--surface-warm, var(--surface-alt)); }
.conv-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-alt); }
.conv-main { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.conv-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.conv-last { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.conv.unread .conv-name, .conv.unread .conv-last { font-weight: 800; color: var(--text); }
.conv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.conv-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.inbox-thread { display: flex; flex-direction: column; min-height: 540px; max-height: 70vh; }
.inbox-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); }
.inbox-empty .ic { font-size: 40px; }
.inbox-thread-inner { display: flex; flex-direction: column; height: 100%; min-height: 540px; }
.inbox-thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.inbox-back { display: none; background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-2); padding: 0 4px 0 0; }
.inbox-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-alt); }
.inbox-thread-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.inbox-thread-meta b { font-size: 15px; }
.inbox-thread-meta span { font-size: 12px; color: var(--text-muted); }
.inbox-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.bubble.them { align-self: flex-start; background: var(--surface-alt); border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.bubble-time { font-size: 10px; opacity: .65; margin-top: 4px; display: block; text-align: right; }
.msg-day { align-self: center; font-size: 11px; color: var(--text-muted); background: var(--surface-alt); padding: 3px 12px; border-radius: 999px; margin: 6px 0; }
.inbox-compose { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.inbox-compose textarea {
  flex: 1; resize: none; border: 1.5px solid var(--border); border-radius: 20px; padding: 10px 16px;
  font: inherit; font-size: 14px; max-height: 120px; line-height: 1.4;
}
.inbox-compose textarea:focus { outline: none; border-color: var(--primary); }
.inbox-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--primary); color: #fff;
  font-size: 17px; cursor: pointer; flex-shrink: 0; transition: opacity .15s;
}
.inbox-send:disabled { opacity: .45; cursor: default; }

@media (max-width: 720px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { border-right: none; max-height: none; }
  .inbox.thread-open .inbox-list { display: none; }
  .inbox:not(.thread-open) .inbox-thread { display: none; }
  .inbox-back { display: block; }
}

/* Konto löschen */
.del-card[hidden] { display: none; }
.del-list { margin: 10px 0 14px 18px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.del-list li { margin-bottom: 4px; }
.del-status { background: #FBEAE9; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }
.del-status a { font-weight: 700; color: var(--text); }
.del-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 8px 0 12px; cursor: pointer; }
.del-check input { margin-top: 3px; }
.del-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.del-input { width: 100%; max-width: 280px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: inherit; letter-spacing: 1px; }
.del-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.del-go { border-color: var(--error) !important; background: var(--error) !important; color: #fff !important; }
.del-go[disabled] { opacity: .45; cursor: not-allowed; }
.del-msg { margin-top: 12px; font-size: 14px; }
.del-msg.err { color: var(--error); }
.bubble .sb-report-btn { font-size: 10px; padding: 0 0 0 8px; }
