/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:              #eef2f7;
  --surface:         #ffffff;
  --surface-2:       #f7f9fc;
  --surface-hover:   #f1f5f9;
  --border:          #e2e8f0;
  --border-strong:   #c8d6e2;

  /* Text */
  --text:            #0f172a;
  --text-secondary:  #334155;
  --muted:           #64748b;

  /* Brand – Teal */
  --brand:           #0d9488;
  --brand-strong:    #0f766e;
  --brand-glow:      rgba(13,148,136,0.35);

  /* Accent – Blue */
  --accent:          #2563eb;
  --accent-light:    #eff6ff;

  /* Semantic */
  --danger:          #dc2626;
  --danger-bg:       #fef2f2;
  --warning:         #d97706;
  --warning-bg:      #fffbeb;
  --ok:              #16a34a;
  --ok-bg:           #f0fdf4;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:    0 4px 14px rgba(15,23,42,0.07), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg: 0 20px 50px rgba(15,23,42,0.15), 0 6px 12px rgba(15,23,42,0.06);

  /* Shape */
  --radius:    10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  /* Motion */
  --t: 0.14s ease;

  /* Sidebar */
  --sidebar-w:       240px;
  --sidebar-bg:      #112040;
  --sidebar-sep:     rgba(255,255,255,0.08);
  --nav-text:        #90afd4;
  --nav-hover-bg:    rgba(255,255,255,0.07);
  --nav-active-bg:   rgba(255,255,255,0.12);
}

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

html {
  background: linear-gradient(to right,
    #0a1828 0%,
    #112040 10%,
    #1c3464 19%,
    #2e5498 27%,
    #5b8ec8 42%,
    #9bc4e8 62%,
    #cce5f8 80%,
    #eaf6ff 100%
  );
  background-attachment: fixed;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button, input, select, textarea { font: inherit; }
p { margin: 0; }

/* ─── App Shell ───────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: transparent;
  border-right: 1px solid rgba(255,255,255,0.10);
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }

/* Brand */
.brand {
  display: block;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--sidebar-sep);
}
.brand:hover { text-decoration: none; opacity: 0.85; transition: opacity var(--t); }

.sidebar-logo {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: screen;
}

/* Login Logo */
.login-logo {
  display: block;
  width: min(300px, 85%);
  height: auto;
  margin: 0 auto 20px;
  mix-blend-mode: screen;
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 8px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  position: relative;
}

.nav-link svg {
  flex-shrink: 0;
  transition: opacity var(--t);
}

.nav-link:hover {
  background: var(--nav-hover-bg);
  color: #e2e8f0;
  text-decoration: none;
}

.nav-link.active {
  background: var(--nav-active-bg);
  color: #ffffff;
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.nav-sep {
  height: 1px;
  background: var(--sidebar-sep);
  margin: 6px 2px;
}

.sidebar-version {
  padding: 10px 16px 14px;
  color: var(--nav-text);
  font-size: 11px;
  line-height: 1.3;
  border-top: 1px solid var(--sidebar-sep);
}

/* ─── Main ────────────────────────────────────────────────────── */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* ─── Topbar ──────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 0 28px;
  height: 58px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.45);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; flex-direction: column; justify-content: center; }

.topbar h1 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Page Content ────────────────────────────────────────────── */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t), box-shadow var(--t), color var(--t);
  text-decoration: none;
}

.button.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 3px var(--brand-glow);
}

.button.primary:hover {
  background: var(--brand-strong);
  box-shadow: 0 3px 10px var(--brand-glow);
  text-decoration: none;
  color: #fff;
}

.button.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text);
}

