﻿@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600&family=Sora:wght@500;600;700&display=swap');

:root {
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-2: #eef4f3;
  --text: #0f1f1c;
  --muted: #5f6d6a;
  --accent: #00897b;
  --accent-strong: #00695c;
  --warning: #f9a825;
  --danger: #d32f2f;
  --border: #e3e9e8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --input-bg: #121817;
  --input-text: #ecf2f1;

  /* soft action buttons */
  --btn-surface: rgba(15, 31, 28, 0.04);
  --btn-surface-hover: rgba(15, 31, 28, 0.07);
  --btn-border: rgba(15, 31, 28, 0.10);
  --btn-border-hover: rgba(15, 31, 28, 0.16);

  /* new: dashboard polish */
  --card-hover: rgba(15, 31, 28, 0.06);
  --ring: rgba(0, 137, 123, 0.22);

  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1413;
    --surface: #161c1b;
    --surface-2: #1e2624;
    --text: #ecf2f1;
    --muted: #9aa6a3;
    --accent: #4db6ac;
    --accent-strong: #26a69a;
    --warning: #ffca28;
    --danger: #ef5350;
    --border: #24302d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --input-bg: #121817;
    --input-text: #ecf2f1;

    --btn-surface: rgba(255, 255, 255, 0.04);
    --btn-surface-hover: rgba(255, 255, 255, 0.07);
    --btn-border: rgba(255, 255, 255, 0.10);
    --btn-border-hover: rgba(255, 255, 255, 0.16);

    --card-hover: rgba(255, 255, 255, 0.05);
    --ring: rgba(77, 182, 172, 0.22);
  }

  .movement-icon.out { background: rgba(239, 83, 80, 0.18); color: #ef9a9a; }
  .movement-icon.in  { background: rgba(38, 166, 154, 0.18); color: #80cbc4; }

  .icon-circle.out { background: rgba(239, 83, 80, 0.2); color: #ef9a9a; }
  .icon-circle.in  { background: rgba(38, 166, 154, 0.2); color: #80cbc4; }

  .sync-pill { background: rgba(77, 182, 172, 0.2); color: #80cbc4; }

  input, select, textarea {
    background: #121817;
    color: var(--text);
    border-color: var(--border);
  }

  input::placeholder, textarea::placeholder { color: var(--muted); }
  input[type="file"] { color: var(--text); }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Work Sans', 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body:not(.landing-body) {
  background: radial-gradient(circle at 10% -10%, rgba(0, 137, 123, 0.14), transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(77, 182, 172, 0.12), transparent 40%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

body:not(.landing-body) header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

body:not(.landing-body) .container {
  padding-top: 88px;
}

/* Landing page */
.landing-body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(0, 137, 123, 0.18), transparent 45%),
    radial-gradient(circle at 20% 60%, rgba(77, 182, 172, 0.15), transparent 45%),
    var(--bg);
}

.landing-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.landing-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.5;
  background: radial-gradient(circle, rgba(0, 137, 123, 0.45), rgba(0, 137, 123, 0.05));
  animation: float-orb 14s ease-in-out infinite;
}

.landing-orb.orb-a {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  animation-duration: 18s;
}

.landing-orb.orb-b {
  width: 220px;
  height: 220px;
  bottom: -90px;
  left: -60px;
  background: radial-gradient(circle, rgba(77, 182, 172, 0.4), rgba(77, 182, 172, 0.08));
  animation-duration: 20s;
}

.landing-orb.orb-c {
  width: 160px;
  height: 160px;
  top: 40%;
  left: 65%;
  background: radial-gradient(circle, rgba(0, 137, 123, 0.3), rgba(0, 137, 123, 0.05));
  animation-duration: 16s;
}

.landing-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(22, 28, 27, 0.7);
  backdrop-filter: blur(12px);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ecfffd;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
}

.brand-title {
  font-family: 'Sora', 'Work Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
}

.landing-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: var(--btn-surface);
  transition: 0.2s ease;
}

.btn:hover {
  background: var(--btn-surface-hover);
  border-color: var(--btn-border-hover);
}

.btn.primary {
  background: var(--accent);
  color: #021512;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(0, 137, 123, 0.25);
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.ghost {
  background: transparent;
}

.btn-muted {
  cursor: default;
  color: var(--muted);
  border-style: dashed;
}

.btn-muted:hover {
  background: transparent;
  border-color: var(--btn-border);
}

.landing-main {
  position: relative;
  z-index: 1;
  padding: 48px 32px 64px;
  flex: 1;
}

.landing-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.landing-hero {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(32px, 3vw, 46px);
  line-height: 1.1;
  margin: 12px 0;
}

.hero-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 520px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(77, 182, 172, 0.15);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.hero-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-weight: 700;
  font-size: 16px;
}

.card-sub {
  color: var(--muted);
  font-size: 13px;
}

.card-grid {
  display: grid;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  display: inline-block;
}

.status-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.status-name {
  font-weight: 600;
}

.status-pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.status-pill.ok {
  background: #e8f5e9;
  color: #1b5e20;
}

.status-pill.warn {
  background: #fff3e0;
  color: #ef6c00;
}

.status-pill.info {
  background: #e0f2f1;
  color: var(--accent-strong);
}

.landing-legal {
  max-width: 1100px;
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
}

.legal-card h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.landing-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.landing-footer a:hover {
  color: var(--accent);
}

.landing-legal-page {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
}

.landing-legal-page h1 {
  margin-bottom: 12px;
}

.legal-text {
  color: var(--muted);
  line-height: 1.6;
}

.legal-block {
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 8px;
  color: var(--text);
}

.card-tile {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.tile-title {
  font-size: 12px;
  color: var(--muted);
}

.tile-value {
  font-weight: 600;
  font-size: 14px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@keyframes float-orb {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(18px, -14px, 0) scale(1.04);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 900px) {
  .landing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-actions {
    flex-wrap: wrap;
  }
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Work Sans', sans-serif;
  margin: 0 0 8px 0;
}

header {
  background: rgba(22, 28, 27, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

header .brand {
  font-weight: 700;
  letter-spacing: 0.4px;
}

nav a {
  margin-right: 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
}

nav a.active { color: var(--accent); }

nav a:hover {
  background: var(--btn-surface-hover);
  color: var(--text);
}

.container {
  padding: 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title { font-weight: 600; }
.card-meta  { font-size: 13px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid #d1e6e2;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  font-family: inherit;
}

input::placeholder, textarea::placeholder { color: var(--muted); }

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--input-text);
  box-shadow: 0 0 0px 1000px var(--input-bg) inset;
  transition: background-color 5000s ease-in-out 0s;
}

input[type="file"] { color: var(--text); }

label { font-size: 13px; color: var(--muted); }

button {
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, filter .12s ease;
}

button:hover { filter: brightness(1.03); transform: translateY(-1px); }
button:active { transform: translateY(0); }

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

button.ghost { background: transparent; color: var(--accent); }

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f5f6;
  font-size: 12px;
  color: var(--muted);
}

.badge.in   { background: #e0f2f1; color: var(--accent-strong); }
.badge.out  { background: #ffebee; color: #b71c1c; }
.badge.sync { background: #e8f5e9; color: #1b5e20; }
.badge.warn { background: #fff8e1; color: #f57f17; }
.badge.alert { background: #ffebee; color: #b71c1c; }

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

.icon--sm { width: 14px; height: 14px; }
.icon--md { width: 18px; height: 18px; }
.icon--lg { width: 20px; height: 20px; }
.icon--xl { width: 22px; height: 22px; }

.badge .icon {
  margin-right: 6px;
}

.badge.icon-only {
  padding: 4px 6px;
}

.badge.icon-only .icon {
  margin-right: 0;
}

.badge.ean-pill {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  letter-spacing: 0.2px;
  border-radius: 12px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row-inline { align-items: center; }

footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 360px;
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* alerts */
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.alert-danger {
  background: rgba(211, 47, 47, 0.10);
  border-color: rgba(211, 47, 47, 0.22);
  color: var(--text);
}

/* existing utility states */
.error {
  background: #fdecea;
  color: #b00020;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.success {
  background: #e8f5e9;
  color: #1b5e20;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table-wrap { width: 100%; overflow-x: auto; }

/* keep old classes referenced elsewhere */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table th { color: var(--muted); font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 12px; }
.link-card { text-decoration: none; color: inherit; }

/* --- dashboard (NEW) --- */
.dashboard-hero {
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(800px 240px at 20% 0%, var(--card-hover), transparent 60%);
  pointer-events: none;
}

.dashboard-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-grid {
  align-items: stretch;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 170px;
  transition: transform .10s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0);
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
  background: linear-gradient(0deg, var(--card-hover), transparent 60%), var(--surface);
}

.dashboard-card:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}

.dashboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 137, 123, 0.10);
  border: 1px solid rgba(0, 137, 123, 0.18);
}

.icon-badge.warn {
  background: rgba(249, 168, 37, 0.12);
  border-color: rgba(249, 168, 37, 0.22);
}

.icon-badge .material-symbols-rounded {
  font-size: 22px;
  line-height: 1;
}

/* KPI blocks */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-top: 8px;
}

.kpi-value-small {
  font-size: 16px;
  font-weight: 800;
  margin-top: 10px;
}

/* incidents list inside card */
.incident-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.incident-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.incident-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-count {
  font-weight: 800;
}

/* footer inside card */
.dashboard-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  padding-top: 2px;
}

.dashboard-arrow {
  font-size: 18px;
  opacity: 0.9;
}

.dashboard-hint {
  font-weight: 700;
}

/* responsive tweaks */
@media (max-width: 560px) {
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }
}

/* --- existing sections below (unchanged) --- */
.list-grid, .detail-grid, .signature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.detail-item {
  background: var(--surface-2);
  border: 1px solid #d1e6e2;
  border-radius: 12px;
  padding: 12px;
}

.detail-item .label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-item .value { font-weight: 600; }

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }

.signature-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.signature-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 10px;
  border: 1px dashed var(--border);
}

.serial-list { display: flex; flex-wrap: wrap; gap: 8px; }
.serial-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2f1;
  color: var(--accent-strong);
  font-size: 12px;
}

