/* ============================================================
   diemeyerz Admin – Design-System v2
   Dunkles Agentur-Theme mit Gold-Akzent, ruhiger und moderner:
   weichere Flächen, klare Typo-Skala, konsistente Chips/Buttons,
   sichtbare Fokus-Ringe, bessere Tabellen und Mobile-Ansicht.
   Alle Klassennamen von v1 bleiben gültig.
   ============================================================ */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --gold: #d7b476; --gold-dim: #c39c5e; --gold-ink: #8a6a35;
  --gold-soft: rgba(215, 180, 118, 0.12);
  --gold-line: rgba(215, 180, 118, 0.45);
  --bg: #0d1014; --panel: #14181e; --panel-2: #1b2129; --panel-3: #222a34;
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ebef; --muted: #98a1ad; --faint: #6b7482;
  --red: #e5484d; --red-soft: rgba(229, 72, 77, 0.12);
  --green: #4cae5e; --green-soft: rgba(76, 174, 94, 0.12);
  --blue: #62a5f5; --blue-soft: rgba(98, 165, 245, 0.12);
  --yellow: #e2b93b; --yellow-soft: rgba(226, 185, 59, 0.12);
  --radius: 12px; --radius-s: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(215, 180, 118, 0.28);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-color: var(--panel-3) var(--bg); }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(215, 180, 118, 0.05), transparent 60%),
    var(--bg);
  color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(215, 180, 118, 0.32); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Linke Seitenleiste ===== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 224px; z-index: 60;
  background: linear-gradient(180deg, #151a21, #12161c);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 1rem 0.7rem 0.8rem;
  overflow-y: auto; scrollbar-width: thin;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 0.6rem; font-weight: 700;
  padding: 0.3rem 0.6rem 1rem; font-size: 1.02rem; letter-spacing: 0.2px;
}
.sidebar .brand img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(215, 180, 118, 0.35); }
.side-group { margin-bottom: 0.85rem; }
.side-label {
  font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.8px;
  color: var(--gold-dim); padding: 0.35rem 0.65rem 0.35rem; opacity: 0.9;
}
.sidebar a {
  position: relative; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.44rem 0.65rem; border-radius: 8px; font-size: 0.895rem; font-weight: 450;
  color: var(--muted); transition: background 0.12s, color 0.12s;
}
.sidebar a .ico { width: 1.25rem; text-align: center; font-size: 0.92rem; opacity: 0.85; }
.sidebar a:hover { color: var(--text); background: rgba(255, 255, 255, 0.055); }
.sidebar a.active { color: var(--gold); background: var(--gold-soft); font-weight: 600; }
.sidebar a.active::before {
  content: ''; position: absolute; left: -0.7rem; top: 20%; bottom: 20%; width: 3px;
  background: var(--gold); border-radius: 0 3px 3px 0;
}
.side-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 0.55rem; }
.side-logout:hover { color: var(--red) !important; background: var(--red-soft) !important; }

.mobilebar { display: none; }

body.has-sidebar .wrap { margin-left: 224px; max-width: none; padding: 1.9rem 2.2rem 4.5rem; }
.wrap > * { max-width: 1180px; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; width: 250px; }
  body.side-open .sidebar { transform: translateX(0); box-shadow: 0 0 50px rgba(0, 0, 0, 0.65); }
  .mobilebar {
    display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1rem;
    background: rgba(20, 24, 30, 0.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50;
  }
  .mobilebar .brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.95rem; }
  .mobilebar .brand img { width: 26px; height: 26px; border-radius: 50%; }
  .side-toggle {
    background: none; border: 1px solid var(--line-strong); color: var(--text);
    font-size: 1.1rem; border-radius: 8px; padding: 0.2rem 0.6rem; cursor: pointer;
  }
  body.has-sidebar .wrap { margin-left: 0; padding: 1.25rem 1rem 3rem; }
}

/* ===== Typografie ===== */
.wrap-classic { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 1.25rem; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 1.75rem 0 0.75rem; color: var(--gold); letter-spacing: 0.1px; }
.muted { color: var(--muted); font-size: 0.85rem; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05rem 0.4rem; font-size: 0.85em; }

/* ===== KPI-Karten ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; box-shadow: var(--shadow);
}
.card .num { font-size: 1.85rem; font-weight: 800; color: var(--gold); line-height: 1.25; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.card .lbl { font-size: 0.79rem; color: var(--muted); margin-top: 0.15rem; }
.card-warn { border-color: rgba(229, 72, 77, 0.45); }
.card-warn .num { color: var(--red); }

/* ===== Tabellen ===== */
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; font-size: 0.88rem;
}
th, td { padding: 0.62rem 0.85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  background: var(--panel-2); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted); white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tbody tr, table tr { transition: background 0.1s; }
tr:hover td { background: rgba(255, 255, 255, 0.025); }
td a { color: var(--gold); font-weight: 500; }
td a:hover { text-decoration: underline; text-underline-offset: 2px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Status-Chips ===== */
.badge {
  display: inline-block; font-size: 0.71rem; font-weight: 600; padding: 0.14rem 0.6rem;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted);
  white-space: nowrap; line-height: 1.5;
}
.badge.neu, .badge.vorgeschlagen, .badge.entwurf { color: var(--yellow); border-color: rgba(226, 185, 59, 0.45); background: var(--yellow-soft); }
.badge.geprueft, .badge.im_gespraech, .badge.offen, .badge.angebot, .badge.gestellt { color: var(--blue); border-color: rgba(98, 165, 245, 0.4); background: var(--blue-soft); }
.badge.aktiv, .badge.beauftragt, .badge.besetzt, .badge.bezahlt { color: var(--green); border-color: rgba(76, 174, 94, 0.5); background: var(--green-soft); }
.badge.inaktiv, .badge.beendet, .badge.abgeschlossen { color: var(--muted); }
.badge.geloescht, .badge.abgelehnt, .badge.abgesagt, .badge.storniert { color: var(--red); border-color: rgba(229, 72, 77, 0.4); background: var(--red-soft); }
.badge.public { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }

