/* ============================================================
   PREPPER VAULT – Post-Apokalyptisches UI
   Oliv-Schwarz / Dunkelgelb / Security-Stripes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Russo+One&family=Oswald:wght@300;400;600;700&display=swap');

/* ── Variablen ─────────────────────────────────────────────── */
:root {
  --bg:          #080a05;
  --bg2:         #0d1108;
  --bg3:         #111908;
  --panel:       #0f1a09;
  --panel2:      #162010;
  --border:      #2a3d10;
  --olive:       #5a7a20;
  --olive-light: #81a830;
  --gold:        #c8a800;
  --gold-bright: #e8c400;
  --gold-dim:    #6b5900;
  --red:         #c82020;
  --red-dim:     #3d0a0a;
  --orange:      #c85000;
  --green-ok:    #3a7020;
  --text:        #c0b060;
  --text-dim:    #6a6030;
  --text-muted:  #3a3a20;
  --stripe-y:    rgba(200,160,0,0.15);
  --stripe-b:    rgba(0,0,0,0.7);
  --font-display: 'Russo One', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --font-body:    'Oswald', sans-serif;
  --radius:       0;
  --glow:         0 0 12px rgba(200,168,0,0.3);
  --glow-s:       0 0 6px rgba(200,168,0,0.2);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 24px,
      rgba(0,0,0,0.15) 24px,
      rgba(0,0,0,0.15) 25px
    );
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── Security-Stripe-Dekorator ─────────────────────────────── */
.stripe-top {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0px, var(--gold) 20px,
    #111 20px, #111 40px
  );
  flex-shrink: 0;
}
.stripe-bottom {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--olive) 0px, var(--olive) 16px,
    transparent 16px, transparent 32px
  );
}

/* Ausgefranste Kante oben */
.ragged-top::before {
  content: '';
  display: block;
  height: 6px;
  background: var(--bg);
  clip-path: polygon(
    0% 100%, 2% 0%, 5% 100%, 8% 20%, 12% 100%,
    15% 10%, 18% 100%, 22% 30%, 25% 100%, 28% 5%,
    32% 100%, 36% 15%, 40% 100%, 44% 25%, 48% 100%,
    52% 0%, 55% 100%, 58% 20%, 62% 100%, 66% 10%,
    70% 100%, 73% 35%, 76% 100%, 80% 5%, 84% 100%,
    88% 20%, 92% 100%, 96% 15%, 100% 100%
  );
}
.ragged-bottom::after {
  content: '';
  display: block;
  height: 6px;
  background: var(--bg);
  clip-path: polygon(
    0% 0%, 3% 100%, 6% 0%, 10% 80%, 14% 0%,
    18% 90%, 22% 0%, 26% 70%, 30% 0%, 34% 95%,
    38% 0%, 42% 75%, 46% 0%, 50% 100%, 54% 0%,
    58% 80%, 62% 0%, 66% 90%, 70% 0%, 74% 65%,
    78% 0%, 82% 85%, 86% 0%, 90% 80%, 94% 0%,
    98% 70%, 100% 0%
  );
}

/* ── Navigationsleiste ─────────────────────────────────────── */
.navbar {
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.navbar-inner {
  display: flex;
  align-items: stretch;
  max-width: 1400px;
  margin: 0 auto;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .8rem 1.2rem;
  text-decoration: none;
  border-right: 2px solid var(--border);
}
.navbar-brand .logo-icon { font-size: 1.4rem; }
.navbar-brand .logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-bright);
  letter-spacing: 3px;
  text-shadow: var(--glow);
}
.navbar-nav {
  display: flex;
  align-items: stretch;
  list-style: none;
  flex: 1;
}
.navbar-nav a {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .8rem 1rem;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: 1px;
  border-right: 1px solid var(--border);
  transition: all .2s;
  text-transform: uppercase;
}
.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--gold-bright);
  background: var(--bg3);
  text-shadow: var(--glow-s);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  margin-left: auto;
  border-left: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-dim);
}
.navbar-right .user-email { color: var(--olive-light); }

/* Hamburger Mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
  padding: .8rem 1rem;
  margin-left: auto;
}

/* ── Layout ────────────────────────────────────────────────── */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-bright);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: var(--glow);
  margin-bottom: 1.5rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--border);
  position: relative;
}
.page-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--gold);
}