.empty-state { color: var(--muted); font-size: 13px; }

.table-row { cursor: pointer; transition: background 120ms ease; }
.table-row:hover { background: var(--surface-2); }
.table-row.row-in { background: rgba(0, 137, 123, 0.08); }
.table-row.row-out { background: rgba(211, 47, 47, 0.08); }
.table-row.row-in:hover { background: rgba(0, 137, 123, 0.14); }
.table-row.row-out:hover { background: rgba(211, 47, 47, 0.14); }

.icon-cell { width: 56px; }
.icon-circle {
  width: 36px; height: 36px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.icon-circle.in { background: #e0f2f1; color: var(--accent-strong); }
.icon-circle.out { background: #ffebee; color: #b71c1c; }

.cell-title { font-weight: 600; margin-bottom: 4px; }
.cell-meta { color: var(--muted); font-size: 12px; }
.cell-muted { color: var(--muted); font-size: 13px; }

.sync-cell { text-align: right; }
.sync-flags {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.sync-flags .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 8px;
  line-height: 1;
}
.sync-flags .badge .icon {
  margin-right: 0;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #e8f5e9;
  color: #1b5e20;
}

.movement-badges {
  gap: 10px;
  align-items: center;
}

.material-symbols-rounded { font-size: 18px; line-height: 1; }

.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

/* Erzwingt: Titel links, Icon rechts in EINER Zeile */
.dashboard-card .dash-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.dashboard-card .dash-title {
  margin: 0 !important;
}

/* Icon darf nicht umbrechen / nicht nach unten rutschen */
.dashboard-card .dash-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  line-height: 1 !important;
  opacity: .9;
  flex: 0 0 auto !important;
}

/* Rows: Typ links, Value rechts */
.dashboard-card .dash-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-card .dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.dashboard-card::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  width: 150px;
  height: 150px;
  transform: translateY(-50%);
  opacity: 0.08;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

.dashboard-card-movements::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10'/%3E%3Cpath d='m13 3 4 4-4 4'/%3E%3Cpath d='M17 17H7'/%3E%3Cpath d='m11 21-4-4 4-4'/%3E%3C/svg%3E");
}

.dashboard-card-incidents::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 16H3z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.dashboard-card-articles::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h12l2 4v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6z'/%3E%3Cpath d='M4 6h16'/%3E%3Cpath d='M9 10h6'/%3E%3Cpath d='M9 14h6'/%3E%3C/svg%3E");
}

