/* PPPTools Library Admin — Stylesheet */

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

/* ── Light Mode (Default) ───────────────────────────────────────────────────── */
:root {
  --brand:      #3a5bc7;
  --brand-dark: #2a4aaa;
  --bg:         #f4f6fb;
  --surface:    #ffffff;
  --border:     #dde2ee;
  --text:       #1a2035;
  --muted:      #6b7694;
  --danger:     #c0392b;
  --warn:       #e67e22;
  --success:    #27ae60;
  --radius:     6px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);
  --sidebar-bg: #1a2035;
  --topbar-bg:  #ffffff;
  --input-bg:   #ffffff;
  --table-head: #f8f9fc;
  --hover-row:  #f6f8fd;
}

/* ── Dark Mode ──────────────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --brand:      #7fa8ff;
  --brand-dark: #5b87f0;
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --border:     #2a2d3e;
  --text:       #e2e8f5;
  --muted:      #8892aa;
  --danger:     #e05555;
  --warn:       #f0913a;
  --success:    #3abf6e;
  --shadow:     0 1px 4px rgba(0,0,0,.4);
  --sidebar-bg: #0d0f18;
  --topbar-bg:  #1a1d27;
  --input-bg:   #12141f;
  --table-head: #12141f;
  --hover-row:  #1f2235;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────────────────────────────────── */

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: #c8cfe8;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.sidebar-brand {
  padding: 18px 20px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: -.3px;
}
.sidebar-brand span { color: #7fa8ff; }
.sidebar-version {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.35);
  margin-top: 3px;
  letter-spacing: .3px;
}
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  color: #c8cfe8;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,.07);
  color: #fff;
  text-decoration: none;
  border-left-color: var(--brand);
}
.sidebar nav a .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: #7a8aaa;
}
.sidebar-footer form button {
  background: none;
  border: none;
  color: #7a8aaa;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.sidebar-footer form button:hover { color: #fff; }

/* Dark-Mode-Toggle-Button */
.dark-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #a0aac0;
  cursor: pointer;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  width: 100%;
  transition: background .15s, color .15s;
}
.dark-toggle:hover  { background: rgba(255,255,255,.12); color: #fff; }
.dark-toggle.active { background: rgba(127,168,255,.15); color: #7fa8ff;
                      border-color: rgba(127,168,255,.3); }

/* Main content */
.main { flex: 1; overflow: auto; }

.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 28px; }
.content-header { margin-bottom: 24px; }
.content-header h1 { font-size: 20px; font-weight: 700; }
.content-header p  { color: var(--muted); margin-top: 2px; }

/* ── Karten / Stat-Blöcke ───────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body  { padding: 20px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase;
              letter-spacing: .5px; margin-bottom: 8px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 12px; color: var(--muted); font-weight: 600;
                          text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; color: var(--brand); }
.stat-card .stat-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Tabellen ───────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--table-head);
  border-bottom: 2px solid var(--border);
  padding: 9px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--hover-row); }

/* ── Badges ─────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-snippet   { background: #e8f0ff; color: #2a52b2; }
.badge-slide     { background: #e8f8ef; color: #1a7a46; }
.badge-storyline { background: #fdf0e0; color: #a05a10; }
.badge-active    { background: #e8f8ef; color: #1a7a46; }
.badge-hidden    { background: #f5f0ff; color: #6030a0; }
.badge-deleted   { background: #fdecea; color: #b02020; }
.badge-free      { background: #f0f4ff; color: #3a5bc7; }
.badge-licensed  { background: #fff8e0; color: #a07010; }
.badge-premium   { background: #fdecea; color: #b02020; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f0f3fa; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a53020; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── Card Header ─────────────────────────────────────────────────────────────── */
.card-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--table-head);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ── Formulare ───────────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--brand); }
select.form-control { cursor: pointer; }

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}
.filter-bar .form-control { width: auto; min-width: 140px; }
.filter-bar input[type=search] { min-width: 220px; }

/* ── Login-Seite ─────────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  padding: 36px 40px;
  width: 360px;
}
.login-card h1 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-card .login-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.alert {
  padding: 9px 13px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error   { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c4; }
.alert-success { background: #e8f8ef; color: var(--success); border: 1px solid #b8e8cc; }

/* ── Flash-Nachrichten ───────────────────────────────────────────────────────── */

.flash-list { list-style: none; margin-bottom: 20px; }
.flash-list li {
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 6px;
}
.flash-ok   { background: #e8f8ef; color: var(--success); border: 1px solid #b8e8cc; }
.flash-err  { background: #fdecea; color: var(--danger);  border: 1px solid #f5c6c4; }

/* ── Sonstige Hilfselemente ──────────────────────────────────────────────────── */

.text-muted  { color: var(--muted); }
.text-right  { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 24px; }
.gap-row { display: flex; gap: 8px; align-items: center; }

/* Bar-Chart (Stats) */
.bar-wrap { display: flex; align-items: center; gap: 8px; }
.bar-bg   { flex: 1; height: 8px; background: #e8ecf5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 8px; background: var(--brand); border-radius: 4px; transition: width .3s; }
.bar-count { font-size: 12px; color: var(--muted); min-width: 28px; text-align: right; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
