/* ===== Lieferantendashboard – styles.css ===== */
/* Extrahiert aus Apps Script Stylesheet.html       */

:root{
  --bg:#f0f6fc; --card:#ffffff; --ink:#2b2b2b; --muted:#3A3A3A; --line:#dde6ee;
  --accent:rgb(47,62,139); --accent-ink:#ffffff; --link:rgb(47,62,139);
  --radius:12px; --gap:14px;
}
[data-theme="dark"]{ --bg:#0f1720; --card:#111827; --ink:#e5e7eb; --muted:#9ca3af; --line:#243244; --accent:#60a5fa; --accent-ink:#0b1220; --link:#93c5fd; }
[data-theme="gelb"]{ --bg:#fff7d1; --card:#ffffff; --ink:#2b2b1a; --muted:#6f6542; --line:#f6dfa2; --accent:#ca8a04; --accent-ink:#1a1606; --link:#b45309; }
[data-theme="gruen"]{ --bg:#eafaf2; --card:#ffffff; --ink:#0f2419; --muted:#4b6b58; --line:#c6ead7; --accent:#0f9d58; --accent-ink:#ffffff; --link:#0b7a43; }
[data-theme="rot"]{ --bg:#fff1f1; --card:#ffffff; --ink:#1f1b1b; --muted:#6b5a5a; --line:#f2c2c2; --accent:#c81e1e; --accent-ink:#ffffff; --link:#991b1b; --thead:#d64b4b; --thead-ink:#ffffff; --zebra:#fff8f8; --badge-bg:#fde2e2; --badge-ink:#991b1b; }
[data-theme="rosa"]{ --bg:#fff1f7; --card:#ffffff; --ink:#2b2430; --muted:#7a6b7a; --line:#ffd6e7; --accent:#ec4899; --accent-ink:#ffffff; --link:#be185d; }

*{box-sizing:border-box}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height:1.35
}
a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}

.container{
  width:100%;
  padding:24px clamp(16px,2vw,32px);
  display:grid;
  gap:var(--gap)
}

/* ========= HEADER ========= */
.header{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:14px 16px;
  border-radius:12px;
  background:#2f3e8b;
  border:1px solid #2f3e8b;
  color:#fff;
  gap:20px;
}
.title{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:18px;
  font-weight:700;
  color:#fff;
}
.title img{height:28px;width:auto;display:block;filter:brightness(0) invert(1)}

.actions{
  display:flex;
  align-items:center;
  margin-left:auto;
  gap:10px;
}
.search-group{
  display:flex;
  align-items:center;
  gap:10px;
}

.header a{color:#fff}
.searchbox{
  max-width:240px;width:100%;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.35);
  border-radius:8px;
  background:#fff;
  font-size:14px;
  color:#1f2937;
}
.theme-btn{
  height:32px;width:32px;border:1px solid rgba(255,255,255,.35);
  background:transparent;color:#fff;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.theme-btn:hover{background:rgba(255,255,255,.12)}
.theme-select{
  height:32px;border:1px solid rgba(255,255,255,.35);
  background:#fff;color:#111;border-radius:8px;padding:0 8px;font-size:13px
}
.hidden{display:none!important}
.icon-btn img{position:relative;top:2px}

/* Cards & Tables */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
  padding:16px 18px
}
.card h4{
  margin:0 0 8px;
  font-size:14px;
  color:var(--muted);
  letter-spacing:.3px;
  text-transform:uppercase
}
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 8px
}

/* kleiner Bearbeitungsstift */
.edit-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;height:18px;
  font-size:16px;line-height:1;
  color:var(--link);
  text-decoration:none;
  margin-left:8px;
}
.edit-link:hover{opacity:.75;text-decoration:none}

.form{display:grid;gap:8px}
.frow{display:grid;grid-template-columns:140px 1fr 140px 1fr;gap:8px}
.frow.single{grid-template-columns:140px 1fr}
.frow .lbl{color:var(--muted);font-size:13px;align-self:center}
.field{
  border:1px solid var(--line);
  background:#f8fbff;
  border-radius:8px;
  padding:8px 10px;
  min-height:32px;
  display:flex;align-items:center
}
[data-theme="dark"] .field{background:#0b1220}

.grid{display:grid;gap:var(--gap)}

/* ========= 2-SPALTEN-HAUPTGRID ========= */
.cols-2-main{
  grid-template-columns: 1.05fr 1.95fr;
  align-items:start;
}

.subhead{
  margin:14px 0 6px;
  color:var(--muted);
  font-size:12px;
  letter-spacing:.3px;
  text-transform:uppercase
}

.table{
  width:100%;
  border-collapse:collapse;
  font-size:14px
}
.table th,.table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  vertical-align:top
}
.table thead th{
  text-align:left;
  color:var(--muted);
  font-weight:700;
  background:#f0f6fc;
  position:sticky;top:0;z-index:1
}
[data-theme="dark"] .table thead th{background:#0b1220}
[data-theme="gelb"] .table thead th{background:#ffe08a}
[data-theme="gruen"] .table thead th{background:#e6f6ea}
[data-theme="rosa"] .table thead th{background:#ffe3ef}
[data-theme="rot"] .table thead th{background:var(--thead);color:var(--thead-ink)}

.table-wrap{max-height:360px;overflow:auto}

/* ===== Graph-Layout ===== */
.card-row{
  display:flex;
  gap:24px;
  justify-content:center;
  align-items:flex-start;
  flex-wrap:wrap;
  max-width:1400px;
  margin:0 auto;
  padding:20px 0;
  grid-column:1 / -1;
}

.card.graph-card{
  flex:0 0 520px;
  width:520px;
  max-width:520px;
}

@media (max-width:1100px){
  .card-row{ max-width:100%; }
  .card.graph-card{
    width:100%;
    max-width:100%;
    flex:1 1 100%;
  }
}

/* Chart-Styles */
.cg-wrap{ width:100%; font-size:12px; }
.cg-title{ font-size:13px; color:var(--muted); margin-bottom:8px; }
.cg-top{ display:flex; align-items:flex-end; gap:10px; }
.cg-y{
  width:50px; display:flex; flex-direction:column; justify-content:space-between;
  height:160px; font-size:11px; color:var(--muted);
  border-right:1px solid var(--line); padding-right:8px; margin-right:4px;
}
.cg-bars{
  display:flex; align-items:flex-end; gap:12px; flex:1;
  border-bottom:1px solid var(--line); height:160px;
}
.cg-bar-wrap{
  flex:1; position:relative; display:flex; align-items:flex-end; justify-content:center;
}
.cg-bar{
  width:16px; background:rgba(47,62,139,.35);
  border-radius:4px 4px 0 0; margin-bottom:-1px;
}
.cg-bar-value{
  position:absolute; bottom:100%; margin-bottom:6px;
  font-size:10px; color:var(--muted); opacity:0; pointer-events:none;
  transition:opacity .15s ease-out;
}
.cg-bar-wrap:hover .cg-bar-value{ opacity:1; }
.cg-x-row{
  display:flex; align-items:flex-start; gap:10px; margin-top:6px; font-size:11px;
}
.cg-x-placeholder{ width:50px; }
.cg-x-labels{ display:flex; gap:12px; flex:1; }
.cg-x-labels div{ flex:1; text-align:center; }

@media (max-width:1100px){
  .cols-2-main{grid-template-columns:1fr}
  .frow{grid-template-columns:140px 1fr}
  .card.graph-card{width:100%}
}

/* ===== Tooltip & Pfeil-Button für Lieferantennummer ===== */
.artnr-tooltip-wrap{
  position:relative;
  display:inline-block;
}

.artnr-tooltip-wrap .searchbox{
  padding-right:34px;
}

.searchbox-btn{
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  height:22px;
  width:22px;
  border:0;
  border-radius:6px;
  cursor:pointer;
  background:var(--accent);
  color:var(--accent-ink);
  font-size:14px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.searchbox-btn:active{
  transform:translateY(-50%) scale(.96);
}

.artnr-tooltip{
  position:absolute;
  left:0;
  top:calc(100% + 6px);
  background:#222;
  color:#fff;
  font-size:12px;
  padding:6px 8px;
  border-radius:6px;
  white-space:nowrap;
  opacity:0;
  transform:translateY(-4px);
  pointer-events:none;
  transition: opacity .12s ease, transform .12s ease;
  transition-delay:0ms;
  z-index:9999;
}

.artnr-tooltip-wrap:hover .artnr-tooltip,
.artnr-tooltip-wrap:focus-within .artnr-tooltip{
  opacity:1;
  transform:translateY(0);
}

/* ===== Login-Screen ===== */
#login-screen{
  position:fixed;inset:0;z-index:99999;
  background:#f1f5f9;
  display:flex;align-items:center;justify-content:center;
}
.login-card{
  background:#fff;
  border-radius:16px;
  padding:40px;
  box-shadow:0 4px 24px rgba(0,0,0,.08);
  text-align:center;
  max-width:380px;
  width:90%;
}
.login-logo-wrap{
  width:80px;height:80px;
  background:#2f3e8b;
  border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 20px;
}
.login-logo-wrap img{height:40px;width:auto;filter:brightness(0) invert(1)}
.login-card h2{margin:0 0 8px;font-size:20px;color:#1f2937}
.login-card p{margin:0 0 24px;font-size:14px;color:#6b7280}
#btn-login{
  background:#2f3e8b;color:#fff;
  border:none;border-radius:8px;
  padding:12px 32px;font-size:15px;font-weight:600;
  cursor:pointer;
}
#btn-login:hover{background:#243070}
.login-error{color:#ef4444;font-size:13px;margin-top:12px;display:none}

/* ===== Ladebildschirm (Scanner) ===== */
#loading-screen{
  position:fixed;inset:0;z-index:99998;
  background:var(--bg);
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  transition:opacity .4s ease;
}
#loading-screen.fade-out{opacity:0;pointer-events:none}
.loader-glow{
  width:120px;height:120px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  position:relative;
  animation:epicPulse 2s infinite ease-in-out;
}
.loader-logo{
  height:60px;width:auto;
  position:relative;z-index:2;
  animation:formFromTopMain 2s infinite ease-in-out;
}
.loader-scan{
  position:absolute;
  left:10%;right:10%;
  height:3px;
  background:linear-gradient(90deg,transparent,#2f3e8b,transparent);
  border-radius:2px;
  z-index:3;
  animation:scanMoveMain 2s infinite ease-in-out;
}
.loader-text{
  margin-top:24px;
  font-size:14px;
  color:var(--muted);
  animation:textPulse 2s infinite ease-in-out;
}

@keyframes epicPulse{
  0%,100%{box-shadow:0 0 30px rgba(47,62,139,.15)}
  50%{box-shadow:0 0 60px rgba(47,62,139,.35)}
}
@keyframes formFromTopMain{
  0%{clip-path:inset(100% 0 0 0)}
  50%{clip-path:inset(0 0 0 0)}
  100%{clip-path:inset(0 0 0 0)}
}
@keyframes scanMoveMain{
  0%{top:0}
  50%{top:100%}
  100%{top:100%}
}
@keyframes textPulse{
  0%,100%{opacity:.4}
  50%{opacity:1}
}

/* ===== Skeleton / Platzhalter ===== */
.skeleton{
  background:linear-gradient(90deg,var(--line) 25%,#e8edf3 50%,var(--line) 75%);
  background-size:200% 100%;
  animation:shimmer 1.5s infinite;
  border-radius:6px;
  min-height:18px;
}
@keyframes shimmer{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}

/* ===== Gesperrt-Overlay ===== */
#lockOverlay{
  position:fixed;inset:0;
  background:rgba(0,0,0,.45);
  display:flex;align-items:center;justify-content:center;
  z-index:9999;
}
.lock-box{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:20px 24px;
  max-width:720px;width:90%;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  font-size:21px;line-height:1.5;
  color:var(--ink);text-align:center;font-weight:600;
}
.lock-box .lock-title{color:#d50000;font-weight:800;margin-bottom:14px}
.lock-box button{
  border:1px solid var(--line);
  background:#fff;color:var(--ink);
  padding:8px 12px;border-radius:8px;
  cursor:pointer;font-weight:600;
}

/* ===== Testsystem-Warnung ===== */
.test-badge{color:red;font-weight:700;margin-right:6px}

/* ===== Listen-Navigation (im Header) ===== */
.liste-nav{
  display:flex;align-items:center;gap:6px;
  margin-left:6px;padding-left:10px;
  border-left:1px solid rgba(255,255,255,.25);
}
.liste-btn-header{
  height:28px;width:28px;border:1px solid rgba(255,255,255,.35);
  background:transparent;color:#fff;border-radius:6px;
  font-size:12px;cursor:pointer;display:inline-flex;
  align-items:center;justify-content:center;flex-shrink:0;
}
.liste-btn-header:hover{background:rgba(255,255,255,.15)}
.liste-btn-header:disabled{opacity:.3;cursor:not-allowed;pointer-events:none}
.liste-select-header{
  max-width:280px;height:28px;border:1px solid rgba(255,255,255,.35);
  border-radius:6px;padding:0 8px;font-size:13px;
  background:#fff;color:#111;
}
.liste-counter-header{
  font-size:12px;color:rgba(255,255,255,.7);white-space:nowrap;flex-shrink:0;
}