.dashboard-card .dash-row-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-card .dash-row-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
  line-height: 1;
}

.dashboard-card .dash-type {
  line-height: 1;
}

.dashboard-card .dash-value {
  margin-left: auto;
}
.dashboard-card .dash-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-card .dash-row-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.dashboard-card .dash-row-icon.in { color: var(--accent-strong); }
.dashboard-card .dash-row-icon.out { color: #b71c1c; }
.dashboard-card .dash-row-icon.warn { color: #f57f17; }

.dashboard-card .dash-type {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-card .dash-value {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.2px;
  flex: 0 0 auto;
}

.dashboard-card .dash-value-small {
  font-size: 14px;
}

.dashboard-card .dash-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  justify-content: flex-end;
}

.dashboard-card .status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.dashboard-card .status-pill.open {
  background: rgba(249, 168, 37, 0.14);
  border-color: rgba(249, 168, 37, 0.3);
  color: #f57f17;
}

.dashboard-card .status-pill.progress {
  background: rgba(33, 150, 243, 0.14);
  border-color: rgba(33, 150, 243, 0.3);
  color: #64b5f6;
}

.dashboard-card .status-pill.resolved {
  background: rgba(38, 166, 154, 0.16);
  border-color: rgba(38, 166, 154, 0.3);
  color: var(--accent-strong);
}

/* Optional: Hover etwas "premium" */
.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.18);
  border-color: rgba(0,0,0,0);
  transition: transform .10s ease, box-shadow .14s ease, border-color .14s ease;
}

