/* ─── CNC-Voss / KartonKlar Design ──────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=DM+Mono&display=swap');

:root {
  --primary:   #1B3A5C;
  --primary-l: #254d7a;
  --gold:      #E8A838;
  --gold-l:    #f0bc5a;
  --success:   #2E7D52;
  --danger:    #D94F4F;
  --bg:        #f0f2f5;
  --card:      #ffffff;
  --text:      #1A1A2E;
  --sub:       #6B7280;
  --border:    #e5e7eb;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ─── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
}
.sidebar-logo {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo .brand { font-size: 16px; font-weight: 800; color: white; }
.sidebar-logo .brand span { color: var(--gold); }
.sidebar-logo .version { font-size: 10px; color: rgba(255,255,255,.3); margin-top: 2px; }
.user-chip {
  margin-top: 10px;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 8px 10px;
}
.user-chip .name { font-size: 12px; font-weight: 700; color: white; }
.user-chip .role { font-size: 10px; color: var(--gold); margin-top: 1px; }

nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-section {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.3);
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 12px 16px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px;
  color: rgba(255,255,255,.7);
  text-decoration: none; font-size: 13px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: rgba(232,168,56,.12); color: var(--gold); border-left-color: var(--gold); font-weight: 700; }
.nav-item .ni { font-size: 15px; width: 18px; text-align: center; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 6px 12px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.logout-btn { color: rgba(255,255,255,.4); text-decoration: none; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.logout-btn:hover { color: var(--danger); }

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 18px; font-weight: 800; color: var(--primary); }
.content { padding: 24px; flex: 1; }

/* ─── Cards ─────────────────────────────────────────────── */
.card { background: white; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 18px; overflow: hidden; }
.card-header { padding: 12px 18px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); background: #fafafa; color: var(--primary); display: flex; align-items: center; justify-content: space-between; }

/* ─── Artikel Grid ───────────────────────────────────────── */
.artikel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.artikel-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
  display: block;
}
.artikel-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.artikel-card .foto {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, var(--primary) 0%, #254d7a 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative; overflow: hidden;
}
.artikel-card .foto img { width: 100%; height: 100%; object-fit: cover; }
.artikel-card .karton-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--gold); color: var(--primary);
  font-size: 11px; font-weight: 800;
  padding: 3px 10px; border-radius: 20px;
}
.artikel-card .body { padding: 14px; }
.artikel-card .titel { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.artikel-card .verwendung { font-size: 12px; color: var(--sub); margin-bottom: 8px; }
.artikel-card .meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all .15s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-l); }
.btn-gold { background: var(--gold); color: var(--primary); }
.btn-gold:hover { background: var(--gold-l); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-ok   { background: #d1fae5; color: #065f46; }
.badge-err  { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gold { background: var(--gold); color: var(--primary); }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin-bottom: 4px; }
.form-control { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: border .15s; }
.form-control:focus { border-color: var(--primary); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 180px; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 8px; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Tables ─────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--sub); letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: #f8fafc; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ─── Stats ──────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: white; border-radius: 12px; border: 1px solid var(--border); padding: 16px 14px; text-align: center; }
.stat-card .ico { font-size: 22px; margin-bottom: 4px; }
.stat-card .val { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* ─── Suche & Filter ─────────────────────────────────────── */
.filter-bar { background: white; border-radius: 12px; border: 1px solid var(--border); padding: 14px 16px; margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-input { flex: 1; min-width: 200px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; }
.search-input:focus { border-color: var(--primary); }

/* ─── Detail View ────────────────────────────────────────── */
.detail-foto { width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; margin-bottom: 16px; }
.detail-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.meta-item .lbl { font-size: 11px; color: var(--sub); margin-bottom: 2px; }
.meta-item .val { font-size: 14px; font-weight: 600; }

/* ─── Login ──────────────────────────────────────────────── */
.login-page { min-height: 100vh; background: var(--primary); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: white; border-radius: 20px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo .brand { font-size: 24px; font-weight: 800; color: var(--primary); }
.login-logo .brand span { color: var(--gold); }
.login-logo .sub { font-size: 12px; color: var(--sub); margin-top: 4px; }

/* ─── Empty State ────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--sub); }
.empty .ico { font-size: 48px; margin-bottom: 12px; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn { padding: 6px 12px; border-radius: 8px; border: 1.5px solid var(--border); background: white; color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:hover:not(.active) { border-color: var(--primary); }

/* ─── Gold Accent Line ───────────────────────────────────── */
.gold-line { height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-l)); border-radius: 2px; margin-bottom: 20px; }

/* ─── Fab Button ─────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--gold); color: var(--primary);
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; text-decoration: none;
  box-shadow: 0 4px 16px rgba(232,168,56,.5);
  transition: all .2s; z-index: 99;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(232,168,56,.6); }

@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main { margin-left: 200px; }
  .content { padding: 14px; }
  .artikel-grid { grid-template-columns: 1fr; }
}