/* ── Panel / Card ───────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--olive), var(--gold-dim), transparent);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .7rem 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.panel-body { padding: 1rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid;
  transition: all .2s;
  background: transparent;
}
.btn-primary {
  border-color: var(--olive-light);
  color: var(--gold-bright);
  background: rgba(90,120,30,.15);
}
.btn-primary:hover {
  background: rgba(90,120,30,.35);
  box-shadow: var(--glow-s);
  color: #fff;
}
.btn-danger {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}
.btn-danger:hover { background: rgba(200,32,32,.3); }
.btn-gold {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(200,168,0,.1);
}
.btn-gold:hover { background: rgba(200,168,0,.25); box-shadow: var(--glow); }
.btn-sm { padding: .35rem .7rem; font-size: .72rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Formulare ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--olive-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.form-control {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .6rem .8rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--olive-light);
  box-shadow: var(--glow-s);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg2); }

/* ── Auth-Seiten ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-box {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border);
  position: relative;
}
.auth-logo {
  text-align: center;
  padding: 2rem 1rem 1rem;
}
.auth-logo .logo-big {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-bright);
  letter-spacing: 6px;
  text-shadow: 0 0 20px rgba(200,180,0,.5), 0 0 40px rgba(200,180,0,.2);
  display: block;
}
.auth-logo .logo-sub {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--olive-light);
  letter-spacing: 4px;
  text-transform: uppercase;
}
.auth-body { padding: 1.5rem; }
.auth-footer {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-dim);
}
.auth-footer a { color: var(--gold); text-decoration: none; }

/* ── Alerts / Flash ─────────────────────────────────────────── */
.alert {
  padding: .7rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: 1px;
  border-left: 4px solid;
}
.alert-error   { border-color: var(--red);    background: var(--red-dim);        color: #ff8080; }
.alert-success { border-color: var(--olive);  background: rgba(60,100,10,.3);    color: var(--olive-light); }
.alert-warning { border-color: var(--orange); background: rgba(200,80,0,.15);    color: #ff9040; }
.alert-info    { border-color: var(--gold);   background: rgba(200,160,0,.1);    color: var(--gold); }

/* ── Tabelle ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: .8rem;
}
.data-table th {
  background: var(--bg3);
  color: var(--olive-light);
  padding: .6rem .8rem;
  text-align: left;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  font-size: .72rem;
}
.data-table td {
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--bg3);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ── MHD-Status-Farben ──────────────────────────────────────── */
.mhd-ok       { color: var(--olive-light); }
.mhd-warning  { color: var(--gold-bright); }
.mhd-critical { color: var(--orange); animation: blink 1.5s step-end infinite; }
.mhd-expired  { color: var(--red); font-weight: bold; }
.mhd-badge {
  display: inline-block;
  padding: .15rem .5rem;
  font-size: .7rem;
  letter-spacing: 1px;
}
.mhd-badge.ok       { background: rgba(60,100,10,.4);  border: 1px solid var(--olive);  color: var(--olive-light); }
.mhd-badge.warning  { background: rgba(200,150,0,.2);  border: 1px solid var(--gold-dim); color: var(--gold-bright); }
.mhd-badge.critical { background: rgba(200,80,0,.25);  border: 1px solid var(--orange); color: #ff9040; }
.mhd-badge.expired  { background: var(--red-dim);      border: 1px solid var(--red);    color: #ff6060; }

@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* ── Dashboard Stat-Cards ───────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 40px; height: 40px;
  background: repeating-linear-gradient(
    45deg,
    var(--stripe-y), var(--stripe-y) 4px,
    transparent 4px, transparent 8px
  );
  opacity: .4;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold-bright);
  line-height: 1;
  text-shadow: var(--glow-s);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: .3rem;
}
.stat-icon {
  font-size: 1.6rem;
  opacity: .6;
  margin-bottom: .3rem;
}

/* ── Bargraphen ─────────────────────────────────────────────── */
.bar-wrap { margin-bottom: .8rem; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-dim);
  margin-bottom: .25rem;
}
.bar-track {
  height: 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--olive), var(--olive-light));
  transition: width .6s ease;
  position: relative;
}
.bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold-bright);
  box-shadow: var(--glow-s);
}

/* ── Lageransicht – Grid ────────────────────────────────────── */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.shelf-card {
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.shelf-card:hover {
  border-color: var(--olive-light);
  box-shadow: var(--glow-s);
}
.shelf-card .shelf-name {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--gold);
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 1px;
}
.shelf-card .shelf-info {
  padding: .6rem .8rem;
  font-size: .75rem;
  color: var(--text-dim);
}
.shelf-items-count {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--olive-light);
}
/* Warnanzeige auf Regalcard */
.shelf-warn-dot {
  position: absolute;
  top: .5rem; right: .5rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
  animation: blink 1.2s step-end infinite;
}

/* ── Suchfeld ───────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.search-bar input {
  flex: 1;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 1rem;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .8rem 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-mono);
  color: var(--gold);
  letter-spacing: 2px;
  font-size: .9rem;
  text-transform: uppercase;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 1.2rem; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1rem;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: .6rem 1.2rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all .2s;
}
.tab-btn.active, .tab-btn:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── View Toggle ────────────────────────────────────────────── */
.view-toggle { display: flex; gap: .3rem; }
.view-toggle button {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 1rem;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.view-toggle button.active,
.view-toggle button:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--panel2);
}

/* ── Admin-Tabelle ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .1rem .45rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: 1px;
  border: 1px solid;
}
.badge-verified   { border-color: var(--olive); color: var(--olive-light); background: rgba(60,100,10,.3); }
.badge-unverified { border-color: var(--red);   color: #ff8080; background: var(--red-dim); }
.badge-admin      { border-color: var(--gold);  color: var(--gold-bright); background: rgba(200,160,0,.15); }

/* ── Globaler Dashboard-Hinweis ─────────────────────────────── */
.global-hint {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  background: rgba(90,120,30,.08);
  border: 1px solid var(--gold-dim);
  border-left: 3px solid var(--gold);
  padding: .6rem .9rem;
  margin-bottom: 1.2rem;
  position: relative;
  animation: hint-in .4s ease;
}
@keyframes hint-in {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.global-hint-icon {
  font-size: 1rem;
  line-height: 1.4;
  flex-shrink: 0;
  opacity: .7;
}
.global-hint-text {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}
.global-hint-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
  padding: 0 .2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color .2s;
}
.global-hint-close:hover { color: var(--red); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--olive); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .navbar-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    z-index: 99;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a { border-right: none; border-bottom: 1px solid var(--border); }
  .navbar-right { border-left: none; padding: .4rem .8rem; font-size: .7rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-title { font-size: 1.2rem; letter-spacing: 2px; }
  .stat-num { font-size: 1.8rem; }
}