/* Artikeluebersicht (nur diese Tabelle) */
.articles-table .article-row {
  cursor: pointer;
  transition: background 120ms ease;
}

.articles-table .article-row:hover {
  background: var(--surface-2);
}

.articles-table .article-name {
  font-weight: 600;
}

.articles-table .article-action {
  text-align: right;
  color: var(--muted);
}

.articles-table .article-action form {
  display: inline-flex;
}

.icon-button {
  border: 1px solid var(--btn-border);
  background: var(--btn-surface);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button.is-danger {
  background: rgba(211, 47, 47, 0.12);
  border-color: rgba(211, 47, 47, 0.35);
  color: var(--danger);
}

.icon-button.is-in {
  background: rgba(38, 166, 154, 0.16);
  border-color: rgba(38, 166, 154, 0.35);
  color: var(--accent-strong);
}

.icon-button.is-out {
  background: rgba(239, 83, 80, 0.16);
  border-color: rgba(239, 83, 80, 0.35);
  color: #b71c1c;
}

.icon-button.is-alert {
  background: rgba(239, 83, 80, 0.16);
  border-color: rgba(239, 83, 80, 0.35);
  color: #b71c1c;
}

/* --- article detail page --- */
.article-detail-page .article-header {
  align-items: center;
}

.article-detail-page .article-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.article-detail-page .article-actions form {
  margin: 0;
}

.article-detail-page .detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.article-detail-page .detail-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.article-detail-page .detail-item .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.article-detail-page .detail-item .value {
  font-weight: 600;
}

.article-detail-page .article-info-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-detail-page .article-info-form .info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.article-detail-page .article-info-form .detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.article-detail-page .article-info-form input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.04);
}

.article-detail-page .article-info-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 182, 172, 0.18);
}

.article-detail-page .article-info-form input[disabled] {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--border);
}

