/* =========================
   1. RESET & BASE
========================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: linear-gradient(180deg, #07192d 0%, #102a45 100%);
  color: #ffffff;
  min-height: 100vh;
}

/* =========================
   2. LAYOUT (HEADER / CONTENT)
========================= */

.site-header {
  background: rgba(4, 18, 33, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-area {
  padding: 40px 20px;
}

.content-box {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  color: #1b2430;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

/* =========================
   3. TYPOGRAPHY
========================= */

h1, h2, h3 {
  color: #0d2f57;
  margin-top: 0;
}

p {
  color: #2f3b4a;
}

/* =========================
   4. NAVIGATION
========================= */

.site-logo {
  height: 60px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  min-width: 110px;
  text-align: center;
  transition: background 0.2s ease;
}

.top-nav a:hover,
.top-nav a.active {
  background: #376da6;
}

/* USER MENU */

.user-menu {
  position: relative;
}

.user-menu-toggle {
  background: #376da6;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 180px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 200;
}

.user-menu-dropdown a {
  display: block;
  padding: 12px 16px;
  color: #1b2430;
  text-decoration: none;
}

.user-menu-dropdown a:hover {
  background: #eef4fb;
  color: #0d2f57;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
  display: block;
}

/* =========================
   5. BUTTONS
========================= */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: #1f5ea8;
  color: #fff;
  border: 1px solid #1f5ea8;
}

.btn-secondary {
  background: #eef4fb;
  color: #0d2f57;
  border: 1px solid #dce3ea;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;

  background: #b62323;
  color: #fff;
  border: 1px solid #b62323;
  cursor: pointer;
}

.btn-small {
  height: 40px;
  min-width: 100px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 10px;
}
/* =========================
   BUTTON INTERACTION
========================= */

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small,
.user-menu-toggle,
button {
  cursor: pointer;
}

/* =========================
   6. FORMS
========================= */

.login-form .form-row {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #0d2f57;
}

.login-form input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c9d2db;
}

/* =========================
   7. FEEDBACK
========================= */

.error-box {
  background: #ffe7e7;
  color: #8d1d1d;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.success-box {
  background: #e8f7e8;
  color: #1f6b1f;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

#mandant-create-error {
  margin-bottom: 14px;
}
/* =========================
   8. COMPONENTS
========================= */

.hero-box,
.pricing-section,
.info-section {
  margin-bottom: 30px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.image-panel img {
  width: 100%;
  border-radius: 12px;
}

/* =========================
   9. ADMIN PANEL
========================= */

.admin-panel {
  background: #f8fbff;
  border: 1px solid #dce3ea;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
}

.admin-actions {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
/* =========================
   ADMIN FORM LAYOUT
========================= */

.admin-grid-form {
  display: grid;
  grid-template-columns: 200px minmax(320px, 1fr);
  gap: 14px 20px;
  align-items: center;
  max-width: 760px;
}

.admin-grid-form .form-row {
  display: contents;
}

.admin-grid-form label {
  margin: 0;
  font-weight: 700;
  color: #0d2f57;
}

.admin-grid-form input[type="text"],
.admin-grid-form input[type="email"],
.admin-grid-form input[type="number"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
}

.form-row-full {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.table-actions .btn-primary,
.table-actions .btn-danger {
  min-width: 110px;
}
/* =========================
   10. TABLES
========================= */

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

.mandanten-table th {
  background: #eef4fb;
  color: #0d2f57;
  text-align: left;
  padding: 14px;
}

.mandanten-table td {
  padding: 14px;
  border-bottom: 1px solid #e7edf3;
}

.mandanten-table tr:hover td {
  background: #fbfdff;
}

/* =========================
   11. RESPONSIVE
========================= */

@media (max-width: 900px) {

  .two-col {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav a {
    min-width: auto;
  }
}

.group-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef4fb;
  color: #0d2f57;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #dce3ea;
}
/* =========================
   12. NEW USER
========================= */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 4px 0;
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #eef4fb;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  color: #0d2f57;
  font-weight: 600;
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
}

.admin-grid-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
  background: #fff;
}
/* =========================
   PRICING PAGE
========================= */

.pricing-hero {
  text-align: center;
  margin-bottom: 36px;
}

.pricing-hero h1 {
  font-size: 52px;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-lead {
  max-width: 980px;
  margin: 0 auto 16px;
  font-size: 22px;
  line-height: 1.5;
  color: #526172;
}

.pricing-note-strong {
  font-size: 18px;
  font-weight: 700;
  color: #0d2f57;
  margin-bottom: 0;
}

.pricing-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  align-items: start;
  margin-bottom: 40px;
}

.level-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
}

.level-card.featured {
  transform: translateY(-18px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.14);
}

.level-card-header {
  min-height: 150px;
  padding: 28px 24px 24px;
  background: linear-gradient(180deg, #7f8793 0%, #a5acb5 100%);
  color: #ffffff;
  text-align: center;
}

.level-card-header h2 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.15;
}

.level-card-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 17px;
  line-height: 1.35;
}

.level-a .level-card-header h2 {
  color: #1970c8;
}

.level-b .level-card-header h2 {
  color: #f2c200;
}

.level-c .level-card-header h2 {
  color: #e83a2d;
}

.level-card-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 26px 20px 24px;
  background: #f8fbff;
  border-bottom: 1px solid #dce3ea;
}

.level-card-price .currency {
  font-size: 28px;
  color: #7e8793;
}

.level-card-price .amount {
  font-size: 70px;
  line-height: 1;
  font-weight: 800;
}

.level-card-price .period {
  font-size: 18px;
  color: #7e8793;
}

