/* Iris-Light — latikan-ui-Stil: hell-Default + Dark-Toggle, Rosé #E84A5F (Iris-Familie), Inter */
:root {
  --accent: #E84A5F;
  --accent-soft: #FCE8EB;
  --bg: #F7F7FB;
  --card: #FFFFFF;
  --text: #1C1B22;
  --muted: #6B6878;
  --border: #E7E5EE;
  --shadow: 0 1px 3px rgba(28,27,34,.06), 0 6px 24px rgba(28,27,34,.05);
  --radius: 14px;
}
[data-theme="dark"] {
  --accent: #FF7488;
  --accent-soft: #3A2026;
  --bg: #131119;
  --card: #1C1A24;
  --text: #EDECF2;
  --muted: #9A96AC;
  --border: #2C2A36;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px; line-height: 1.45;
}
button, input, textarea, select { font: inherit; }

/* --- Topbar --- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--card);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.brand .flame { color: var(--accent); display: inline-flex; align-items: center; }
.brand .flame svg { display: block; }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }
.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { color: #fff; filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--accent); border-color: var(--border); }

/* --- Layout --- */
.layout { display: grid; grid-template-columns: 400px 1fr; height: calc(100vh - 57px); }
.list-pane { border-right: 1px solid var(--border); overflow-y: auto; background: var(--bg); }
.list-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--border); z-index: 2; }
.list-head h2 { margin: 0; font-size: 14px; }
.list-head #count { margin-left: auto; color: var(--muted); font-size: 12px; }

.mcard { display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mcard:hover { background: var(--accent-soft); }
.mcard.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mcard .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mcard .cust { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mcard .subj { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .meta { display: flex; gap: 6px; align-items: center; margin-top: 2px; }

.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.b-angebot { background: #E7F7EE; color: #15935A; }
.b-anfrage { background: #EAF2FF; color: #2563EB; }
.b-routine { background: #FFF6DA; color: #A77B12; }
.b-fyi { background: #F0EEF4; color: var(--muted); }
.b-spam { background: #FDE7E7; color: #C2403A; }
.b-draft { background: var(--accent-soft); color: var(--accent); }
.b-offer { background: #EAF2FF; color: #2563EB; }
.b-offer-warn { background: #FDE7E7; color: #C2403A; }
[data-theme="dark"] .badge { filter: brightness(.92); }

/* Anti-Doppel-Angebot-Banner (Detail) */
.offer-banner { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: #EAF2FF; color: #1C3A66; border: 1px solid #C7DBFF; font-size: 13.5px; }
.offer-banner.warn { background: #FDE7E7; color: #7A2620; border-color: #F4C6C2; font-weight: 500; }
.offer-banner .ob-ic { font-size: 16px; line-height: 1.3; }
.offer-banner .ob-cnt { display: inline-block; margin-left: 6px; opacity: .8; font-size: 12px; }
[data-theme="dark"] .offer-banner { background: #1B2740; color: #Bcd; border-color: #28406b; }
[data-theme="dark"] .offer-banner.warn { background: #3A2026; color: #F4C6C2; border-color: #5a2a2a; }

/* Confirm-Modal */
.cf-modal { max-width: 440px; }
.cf-modal p { color: var(--text); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.cf-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* --- Detail --- */
.detail-pane { overflow-y: auto; padding: 24px 30px; }
.detail-empty { color: var(--muted); display: grid; place-items: center; height: 100%; text-align: center; padding: 40px; }
.detail-empty svg { opacity: .35; margin-bottom: 14px; }
.d-head { margin-bottom: 6px; }
.d-subj { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 6px; }
.d-from { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.d-from b { color: var(--text); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-top: 18px; }
.card h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mailbody { white-space: pre-wrap; word-break: break-word; font-size: 14px; max-height: 360px; overflow-y: auto; }
.mailbody.html { white-space: normal; }
.mailbody.html img { max-width: 100%; height: auto; }

.draft-area { width: 100%; min-height: 200px; resize: vertical; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); line-height: 1.5; }
.draft-area:focus { outline: none; border-color: var(--accent); }
.draft-hint { color: var(--muted); font-size: 12px; margin: 8px 2px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.verlauf-item { border-left: 3px solid var(--border); padding: 6px 0 8px 12px; margin-bottom: 8px; }
.verlauf-item .vrow { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.verlauf-item .vdir { font-weight: 700; }
.verlauf-item .vdir.in { color: #2563EB; }
.verlauf-item .vdir.out { color: #15935A; }
.verlauf-item .vsubj { font-weight: 600; }
.verlauf-item .vsnip { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.verlauf-item .vdate { color: var(--muted); margin-left: auto; white-space: nowrap; }

/* --- Toast --- */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); animation: tin .2s ease; }
.toast.err { background: #C2403A; color: #fff; }
.toast.ok { background: #15935A; color: #fff; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* --- Login --- */
.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 30px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.login-card p.hint { font-size: 11.5px; margin-top: 4px; }
.login-card input { padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card .btn-accent { padding: 11px; border-radius: 10px; }
.err { color: #C2403A; font-size: 13px; min-height: 16px; }

/* --- Modal (FAQ / Tour) --- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 80; padding: 20px; }
.modal-back[hidden] { display: none; }
.modal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 560px; width: 100%; max-height: 82vh; overflow-y: auto; padding: 24px 26px; }
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.modal .qa { margin-bottom: 14px; }
.modal .qa b { display: block; margin-bottom: 3px; }
.modal .qa span { color: var(--muted); font-size: 13.5px; }
.modal .close { float: right; }

/* --- Tour spotlight --- */
.tour-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90; }
.tour-back[hidden] { display: none; }
.tour-pop { position: fixed; z-index: 91; background: var(--card); color: var(--text); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; max-width: 320px; }
.tour-pop h4 { margin: 0 0 6px; font-size: 14px; }
.tour-pop p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.tour-pop .tnav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-spot { position: fixed; z-index: 90; border-radius: 12px; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0,0,0,.5); pointer-events: none; transition: all .2s ease; }

/* --- Mobile --- */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .list-pane { max-height: 42vh; border-right: none; border-bottom: 1px solid var(--border); }
  .detail-pane { padding: 18px 16px; }
}