.article-detail-page .article-edit-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.article-detail-page .article-edit-form input[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.article-detail-page .form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.article-detail-page .movement-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.article-detail-page .movement-card:hover {
  background: linear-gradient(0deg, var(--card-hover), transparent 60%), var(--surface-2);
}

.article-detail-page .movement-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.article-detail-page .movement-icon.in {
  background: rgba(0, 137, 123, 0.12);
  color: var(--accent-strong);
}

.article-detail-page .movement-icon.out {
  background: rgba(211, 47, 47, 0.12);
  color: #b71c1c;
}

.article-detail-page .movement-card .badge {
  align-self: center;
}

.article-detail-page .movement-flags {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.article-detail-page .serial-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-detail-page .serial-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.article-detail-page .serial-chip {
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px;
}

.article-detail-page .icon-button {
  border: 1px solid var(--btn-border);
  background: var(--btn-surface);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.article-detail-page .icon-button.is-danger {
  background: rgba(211, 47, 47, 0.12);
  border-color: rgba(211, 47, 47, 0.35);
  color: var(--danger);
}

.article-detail-page .serial-row form {
  margin-left: auto;
}

/* --- incidents page --- */
.incidents-page .incident-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: transform .12s ease, box-shadow .14s ease, border-color .14s ease;
}

.incidents-page .incident-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0,0,0,0);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}

.incidents-page .incident-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 137, 123, 0.12);
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.incidents-page .incident-icon-wrap.UnknownEan {
  background: rgba(33, 150, 243, 0.12);
  color: #64b5f6;
}

.incidents-page .incident-icon-wrap.UnknownSerialOutbound {
  background: rgba(211, 47, 47, 0.12);
  color: #ef9a9a;
}

.incidents-page .incident-icon-wrap.SerialMissing {
  background: rgba(249, 168, 37, 0.15);
  color: #ffca28;
}

.incidents-page .incident-title {
  font-weight: 700;
}

.incidents-page .incident-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.incidents-page .incident-status {
  margin-left: auto;
}

/* --- incident detail --- */
.incident-detail-page .incident-edit-form .row {
  align-items: center;
}

/* --- stats page --- */
.stats-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stats-page .stats-filter {
  margin-top: 12px;
}

.stats-page .stats-filter .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.stats-page .stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-page .stat-title {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stats-page .stat-value {
  font-size: 28px;
  font-weight: 800;
}

.stats-page .stat-meta {
  color: var(--muted);
  font-size: 13px;
}

.stats-page .chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-x: auto;
}

.stats-page .chart {
  display: grid;
  grid-template-columns: repeat(var(--chart-cols, 7), minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 180px;
  min-width: calc(var(--chart-cols, 7) * 48px);
}

.stats-page .chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stats-page .bars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  align-items: end;
  height: 140px;
  width: 100%;
}

.stats-page .bar {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  transition: height 0.3s ease;
  position: relative;
}

.stats-page .bar.in {
  background: rgba(0, 137, 123, 0.5);
}

.stats-page .bar.out {
  background: rgba(211, 47, 47, 0.5);
}

.stats-page .bar-value {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  opacity: 0.9;
  pointer-events: none;
  white-space: nowrap;
}

.stats-page .chart-col .label {
  font-size: 11px;
  color: var(--muted);
}

.stats-page .legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.stats-page .legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.stats-page .legend .dot.in {
  background: rgba(0, 137, 123, 0.7);
}

.stats-page .legend .dot.out {
  background: rgba(211, 47, 47, 0.7);
}

.stats-page .list.compact {
  gap: 8px;
}

.stats-page .mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stats-page .top-articles .top-article-row {
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
}

.stats-page .top-articles .mini-left {
  flex: 1;
  min-width: 0;
}