/* ─── Metrics Grid ────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--border-strong);
}

.metric-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* Per-card accent colours */
.metric-card:nth-child(1)::before { background: #6366f1; }
.metric-card:nth-child(2)::before { background: #3b82f6; }
.metric-card:nth-child(3)::before { background: var(--brand); }
.metric-card:nth-child(4)::before { background: #8b5cf6; }
.metric-card:nth-child(5)::before { background: #f59e0b; }

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}

.metric-card.warning::before { background: var(--warning); }
.metric-card.warning strong  { color: var(--warning); }
.metric-card.ok strong       { color: var(--ok); }
.metric-card.ok::before      { background: var(--ok); }
.metric-card.danger strong   { color: var(--danger); }
.metric-card.danger::before  { background: var(--danger); }

/* ─── Content Grid ────────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 14px;
}

/* ─── Panels ──────────────────────────────────────────────────── */
.panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-header a {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.panel-header a:hover { text-decoration: underline; }

/* ─── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 13.5px;
  white-space: nowrap;
  color: var(--text-secondary);
}

td strong, td b { color: var(--text); }

tbody tr { transition: background var(--t); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }

td code {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  color: var(--text-secondary);
  white-space: normal;
  word-break: break-all;
}

.copy-code {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
  cursor: copy;
  white-space: nowrap;
  word-break: normal;
  overflow-x: auto;
  text-align: left;
}

.copy-code:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.permission-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.permission-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.spaced-panel {
  margin-top: 16px;
}

.secret-panel {
  margin-bottom: 16px;
}

.secret-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1fr) minmax(320px, 1.5fr);
  gap: 14px;
  padding: 16px 18px;
  align-items: start;
}

.secret-grid span,
.secret-grid strong {
  display: block;
}

.secret-grid strong {
  margin-top: 4px;
}

.secret-code {
  max-width: 520px;
}

.form-note {
  margin-top: 12px;
}

.form-section-title {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.inline-admin-form {
  padding: 12px 0 4px;
}

.project-permission-row td {
  background: rgba(247,249,252,0.8);
  white-space: normal;
}

.project-permission-row details {
  max-width: 780px;
}

.project-permission-row summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}

/* ─── Status Badges ───────────────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status.ok          { background: var(--ok-bg);      color: var(--ok); }
.status.pending     { background: var(--accent-light); color: #1d4ed8; }
.status.danger      { background: var(--danger-bg);  color: var(--danger); }
.status.muted-status { background: var(--surface-2);  color: var(--muted); border: 1px solid var(--border); }

/* ─── Misc ────────────────────────────────────────────────────── */
.muted { color: var(--muted); }

.empty-state {
  max-width: 540px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--text-secondary);
}

/* ─── Login ───────────────────────────────────────────────────── */
.login-body {
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(30,72,140,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(13,100,140,0.35) 0%, transparent 65%),
    linear-gradient(160deg, #060d1a 0%, #0a1830 50%, #091525 100%);
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

/* Two-column login card */
.login-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  width: min(920px, 100%);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.07);
}

/* Left: hero */
.login-hero {
  /* Hintergrund matcht exakt die Logofarbe #0d1c38 → nahtloser Übergang */
  background:
    radial-gradient(ellipse 90% 60% at 60% 80%, rgba(30,80,160,0.25) 0%, transparent 65%),
    linear-gradient(160deg, #0d1c38 0%, #102040 40%, #142850 100%);
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.login-hero-inner {
  position: relative;
  z-index: 1;
}

.login-hero-logo {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin-bottom: 36px;
  /* kein mix-blend-mode — Hintergrundfarben matchen direkt */
}

.login-tagline {
  margin: 0 0 28px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8ab4d8;
  font-size: 13.5px;
  font-weight: 500;
}

.login-features li svg {
  flex-shrink: 0;
  color: #0d9488;
  width: 15px;
  height: 15px;
}

/* Right: form */
.login-form-side {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 44px;
}

.login-form-inner {
  width: 100%;
  max-width: 340px;
}

.login-form-header {
  margin-bottom: 28px;
}

.login-form-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.login-form-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.button.primary.login-submit {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  font-size: 14px;
  justify-content: center;
  border-radius: 8px;
  background: #2563eb;
  box-shadow: 0 2px 12px rgba(37,99,235,0.35);
}

.button.primary.login-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 20px rgba(37,99,235,0.45);
}

@media (max-width: 700px) {
  .login-card { grid-template-columns: 1fr; }
  .login-hero { padding: 36px 28px; }
  .login-form-side { padding: 36px 28px; }
  .login-tagline { font-size: 20px; }
}


/* Fallback: altes HTML vor Rebuild */
.login-logo {
  display: none;
}
.login-panel {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.07);
  padding: 40px;
}

/* ─── Forms ───────────────────────────────────────────────────── */
label {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select,
input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t), box-shadow var(--t);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.11);
}

.button.primary[type="submit"] {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  font-size: 14px;
}

.field-error { color: var(--danger); font-size: 12px; margin-top: 2px; }

.alert {
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  font-size: 13px;
}

.alert.success {
  border-color: rgba(22,163,74,0.22);
  background: var(--ok-bg);
  color: var(--ok);
}

.admin-form {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.admin-form:last-child { border-bottom: none; }

.admin-form h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px 14px;
  align-items: end;
}

.form-inline {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.button.compact,
.button.primary.compact[type="submit"] {
  width: auto;
  height: 34px;
  margin-top: 0;
  font-size: 13px;
}

.check-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: center;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
}

.check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.user-admin-panel { margin-top: 16px; }

.admin-user-list {
  display: flex;
  flex-direction: column;
}

.user-admin-card {
  border-bottom: 1px solid var(--border);
}

.user-admin-card:last-child { border-bottom: none; }

.user-admin-card summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.user-admin-card summary::-webkit-details-marker { display: none; }

.user-admin-card summary:hover { background: var(--surface-hover); }

.user-admin-card summary strong,
.user-admin-card summary small {
  display: block;
}

.user-admin-card summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.user-admin-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.user-admin-sections {
  border-top: 1px solid var(--border);
  background: rgba(247,249,252,0.75);
}

.compact-table th,
.compact-table td {
  padding: 8px 12px;
}

.table-check {
  white-space: nowrap;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .metrics-grid   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 56px; }

  .brand span,
  .nav-link span { display: none; }

  .brand { padding: 14px 11px; justify-content: center; }
  .brand-mark { width: 32px; height: 32px; }

  .nav { padding: 8px 6px; }
  .nav-link { justify-content: center; padding: 0; min-height: 40px; }
  .nav-link.active::before { display: none; }

  .topbar { padding: 0 18px; }
  .page-content { padding: 16px 18px; }
}

