/* Grundlayout */
:root {
  --bg: #0b0c10;
  --panel: #0f172a;
  --panel-alt: #111827;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --accent-strong: #38bdf8;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 14px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(56,189,248,0.08), transparent 30%), radial-gradient(circle at 80% 0%, rgba(99,102,241,0.1), transparent 28%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 60px; /* space for fixed footer */
}

/* Main takes remaining height so footer stays at viewport bottom when content is short */
body > main {
  flex: 1 0 auto;
  display: block;
  width: 100%;
}

/* Header / Navigation */

.site-header {
  display: grid;
  grid-template-columns: 2fr 1.5fr 2.5fr;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(15,23,42,0.95), rgba(8,47,73,0.9));
  border-bottom: 1px solid rgba(148, 163, 253, 0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left h1 {
  margin: 0;
  font-size: 20px;
  color: #e5e7eb;
}
.profile-banner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(148,163,253,0.4);
  object-fit: cover;
}
.profile-name { font-weight: 700; font-size: 16px; color: #e2e8f0; }
.profile-meta { color: #9ca3af; font-size: 13px; }
.profile-meta.small { font-size: 12px; }
.profile-ticker { color: #cbd5e1; font-size: 12px; margin-left: 6px; }

.nav-user {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.header-center {
  text-align: center;
}
.company-title { margin: 0; font-size: 18px; color: #e5e7eb; letter-spacing: 0.2px; }
.company-title { font-size: 20px; font-weight: 700; letter-spacing: 0.3px; }

.header-logo {
  max-height: 42px;
}

.header-right {
  text-align: right;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.lang-switch form { margin: 0; }
.lang-switch select {
  width: auto;
  min-width: 74px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 253, 0.35);
  background: rgba(255,255,255,0.04);
  color: #e5e7eb;
  font-size: 12px;
}
.lang-switch select:focus { outline: none; border-color: rgba(148, 163, 253, 0.7); }

.header-right a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  text-decoration: none;
  color: #cbd5e1;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 253, 0.2);
  background: rgba(255,255,255,0.02);
  transition: all 0.18s ease;
}

.header-right a:hover {
  color: #ffffff;
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(17, 24, 39, 0.9);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.nav-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-admin a {
  border-color: rgba(239,68,68,0.5);
  color: #fecdd3;
}
.nav-admin a:hover {
  border-color: rgba(239,68,68,0.7);
  background: rgba(127,29,29,0.25);
  color: #fff5f5;
}

/* Container / Content */

.container {
  padding: 26px 22px 140px;
  max-width: 1400px;
  margin: 0 auto;
  flex: 1 0 auto;
}
.section { margin-bottom: 24px; }
.muted { color: var(--muted); }

.grid {
  display: grid;
  gap: 16px;
}
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid.cols-2.wide { grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.settings-grid { grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 18px; }

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.card h3 { margin-top: 0; margin-bottom: 8px; }
.card .subline { color: var(--muted); margin-top: 0; }
.card.compact { padding: 12px 14px; border-radius: 12px; }
.card.compact h3 { font-size: 16px; margin-bottom: 4px; }
.card.compact .stat { font-size: 18px; }
.card.compact .stat-label { font-size: 12px; }
.card.half { max-width: 620px; }
.stat {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 4px;
}
.stat-label { color: var(--muted); font-size: 13px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(148,163,253,0.12);
  color: #e0e7ff;
  border: 1px solid rgba(148,163,253,0.4);
}
.pill.success { background: rgba(34,197,94,0.16); border-color: rgba(34,197,94,0.35); color: #bbf7d0; }
.pill.warn { background: rgba(245,158,11,0.18); border-color: rgba(245,158,11,0.4); color: #fef3c7; }
.pill.danger { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); color: #fecdd3; }

/* Flash-Messages */

.flashes {
  list-style: none;
  padding: 10px 14px;
  margin: 0 0 16px 0;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(129, 140, 248, 0.6);
  border-radius: 12px;
  color: #e5e7eb;
  box-shadow: 0 4px 18px rgba(0,0,0,0.7);
}

.flashes li + li {
  margin-top: 4px;
}
.warn { color: #f59e0b; font-weight: 600; }

/* Formulare */

label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: #9ca3af;
}

input,
textarea,
select {
  width: 100%;
  max-width: 640px;
  padding: 9px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: #020817;
  color: #e5e5e5;
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(129, 140, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%), linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  max-width: 520px;
}

.form-grid {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.form-grid .field { display: flex; flex-direction: column; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-grid .field.inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.field.inline label { margin: 0; }
.field.inline input[type="checkbox"] { width: auto; margin: 0 6px 0 0; }
.inline-input { flex: 1; max-width: 620px; margin-bottom: 0; }
.subsection-title {
  margin: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  color: var(--muted);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

/* Buttons */

button,
.button {
  display: inline-block;
  padding: 10px 16px;
  margin-top: 10px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.9);
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  color: #f9fafb;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

button:hover,
.button:hover {
  background: linear-gradient(90deg, #60a5fa, #93c5fd);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
  transform: translateY(-1px);
}
.button.small { padding: 6px 12px; font-size: 13px; }
.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: rgba(148,163,253,0.4);
}
.button.ghost {
  background: rgba(255,255,255,0.03);
  border-color: rgba(148,163,253,0.25);
}
.button.danger {
  border-color: rgba(239,68,68,0.7);
  background: linear-gradient(90deg, #ef4444, #f97316);
}

/* Tabellen */

.table-wrapper {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: visible;
  margin-top: 12px;
  min-width: 0;
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  min-width: 720px;
}

table.wide {
  min-width: 900px;
}

th,
td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  word-break: break-word;
}

.scrollable {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

th {
  text-align: left;
  background: var(--panel-alt);
  color: #cbd5e1;
  font-weight: 600;
  letter-spacing: 0.01em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(15, 23, 42, 0.95);
}

th.num, td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.mono, td.mono { font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace; white-space: nowrap; }

.list-plain {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}
.list-plain li {
  margin: 6px 0;
  color: var(--text);
}
.list-plain .stat-label { display: block; margin-top: 2px; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #e2e8f0;
  background: rgba(148, 163, 253, 0.15);
  border: 1px solid rgba(148, 163, 253, 0.3);
}
.badge.success { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.45); color: #bbf7d0; }
.badge.warn { background: rgba(245,158,11,0.2); border-color: rgba(245,158,11,0.4); color: #fed7aa; }
.badge.danger { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.45); color: #fecdd3; }

/* Footer */

footer {
  margin-top: 24px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(75, 85, 99, 0.7);
  background: #020817;
  color: #6b7280;
  font-size: 13px;
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
}
.site-footer .footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}
.site-footer .footer-right {
  color: #94a3b8;
  margin-left: auto;
}
.site-footer .footer-logo {
  height: 36px;
  width: auto;
}
.site-footer .footer-link {
  color: #cbd5e1;
  text-decoration: none;
}
.site-footer .footer-link:hover { color: #fff; }
.site-footer .footer-sep {
  color: #475569;
}
.users-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}
.users-grid .card {
  width: 100%;
}
.users-grid .actions {
  justify-content: flex-start;
}