.stats-page .top-articles .mini-title {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

.stats-page .top-articles .mini-right {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.stats-page .mini-badges {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.stats-page .count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid transparent;
  min-width: 44px;
  justify-content: center;
}

.stats-page .count-pill.in {
  color: #a5f3eb;
  background: rgba(0, 137, 123, 0.16);
  border-color: rgba(0, 137, 123, 0.35);
}

.stats-page .count-pill.out {
  color: #ffcdd2;
  background: rgba(211, 47, 47, 0.16);
  border-color: rgba(211, 47, 47, 0.35);
}

.stats-page .stats-table td {
  vertical-align: middle;
}

/* --- feedback page --- */
.feedback-page .feedback-table .cell-muted {
  max-width: 360px;
}

.feedback-detail-page .detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.feedback-detail-page .detail-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.feedback-detail-page .detail-value {
  font-weight: 600;
  color: var(--text);
}

.feedback-detail-page .feedback-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stats-page .mini-title {
  font-weight: 600;
}

.stats-page .mini-value {
  font-weight: 800;
}

/* --- users page --- */
.users-page .form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.users-page .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.users-page .form-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.users-page .form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.users-page .pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.users-page .pill-group.compact .pill-check {
  padding: 4px 8px;
  font-size: 12px;
}

.users-page .pill-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.users-page .pill-check input {
  width: 16px;
  height: 16px;
}

.users-page .form-actions {
  display: flex;
  justify-content: flex-end;
}

.users-page .inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.users-page .table-input {
  width: 100%;
  min-width: 140px;
}

.users-page .inline-form input {
  min-width: 160px;
}

.users-page .roles-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-page .row-actions {
  display: flex;
  justify-content: flex-end;
}

.users-page .users-table .cell-strong {
  font-weight: 600;
}

.users-page .users-table .th-actions,
.users-page .users-table .actions-cell {
  text-align: right;
  white-space: nowrap;
}

.users-page .users-table .actions {
  display: inline-flex;
  gap: 8px;
  align-items: flex-end;
  justify-content: flex-end;
}

.users-page .users-table .actions.vertical {
  flex-direction: column;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .users-page .users-table thead {
    display: none;
  }

  .users-page .users-table,
  .users-page .users-table tbody,
  .users-page .users-table tr,
  .users-page .users-table td {
    display: block;
    width: 100%;
  }

  .users-page .users-table tr {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .users-page .users-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
  }

  .users-page .users-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--muted);
    min-width: 90px;
  }

  .users-page .users-table .roles-form,
  .users-page .users-table .inline-form,
  .users-page .users-table .actions {
    width: 100%;
  }

  .users-page .users-table .actions.vertical {
    align-items: flex-end;
  }
}

.users-page .invites-table .cell-strong {
  font-weight: 600;
}

.users-page .invites-table .actions-cell,
.users-page .invites-table .th-actions {
  text-align: right;
  white-space: nowrap;
}

/* --- reporting page --- */
.reporting-page .row-inline {
  align-items: center;
}

.reporting-page .row-inline input {
  flex: 1 1 260px;
}

.reporting-page .recipients-table .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reporting-page .recipients-table .actions-cell {
  text-align: right;
}

.reporting-page .recipients-table .email-cell {
  font-weight: 600;
}

/* --- shared action buttons (users + reporting) --- */
.users-page .btn-action,
.reporting-page .btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--btn-surface);
  color: var(--text);
  border: 1px solid var(--btn-border);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}

.feedback-page .btn-action,
.feedback-detail-page .btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--btn-surface);
  color: var(--text);
  border: 1px solid var(--btn-border);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
}

.feedback-page .btn-action:hover,
.feedback-detail-page .btn-action:hover {
  background: var(--btn-surface-hover);
  border-color: var(--btn-border-hover);
  transform: translateY(-1px);
}

.users-page .btn-action.icon-only,
.reporting-page .btn-action.icon-only {
  padding: 8px;
  width: 36px;
  height: 36px;
  justify-content: center;
}

.users-page .btn-action.icon-only .btn-label,
.reporting-page .btn-action.icon-only .btn-label {
  display: none;
}

.users-page .btn-action:hover,
.reporting-page .btn-action:hover {
  background: var(--btn-surface-hover);
  border-color: var(--btn-border-hover);
  transform: translateY(-1px);
}

.users-page .btn-action .btn-icon svg,
.reporting-page .btn-action .btn-icon svg {
  width: 16px;
  height: 16px;
}

.users-page .btn-action.is-danger,
.reporting-page .btn-action.is-danger {
  background: rgba(211, 47, 47, 0.12);
  border-color: rgba(211, 47, 47, 0.35);
  color: var(--danger);
}

.users-page .btn-action.is-success,
.reporting-page .btn-action.is-success {
  background: rgba(0, 137, 123, 0.12);
  border-color: rgba(0, 137, 123, 0.35);
  color: var(--accent-strong);
}
