:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #1b1f2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 24px 60px;
  line-height: 1.5;
  background: radial-gradient(circle at top, #f7fbff 0%, #f0f4ff 40%, #e6ebf9 100%);
  color: #1f2433;
}

.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

.hero-header {
  background: url('../img/hintergrund.png') center/cover no-repeat;
  position: relative;
  padding: 48px 32px;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
  margin: 0 -24px 18px;
}

.hero-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}

.hero-left {
  flex: 0 1 auto;
  min-width: 260px;
}

.hero-right {
  flex: 0 0 auto;
}

.hero-logo {
  height: 140px;
  width: auto;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  color: #004e7a;
  margin: 0 0 12px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 2.6rem;
  color: #004e7a;
}

.hero-subtitle {
  margin: 0 0 20px;
  font-size: 1.2rem;
  color: #1f2433;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, #5b6dfd, #7a87ff);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 24px -15px rgba(15, 34, 68, 0.6);
}

.hero-btn.ghost {
  background: rgba(255, 255, 255, 0.8);
  color: #4b5dff;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  background: #004e7a;
  padding: 14px;
  border-radius: 16px;
  margin: -26px auto 24px;
  max-width: 960px;
  box-shadow: 0 25px 55px -35px rgba(0, 40, 70, 0.7);
}

.main-nav a {
  color: #fff;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}

h1 {
  margin-top: 0;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
}

h2 {
  margin-top: 30px;
  font-size: 1.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 25px 60px -35px rgba(69, 91, 173, 0.45);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 34, 68, 0.08);
}

th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6a94;
  background: #f4f6ff;
}

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

tr:hover {
  background: rgba(99, 125, 255, 0.06);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.pill.draft {
  background: rgba(255, 196, 0, 0.16);
  color: #b38200;
}

.pill.final {
  background: rgba(0, 200, 131, 0.18);
  color: #007a4d;
}

.pill.missing {
  background: rgba(255, 94, 138, 0.18);
  color: #c9184a;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 18px 0;
}

.page-link {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  color: #4b5dff;
  text-decoration: none;
  box-shadow: 0 8px 20px -15px rgba(15, 34, 68, 0.6);
  font-weight: 600;
}

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

.source-grid div {
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 15px 35px -25px rgba(33, 45, 118, 0.55);
}

.source-grid span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f7bb5;
}

.source-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  color: #1b2555;
}

.account-sources td {
  background: #f5f6ff;
}

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

.card {
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  box-shadow: 0 20px 45px -25px rgba(48, 75, 160, 0.6);
  border: 1px solid rgba(110, 140, 255, 0.15);
}

.card h3 {
  margin: 0 0 10px 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #7a88b9;
}

.card p {
  margin: 0;
  font-size: 2.1rem;
  font-variant-numeric: tabular-nums;
  color: #1b2555;
}

small {
  color: #7a88b9;
}

.period-form {
  margin: 24px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.period-form label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f7bb5;
  display: block;
  margin-bottom: 6px;
}

.period-form select,
.period-form input[type="text"] {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(54, 74, 171, 0.25);
  min-width: 220px;
  background: #fff;
}

.period-form button,
.btn-primary {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: #5b6dfd;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 25px -18px rgba(15, 34, 68, 0.8);
  cursor: pointer;
}

.action-link {
  display: inline-flex;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #4b5dff;
  font-weight: 600;
  box-shadow: 0 8px 24px -15px rgba(15, 34, 68, 0.8);
}

.table-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 25px 60px -35px rgba(69, 91, 173, 0.45);
}

.navbar {
  background: #2c3e50;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-radius: 16px;
}