.level-a .amount {
  color: #1970c8;
}

.level-b .amount {
  color: #d4aa00;
}

.level-c .amount {
  color: #e83a2d;
}

.level-card-body {
  padding: 28px 28px 30px;
}

.level-highlight {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #1b2430;
  margin-bottom: 18px;
}

.level-meta {
  font-size: 16px;
  color: #5f6c7b;
  margin-bottom: 20px;
}

.level-card-body hr {
  border: 0;
  border-top: 2px solid #d6dde6;
  margin: 22px 0 24px;
}

.level-module-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.level-module-list li {
  margin-bottom: 16px;
  color: #2f3b4a;
  line-height: 1.5;
}

.level-actions {
  margin-top: 24px;
}

.level-actions .btn-primary {
  width: 100%;
}

.pricing-bottom-note {
  margin-top: 18px;
}

/* =========================
   RESPONSIVE PRICING
========================= */

@media (max-width: 1200px) {
  .pricing-levels {
    grid-template-columns: 1fr;
  }

  .level-card.featured {
    transform: none;
  }

  .pricing-hero h1 {
    font-size: 40px;
  }

  .pricing-lead {
    font-size: 19px;
  }
}

@media (max-width: 700px) {
  .level-card-header {
    min-height: auto;
    padding: 22px 18px;
  }

  .level-card-header h2 {
    font-size: 24px;
  }

  .level-card-header p {
    font-size: 16px;
  }

  .level-card-price {
    flex-wrap: wrap;
    padding: 22px 18px;
  }

  .level-card-price .amount {
    font-size: 52px;
  }

  .level-card-price .period {
    width: 100%;
    text-align: center;
  }

  .level-card-body {
    padding: 22px 18px 24px;
  }

  .level-highlight {
    font-size: 21px;
  }
}

/* =========================
   COUNTRY SWITCH
========================= */

.country-switch-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}

.country-label {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.country-switch-form select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: #376da6;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.country-switch-form select:focus {
  outline: none;
  border-color: #8fb6e2;
  box-shadow: 0 0 0 3px rgba(143, 182, 226, 0.2);
}

/* =========================
   Kurse 
========================= */


.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.course-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.course-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

/* =========================
   Dokumente 
========================= */
.status-ok {
  color: #178b35;
  font-weight: 700;
}

.status-missing {
  color: #b62323;
  font-weight: 700;
}
.col-id {
  width: 60px;
}

.mandanten-table td,
.mandanten-table th {
  vertical-align: middle;
}

.file-block {
  display: flex;
  flex-direction: column;
}

.file-name {
  font-weight: 600;
  color: #3a2b7a;
  text-decoration: none;
}

.file-name:hover {
  text-decoration: underline;
}

.file-meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}


.admin-grid-form select,
.mandanten-table select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
  background: #fff;
}

/* ===============================
   Progress Bar Dokumente
   =============================== */

.progress-box {
  margin: 20px 0 30px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
  color: #334155;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5eaf0;
  border-radius: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #2e7d32);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.progress-red {
  background: #d32f2f;
}

.progress-yellow {
  background: #f9a825;
}

.progress-green {
  background: #2e7d32;
}

/* ===============================
   Home 
   =============================== */
.section {
  margin: 40px 0;
}

.section.alt {
  background: #f6f8fb;
  padding: 30px;
  border-radius: 16px;
}

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

.card {
  background: #fff;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #e3e8ef;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.cta-section {
  text-align: center;
}

.checkbox-group {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
}

/* ===============================
   Footer
   =============================== */

.site-footer {
  margin-top: 60px;
  padding: 20px 30px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 14px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ===============================
   Impressum / Legal
   =============================== */

.legal-section {
  padding: 10px 20px;
}

.legal-section h2 {
  margin-top: 0;
}

.legal-section ul {
  padding-left: 18px;
}

.legal-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.responsive-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .responsive-stack {
    grid-template-columns: 1fr;
  }
}

.admin-grid-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-size: 16px;
  box-sizing: border-box;
  resize: vertical;
  font-family: Arial, Helvetica, sans-serif;
}


/* assessment fragen */
/* Grundlayout */
.content-section.ai-explainer {
  padding: 40px 20px;
  background: #f9fafb;
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f2937;
  line-height: 1.6;
}

/* Titel */
.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #111827;
}

/* Lead Text */
.lead {
  font-size: 18px;
  margin-bottom: 20px;
}

/* Standard Paragraph */
.content-wrapper p {
  margin-bottom: 16px;
}

/* Listen */
.example-list,
.key-points {
  margin: 15px 0 20px 20px;
  padding: 0;
}

.example-list li,
.key-points li {
  margin-bottom: 8px;
}

/* Quote / Highlight */
.highlight-quote {
  margin: 25px 0;
  padding: 20px;
  background: #eef2ff;
  border-left: 5px solid #6366f1;
  font-size: 18px;
  font-weight: 500;
  color: #1e3a8a;
  border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .section-title {
    font-size: 22px;
  }

  .lead {
    font-size: 16px;
  }

  .highlight-quote {
    font-size: 16px;
  }
}

.mandanten-table textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
  font-family: Arial, Helvetica, sans-serif;
}

/* ===============================
   Kursverwaltung Tabelle
   =============================== */

.input-small {
  width: 60px;
  padding: 6px 8px;
}

.input-full {
  width: 100%;
  margin-bottom: 6px;
}

.textarea-inline {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
}

/* ===============================
   Kursfortschritt (grün/grau)
   =============================== */

.course-progress-box {
  margin-bottom: 24px;
}