/* ===== Formulare ===== */
form.inline { display: inline-flex; gap: 0.4rem; align-items: center; }
label { display: block; font-size: 0.76rem; font-weight: 600; color: var(--muted); margin-bottom: 0.28rem; letter-spacing: 0.2px; }
input, select, textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); color: var(--text); padding: 0.52rem 0.75rem;
  font-family: inherit; font-size: 0.9rem; transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring); }
input[type=checkbox] { width: auto; accent-color: var(--gold-dim); }
input[type=date], input[type=month] { color-scheme: dark; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2398a1ad' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; padding-right: 1.9rem;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.9rem; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.field { margin-bottom: 0.9rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; background: linear-gradient(180deg, #e2c186, var(--gold));
  color: #14161a; font-weight: 650; font-size: 0.88rem; border: none;
  border-radius: var(--radius-s); padding: 0.55rem 1.2rem; cursor: pointer;
  transition: filter 0.12s, transform 0.05s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-line); box-shadow: none; }
.btn.ghost:hover { background: var(--gold-soft); filter: none; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(229, 72, 77, 0.5); box-shadow: none; }
.btn.danger:hover { background: var(--red-soft); filter: none; }
.btn.small { font-size: 0.78rem; padding: 0.3rem 0.7rem; }

/* ===== Panels & Meldungen ===== */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.panel > h2:first-child, .panel h2[style*="margin-top:0"] { margin-top: 0; }
.msg { border-radius: 10px; padding: 0.7rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; }
.msg.ok { background: var(--green-soft); border: 1px solid rgba(76, 174, 94, 0.4); }
.msg.err { background: var(--red-soft); border: 1px solid rgba(229, 72, 77, 0.4); }

/* ===== Dashboard ===== */
.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; margin-bottom: 0.5rem; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 168px; padding-top: 0.5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bar-col .bar {
  width: 100%; max-width: 42px;
  background: linear-gradient(180deg, var(--gold), var(--gold-ink));
  border-radius: 5px 5px 0 0; opacity: 0.88; transition: opacity 0.12s;
}
.bar-col:hover .bar { opacity: 1; box-shadow: 0 0 14px rgba(215, 180, 118, 0.35); }
.bar-val { font-size: 0.62rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-lbl { font-size: 0.65rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; }
.dash-meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 0.9rem;
  padding-top: 0.75rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted);
}
.dash-meta strong { color: var(--text); }
.dash-meta a { color: var(--gold); }
.pipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.pipe {
  display: flex; flex-direction: column; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.9rem;
  font-size: 0.78rem; color: var(--muted); transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.pipe:hover { border-color: var(--gold-line); color: var(--text); background: var(--panel-3); }
.pipe .num { font-size: 1.35rem; font-weight: 800; color: var(--gold); line-height: 1.25; font-variant-numeric: tabular-nums; }

/* ===== Filter-Pills ===== */
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters a {
  font-size: 0.82rem; padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted); transition: all 0.12s;
}
.filters a:hover { color: var(--text); border-color: var(--faint); }
.filters a.on { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); font-weight: 600; }

/* ===== Skills ===== */
.skills-inline { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.skills-inline span { font-size: 0.75rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.55rem; color: var(--muted); }
.skills-pick { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.skills-pick label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 400; color: var(--text); margin: 0; }

/* ===== Login ===== */
.login-box { max-width: 380px; margin: 12vh auto; }
.login-box .panel { padding: 2.2rem 2rem; border-color: var(--line-strong); }
.login-box .brand { display: flex; align-items: center; gap: 0.7rem; justify-content: center; margin-bottom: 1.5rem; font-weight: 700; font-size: 1.15rem; }
.login-box .brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(215, 180, 118, 0.3); }

/* ===== Tag-Picker ===== */
.tagpicker { position: relative; }
.tp-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.45rem 0.55rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--panel-2); cursor: text; }
.tp-tags:focus-within { border-color: var(--gold); box-shadow: var(--ring); }
.tp-tag { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold); font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.35rem 0.15rem 0.55rem; border-radius: 999px; }
.tp-x { background: none; border: none; color: var(--gold); font-size: 0.95rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; }
.tp-x:hover { color: var(--red); }
.tp-input { flex: 1; min-width: 160px; border: none; outline: none; background: transparent; color: var(--text); font-family: inherit; font-size: 0.88rem; padding: 0.15rem; width: auto; box-shadow: none !important; }
.tp-list { position: absolute; z-index: 30; left: 0; right: 0; margin-top: 4px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius-s); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); overflow: hidden; }
.tp-item { padding: 0.45rem 0.8rem; font-size: 0.85rem; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; color: var(--text); }
.tp-item:hover, .tp-item.on { background: var(--gold-soft); }
.tp-cat { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.tp-empty { padding: 0.45rem 0.8rem; font-size: 0.82rem; color: var(--muted); }

/* ===== Druck ===== */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .mobilebar, .btn, form.inline { display: none !important; }
  body.has-sidebar .wrap { margin-left: 0; padding: 0; }
  table, .panel, .card { box-shadow: none; border-color: #ccc; background: #fff; }
}
