/* ============================================================
   barox Switch-Katalog – Design
   Helvetica Now · barox Navy & Orange
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Helvetica Now Text";
  src: url("../fonts/HelveticaNowText-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Helvetica Now Text";
  src: url("../fonts/HelveticaNowText-It.otf") format("opentype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Helvetica Now Text";
  src: url("../fonts/HelveticaNowText-Medium.otf") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Helvetica Now Text";
  src: url("../fonts/HelveticaNowText-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Helvetica Now Display";
  src: url("../fonts/HelveticaNowDisplay-Md.otf") format("opentype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Helvetica Now Display";
  src: url("../fonts/HelveticaNowDisplay-Bd.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Design-Tokens ---------- */
:root {
  --navy:        #0d2a4a;
  --navy-dark:   #081d35;
  --navy-700:    #143a61;
  --navy-600:    #1b4a79;
  --orange:      #f39200;
  --orange-600:  #d97f00;
  --orange-soft: #fff3e0;

  --bg:      #f4f6f9;
  --surface: #ffffff;
  --border:  #e2e8f0;
  --text:    #1c2a3a;
  --muted:   #64748b;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(13, 42, 74, .06), 0 1px 3px rgba(13, 42, 74, .08);
  --sidebar-w: 248px;

  --font-text: "Helvetica Now Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Helvetica Now Display", "Helvetica Now Text", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 .4em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- App-Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #cdd9e6;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.sidebar-brand { padding: 4px 8px 22px; }
.sidebar-brand img { width: 130px; display: block; }
.sidebar-brand .sub {
  color: #7e94ab; font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; margin-top: 8px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  color: #cdd9e6; font-weight: 500; font-size: .9rem;
}
.nav-item:hover { background: var(--navy-700); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--orange); color: #fff; }
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .count {
  margin-left: auto; background: rgba(255,255,255,.18);
  border-radius: 999px; padding: 0 8px; font-size: .72rem;
}
.sidebar-user {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 14px; margin-top: 14px;
}
.sidebar-user .name { color: #fff; font-weight: 500; }
.sidebar-user .role { color: #7e94ab; font-size: .78rem; text-transform: capitalize; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: none;
  align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: 12px 16px;
}
.topbar img { height: 26px; }
.content { max-width: 1180px; margin: 0 auto; padding: 26px 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 8px; font-size: .88rem;
  font-weight: 500; font-family: var(--font-text);
  border: 1px solid transparent; cursor: pointer; transition: .12s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-600); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

/* ---------- Forms ---------- */
.input, select.input, textarea.input {
  width: 100%; padding: 9px 11px; font-size: .88rem;
  font-family: var(--font-text);
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); outline: none; transition: .12s;
}
.input:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(27,74,121,.12); }
textarea.input { min-height: 84px; resize: vertical; }
.label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 4px; }

/* ---------- Chips / Badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 500;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  cursor: pointer; user-select: none;
}
.chip:hover { text-decoration: none; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.active.accent { background: var(--orange); border-color: var(--orange); }
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 500; }
.st-active { background: #dcfce7; color: #15803d; } .st-active .dot { background: #22c55e; }
.st-future { background: #dbeafe; color: #1d4ed8; } .st-future .dot { background: #3b82f6; }
.st-legacy { background: #fef3c7; color: #b45309; } .st-legacy .dot { background: #f59e0b; }
.st-eol    { background: #fee2e2; color: #b91c1c; } .st-eol .dot    { background: #ef4444; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.table thead th {
  text-align: left; padding: 11px 14px; background: #f1f5f9;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tbody tr:hover { background: #f8fafc; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82rem; color: var(--muted); }

/* ---------- Toolbar / Filter ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: .88rem; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.viewtoggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.viewtoggle a { padding: 8px 11px; color: var(--muted); display: inline-flex; background: #fff; }
.viewtoggle a.active { background: var(--navy); color: #fff; }

.filter-bar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { padding-left: 40px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-row .spacer { flex: 1; }

/* ---------- Produkt-Karten ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.product-card { display: flex; flex-direction: column; padding: 18px; }
.product-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.product-card .pname { font-weight: 700; color: var(--navy); font-family: var(--font-display); }
.product-card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 12px; color: var(--muted); }
.product-card .meta b { color: var(--text); font-weight: 500; }
.product-card .foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }

/* ---------- Detailseite ---------- */
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
.spec-area > h2 { margin-bottom: 12px; }
.spec-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.spec-tile { border-top: 3px solid var(--orange); }
.spec-tile-title { color: var(--navy); font-size: .82rem; font-weight: 700; letter-spacing: .02em; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.spec-list-tile { grid-template-columns: 1fr; gap: 0; }
.spec-item { padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.spec-item dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.spec-item dd { margin: 2px 0 0; }
.notes-box { margin-top: 18px; background: var(--orange-soft); border: 1px solid #fde0b8; border-radius: 8px; padding: 12px 14px; }
.notes-box .head { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--orange-600); display: flex; align-items: center; gap: 6px; }
.notes-box p { margin: 6px 0 0; white-space: pre-wrap; }
.relations { display: flex; flex-wrap: wrap; gap: 18px; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; font-size: .88rem; }

/* ---------- Dokumente ---------- */
.doc-group { margin-bottom: 14px; }
.doc-group h3 { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.doc-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; margin-bottom: 5px; }
.doc-item a { display: inline-flex; align-items: center; gap: 8px; color: var(--navy-600); overflow: hidden; }
.doc-item .ver { color: var(--muted); font-size: .76rem; }

/* ---------- Compare ---------- */
.compare-table th, .compare-table td { min-width: 170px; }
.compare-table .sticky { position: sticky; left: 0; background: #fff; z-index: 2; }
.compare-table thead .sticky { background: #f1f5f9; }

/* schwebende Vergleichsleiste */
.compare-bar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; border-radius: 999px;
  padding: 10px 16px; display: none; align-items: center; gap: 14px;
  box-shadow: 0 8px 24px rgba(13,42,74,.3); z-index: 50;
}
.compare-bar.show { display: flex; }
.compare-bar .btn { padding: 6px 14px; }

/* ---------- Flash ---------- */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .88rem; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #b91c1c; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-600)); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 410px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card img.logo { width: 180px; margin: 0 auto 8px; display: block; }
.login-card .tagline { color: var(--muted); margin: 4px 0 26px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; }
.login-card .hint { color: #94a3b8; font-size: .8rem; margin-top: 18px; }

/* ---------- Diverses ---------- */
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.row-actions { display: flex; gap: 8px; }
details.diff summary { cursor: pointer; color: var(--navy-600); font-size: .8rem; }
details.diff ul { margin: 6px 0 0; padding-left: 18px; font-size: .8rem; color: var(--muted); }
.full { grid-column: 1 / -1; }
.toggle-types { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Responsive (Tablet/Mobil) ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .spec-list { grid-template-columns: 1fr; }
  .content { padding: 18px 16px; }
}