.navbar a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.navbar a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.navbar .brand {
  font-size: 18px;
  font-weight: bold;
  margin-right: auto;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.card-plain {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input,
select,
textarea {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* MCP Dashboard Layout */
body.mcp-app {
  background: #f5f6fb;
  color: #1d2130;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  margin: 0;
}

body.mcp-app header {
  padding: 24px;
  border-bottom: 1px solid #e0e5f5;
  background: #ffffff;
  box-shadow: 0 10px 25px -22px rgba(15, 23, 42, 0.45);
}

body.mcp-app h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.3px;
}

body.mcp-app .muted {
  color: #7b8198;
  font-size: 0.9rem;
}

body.mcp-app main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body.mcp-app .stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

body.mcp-app .stack > section {
  width: 100%;
}

body.mcp-app .card {
  background: #ffffff;
  border: 1px solid rgba(32, 56, 117, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.55);
}

body.mcp-app .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

body.mcp-app .section-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

body.mcp-app label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 600;
}

body.mcp-app input,
body.mcp-app button {
  font: inherit;
  border-radius: 14px;
  border: 1px solid rgba(32, 56, 117, 0.18);
  padding: 10px 12px;
  background: #fff;
}

body.mcp-app button {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.mcp-app button.primary {
  background: #5b6dfd;
  color: #fff;
  border: none;
  box-shadow: 0 12px 24px -16px rgba(46, 69, 174, 0.8);
}

body.mcp-app button.danger {
  background: #d13a55;
  color: #fff;
  border: none;
  box-shadow: 0 12px 24px -18px rgba(185, 33, 74, 0.7);
}

body.mcp-app button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.mcp-app .pill {
  border-radius: 999px;
  border: 1px solid rgba(32, 56, 117, 0.15);
  padding: 6px 14px;
  font-size: 0.85rem;
  background: #f5f7fb;
  font-weight: 600;
}

body.mcp-app .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

body.mcp-app .grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

body.mcp-app .metric {
  border: 1px solid rgba(32, 56, 117, 0.12);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 14px 30px -25px rgba(18, 33, 79, 0.45);
}

body.mcp-app .metric .value {
  font-size: 1.9rem;
  font-weight: 600;
}

body.mcp-app table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: 0 16px 35px -30px rgba(18, 33, 79, 0.5);
}

body.mcp-app th,
body.mcp-app td {
  border: 1px solid rgba(32, 56, 117, 0.12);
  padding: 12px 14px;
  font-size: 0.9rem;
}

body.mcp-app thead {
  background: #eef1ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #6f7bb5;
}

body.mcp-app .service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

body.mcp-app .service-card {
  border: 1px solid rgba(32, 56, 117, 0.12);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.mcp-app .alert {
  padding: 14px;
  border-radius: 16px;
  border-left: 5px solid #5b6dfd;
  background: #e3e8ff;
}

body.mcp-app .msg {
  display: none;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid;
}

body.mcp-app .msg.ok {
  background: #e7ffe7;
  border-color: #7bd889;
  color: #168f53;
}

body.mcp-app .msg.bad {
  background: #ffe8ec;
  border-color: #f3a2b7;
  color: #c12d4f;
}

/* CRM Dashboard Layout */
.crm-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.crm-hero {
  margin-bottom: 32px;
}

.crm-hero .kpi-grid {
  margin-top: 18px;
}

.crm-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0 32px;
}

.crm-nav button {
  border: none;
  background: rgba(75, 93, 255, 0.12);
  color: #4b5dff;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.crm-nav button.active {
  background: #4b5dff;
  color: #fff;
  box-shadow: 0 12px 25px -18px rgba(75, 93, 255, 0.8);
}

.module-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 25px 55px -35px rgba(15, 34, 68, 0.45);
  border: 1px solid rgba(90, 110, 255, 0.1);
  margin-bottom: 24px;
}

.module-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.table-wrapper {
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 25px 55px -40px rgba(33, 45, 118, 0.5);
}

.table-wrapper table {
  margin: 0;
}

.status-pill {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pill.ok {
  background: rgba(0, 200, 131, 0.18);
  color: #007a4d;
}

.status-pill.warn {
  background: rgba(255, 196, 0, 0.16);
  color: #b38200;
}

.status-pill.error {
  background: rgba(255, 94, 138, 0.18);
  color: #c9184a;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2433;
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 20px 40px -30px rgba(15, 23, 42, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: #6f7bb5;
}

.search-bar-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-bar-inline input {
  flex: 1;
  min-width: 240px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(54, 74, 171, 0.25);
}

.search-bar-inline button {
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  background: #5b6dfd;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.pagination-bar button {
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(75, 93, 255, 0.1);
  color: #4b5dff;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }
  table {
    font-size: 0.9rem;
  }
  th,
  td {
    padding: 6px 8px;
  }
}
