/* FIPAX WhatsApp – Ergänzungen zum CRM-Design (app.css) */
:root { --wa-gruen: #1F8A4C; --wa-blase-aus: #E3F3E8; }

.wa-kopf-titel { font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 16px; color: var(--navy); }

/* Ungelesen-Zähler */
.wa-zahl { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--wa-gruen); color: #fff;
    font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-zahl[hidden] { display: none; }
.wa-punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 4px; }
.wa-punkt.gross { width: 16px; height: 16px; margin: 0; }
.wa-nav-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.wa-nav-text small { color: var(--gedimmt); font-weight: 400; font-size: 12px; }

.wa-neu { background: var(--gruen-bg); color: var(--gruen); padding: 10px 32px; font-weight: 600; border-bottom: 1px solid #BFE3CB; }
.wa-neu[hidden] { display: none; }
.wa-neu a { color: var(--gruen); }

/* Übersicht: drei Kanäle */
.wa-kanaele { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.wa-kanal { display: flex; flex-direction: column; gap: 12px; background: var(--flaeche); border: 1px solid var(--linie); border-top: 5px solid var(--kf);
    border-radius: var(--radius); padding: 18px 20px; color: inherit; text-decoration: none; box-shadow: var(--schatten); min-width: 0; }
.wa-kanal:hover { border-color: var(--navy); border-top-color: var(--kf); color: inherit; }
.wa-kanal.neu { background: linear-gradient(180deg, #F2FBF5 0, #fff 70%); border-color: #8FCFA7; border-top-color: var(--kf); }
.wa-kanal-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wa-kanal-name { font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 18px; }
.wa-kanal-zahl { min-width: 48px; height: 48px; padding: 0 12px; border-radius: 24px; background: var(--wa-gruen); color: #fff;
    font: 700 22px/48px Montserrat, Inter, sans-serif; text-align: center; animation: wa-puls 2s ease-in-out infinite; }
.wa-kanal-zahl[hidden], .wa-kanal-ok[hidden] { display: none; }
.wa-kanal-ok { width: 48px; height: 48px; border-radius: 50%; background: var(--grund); color: var(--gedimmt); font-size: 22px;
    display: flex; align-items: center; justify-content: center; }
.wa-kanal-status strong { color: var(--wa-gruen); }
.wa-kanal-letzte { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; border-top: 1px solid var(--linie-2); padding-top: 12px; min-height: 64px; }
.wa-kanal-wer { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-kanal-zeit { color: var(--gedimmt); font-size: 12px; }
.wa-kanal-text { grid-column: 1 / -1; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.wa-kanal-fuss { margin-top: auto; }
@keyframes wa-puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 138, 76, .45); } 50% { box-shadow: 0 0 0 8px rgba(31, 138, 76, 0); } }
@media (prefers-reduced-motion: reduce) { .wa-kanal-zahl { animation: none; } }

/* Kanal: Liste + Verlauf */
.wa-titel { display: flex; align-items: center; gap: 12px; }
.wa-chat-raster { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.wa-liste { padding: 12px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 210px); overflow-y: auto; }
.wa-suche { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rand-feld); border-radius: 10px; padding: 0 10px; margin-bottom: 8px; color: var(--gedimmt); }
.wa-suche input { border: 0; height: 40px; flex: 1; font: inherit; min-width: 0; background: transparent; }
.wa-suche input:focus { outline: none; }
.wa-suche:focus-within { outline: 2px solid var(--akzent); outline-offset: 1px; }
.wa-chat { display: flex; gap: 10px; padding: 10px; border-radius: 10px; color: inherit; text-decoration: none; align-items: center; }
.wa-chat:hover { background: #EEF2F7; color: inherit; }
.wa-chat.aktiv { background: var(--akzent-soft); }
.wa-chat.neu .wa-chat-name, .wa-chat.neu .wa-chat-vorschau { font-weight: 600; color: var(--navy); }
.wa-chat.neu .wa-chat-zeit { color: var(--wa-gruen); font-weight: 600; }
.wa-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--band); color: var(--navy); font-weight: 600; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; flex: none; }
.wa-chat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wa-chat-zeile { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-chat-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-zeit { margin-left: auto; color: var(--gedimmt); font-size: 12px; flex: none; }
.wa-chat-vorschau { color: var(--gedimmt); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.wa-verlauf { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; overflow: hidden; }
.wa-leer { margin: auto; color: var(--gedimmt); }
.wa-verlauf-kopf { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--linie-2); background: var(--band); flex-wrap: wrap; }
.wa-verlauf-wer { min-width: 0; }
.wa-zurueck { display: none; font-size: 20px; text-decoration: none; padding: 4px 8px; }
.wa-crm { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wa-crm .chip { height: 32px; padding: 0 12px; gap: 6px; font-size: 13px; max-width: 240px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wa-crm .chip svg { width: 14px; height: 14px; flex: none; }
.wa-nachrichten { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; background: #F3F6F9; }
.wa-tag { align-self: center; margin: 10px 0 4px; }
.wa-tag span { background: #fff; border: 1px solid var(--linie-2); border-radius: 8px; padding: 3px 10px; font-size: 12px; color: var(--gedimmt); }
.wa-blase { max-width: min(75%, 560px); padding: 8px 12px 6px; border-radius: 12px; background: #fff; border: 1px solid var(--linie-2); box-shadow: 0 1px 1px rgba(20, 43, 68, .06); }
.wa-blase.ein { align-self: flex-start; border-top-left-radius: 4px; }
.wa-blase.aus { align-self: flex-end; background: var(--wa-blase-aus); border-color: #C6E5D0; border-top-right-radius: 4px; }
.wa-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.wa-meta { font-size: 11px; color: var(--gedimmt); text-align: right; margin-top: 2px; }
.wa-bild { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin-bottom: 4px; }
.wa-datei { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; overflow-wrap: anywhere; }
.wa-blase audio { max-width: 100%; }
.wa-fuss { padding: 10px 16px; border-top: 1px solid var(--linie-2); }

/* Einstellungen */
.wa-kanal-einst { border: 1px solid var(--linie-2); border-left: 5px solid var(--kf); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.wa-kanal-einst .feld input[type=color] { height: 44px; padding: 4px; width: 100%; }
.feld input[readonly] { background: var(--grund); }

@media (max-width: 900px) {
    .wa-chat-raster { grid-template-columns: minmax(0, 1fr); }
    .wa-chat-raster.mit-chat .wa-liste { display: none; }
    .wa-chat-raster:not(.mit-chat) .wa-verlauf { display: none; }
    .wa-zurueck { display: inline-block; }
    .wa-liste, .wa-verlauf { max-height: none; }
    .wa-verlauf { height: calc(100vh - 160px); }
    .wa-blase { max-width: 88%; }
    .wa-neu { padding: 10px 16px; }
}

.wa-schritte { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
