/* ==========================================================================
   KATONA J — portal.css
   Zusätzliche Komponenten für Cont (Login/Register), Kunden-Portal & Admin.
   Nutzt die Design-Tokens aus styles.css (:root).
   ========================================================================== */

/* ----------------------------------------------------------- Auth (cont.html) */
.auth-wrap { max-width: 920px; margin-inline: auto; }
.auth-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth__tabs { display: flex; border-bottom: 1px solid var(--border); }
.auth__tab {
  flex: 1; padding: 18px 14px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-family: var(--font-body); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  border-bottom: 2px solid transparent;
}
.auth__tab:hover { color: var(--text); }
.auth__tab.active { color: var(--text); border-bottom-color: var(--red); background: var(--red-soft); }
.auth__panel { display: none; padding: clamp(22px, 4vw, 40px); }
.auth__panel.active { display: block; }
.auth__panel > .form { max-width: 820px; }
.auth__err, .auth__ok {
  display: none; margin: 14px 0 0; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.auth__err.show { display: block; background: var(--red-soft); border: 1px solid var(--red-bright); color: #ffd9d6; }
.auth__ok.show { display: block; background: rgba(31,157,87,0.12); border: 1px solid #1f9d57; color: #9be7bd; }
.auth__hint { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }
.auth__hint a { color: var(--red-bright); font-weight: 600; }

/* ----------------------------------------------------------- Tabs (Dashboard) */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 12px 20px; background: none; border: 0; border-bottom: 2px solid transparent;
  cursor: pointer; color: var(--muted); font-family: var(--font-body); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--red); }
.tab .count {
  display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 7px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 0.72rem; font-weight: 700;
}
.panel { display: none; }
.panel.active { display: block; }

/* ----------------------------------------------------------- Karten / Layout */
.card-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); margin-bottom: 22px;
}
.card-box h3 { font-size: 1.3rem; margin-bottom: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ----------------------------------------------------------- Profil (KV) */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2px; }
.kv__item { padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.kv__k { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 3px; }
.kv__v { font-size: 1rem; font-weight: 600; word-break: break-word; }

.qa-list { display: grid; gap: 8px; margin-top: 8px; }
.qa { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 0.92rem; }
.qa .n { color: var(--muted-2); font-weight: 700; min-width: 22px; }
.qa .q { flex: 1; }
.qa .a { font-weight: 700; font-size: 0.78rem; padding: 2px 12px; border-radius: 999px; }
.qa--da .a { background: #3a2410; color: #ffb259; }
.qa--nu .a { background: #11331f; color: #6fe0a0; }

/* ----------------------------------------------------------- News (Social-Post-Stil) */
.posts { display: grid; gap: 18px; max-width: 640px; margin-inline: auto; }
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.post:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post__avatar {
  width: 46px; height: 46px; border-radius: 50%; background: var(--red); color: #fff;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 1.05rem;
  letter-spacing: 0.04em; flex-shrink: 0;
}
.post__id { flex: 1; min-width: 0; }
.post__author { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.post__verified { color: var(--red-bright); font-size: 0.85rem; }
.post__time { color: var(--muted-2); font-size: 0.8rem; }
.post__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.post__title { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.post__text {
  white-space: pre-wrap; line-height: 1.6; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}
.post .news-media { margin: 0 0 12px; }
.post .news-media img { max-height: 430px; object-fit: cover; }
.post .news-media video { max-height: 430px; }
.post__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 2px;
}
.post__stat { color: var(--muted); font-size: 0.9rem; }
.post__stats { display: flex; align-items: center; gap: 14px; }
.post__actions { display: flex; gap: 6px; }

/* Avatare (Bild oder generierte Initialen) */
.avatar { border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center; overflow: hidden; vertical-align: middle; color: #fff; font-weight: 700; line-height: 1; }
.avatar--brand { background: var(--red); font-family: var(--font-display); letter-spacing: 0.04em; }
.avatar--gen { font-family: var(--font-body); }

/* Like (Hantel-Icon) */
.like-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; color: var(--muted); font: inherit; font-size: 0.9rem; padding: 4px 6px; border-radius: 8px; transition: color 0.15s var(--ease), background 0.15s var(--ease); }
.like-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.like-btn.liked { color: var(--red-bright); }
.like-btn .dumbbell { transition: transform 0.15s var(--ease); }
.like-btn.liked .dumbbell { transform: rotate(-12deg) scale(1.1); }

/* ----------------------------------------------------------- News (kompakte Vorschau, alt) */
.news-rows { display: grid; gap: 14px; }
.news-row {
  display: flex; gap: 16px; align-items: center; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.news-row:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.news-row__thumb {
  width: 104px; height: 76px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center;
}
.news-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-row__thumb .ph { color: var(--muted-2); font-size: 1.5rem; }
.news-row__main { flex: 1; min-width: 0; }
.news-row__title { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-row__meta { color: var(--muted-2); font-size: 0.8rem; margin: 4px 0 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.news-row__excerpt {
  color: var(--muted); font-size: 0.92rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-row__arrow { color: var(--muted-2); font-size: 1.4rem; flex-shrink: 0; }

/* Artikel im Popup — Bild/Video nie zu groß */
.article__meta { color: var(--muted-2); font-size: 0.85rem; margin-bottom: 14px; }
.article__text { white-space: pre-wrap; line-height: 1.75; }

/* ----------------------------------------------------------- News-Feed (alt, ungenutzt) */
.news-list { display: grid; gap: 22px; }
.news-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.news-card__body { padding: clamp(18px, 3vw, 28px); }
.news-card__title { font-size: clamp(1.3rem, 3vw, 1.9rem); margin-bottom: 8px; }
.news-card__meta { color: var(--muted-2); font-size: 0.82rem; margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.news-card__text { color: var(--text); white-space: pre-wrap; line-height: 1.7; }
.news-media { display: grid; gap: 12px; margin: 16px 0; }
.news-media img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.news-media video { width: 100%; max-height: 60vh; border-radius: var(--radius-sm); background: #000; }
.embed { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.news-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.news-links a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.86rem; font-weight: 600;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.news-links a:hover { border-color: var(--red); color: var(--red-bright); }

/* Badges */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.72rem;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge--all { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge--selected { background: var(--red-soft); color: var(--red-bright); }
.badge--pending { background: #3a2410; color: #ffb259; }
.badge--active { background: #11331f; color: #6fe0a0; }
.badge--rejected { background: #3a1414; color: #ff8d8d; }

/* ----------------------------------------------------------- Kommentare */
.comments { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--red-soft); color: var(--red-bright); font-weight: 700; font-size: 0.9rem;
}
.comment__main { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; margin-bottom: 3px; }
.comment__head b { font-weight: 700; }
.comment__head .when { color: var(--muted-2); }
.comment__body { color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comment__del { margin-left: auto; background: none; border: 0; color: var(--muted-2); cursor: pointer; font-size: 0.8rem; }
.comment__del:hover { color: var(--red-bright); }
.comment__actions { margin-top: 4px; }
.comment__actions .like-btn { padding: 2px 6px; font-size: 0.82rem; }

/* Profil-Avatar (Portal + Admin) */
.profile-avatar { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.profile-avatar__btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.comment-form { display: flex; gap: 10px; margin-top: 14px; }
.comment-form textarea {
  flex: 1; min-height: 46px; max-height: 160px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-body); font-size: 0.95rem; resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--red); }

/* ----------------------------------------------------------- Tabellen (Admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: middle; }
.table th { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ----------------------------------------------------------- kleine Buttons */
.btn--sm { padding: 7px 14px; font-size: 0.76rem; }
.btn--danger { background: linear-gradient(180deg, #c41410, #8d0d0a); }
.btn--danger:hover { box-shadow: 0 14px 40px -16px rgba(225,6,0,0.6); }
.btn--ok { background: linear-gradient(180deg, #1f9d57, #137a40); }
.linkbtn { background: none; border: 0; color: var(--red-bright); cursor: pointer; font-weight: 600; font-size: 0.84rem; padding: 0; }

/* ----------------------------------------------------------- Composer / Felder */
.stack { display: grid; gap: 14px; }
.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-fields .field { flex: 1; min-width: 180px; }
.media-item, .link-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.media-item img, .media-item video { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.media-item .grow, .link-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; color: var(--muted); }
.x-btn { background: none; border: 0; color: var(--muted-2); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.x-btn:hover { color: var(--red-bright); }

/* Zielgruppen-Auswahl */
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.target { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.target input { width: 16px; height: 16px; accent-color: var(--red); }
.hidden { display: none !important; }

/* ----------------------------------------------------------- Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); overflow-y: auto; }
.modal.open { display: flex; }
.modal__box { width: 100%; max-width: 720px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 1.3rem; }
.modal__body { padding: 22px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal__close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.6rem; line-height: 1; }
.modal__close:hover { color: var(--text); }

/* ----------------------------------------------------------- Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); z-index: 300; padding: 12px 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); font-size: 0.9rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--red-bright); }

/* Pending-Screen */
.pending-box { text-align: center; max-width: 560px; margin-inline: auto; padding: clamp(28px,5vw,48px); }
.pending-box .big { font-size: 3rem; margin-bottom: 12px; }

/* Spinner */
.loading { color: var(--muted); padding: 30px; text-align: center; }

/* ----------------------------------------------------------- Passwort-Toggle */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; font-size: 1.05rem; opacity: 0.6; line-height: 1; }
.pw-toggle:hover { color: var(--text); }

/* ----------------------------------------------------------- Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: 4vh 4vw; background: rgba(0,0,0,0.9); backdrop-filter: blur(3px); }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.lightbox__close { position: absolute; top: 18px; right: 24px; background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; }
.news-media img { cursor: zoom-in; }

/* ----------------------------------------------------------- Statistik */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; }
.stat__n { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.stat__n.accent { color: var(--red-bright); }
.stat__l { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); margin-top: 6px; }

/* ----------------------------------------------------------- „NOU"-Badge */
.badge--new { background: var(--red); color: #fff; }
.tab .count.count--soft { background: var(--surface-2); color: var(--red-bright); border: 1px solid var(--red); }

/* ----------------------------------------------------------- Suche */
.search-input { width: 100%; max-width: 320px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-family: var(--font-body); font-size: 0.92rem; }
.search-input:focus { outline: none; border-color: var(--red); }

@media (max-width: 640px) {
  .news-card__meta { gap: 8px; }
  .modal { padding: 2vh 8px; }
}