.course-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
  color: #334155;
}

/* Hintergrund = grau */
.course-progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb; /* grau */
  border-radius: 8px;
  overflow: hidden;
}

/* Fortschritt = grün */
.course-progress-fill {
  height: 100%;
  background: #22c55e; /* grün */
  border-radius: 8px;
  transition: width 0.3s ease;
}

/* ===============================
   CSV Upload User
   =============================== */

.upload-panel {
  max-width: 1100px;
}

.upload-form {
  margin-top: 8px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}

.upload-main {
  background: #f8fbff;
  border: 1px solid #dce3ea;
  border-radius: 16px;
  padding: 24px;
}

.upload-label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: #0d2f57;
  font-size: 20px;
}

.upload-info-card {
  background: #f8fbff;
  border: 1px solid #dce3ea;
  border-radius: 16px;
  padding: 24px;
}

.upload-info-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #0d2f57;
}

.upload-info-card h2:not(:first-child) {
  margin-top: 22px;
}

.upload-code {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef4fb;
  border: 1px solid #dce3ea;
  color: #0d2f57;
  font-family: monospace;
  font-size: 18px;
}

.upload-example {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: monospace;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: auto;
}

.upload-hints {
  margin: 0;
  padding-left: 18px;
}

.upload-hints li {
  margin-bottom: 8px;
}

.upload-actions {
  margin-top: 24px;
}

.error-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

@media (max-width: 900px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

.admin-actions-spaced {
  margin-bottom: 22px;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: #f8fbff;
  border: 1px solid #dce3ea;
  border-radius: 12px;
  color: #334155;
}

.status-legend strong {
  color: #0d2f57;
}

.admin-subtitle {
  margin: 6px 0 0;
  color: #526172;
}

/* ===============================
   Profil Layout
   =============================== */

.profile-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  row-gap: 14px;
  column-gap: 20px;
  align-items: center;
  margin-top: 20px;
}

/* Labels linksbündig */
.profile-label {
  text-align: left;
  font-weight: 700;
  color: #1e3a5f;
}

/* Werte */
.profile-value {
  color: #1f2937;
}

/* Gruppen-Badges */
.badge {
  display: inline-block;
  padding: 6px 14px;
  margin-right: 8px;
  border-radius: 999px;
  background: #e7edf5;
  color: #1e3a5f;
  font-weight: 600;
  font-size: 14px;
}

@media (max-width: 700px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-label {
    margin-top: 10px;
  }
}

.profile-label {
  color: #64748b;
}