@media (max-width: 680px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }

  .metrics-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar         { height: auto; padding: 12px 18px; flex-wrap: wrap; }
}

/* ─── Reports ─────────────────────────────────────────────────── */
.report-toolbar { margin-bottom: 18px; }

.report-toolbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
}

.report-toolbar-inner h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

.report-datenav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-datenav input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.report-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 0 18px 18px;
}

.report-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.report-filter-form input,
.report-filter-form select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.report-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Trend column chart */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 20px 18px 16px;
  height: 220px;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.trend-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.trend-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-bar {
  width: 70%;
  max-width: 46px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(to top, var(--brand-strong), var(--brand));
  transition: height var(--t);
}

.trend-col.selected .trend-bar {
  background: linear-gradient(to top, #1d4ed8, var(--accent));
}

.trend-col.selected .trend-label { color: var(--accent); font-weight: 700; }

.trend-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.trend-weekday {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Horizontal bars inside tables */
.report-barcol { width: 40%; min-width: 180px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-track {
  flex: 1;
  height: 10px;
  background: var(--surface-hover);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(to right, var(--brand), var(--accent));
}

.bar-count {
  min-width: 28px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

/* ─── Settings ────────────────────────────────────────────────── */
.settings-hint {
  margin-top: 10px;
  font-size: 12px;
}

.settings-intro {
  padding: 14px 18px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.settings-intro code {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
}

.company-ip-form {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.company-ip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.company-ip-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.company-ip-form textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}

.company-ip-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
