:root {
  --navy:       #001148;
  --navy-mid:   #001A5B;
  --teal:       #00547A;
  --blue:       #0C71C3;
  --blue-bright:#2EA3F2;
  --footer-bg:  #001F3F;
  --green:      #1b7a3e;
  --green-bg:   #e8f5ee;
  --green-brd:  #a7d7b5;
  --yellow:     #a06200;
  --yellow-bg:  #fff8e1;
  --yellow-brd: #ffe082;
  --red:        #b71c1c;
  --red-bg:     #fdecea;
  --red-brd:    #ef9a9a;
  --gray:       #F3F5F8;
  --gray-mid:   #6b7280;
  --border:     #dde3ec;
  --text:       #111827;
  --white:      #ffffff;
  --radius:     10px;
  --shadow:     0 2px 14px rgba(0,17,72,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  background: var(--gray);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  background: var(--teal);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  padding: 0.35rem 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.topbar a { color: #cce8f0; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  background: var(--white);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,17,72,0.10);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo img { height: 40px; width: auto; display: block; }
.logo-fallback { font-size: 1.3rem; font-weight: 900; color: #001A5B; }
.logo-fallback span { color: #0C71C3; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-title { font-size: 0.82rem; color: var(--navy-mid); font-weight: 600; }

/* ── Language switcher ───────────────────────────────────── */
.lang-switcher { display: flex; gap: 0.3rem; }
.lang-btn {
  padding: 0.28rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--navy-mid);
  font-family: inherit;
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--blue); color: var(--blue); }
.lang-btn.active { background: var(--blue); color: white; border-color: var(--blue); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--teal) 100%);
  color: white;
  padding: 2.2rem 1.5rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.hero p { color: #aac8e8; font-size: 0.92rem; margin-bottom: 1.4rem; }
.hero-search {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.hero-search input {
  flex: 1;
  padding: 0.82rem 1.1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 0.97rem;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.5); }
.hero-search input:focus { outline: none; border-color: var(--blue-bright); background: rgba(255,255,255,0.18); }
.hero-search button {
  background: var(--blue);
  color: white;
  border: none;
  padding: 0.82rem 1.6rem;
  font-size: 0.97rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  transition: background 0.2s;
  white-space: nowrap;
}
.hero-search button:hover { background: #0a5fa8; }
.hero-search button:disabled { background: #555; cursor: not-allowed; }
.search-hint { color: rgba(255,255,255,0.45); font-size: 0.75rem; margin-top: 0.55rem; }

/* ── MAIN ────────────────────────────────────────────────── */
main {
  max-width: 1050px;
  margin: 0 auto;
  padding: 1.3rem 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray);
}
.card-icon { font-size: 1.2rem; }
.card-title { font-size: 0.97rem; font-weight: 700; color: var(--navy-mid); flex: 1; }
.hidden { display: none !important; }

/* ── PLACEHOLDER ─────────────────────────────────────────── */
.placeholder { text-align: center; padding: 2.5rem 1.5rem; color: var(--gray-mid); }
.placeholder-icon { font-size: 3rem; margin-bottom: 0.8rem; }
.placeholder h3 { font-size: 1.05rem; color: var(--navy-mid); margin-bottom: 0.4rem; }
.placeholder p { font-size: 0.85rem; }
.chips { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: center; margin-top: 0.9rem; }
.chip {
  background: var(--white);
  border: 1.5px solid var(--border);
  padding: 0.28rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }

/* ── SPINNER ─────────────────────────────────────────────── */
.spinner-wrap { display: flex; flex-direction: column; align-items: center; padding: 2rem; gap: 0.8rem; color: var(--gray-mid); font-size: 0.88rem; }
.spinner { width: 2rem; height: 2rem; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ERROR ───────────────────────────────────────────────── */
.error-box {
  background: var(--red-bg);
  border: 1px solid var(--red-brd);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  color: var(--red);
  font-size: 0.9rem;
}

/* ── PRODUCT CARD ────────────────────────────────────────── */
.product-name { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 0.25rem; }
.product-formula { font-family: 'Courier New', monospace; font-size: 1rem; color: var(--blue); margin-bottom: 0.7rem; }
.cas-badge {
  display: inline-block;
  background: var(--navy-mid);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-family: monospace;
}
.eg-badge {
  display: inline-block;
  background: var(--teal);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-family: monospace;
}
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table td { padding: 0.45rem 0.65rem; font-size: 0.86rem; border-bottom: 1px solid var(--border); }
.data-table td:first-child { color: var(--gray-mid); width: 45%; }
.data-table td:last-child { font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) { background: var(--gray); }
.synonyms-label { font-size: 0.73rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-mid); margin-bottom: 0.4rem; }
.synonyms { font-size: 0.8rem; color: var(--gray-mid); line-height: 1.6; }
.btn-pubchem {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-top: 0.8rem; background: var(--navy-mid); color: white;
  padding: 0.35rem 0.9rem; border-radius: 6px; font-size: 0.8rem;
  font-weight: 700; text-decoration: none; transition: background 0.2s;
}
.btn-pubchem:hover { background: var(--teal); }

/* ── REACH AMPEL ─────────────────────────────────────────── */
.reach-ampel {
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
}
.reach-ampel.gruen { background: var(--green-bg); border: 1px solid var(--green-brd); border-left: 5px solid var(--green); }
.reach-ampel.gelb  { background: var(--yellow-bg); border: 1px solid var(--yellow-brd); border-left: 5px solid #f59e0b; }
.reach-ampel.rot   { background: var(--red-bg);    border: 1px solid var(--red-brd);    border-left: 5px solid var(--red); }
.reach-ampel.grau  { background: var(--gray);      border: 1px solid var(--border);     border-left: 5px solid var(--gray-mid); }
.ampel-status { font-size: 0.97rem; font-weight: 800; margin-bottom: 0.3rem; }
.ampel-detail { font-size: 0.83rem; line-height: 1.7; }
.ampel-detail li { margin-left: 1.2rem; margin-bottom: 0.15rem; }
.btn-echa {
  display: inline-flex; align-items: center; gap: 0.3rem;
  margin-top: 0.7rem; background: var(--navy-mid); color: white;
  padding: 0.35rem 0.9rem; border-radius: 6px; font-size: 0.78rem;
  font-weight: 700; text-decoration: none; transition: background 0.2s;
}
.btn-echa:hover { background: var(--teal); }

/* ── GHS ─────────────────────────────────────────────────── */
.ghs-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ghs-title { font-size: 0.82rem; font-weight: 700; color: var(--navy-mid); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.7rem; }
.ghs-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.ghs-item { text-align: center; width: 66px; }
.ghs-diamond {
  width: 50px; height: 50px; margin: 0 auto 0.25rem;
  border: 3px solid #e53e3e; border-radius: 4px;
  transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
  background: white;
}
.ghs-diamond span { transform: rotate(-45deg); font-size: 1.3rem; display: block; }
.ghs-label { font-size: 0.62rem; color: var(--gray-mid); line-height: 1.2; }
.signal-word { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 0.2rem 0.7rem; border-radius: 4px; margin-bottom: 0.8rem; }
.signal-danger  { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-brd); }
.signal-warning { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-brd); }
.statements { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stmt-group h4 { font-size: 0.77rem; font-weight: 700; color: var(--navy-mid); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.45rem; }
.stmt-list { list-style: none; }
.stmt-list li { font-size: 0.78rem; color: var(--gray-mid); padding: 0.18rem 0; border-bottom: 1px solid var(--gray); line-height: 1.4; }
.stmt-list li:last-child { border: none; }
.stmt-code { font-weight: 700; color: var(--navy-mid); margin-right: 0.3rem; font-family: monospace; }

/* ── SUPPLIERS ───────────────────────────────────────────── */
.btn-load {
  background: var(--blue);
  color: white;
  border: none;
  padding: 0.35rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: auto;
}
.btn-load:hover { background: var(--navy-mid); }

.supplier-count { font-size: 0.78rem; color: var(--gray-mid); margin-bottom: 0.9rem; }
.supplier-count strong { color: var(--navy-mid); }

.vendor-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 1rem; }
.vendor-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.vendor-table thead th {
  background: var(--gray); color: var(--gray-mid);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 0.45rem 0.65rem;
  text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.vendor-row { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.vendor-row:last-child { border-bottom: none; }
.vendor-row:hover { background: var(--gray); }
.vendor-row td { padding: 0.5rem 0.65rem; vertical-align: middle; }
.vlink {
  display: inline-block; margin-right: 0.35rem;
  font-size: 0.73rem; font-weight: 700; color: var(--blue);
  text-decoration: none; background: #e8f3fc;
  padding: 0.12rem 0.45rem; border-radius: 4px;
}
.vlink:hover { background: var(--blue); color: white; }
.vbadge {
  display: inline-block; font-size: 0.62rem; font-weight: 700;
  padding: 0.08rem 0.4rem; border-radius: 3px;
  background: var(--teal); color: white; margin-right: 0.3rem; vertical-align: middle;
}
.eu-badge {
  display: inline-block; font-size: 0.62rem; font-weight: 700;
  padding: 0.08rem 0.4rem; border-radius: 3px;
  background: #e8f0fc; color: var(--navy-mid); border: 1px solid #c5d3ef;
}
.no-suppliers { text-align: center; color: var(--gray-mid); padding: 1.5rem 0; font-size: 0.88rem; }

/* ── SEARCH PLATFORMS ────────────────────────────────────── */
.platform-section { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.platform-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-mid); margin-bottom: 0.7rem; }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 0.75rem; }
.platform-card {
  display: block; text-decoration: none;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 0.85rem 0.95rem; background: var(--white);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s;
}
.platform-card:hover { box-shadow: 0 6px 18px rgba(0,17,72,0.12); transform: translateY(-2px); border-color: var(--blue); }
.platform-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.platform-icon { font-size: 1.3rem; }
.platform-badge { font-size: 0.62rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 8px; background: #e8f3fc; color: var(--blue); }
.platform-name { font-size: 0.85rem; font-weight: 700; color: var(--navy-mid); margin-bottom: 0.2rem; }
.platform-desc { font-size: 0.72rem; color: var(--gray-mid); line-height: 1.4; }

/* ── RFQ ─────────────────────────────────────────────────── */
.rfq-controls { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.1rem; align-items: flex-end; }
.rfq-field { display: flex; flex-direction: column; gap: 0.25rem; }
.rfq-field label { font-size: 0.74rem; font-weight: 700; color: var(--gray-mid); text-transform: uppercase; letter-spacing: 0.3px; }
.rfq-field input, .rfq-field select { padding: 0.48rem 0.7rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: 0.88rem; font-family: inherit; min-width: 150px; background: white; }
.rfq-field input:focus, .rfq-field select:focus { outline: none; border-color: var(--blue); }
.lang-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-lang {
  padding: 0.45rem 1rem; border: 2px solid var(--border);
  border-radius: 6px; background: white; font-size: 0.85rem;
  font-weight: 700; font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.btn-lang:hover, .btn-lang.active { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary {
  background: var(--blue); color: white; border: none;
  padding: 0.55rem 1.3rem; border-radius: 6px;
  font-size: 0.92rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background 0.2s; align-self: flex-end;
}
.btn-primary:hover { background: var(--navy-mid); }
.rfq-result { margin-top: 1.1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.rfq-subject-row { display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.9rem; font-size: 0.88rem; flex-wrap: wrap; }
.rfq-body-wrap {
  background: var(--gray); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 1.1rem;
  max-height: 420px; overflow-y: auto;
}
.rfq-body-wrap pre {
  white-space: pre-wrap; font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 0.83rem; line-height: 1.7; color: var(--text);
}
.rfq-actions { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }
.rfq-actions button {
  padding: 0.5rem 1.1rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background 0.15s;
}
#copyBtn { background: var(--blue); color: white; border: none; }
#copyBtn:hover { background: var(--navy-mid); }
#copyBtn.copied { background: var(--green); }
.btn-mailto { background: white; color: var(--blue); border: 2px solid var(--blue); }
.btn-mailto:hover { background: #e8f3fc; }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--footer-bg);
  color: #6b8a99;
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  margin-top: auto;
}
footer strong { color: white; }
footer a { color: var(--blue-bright); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar { font-size: 0.72rem; padding: 0.3rem 1rem; }
  nav { padding: 0.5rem 1rem; }
  .nav-title { display: none; }
  .hero { padding: 1.6rem 1rem; }
  .card-grid, .statements { grid-template-columns: 1fr; }
  .rfq-controls { flex-direction: column; }
  .rfq-field input, .rfq-field select { min-width: unset; width: 100%; }
  .platform-grid { grid-template-columns: 1fr 1fr; }
}

/* ══ RFQ-PORTAL (P0) ═══════════════════════════════════════ */

/* Login */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-card { width: 100%; max-width: 380px; padding: 2rem; text-align: center; }
.login-card form { text-align: left; margin-top: .5rem; }
.login-card .rfq-field input { width: 100%; }

/* Nav-Links */
.nav-link { color: var(--navy); text-decoration: none; font-weight: 700; font-size: .88rem; padding: .35rem .7rem; border-radius: 6px; }
.nav-link:hover { background: var(--gray); }
.nav-link.nav-active { background: var(--blue); color: #fff; }

/* Zahlenband */
/* auto-fit statt fester 4 Spalten: das Portal zeigt inzwischen 5 Kacheln
   (Licitaciones kam mit M13 dazu) — die fünfte brach allein in Zeile 2 um */
.statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; text-align: center; }
.stat-n { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.stat-label { font-size: .78rem; color: var(--gray-mid); font-weight: 600; }
.stat-alert .stat-n { color: var(--red); }
.stat-good .stat-n { color: var(--green); }

/* Ampeln, Badges, Kleinkram */
.ampel-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; vertical-align: baseline; }
.ampel-gruen { background: #2e9e5b; }
.ampel-gelb  { background: #f0ad00; }
.ampel-rot   { background: #d64545; }
.status-badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--gray); border: 1px solid var(--border); color: var(--navy); white-space: nowrap; }
.st-ofertas, .st-decision { background: var(--yellow-bg); border-color: var(--yellow-brd); color: var(--yellow); }
.st-pedido, .st-transito, .st-entregado { background: #e8f3fc; border-color: #b7d9f5; color: var(--teal); }
.st-facturado, .st-cerrado, .st-rfq-beantwortet, .st-ang-ausgewaehlt { background: var(--green-bg); border-color: var(--green-brd); color: var(--green); }
.st-rfq-gesendet { background: #e8f3fc; border-color: #b7d9f5; color: var(--teal); }
.st-rfq-gestrichen, .st-ang-abgelehnt { background: var(--red-bg); border-color: var(--red-brd); color: var(--red); }
.prio-urgent { display: inline-block; margin-left: .4rem; padding: .1rem .45rem; border-radius: 4px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 800; }
.ts-mini { font-size: .74rem; color: var(--gray-mid); }
.overdue { color: var(--red); font-weight: 800; }

/* Formulare im Portal */
.neu-form { background: var(--gray); border: 1px dashed var(--border); border-radius: 8px; padding: .9rem; margin-bottom: 1rem; }
.neu-form textarea, #kopfContent textarea { padding: .48rem .7rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: .88rem; font-family: inherit; width: 100%; }
.supplier-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .3rem; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: .5rem; }
.supplier-check { font-size: .85rem; display: flex; gap: .4rem; align-items: center; cursor: pointer; }
.kopf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; }
.kopf-grid select { padding: .3rem .5rem; border: 1.5px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .85rem; background: #fff; }

/* RFQ-Tabelle */
.rfq-actions-cell { white-space: nowrap; }
.rfq-actions-cell .vlink { margin-right: .45rem; }
.rfq-text-row pre { white-space: pre-wrap; font-size: .8rem; background: var(--gray); border-radius: 6px; padding: .7rem; font-family: Consolas, monospace; }

/* Vergleich */
.empfehlung-row { background: var(--green-bg) !important; }
.empfehlung-tag { color: var(--green); font-weight: 800; font-size: .74rem; }
.row-dim { opacity: .55; }
.hinweise { margin: .7rem 0 0 1.1rem; font-size: .85rem; color: var(--yellow); }

/* Viewer-Rolle: alles Schreibende ausblenden/sperren */
.viewer .admin-only { display: none !important; }
.viewer .admin-input, .viewer .kopf-grid select { pointer-events: none; opacity: .7; }

/* Toast */
/* bottom 90px + z-index über dem Chat-Widget (950): der 🤖-Button unten
   rechts verdeckte sonst jede Meldung */
.toast { position: fixed; bottom: 90px; right: 1.2rem; background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 8px; font-size: .85rem; box-shadow: var(--shadow); z-index: 1100; }
.toast-error { background: var(--red); }

/* Briefings */
.st-brf-angefordert { background: var(--yellow-bg); border-color: var(--yellow-brd); color: var(--yellow); }
.st-brf-in_arbeit   { background: #e8f3fc; border-color: #b7d9f5; color: var(--teal); }
.st-brf-fertig      { background: var(--green-bg); border-color: var(--green-brd); color: var(--green); }
.typ-kunde          { background: var(--green-bg); border-color: var(--green-brd); color: var(--green); }
.typ-lieferant      { background: #e8f3fc; border-color: #b7d9f5; color: var(--teal); }
.typ-dienstleister  { background: var(--gray); }
.briefing-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin-bottom: .5rem; }
.briefing-statusrow { display: flex; align-items: center; gap: .4rem; margin: .3rem 0 .8rem; }
.lang-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Markdown-Inhalt der Briefings */
.md-content { line-height: 1.65; font-size: .92rem; }
.md-content h2 { font-size: 1.25rem; color: var(--navy); margin: 1.2rem 0 .5rem; border-bottom: 2px solid var(--border); padding-bottom: .25rem; }
.md-content h3 { font-size: 1.02rem; color: var(--navy-mid); margin: 1rem 0 .4rem; }
.md-content h4, .md-content h5 { font-size: .92rem; color: var(--navy-mid); margin: .8rem 0 .3rem; }
.md-content p { margin: .45rem 0; }
.md-content ul, .md-content ol { margin: .45rem 0 .45rem 1.4rem; }
.md-content li { margin-bottom: .2rem; }
.md-content li.md-check { list-style: none; margin-left: -1.1rem; }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 1.1rem 0; }
.md-content code { background: var(--gray); padding: .05rem .3rem; border-radius: 4px; font-size: .85em; }
.md-content blockquote { border-left: 3px solid var(--border); margin: .5rem 0; padding: .2rem .8rem; color: var(--gray-mid); }
.md-content .md-table td, .md-content .md-table th { vertical-align: top; }
.md-content a { color: var(--blue); }

/* Klapptext-Abschnitte im Briefing (h3-Zwischenüberschriften) */
.md-content details.briefing-section { border-bottom: 1px solid var(--border); }
.md-content details.briefing-section:last-of-type { border-bottom: none; }
.md-content details.briefing-section > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center;
  gap: .45rem; user-select: none; padding: .1rem 0;
}
.md-content details.briefing-section > summary::-webkit-details-marker { display: none; }
.md-content details.briefing-section > summary::marker { content: ''; }
.md-content details.briefing-section > summary::before {
  content: '▶'; font-size: .65em; color: var(--gray-mid); flex-shrink: 0;
  transition: transform .15s ease; margin-top: .1rem;
}
.md-content details.briefing-section[open] > summary::before { transform: rotate(90deg); }
.md-content details.briefing-section > summary h3 { margin: .6rem 0; flex: 1; }
.md-content details.briefing-section > summary:hover h3 { color: var(--blue); }

@media (max-width: 760px) {
  .statbar { grid-template-columns: repeat(2, 1fr); }
}

/* Licitaciones (M13): Aktions-Buttons kompakt und ohne Umbruch */
.lic-actions { white-space: nowrap; }
.lic-actions .btn-load { display: block; width: 100%; margin: 2px 0; font-size: .72rem; padding: .25rem .5rem; }


/* Ayuda: Handbuch-Layout + Chat */
.ayuda-layout { display: flex; gap: 1.2rem; align-items: flex-start; }
.ayuda-nav { flex: 0 0 220px; display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 1rem; }
.ayuda-nav-item { text-align: left; background: none; border: 1px solid transparent; border-radius: 8px;
  padding: .45rem .6rem; cursor: pointer; font-size: .85rem; color: inherit; }
.ayuda-nav-item:hover { background: rgba(0,0,0,.05); }
.ayuda-nav-item.active { background: var(--navy-mid, #1c3f6e); color: #fff; }
.ayuda-content { flex: 1; min-width: 0; font-size: .92rem; line-height: 1.55; }
.ayuda-content h2 { margin: .2rem 0 .6rem; }
.ayuda-content h3 { margin: 1rem 0 .4rem; }
.ayuda-content p, .ayuda-content ul, .ayuda-content ol { margin-bottom: .6rem; }
@media (max-width: 760px) { .ayuda-layout { flex-direction: column; } .ayuda-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.ayuda-chat-log { display: flex; flex-direction: column; gap: .5rem; max-height: 340px; overflow-y: auto; }
.chat-bubble { max-width: 85%; padding: .55rem .8rem; border-radius: 12px; font-size: .88rem; line-height: 1.45; }
.chat-user { align-self: flex-end; background: var(--navy-mid, #1c3f6e); color: #fff; border-bottom-right-radius: 4px; }
.chat-assistant { align-self: flex-start; background: rgba(0,0,0,.06); border-bottom-left-radius: 4px; }

/* Sprach-Umschalter: ein Schalter statt zwei Buttons */
.lang-toggle { position: relative; display: inline-flex; border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px; cursor: pointer; user-select: none; overflow: hidden; background: rgba(255,255,255,.12); }
nav .lang-toggle { border-color: #c3cede; background: #eef2f8; }
.lt-opt { position: relative; z-index: 1; padding: .28rem .7rem; font-size: .78rem; font-weight: 700;
  color: #5a6b83; transition: color .2s; }
.lang-toggle::before { content: ''; position: absolute; top: 2px; bottom: 2px; left: 2px;
  width: calc(50% - 2px); background: var(--navy-mid, #1c3f6e); border-radius: 999px; transition: transform .2s; }
.lang-toggle.de::before { transform: translateX(100%); }
.lang-toggle:not(.de) .lt-opt[data-lang="es"], .lang-toggle.de .lt-opt[data-lang="de"] { color: #fff; }

/* Nutzer-Anzeige in der Nav (Topbar wurde entfernt: interne App) */
.nav-user { font-size: .78rem; color: #5a6b83; white-space: nowrap; }