.profile-value {
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-card {
  padding: 16px;
  background: #f8fbff;
  border: 1px solid #dce3ea;
  border-radius: 12px;
}

.dashboard-value {
  font-size: 28px;
  font-weight: bold;
}


.report-filters {
  margin: 20px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 16px;
  border-radius: 10px;
  font-weight: 600;
}

/* ===============================
   Kursübersicht User
   =============================== */

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

.course-card {
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.course-card-completed {
  background: #eaf8ee;
  border: 1px solid #9fd3ac;
}

.course-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.course-code {
  font-size: 14px;
  font-weight: 800;
  color: #0d2f57;
  letter-spacing: 0.04em;
}

.course-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.course-badge-completed {
  background: #22c55e;
  color: #ffffff;
}

.course-card h3 {
  margin: 0 0 10px;
  color: #0d2f57;
}

.course-card p {
  margin: 0 0 16px;
  color: #475569;
}

.course-actions {
  margin-top: 10px;
}

/* Kurs Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* Karte */
.course-card {
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

/* Fertig */
.course-card-completed {
  background: #eaf8ee;
  border: 1px solid #9fd3ac;
}

/* Header */
.course-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* Code */
.course-code {
  font-weight: 800;
  color: #0d2f57;
}

/* Badge */
.course-badge {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.course-badge-completed {
  background: #22c55e;
  color: white;
}

/* Progress */
.progress-box {
  margin: 10px 0 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: #475569;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e5eaf0;
  border-radius: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #15803d);
}

/* ===============================
   User Dropdown Menü (neu)
   =============================== */

.user-menu {
  position: relative;
}

.user-menu-btn {
  background: #eef3f9;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: #1f2f46;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 10px 0;
  display: none;
  z-index: 1000;
}

/* Hover öffnen */
.user-menu:hover .user-dropdown {
  display: block;
}

/* Gruppen */
.menu-group {
  padding: 6px 0;
}

/* Titel */
.menu-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding: 6px 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Links */
.user-dropdown a {
  display: block;
  padding: 10px 16px;
  color: #1f2937;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}

/* Hover Effekt */
.user-dropdown a:hover {
  background: #f1f5f9;
}

/* Separator */
.menu-separator {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

/* Pastell-Hintergründe pro Gruppe */

.menu-group:nth-child(1) {
  background: #f8fafc;
}

.menu-group:nth-child(3) {
  background: #f0fdf4;
}

.menu-group:nth-child(5) {
  background: #fefce8;
}

.menu-group:nth-child(7) {
  background: #fdf2f8;
}

/*********************/
/*. User Menü        */
/*********************/
.top-nav a,
.user-menu-btn,
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 44px;
  min-width: 140px;   /* 👈 gleich breit */
  padding: 0 18px;

  border-radius: 22px;
  font-weight: 600;
  font-size: 15px;

  box-sizing: border-box;
}

.top-nav a,
.lang-btn {
  gap: 8px;
}

.user-menu {
  position: relative;
}

/* 🔥 WICHTIG: kein Abstand mehr */
.user-dropdown {
  position: absolute;
  right: 0;
  top: 100%;          /* direkt anschließen */
  margin-top: 4px;    /* kleiner Abstand erlaubt */

  min-width: 240px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);

  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: all 0.2s ease;
}

/* 🔥 Hover stabil */
.user-menu:hover .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  height: 10px;
  width: 100%;
}

/* ===============================
   Error Pages
   =============================== */

.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

.error-card {
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border-radius: 18px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.error-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.error-card h1 {
  margin-bottom: 10px;
  color: #0d2f57;
}

.error-card p {
  color: #475569;
  margin-bottom: 25px;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  background: #e2e8f0;
  color: #1f2937;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

.form-hint {
  margin-top: 8px;
  font-size: 14px;
  color: #526172;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.checkbox-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #dce3ea;
  border-radius: 14px;
  background: #f8fbff;
  cursor: pointer;
  font-weight: 600;
  color: #1e3a5f;
}

.checkbox-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.admin-table th {
  text-align: left;
  padding: 10px;
  background: #f1f5f9;
}

.admin-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.status-active {
  color: #15803d;
  font-weight: 600;
}

.status-inactive {
  color: #b91c1c;
  font-weight: 600;
}

/* Level Badges */
.level-badge {
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}

.level-1 {
  background: #dcfce7;
  color: #166534;
}

.level-2 {
  background: #fef9c3;
  color: #854d0e;
}

.level-3 {
  background: #e0f2fe;
  color: #075985;
}

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

/* Basis Button */
.btn-icon {
  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  border: 1px solid transparent;

  font-size: 15px;
  cursor: pointer;

  transition: all 0.2s ease;
}

/* EDIT */
.btn-edit {
  background: #e0f2fe;
  color: #075985;
}

.btn-edit:hover {
  background: #bae6fd;
  transform: translateY(-1px);
}

/* DELETE */
.btn-delete {
  background: #fee2e2;
  color: #991b1b;
  border: none;
}

.btn-delete:hover {
  background: #fecaca;
  transform: translateY(-1px);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* kleines Level-Icon */
.user-level-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}

/* Farben passend zu deinen Badges */

/* 🟡 GOLD */

.level-1 {

  background: linear-gradient(145deg, #ffd700, #e6b800);

  border: 1px solid #c9a200;

}

/* ⚪ SILBER */

.level-2 {

  background: linear-gradient(145deg, #d1d5db, #9ca3af);

  border: 1px solid #6b7280;

}

/* 🟤 BRONZE */

.level-3 {

  background: linear-gradient(145deg, #cd7f32, #a65a1f);

  border: 1px solid #7c3e0a;

}

/* =========================================
   Dokumente - überarbeitetes Layout
========================================= */

.page-header-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 18px;
}

.page-header-with-actions h1 {
  margin-bottom: 12px;
}

.intro-text {
  margin: 0;
  max-width: 980px;
  line-height: 1.55;
}


/* Dokument-Tabelle */

.documents-panel {
  overflow: hidden;
}

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

.documents-table {
  min-width: 1150px;
}

.documents-table th {
  white-space: nowrap;
}

.documents-table td {
  vertical-align: middle;
}

.document-level {
  font-weight: 600;
}

.document-empty {
  color: #64748b;
}


/* =========================================
   Dokumentvorlage
========================================= */

.template-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}


/* =========================================
   Upload Aktionen
========================================= */

.document-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;

  min-width: 210px;
}


/*
  Wichtig:
  Abstand zwischen Dateiauswahl und Hochladen
*/

.document-upload-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* schöner eigener Datei-Button */

.file-picker {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  width: 100%;
  min-height: 42px;

  padding: 9px 12px;

  border: 1px solid #cfd8e3;
  border-radius: 10px;

  background: #ffffff;

  color: #334155;
  font-size: 13px;

  cursor: pointer;

  overflow: hidden;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.file-picker:hover {
  background: #f8fbff;
  border-color: #9fb6d0;
}

.file-picker input[type="file"] {
  display: none;
}

.file-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Upload */

.document-upload-button {
  width: 100%;
}


/* Löschen */

.document-delete-button {
  width: 100%;
}


/* =========================================
   Hilfe Button
========================================= */

.help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 auto;

  min-width: 110px;
  height: 44px;

  padding: 0 18px;

  border: 1px solid #cbd5e1;
  border-radius: 22px;

  background: #eef4fb;
  color: #0d2f57;

  font-size: 15px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.help-button:hover {
  background: #dceafb;
  border-color: #a6bed8;
  transform: translateY(-1px);
}


/* =========================================
   Hilfe Modal
========================================= */

body.modal-open {
  overflow: hidden;
}

.help-modal {
  position: fixed;
  inset: 0;

  display: none;

  z-index: 5000;
}

.help-modal.open {
  display: block;
}


.help-modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(5, 18, 35, 0.7);

  backdrop-filter: blur(3px);
}


.help-modal-dialog {
  position: relative;

  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 70px);

  margin: 35px auto;

  display: flex;
  flex-direction: column;

  background: #ffffff;

  border-radius: 20px;

  box-shadow:
    0 30px 80px
    rgba(0, 0, 0, 0.35);

  overflow: hidden;
}


/* Header */

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding: 24px 28px;

  background:
    linear-gradient(
      180deg,
      #f8fbff 0%,
      #eef4fb 100%
    );

  border-bottom:
    1px solid #dce3ea;
}

.help-modal-header h2 {
  margin: 0 0 8px;
}


.help-role-badge {
  display: inline-flex;

  padding: 5px 11px;

  border-radius: 999px;

  background: #dceafb;
  color: #0d2f57;

  font-size: 12px;
  font-weight: 700;
}


/* Schließen X */

.help-close {
  width: 38px;
  height: 38px;

  border: 0;
  border-radius: 50%;

  background: transparent;

  color: #475569;

  font-size: 30px;
  line-height: 1;

  cursor: pointer;
}

.help-close:hover {
  background: #e2e8f0;
}


/* Body */

.help-modal-body {
  flex: 1;

  overflow-y: auto;

  padding: 28px;
}

.help-section {
  margin-bottom: 34px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  margin-bottom: 10px;
}

.help-section p,
.help-section li {
  line-height: 1.55;
}

.help-section ol,
.help-section ul {
  padding-left: 24px;
}


/* =========================================
   Screenshots in Hilfe
========================================= */

.help-image-placeholder {
  position: relative;

  margin-top: 18px;

  padding: 10px;

  background: #f8fafc;

  border: 1px solid #dce3ea;
  border-radius: 14px;

  overflow: hidden;
}

.help-image-placeholder img {
  display: block;

  width: 100%;
  height: auto;

  border-radius: 9px;
}

.help-image-placeholder span {
  display: none;
}


/* Falls Screenshot noch nicht vorhanden */

.help-image-placeholder.image-missing {
  min-height: 150px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 2px dashed #cbd5e1;

  color: #64748b;
}

.help-image-placeholder.image-missing img {
  display: none;
}

.help-image-placeholder.image-missing span {
  display: block;

  font-size: 14px;
}


/* =========================================
   Modal Footer
========================================= */

.help-modal-footer {
  display: flex;
  justify-content: flex-end;

  padding: 18px 28px;

  background: #f8fafc;

  border-top:
    1px solid #e2e8f0;
}


/* =========================================
   Mobile
========================================= */

@media (max-width: 800px) {

  .page-header-with-actions {
    flex-direction: column;
  }

  .help-button {
    align-self: flex-start;
  }

  .help-modal-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);

    margin: 10px auto;
  }

  .help-modal-header,
  .help-modal-body,
  .help-modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

}
/* =========================================================
   V2.2 - Dokumentenworkflow
========================================================= */
.documents-table { min-width: 1280px; }
.document-progress-box { margin-bottom: 14px; }
.document-status-legend {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px;
}
.doc-status {
  display: inline-flex; align-items: center; padding: 6px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}
.doc-status-missing { background: #f1f5f9; color: #64748b; }
.doc-status-uploaded { background: #dbeafe; color: #1d4ed8; }
.doc-status-approved { background: #dcfce7; color: #166534; }
.doc-status-rejected { background: #fee2e2; color: #991b1b; }
.required-badge, .optional-badge {
  display: inline-flex; margin-top: 7px; padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.required-badge { background: #fff1f2; color: #be123c; }
.optional-badge { background: #f1f5f9; color: #64748b; }
.document-description-cell { min-width: 210px; max-width: 320px; }
.document-template-btn { width: 100%; white-space: nowrap; }
.document-actions {
  display: flex; flex-direction: column; gap: 12px; min-width: 210px;
}
.document-upload-form { display: flex; flex-direction: column; gap: 12px; }
.file-picker {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 42px; padding: 9px 12px; border: 1px solid #cfd8e3;
  border-radius: 10px; background: #fff; color: #334155; font-size: 13px;
  font-weight: 600; cursor: pointer; overflow: hidden;
}
.file-picker:hover { background: #eef4fb; border-color: #9fb6d0; }
.file-picker input[type="file"] { display: none; }
.file-picker-label {
  display: block; width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: center;
}
.document-upload-button, .document-delete-button, .document-delete-form { width: 100%; }
.document-review-form {
  border-top: 1px solid #e2e8f0; padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.document-review-form textarea {
  width: 100%; min-height: 70px; resize: vertical; padding: 9px 10px;
  border: 1px solid #cfd8e3; border-radius: 10px; font: inherit;
}
.document-review-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-approve, .btn-reject {
  border: 0; border-radius: 10px; font-weight: 700; cursor: pointer;
}
.btn-approve { background: #dcfce7; color: #166534; }
.btn-approve:hover { background: #bbf7d0; }
.btn-reject { background: #fee2e2; color: #991b1b; }
.btn-reject:hover { background: #fecaca; }
.review-comment {
  margin-top: 8px; padding: 8px 10px; background: #f8fafc;
  border-radius: 8px; color: #475569; font-size: 12px;
}
.document-history { margin-top: 10px; }
.document-history summary { cursor: pointer; font-size: 12px; color: #0d2f57; font-weight: 700; }
.document-history-list { margin-top: 7px; display: flex; flex-direction: column; gap: 6px; }
.document-history-item {
  display: flex; flex-direction: column; gap: 2px; padding: 7px 9px;
  background: #f8fafc; border-radius: 8px; font-size: 11px;
}
.document-history-item a { color: #1f5ea8; font-weight: 700; }
.document-history-item span { color: #64748b; }

/* V2.2 - Checklistenverwaltung */
.checklist-table { min-width: 1220px; }
.checklist-required-toggle { width: fit-content; }
.checklist-inline-check {
  display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px;
}
.checklist-template-cell { min-width: 230px; }
.checklist-template-upload { width: 100%; margin-top: 8px; font-size: 12px; }
.table-actions-vertical { flex-direction: column; align-items: stretch; }
.table-actions-vertical .btn-small { width: 100%; }

/* V2.2 - Kursvalidierung */
.course-validation-ok { color: #166534; font-weight: 700; }
.course-validation-warning { color: #b45309; font-weight: 700; }
.course-validation-error { color: #b91c1c; }


/* =========================================================
   V2.2.1 - breite Verwaltungsseiten
   Dokumenten- und Checklisten-Tabellen sollen auf Desktop
   vollständig sichtbar sein, ohne dass die Aktionsspalte
   abgeschnitten wird.
========================================================= */
.content-box.content-box-wide {
  max-width: 1720px;
}

.content-box-wide .admin-panel {
  width: 100%;
}

.content-box-wide .table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.content-box-wide .documents-table,
.content-box-wide .checklist-table {
  width: 100%;
}

.content-box-wide .documents-table {
  min-width: 1420px;
}

.content-box-wide .checklist-table {
  min-width: 1460px;
}

.content-box-wide .documents-table th:last-child,
.content-box-wide .documents-table td:last-child {
  min-width: 230px;
}

.content-box-wide .checklist-table th:last-child,
.content-box-wide .checklist-table td:last-child {
  min-width: 180px;
}

@media (max-width: 1500px) {
  .content-box.content-box-wide {
    max-width: calc(100vw - 32px);
    padding-left: 22px;
    padding-right: 22px;
  }
}

/* ========================= V3.0 LICENSING / STRIPE ========================= */
.license-pricing-hero{text-align:center;max-width:1000px;margin:0 auto 42px}.license-pricing-hero h1{font-size:36px;margin:0 0 24px}.license-pricing-hero p{color:#5f6c7b;line-height:1.55;margin:8px 0}.license-vat-note{margin-top:20px!important}.license-price-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;align-items:stretch}.license-price-card{background:#fff;border:1px solid #dce3ea;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 10px 28px rgba(20,42,66,.07)}.license-price-card.featured{border:2px solid #2aa391;transform:translateY(-8px)}.license-price-head{background:#aeb1b4;color:#fff;text-align:center;padding:18px 14px}.license-price-head h2{font-size:25px;margin:0 0 5px}.license-price-head strong{color:#087f70}.trial-card .license-price-head{background:#52779d}.trial-card .license-price-head strong{color:#fff}.license-price{min-height:118px;display:flex;align-items:center;justify-content:center;gap:5px;border-bottom:1px solid #e2e8f0}.license-price .license-amount{font-size:52px;color:#2aa391;font-weight:400}.license-price .license-currency{color:#687684}.license-price>span:last-child{color:#687684}.license-price-body{padding:22px;display:flex;flex-direction:column;flex:1}.license-price-body ul{padding-left:20px;line-height:1.55;flex:1}.license-price-body li{margin-bottom:9px}.license-price-body .btn-primary{text-align:center}.audit-addon{margin-top:34px;background:#fff;border:1px solid #dce3ea;border-radius:18px;padding:30px;display:grid;grid-template-columns:2fr 1fr;gap:34px;box-shadow:0 10px 28px rgba(20,42,66,.07)}.addon-kicker{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:#2a9d8f;font-weight:800}.audit-addon h2{margin:8px 0 10px}.audit-addon li{margin:8px 0}.addon-buy{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border-left:1px solid #e2e8f0;padding-left:28px}.addon-buy .license-amount{font-size:52px;color:#2aa391}.order-panel{max-width:900px;margin:0 auto}.order-test-banner{padding:12px 14px;margin-bottom:20px;border-radius:10px;background:#fff7d6;border:1px solid #f2d36b;color:#6f5700;font-weight:700}.order-consent{display:flex;gap:10px;align-items:flex-start}.order-summary{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;background:#f3f8fb;border-radius:12px;font-size:18px}.order-summary strong{font-size:24px;color:#087f70}.payment-state{max-width:820px;margin:30px auto;background:#fff;border:1px solid #dce3ea;border-radius:18px;padding:34px;text-align:center}.payment-state.success{border-top:5px solid #2aa391}.payment-facts{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:28px 0}.payment-facts div{background:#f5f8fb;border-radius:12px;padding:16px}.payment-facts span,.payment-facts strong{display:block}.payment-facts span{font-size:13px;color:#64748b;margin-bottom:6px}@media(max-width:1100px){.license-price-grid{grid-template-columns:repeat(2,1fr)}.license-price-card.featured{transform:none}}@media(max-width:700px){.license-price-grid,.audit-addon,.payment-facts{grid-template-columns:1fr}.addon-buy{border-left:0;border-top:1px solid #e2e8f0;padding:24px 0 0}.license-pricing-hero h1{font-size:30px}}

/* V3.0.1 pricing */
.cv-five-plans { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; }
.enterprise-price { font-size: 1rem !important; line-height: 1.15; text-align:center; max-width:100%; }
@media (max-width: 1250px) { .cv-five-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cv-five-plans { grid-template-columns: 1fr; } }


/* =========================
   V3.0.4 – Lizenzübersichten
========================= */
.license-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
.license-summary-card {
  background: #ffffff;
  border: 1px solid #dce3ea;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 18px rgba(20, 42, 66, 0.05);
}
.license-summary-card .license-summary-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: 7px;
}
.license-summary-card strong {
  display: block;
  font-size: 20px;
  color: #17324d;
}
.license-summary-card small,
.license-status-text,
.muted { color: #64748b; }
.col-license-users,
.col-license-date { white-space: nowrap; }
.col-license { min-width: 130px; }

@media (max-width: 950px) {
  .license-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .license-summary-grid { grid-template-columns: 1fr; }
}


/* =========================
   V3.0.5 – Mandanten-/Lizenzverwaltung
========================= */
.admin-mandanten-panel {
  overflow: hidden;
}

.admin-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.admin-mandanten-table {
  width: 100%;
  min-width: 1320px;
  table-layout: fixed;
}

.admin-mandanten-table th:nth-child(1),
.admin-mandanten-table td:nth-child(1) { width: 58px; }

.admin-mandanten-table th:nth-child(2),
.admin-mandanten-table td:nth-child(2) { width: 235px; }

.admin-mandanten-table th:nth-child(3),
.admin-mandanten-table td:nth-child(3) { width: 235px; }

.admin-mandanten-table th:nth-child(4),
.admin-mandanten-table td:nth-child(4) { width: 250px; }

.admin-mandanten-table th:nth-child(5),
.admin-mandanten-table td:nth-child(5) { width: 105px; }

.admin-mandanten-table th:nth-child(6),
.admin-mandanten-table td:nth-child(6) { width: 150px; }

.admin-mandanten-table th:nth-child(7),
.admin-mandanten-table td:nth-child(7) { width: 120px; }

.admin-mandanten-table th:nth-child(8),
.admin-mandanten-table td:nth-child(8) { width: 220px; }

.admin-mandanten-table input[type="text"],
.admin-mandanten-table input[type="email"],
.admin-mandanten-table input[type="number"],
.admin-mandanten-table input[type="date"],
.admin-mandanten-table select {
  width: 100%;
  min-width: 0;
}

.admin-row-actions {
  white-space: nowrap;
}

.admin-row-actions .btn,
.inline-action-form {
  display: inline-block;
  vertical-align: middle;
}

.admin-row-actions .btn {
  margin: 2px 4px 2px 0;
}

.license-editor-row td {
  padding: 0 !important;
  background: #f8fafc;
}

.license-editor {
  padding: 20px 24px 22px;
  border-top: 1px solid #d9e2ec;
  border-bottom: 1px solid #d9e2ec;
}

.license-editor-form {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr .8fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.license-editor-form .form-row {
  margin: 0;
}

.license-editor-main-actions {
  margin: 0;
}

.license-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.license-admin-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: #64748b;
}

.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
}

.form-row-wide {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .license-editor-form {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
  .admin-create-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .license-editor-form,
  .admin-create-grid {
    grid-template-columns: 1fr;
  }
  .form-row-wide {
    grid-column: auto;
  }
}


/* =========================
   V3.0.6 – Aktionen immer sichtbar
========================= */

/*
 * Die Tabelle darf weiterhin horizontal scrollen, die Aktionsspalte bleibt
 * jedoch permanent am rechten Rand des sichtbaren Tabellenbereichs stehen.
 */
.admin-table-scroll {
  position: relative;
  overflow-x: auto;
}

.admin-mandanten-table th.actions-head,
.admin-mandanten-table td.admin-row-actions {
  position: sticky;
  right: 0;
  background: #f8fafc;
  border-left: 1px solid #d9e2ec;
  box-shadow: -10px 0 16px rgba(15, 23, 42, 0.08);
}

.admin-mandanten-table th.actions-head {
  z-index: 20;
  background: #eef2f6;
}

.admin-mandanten-table td.admin-row-actions {
  z-index: 15;
  min-width: 230px;
  width: 230px;
}

/* Die Buttons bleiben vollständig innerhalb der fixierten Spalte. */
.admin-row-actions {
  white-space: normal;
}

.admin-row-actions .btn,
.admin-row-actions .inline-action-form {
  display: inline-block;
  margin: 3px 4px 3px 0;
  vertical-align: middle;
}

.admin-row-actions .btn {
  min-width: 66px;
}

/*
 * Lizenz-Editor-Zeilen überspannen die gesamte Tabelle und benötigen
 * keine zusätzliche sticky Aktionszelle.
 */
.license-editor-row td {
  position: static;
}

/* Bei schmaleren Viewports wird die Aktionsspalte kompakter,
   bleibt aber weiterhin permanent sichtbar. */
@media (max-width: 900px) {
  .admin-mandanten-table th:nth-child(8),
  .admin-mandanten-table td:nth-child(8) {
    width: 190px;
  }

  .admin-mandanten-table td.admin-row-actions {
    min-width: 190px;
    width: 190px;
  }

  .admin-row-actions .btn {
    font-size: 12px;
    padding-left: 8px;
    padding-right: 8px;
    min-width: auto;
  }
}


/* =========================
   V3.0.7 – breitere Adminansicht / Lizenz speichern sichtbar
========================= */

/* Die Mandantenverwaltung nutzt nahezu die gesamte Browserbreite. */
.content-box.admin-mandanten-content {
  max-width: min(1840px, calc(100vw - 28px));
  width: 100%;
}

/* Trotz breiter Tabelle bleibt rechts Platz für die sticky Aktionsspalte. */
.admin-mandanten-table {
  min-width: 1440px;
}

/* 4 Buttons: Speichern / User / Lizenz / Löschen */
.admin-mandanten-table th:nth-child(8),
.admin-mandanten-table td:nth-child(8),
.admin-mandanten-table td.admin-row-actions {
  width: 300px;
  min-width: 300px;
}

/* Lizenzfelder dürfen die verfügbare Breite vollständig verwenden. */
.license-editor-form {
  grid-template-columns:
    minmax(180px, 1.25fr)
    minmax(170px, 1.15fr)
    minmax(140px, .8fr)
    minmax(180px, 1fr)
    minmax(180px, 1fr);
  gap: 16px;
  width: 100%;
}

/* Der Speichern-Button liegt bewusst in einer eigenen Zeile.
   Er kann dadurch nie rechts außerhalb des Sichtbereichs verschwinden. */
.license-editor-save-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
}

.license-save-btn {
  min-width: 180px;
  font-weight: 700;
}

.license-quick-actions {
  margin-top: 12px;
}

/* Read-only Useransicht */
.admin-readonly-users-table {
  width: 100%;
  min-width: 1050px;
}

@media (max-width: 1100px) {
  .content-box.admin-mandanten-content {
    max-width: calc(100vw - 16px);
  }

  .license-editor-form {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 650px) {
  .license-editor-form {
    grid-template-columns: 1fr;
  }
}

/* V3.1 */
.cv-five-plans { grid-template-columns: repeat(5,minmax(0,1fr)); align-items:stretch; }
.license-price-card { display:flex; flex-direction:column; }
.license-price-body { display:flex; flex-direction:column; flex:1; }
.license-price-body .btn-primary { margin-top:auto; }
.document-template-config-link { display:flex; justify-content:flex-end; margin-bottom:16px; }
@media(max-width:1200px){.cv-five-plans{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:700px){.cv-five-plans{grid-template-columns:1fr;}}


/* =========================
   V3.1.1 – Compliance Audit UI
========================= */

/* Alle breiten Tabellen bleiben vollständig bedienbar.
   Wenn der Viewport zu schmal ist, wird horizontal gescrollt. */
.table-wrap,
.admin-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.documents-table {
  min-width: 1280px;
}

.documents-table th:last-child,
.documents-table td:last-child {
  min-width: 250px;
}

/* Der Aktionsbereich soll nicht zusammengedrückt werden. */
.documents-table .document-actions,
.documents-table td:last-child {
  white-space: nowrap;
}

/* Mandanten-Vorlageneinstellungen ebenfalls scrollbar statt abgeschnitten. */
.admin-section .mandanten-table {
  min-width: 900px;
}

/* Keine Level-Spalte mehr im Compliance Cockpit. */
.documents-table .required-badge,
.documents-table .optional-badge {
  display: inline-block;
  margin: 0 8px 8px 0;
}

/* Einstellungen optisch klar vom Cockpit trennen. */
.document-template-config-link {
  margin-bottom: 18px;
}

/* V3.1.2 – globaler Vorlagenpool */
.template-library-upload {
  display:flex;
  gap:18px;
  align-items:end;
  flex-wrap:wrap;
  margin-bottom:18px;
}
.template-library-upload .form-row { margin:0; min-width:280px; }
.template-library-table { min-width:760px; }
.template-library-table td:last-child { width:260px; white-space:nowrap; }
.checklist-template-cell .status-missing { display:block; margin-top:7px; }
.checklist-template-cell .status-ok { display:block; margin-top:7px; }

/* V3.1.3 */
#order-submit:disabled { opacity:.48; cursor:not-allowed; filter:grayscale(.2); }
.order-consent a { text-decoration:underline; }
.legal-page { max-width:900px; margin:0 auto; line-height:1.65; }
.legal-page h2 { margin-top:0; }

/* V3.1.4 */
.license-documentation-title {
  margin: 24px 0 8px;
  font-size: 1.35rem;
  line-height: 1.25;
  color: #163b68;
}
.enterprise-contact-btn {
  font-size: 0.82rem !important;
  line-height: 1.15 !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  white-space: normal;
}
.payment-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .payment-facts { grid-template-columns: 1fr; }
}

/* V3.2.2: Bestellformular – saubere Zeilen und linksbündige Labels */
.order-panel .order-form { display:grid; grid-template-columns:minmax(190px, 235px) minmax(0, 1fr); column-gap:24px; row-gap:14px; max-width:none; align-items:start; }
.order-panel .order-form .form-row { display:contents; }
.order-panel .order-form .form-row > label:not(.order-consent) { grid-column:1; text-align:left; justify-self:start; padding-top:12px; margin:0; }
.order-panel .order-form .form-row > input, .order-panel .order-form .form-row > select, .order-panel .order-form .order-vat-input { grid-column:2; width:100%; min-width:0; box-sizing:border-box; }
.order-panel .order-form input:not([type=checkbox]), .order-panel .order-form select { min-height:44px; width:100%; box-sizing:border-box; }
.order-panel .order-form .order-section-heading { display:block; grid-column:1 / -1; margin:12px 0 0; }
.order-panel .order-form .order-section-heading h3 { margin:0; font-size:1.1rem; }
.order-panel .order-form .order-vat-input small { display:block; margin-top:6px; line-height:1.4; color:#526478; }
.order-panel .order-form .order-consent-row { display:block; grid-column:2; margin:0; }
.order-panel .order-form .order-consent { display:flex; align-items:flex-start; font-weight:600; line-height:1.4; }
.order-panel .order-form .order-consent input { flex:none; margin-top:4px; }
.order-panel .order-form .form-row-full:has(.order-summary), .order-panel .order-form .form-row-full:has(.admin-actions) { display:block; grid-column:1 / -1; margin:8px 0 0; }
.order-panel .order-form .order-summary { justify-content:flex-start; gap:18px; }
.order-panel .order-form .order-required { color:#b42318; font-weight:800; }
@media(max-width:680px){.order-panel .order-form{grid-template-columns:minmax(0,1fr);row-gap:8px}.order-panel .order-form .form-row{display:flex;flex-direction:column;gap:6px;margin:0 0 9px}.order-panel .order-form .form-row > label:not(.order-consent){padding:0}.order-panel .order-form .order-section-heading,.order-panel .order-form .order-consent-row,.order-panel .order-form .form-row-full:has(.order-summary),.order-panel .order-form .form-row-full:has(.admin-actions){grid-column:1}.order-panel .order-form .order-summary{flex-wrap:wrap}}
