/* ========================================
   DIMENSIONARIUM - LIGHT MODE THEME
   Fantasy/RPG Academy Style
   ======================================== */

:root {
    --gold-primary: #d3b26c;
    --gold-secondary: #c9a961;
    --gold-dark: #b39653;
    --purple-primary: #8f6a33;
    --purple-light: #c6a15b;
    --blue-accent: #2d5a7b;
    --bg-light: #f8f5f0;
    --bg-card: #ffffff;
    --text-primary: #2c2416;
    --text-secondary: #5a5040;
    --border-color: #e0d5c7;
    --shadow: rgba(42, 28, 18, 0.08);
}

/* ========== GLOBAL STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lora', Georgia, serif;
    background: linear-gradient(135deg, #f8f5f0 0%, #ede8e0 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: 80px;
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: var(--purple-primary);
    letter-spacing: 0.5px;
}

/* ========== NAVBAR ========== */
.navbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 245, 240, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--gold-primary);
    box-shadow: 0 4px 20px var(--shadow);
    padding: 0.8rem 0;
}

.navbar-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.18));
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.brand-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-toggler {
    border-color: var(--gold-primary);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23d3b26c' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    color: var(--gold-primary);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-secondary));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.btn-nav-logout {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
    color: white;
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
}

.btn-nav-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 44, 95, 0.3);
}

.btn-theme-toggle {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.btn-theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 16px rgba(211, 178, 108, 0.4);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    min-height: calc(100vh - 180px);
    padding: 2rem 0;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 8px 24px var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(42, 28, 18, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
    color: white;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--gold-primary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ========== BUTTONS ========== */
.btn {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 44, 95, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 44, 95, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #3a7d5a 0%, #4a9d6a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(58, 125, 90, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(58, 125, 90, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #9d4a4a 0%, #b35a5a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(157, 74, 74, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(157, 74, 74, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--purple-primary);
    color: var(--purple-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--purple-primary);
    color: white;
}

.btn-outline-secondary {
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--text-secondary);
    color: white;
}

/* ========== FORMS ========== */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 0.2rem rgba(211, 178, 108, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ========== TABLES ========== */
.table {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%);
    color: white;
    font-family: 'Cinzel', serif;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--bg-light);
    transform: scale(1.01);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(248, 245, 240, 0.5);
}

/* ========== PROGRESS BARS ========== */
.progress {
    height: 24px;
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar {
    background: linear-gradient(90deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.6s ease;
}

/* ========== BADGES ========== */
.badge {
    font-family: 'Cinzel', serif;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

.bg-primary {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-light) 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #3a7d5a 0%, #4a9d6a 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #9d4a4a 0%, #b35a5a 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #d4a54a 0%, #e5b55a 100%) !important;
}

/* ========== YEARBOOK ========== */
.yearbook-img-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--bg-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    position: relative;
}

.yearbook-img-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(74, 44, 95, 0.1) 100%);
    pointer-events: none;
}

.yearbook-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .yearbook-img {
    transform: scale(1.05);
}

/* ========== ALERTS ========== */
.alert {
    border-radius: 10px;
    border-left: 4px solid;
    box-shadow: 0 4px 12px var(--shadow);
}

.alert-success {
    border-left-color: #4a9d6a;
    background: linear-gradient(135deg, rgba(58, 125, 90, 0.1) 0%, rgba(74, 157, 106, 0.1) 100%);
}

.alert-danger {
    border-left-color: #9d4a4a;
    background: linear-gradient(135deg, rgba(157, 74, 74, 0.1) 0%, rgba(179, 90, 90, 0.1) 100%);
}

.alert-warning {
    border-left-color: #d4a54a;
    background: linear-gradient(135deg, rgba(212, 165, 74, 0.1) 0%, rgba(229, 181, 90, 0.1) 100%);
}

.alert-info {
    border-left-color: var(--blue-accent);
    background: linear-gradient(135deg, rgba(45, 90, 123, 0.1) 0%, rgba(65, 110, 143, 0.1) 100%);
}

/* ========== FOOTER ========== */
.footer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 245, 240, 0.98) 100%);
    border-top: 2px solid var(--gold-primary);
    padding: 2rem 0;
    color: var(--text-secondary);
    box-shadow: 0 -4px 20px var(--shadow);
}

.side-nav-card {
    background-color: #fcfaf7;
    border: none;
    transition: none;
    box-shadow: none; /* Optional: removal of shadow if requested, but only 'border' was explicitly mentioned. Keeping shadow for separation unless it feels wrong. User said 'Umrandung'. */
}

.side-nav-card:hover {
    transform: none;
    box-shadow: none;
}

/* ========== PAGE NAVIGATION (SIDEBAR) ========== */
.side-nav {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

/* Slim scrollbar for sidebar */
.side-nav::-webkit-scrollbar {
    width: 4px;
}
.side-nav::-webkit-scrollbar-track {
    background: transparent;
}
.side-nav::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: 10px;
}

.side-nav .btn {
    border-radius: 8px;
    padding: 0.6rem 0.8rem; /* ~10% smaller padding */
    font-size: 0.85rem;    /* ~10% smaller font */
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    width: 100%;
    margin: 0;
}

.side-nav .btn-outline-primary {
    border-color: var(--purple-primary);
    color: var(--purple-primary);
}

/* Light mode: keep hover ripple visible, but improve readability */
body .side-nav .btn::before,
body .page-nav .btn::before {
    background: rgba(255, 255, 255, 0.14);
}

body .side-nav .btn-primary:hover,
body .page-nav .btn-primary:hover {
    color: #fff;
}

body .side-nav .btn-outline-primary:hover,
body .page-nav .btn-outline-primary:hover {
    background: var(--purple-primary);
    color: #fff;
}

.side-nav .btn i {
    width: 24px;
    text-align: center;
}

@media (max-width: 991.98px) {
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
    
    .side-nav {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .side-nav .btn {
        flex: 1 0 auto;
    }
}

.page-nav {
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-nav .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
}

.page-title h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.page-title h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), transparent);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .navbar-logo {
        height: 50px;
    }
    
    .page-title h2 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}


/* === Shared design tokens and accessibility === */
:root {
  --font-body: 'Lora', Georgia, serif;
  --font-heading: 'Cinzel', serif;

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 15px;

  --shadow-1: 0 2px 8px rgba(0,0,0,.12);
  --shadow-2: 0 6px 18px rgba(0,0,0,.18);
  --shadow-glow: 0 0 20px rgba(229,197,118,.25);

  --t-fast: .15s;
  --t-base: .3s;
  --ease: cubic-bezier(.2,.8,.2,1);

  --navbar-h: 72px;
}

:root { color-scheme: dark; }

html, body {
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.btn, .badge, .card-header, .modal-header {
  font-family: var(--font-heading);
}

:focus-visible {
  outline: 3px solid #e5c576;
  outline-offset: 2px;
}

/* Logical props where safe */
.container, .card, .btn { margin-inline: auto; }

/* Motion reduction */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Utilities */
.shadow-1 { box-shadow: var(--shadow-1); }
.shadow-2 { box-shadow: var(--shadow-2); }
.grad-gold { background: linear-gradient(135deg, #e5c576 0%, #d9b866 100%); }
.grad-purple { background: linear-gradient(135deg, #b88d4a 0%, #d9b866 100%); }

/* Fixed navbar helper */
.has-fixed-navbar { padding-top: var(--navbar-h); }


/* Fluid type for headings */
h1 { font-size: clamp(2rem, 1.2rem + 2.2vw, 3rem); }
h2 { font-size: clamp(1.6rem, 1.0rem + 1.8vw, 2.4rem); }
h3 { font-size: clamp(1.3rem, .9rem + 1.2vw, 1.8rem); }

/* === Fix: .table-dark bleibt im Light-Mode hell === */
body .table-dark{
  /* Basiston hellsetzen */
  --bs-table-color: #111;
  --bs-table-bg: #ffffff;
  --bs-table-border-color: rgba(0,0,0,.15);

  /* Stripes/Hover */
  --bs-table-striped-color: #111;
  --bs-table-striped-bg: rgba(0,0,0,.02);
  --bs-table-hover-color: #111;
  --bs-table-hover-bg: rgba(0,0,0,.04);

  /* WICHTIG: State/Type-Kette neutralisieren, damit der inset-Fill nicht dunkel/grün wird */
  --bs-table-bg-state: transparent;
  --bs-table-bg-type: transparent;
  --bs-table-color-state: initial;
  --bs-table-color-type: initial;
}

/* Tabellenzellen erhalten oft den inset-Fill: hier sicherstellen, dass er wei ist */
body .table-dark > :not(caption) > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-bg)));
}

/* Light: .table-dark sauber aufhellen + Zebra + Hover */
body .table-dark{
  --bs-table-color:#111;
  --bs-table-bg:#fff;
  --bs-table-border-color:rgba(0,0,0,.15);
  --bs-table-striped-bg:rgba(0,0,0,.04);
  --bs-table-hover-bg:rgba(0,0,0,.06);
  --bs-table-bg-state:transparent;
  --bs-table-bg-type:transparent;
}

/* Grundfüllung (wei) über inset-Fill */
body .table-dark > :not(caption) > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-bg);
}

/* Zebra-Streifen */
body .table-dark.table-striped > tbody > tr:nth-of-type(odd) > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-striped-bg);
}

/* Hover-Zeile */
body .table-dark.table-hover > tbody > tr:hover > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-hover-bg);
}

.object-fit-cover { object-fit: cover; }
.object-fit-contain { object-fit: contain; background-color: var(--bs-body-bg); }
.character-card .badge { vertical-align: middle; }

.portrait-9x16 {
  width: 100%;
  aspect-ratio: 9 / 16;
}
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }


/* === Character card stats grid and tooltip defaults === */
.character-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem .75rem;
}
@media (min-width: 576px) {
  .character-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .character-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.character-stats .stat {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: .25rem;
}

/* Light tooltip contrast */
.tooltip {
  --bs-tooltip-bg: #212529;
  --bs-tooltip-color: #fff;
  --bs-tooltip-opacity: 1;
}




/* === Character image + level-card sync hooks ===
   Ziel: Bild-Card richtet sich NUR nach der Höhe der Level-Fortschritt-Card.
   Umsetzung: Höhe über CSS-Var --level-card-h (per JS gesetzt). Bild skaliert vollständig sichtbar.
*/
#level-table-card {
  /* signalisiert Gröe für Observer; keine Layoutänderung */
  contain: size layout style;
}

#char-image-card {
  /* Standard: auto, wird via --level-card-h überschrieben */
  height: var(--level-card-h, auto);
  overflow: hidden;
}

#char-image-card .card-body {
  padding: 0; /* maximale nutzbare Fläche für das Bild */
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-image-container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-image {
  width: 100%;
  height: 100%;
  object-fit: contain;  /* Bild bleibt komplett sichtbar */
  display: block;
}

/* Sicherheitsnetz: falls die Row fälschlich "align-items-stretch" bekommt, neutralisieren */
.row.align-items-stretch #level-table-card,
.row.align-items-stretch #char-image-card {
  align-self: auto;
}

/* Verhindere, dass Tabellen-Card auf volle Höhe gezwungen wird */
#level-table-card .card-body { height: auto; }



/* ===== Unified base theme (single stylesheet) ===== */
/* Designsystem: Grund = Graphit, Primaer = Gold, Akzent = Gold, Links = Blau */

body {
  color-scheme: dark;

  /* Neutrals */
  --dm-bg: #0e0e11;
  --dm-bg-elev: #15161a;
  --dm-surface-1: #1b1c21;
  --dm-surface-2: #121318;
  --dm-border: #2a2d34;
  --dm-shadow: rgba(0,0,0,.45);

  /* Text */
  --dm-text: #f0f1f5;
  --dm-text-muted: #c2c6d1;
  --dm-heading: #e6d2a2;

  /* Brand */
  --dm-primary: #b88d4a;         /* Gold */
  --dm-primary-strong: #8f6a33;
  --dm-accent: #d3b26c;          /* Gold */
  --dm-link: #9cc7ff;            /* Blau */
  --dm-link-hover: #e6c988;

  /* Semantic tints (dezent für Hintergründe) */
  --dm-success: #5ab37e;
  --dm-danger:  #c96e6e;
  --dm-warning: #e5b55a;
  --dm-info:    #64a0ca;

  /* Radius und Interaktionen */
  --dm-radius: 10px;
  --dm-focus:  0 0 0 0.2rem rgba(211,178,108,0.25);
}

/* Grundfläche */
body {
  background: linear-gradient(135deg, var(--dm-bg) 0%, #14161b 100%) fixed;
  color: var(--dm-text);
}

/* Typografie */
body h1,
body h2,
body h3,
body h4,
body h5,
body h6 { color: var(--dm-heading); }

body p,
body li,
body dt,
body dd,
body label,
body .form-label,
body .form-text,
body .dropdown-item,
body .breadcrumb,
body .nav-link,
body .text-body { color: var(--dm-text); }

body .text-muted,
body .text-secondary,
body small,
body .placeholder,
body .table .text-muted { color: var(--dm-text-muted); }

/* Links */
body a,
body .btn-link { color: var(--dm-link); }
body a:hover,
body .btn-link:hover { color: var(--dm-link-hover); }

/* Navbar + Footer */
body .navbar,
body .footer {
  background: linear-gradient(135deg, rgba(18,19,23,.98) 0%, rgba(14,14,17,.98) 100%);
  border-color: var(--dm-accent);
  box-shadow: 0 4px 20px var(--dm-shadow);
  color: var(--dm-text-muted);
}
body .nav-link { color: var(--dm-text); }
body .nav-link:hover { color: var(--dm-accent); }
body .navbar-toggler { border-color: var(--dm-accent); }
body .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23d3b26c' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Karten/Container */
body .card {
  background: var(--dm-bg-elev);
  border: 1px solid var(--dm-border);
  box-shadow: 0 8px 24px var(--dm-shadow);
  border-radius: var(--dm-radius);
}
body .card-header,
body thead th {
  background: var(--dm-surface-1);
  color: var(--dm-text);
  border-color: var(--dm-border);
}
body .card-footer {
  background: #101114;
  border-top-color: var(--dm-border);
}

/* Page-Nav */
body .page-nav,
body .side-nav-card {
  background: var(--dm-bg-elev);
  box-shadow: none;
  border: none;
  border-radius: var(--dm-radius);
  transition: none;
}

body .side-nav-card:hover {
    transform: none;
    box-shadow: none;
}

body .side-nav .btn-outline-primary {
    border-color: var(--dm-primary);
    color: var(--dm-primary);
}

body .side-nav .btn-outline-primary:hover {
    background: var(--dm-primary);
    color: #fff;
}

body .page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body .page-nav .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
}

/* Tabellen */
body .table { background: var(--dm-bg-elev); color: var(--dm-text); }
body .table td,
body .table th { border-color: var(--dm-border); color: var(--dm-text); }
body .table tbody tr:hover { background: var(--dm-surface-2); }
body .table-striped tbody tr:nth-of-type(odd) { background: rgba(255,255,255,0.03); }
body table a { color: var(--dm-link); }
body table a:hover { color: var(--dm-link-hover); }

/* =============== Buttons: vereinheitlicht =============== */
body .btn {
  border-radius: var(--dm-radius);
  border: 1px solid transparent;
  box-shadow: none;
  transition: filter .15s ease, transform .02s ease;
}

/* Keep theme toggle animation consistent in dark mode */
body .btn-theme-toggle {
  transition: all 0.3s ease;
}
body .btn:focus-visible { outline: 0; box-shadow: var(--dm-focus); }
body .btn:active { transform: translateY(0.5px); }

/* Primär = Violett */
body .btn-primary {
  background: var(--dm-primary-strong);
  border-color: var(--dm-primary-strong);
  color: #fff;
}
body .btn-primary:hover { filter: brightness(1.06); }
body .btn-primary:disabled,
body .btn-primary.disabled {
  background: #3a214c;
  border-color: #3a214c;
  color: #bfa9d3;
}

/* Sekundär = neutrale Kante */
body .btn-secondary {
  background: var(--dm-surface-1);
  border-color: var(--dm-border);
  color: var(--dm-text);
}
body .btn-secondary:hover { filter: brightness(1.06); }

/* Erfolgs-, Warn-, Info-, Gefahr-Buttons  Ton-in-Ton, einheitliche Logik */
body .btn-success    { background: rgba(90,179,126,0.18); border-color: rgba(90,179,126,0.45); color: #d9f3e5; }
body .btn-warning    { background: rgba(229,181,90,0.18); border-color: rgba(229,181,90,0.45); color: #fff2d2; }
body .btn-info       { background: rgba(100,160,202,0.18); border-color: rgba(100,160,202,0.45); color: #e0f0fb; }
body .btn-danger     { background: rgba(201,110,110,0.18); border-color: rgba(201,110,110,0.45); color: #ffe3e3; }
body .btn-success:hover,
body .btn-warning:hover,
body .btn-info:hover,
body .btn-danger:hover { filter: brightness(1.06); }

/* Outline-Varianten: nur Rahmen + Text, Hover füllt mit Farbe */
body .btn-outline-primary { border-color: var(--dm-primary); color: var(--dm-primary); background: transparent; }
body .btn-outline-primary:hover { background: var(--dm-primary); color: #fff; }

body .btn-outline-secondary { border-color: var(--dm-text-muted); color: var(--dm-text-muted); background: transparent; }
body .btn-outline-secondary:hover { background: var(--dm-text-muted); color: var(--dm-bg); }

body .btn-outline-success { border-color: var(--dm-success); color: var(--dm-success); background: transparent; }
body .btn-outline-success:hover { background: var(--dm-success); color: #0e0f12; }

body .btn-outline-warning { border-color: var(--dm-warning); color: var(--dm-warning); background: transparent; }
body .btn-outline-warning:hover { background: var(--dm-warning); color: #1f1f1f; }

body .btn-outline-info { border-color: var(--dm-info); color: var(--dm-info); background: transparent; }
body .btn-outline-info:hover { background: var(--dm-info); color: #0e0f12; }

body .btn-outline-danger { border-color: var(--dm-danger); color: var(--dm-danger); background: transparent; }
body .btn-outline-danger:hover { background: var(--dm-danger); color: #0e0f12; }

/* Link-Buttons an Linkpalette gebunden */
body .btn-link { color: var(--dm-link); text-decoration: none; }
body .btn-link:hover { color: var(--dm-link-hover); text-decoration: underline; }

/* Badges, Pills */
body .badge { color: #fff; }
body .badge.bg-warning,
body .badge.text-bg-warning { color: #1f1f1f; }
body .badge.bg-info,
body .badge.text-bg-info { color: #0e0f12; }

/* Formulare */
body .form-control,
body .form-select,
body .form-check-input {
  background: var(--dm-bg-elev);
  color: var(--dm-text);
  border-color: var(--dm-border);
  border-radius: var(--dm-radius);
}
body .form-control::placeholder { color: #aeb3bf; opacity: 1; }
body .form-control:focus,
body .form-select:focus,
body .form-check-input:focus {
  border-color: var(--dm-accent);
  box-shadow: var(--dm-focus);
}
body .form-check-input:checked {
  background-color: var(--dm-primary-strong);
  border-color: var(--dm-primary-strong);
}

/* Datei-Upload vereinheitlicht mit Buttons */
body .form-control[type="file"]{
  background: var(--dm-bg-elev);
  color: var(--dm-text);
  border-color: var(--dm-border);
}
body .form-control[type="file"]::file-selector-button{
  background-color: var(--dm-primary-strong);
  color: #fff;
  border: 1px solid var(--dm-primary-strong);
  border-radius: var(--dm-radius);
  transition: filter .15s ease, transform .02s ease;
}
body .form-control[type="file"]:hover::file-selector-button{ filter: brightness(1.06); }
body .form-control[type="file"]::-webkit-file-upload-button{
  background-color: var(--dm-primary-strong);
  color: #fff;
  border: 1px solid var(--dm-primary-strong);
  border-radius: var(--dm-radius);
}

/* Alerts */
body .alert {
  color: var(--dm-text);
  background: var(--dm-bg-elev);
  border-color: var(--dm-border);
  box-shadow: 0 4px 12px var(--dm-shadow);
  border-radius: var(--dm-radius);
}
body .alert-success { background: linear-gradient(135deg, rgba(74,157,106,0.12) 0%, rgba(90,179,126,0.12) 100%); }
body .alert-danger  { background: linear-gradient(135deg, rgba(179,90,90,0.12) 0%, rgba(201,110,110,0.12) 100%); }
body .alert-warning { background: linear-gradient(135deg, rgba(229,181,90,0.12) 0%, rgba(217,168,78,0.12) 100%); }
body .alert-info    { background: linear-gradient(135deg, rgba(88,147,189,0.12) 0%, rgba(100,160,202,0.12) 100%); }

/* Progress */
body .progress { background: #101114; border: 1px solid var(--dm-border); border-radius: var(--dm-radius); }
body .progress-bar { background: var(--dm-accent); color: #101114; }

/* Trennlinien, Medien */
body hr { border-color: var(--dm-border); }
body img,
body video { filter: none; }

/* Fokus-Sichtbarkeit global */
body :focus-visible { outline: 3px solid var(--dm-accent); outline-offset: 2px; }

/* Bootstrap-Variablen für konsistente Ableitungen */
body .table{
  --bs-table-color: var(--dm-text);
  --bs-table-bg: var(--dm-bg-elev);
  --bs-table-border-color: var(--dm-border);
  --bs-table-striped-color: var(--dm-text);
  --bs-table-striped-bg: var(--dm-surface-2);
  --bs-table-hover-color: var(--dm-text);
  --bs-table-hover-bg: #171821;
  --bs-table-accent-bg: transparent;
}

body{
  --bs-body-bg: var(--dm-bg);
  --bs-body-color: var(--dm-text);
  --bs-secondary-bg: var(--dm-bg-elev);
  --bs-tertiary-bg: var(--dm-surface-1);

  --bs-secondary-color: #cfd3de;
  --bs-tertiary-color: #b6bbca;

  --bs-link-color: var(--dm-link);
  --bs-link-hover-color: var(--dm-link-hover);
  --bs-heading-color: var(--dm-heading);

  --bs-border-color: var(--dm-border);
  --bs-btn-border-radius: var(--dm-radius);
}

/* Keep .table-dark truly dark in dark mode */
body .table-dark{
  --bs-table-color: #e6e6e6;
  --bs-table-bg: #151821;
  --bs-table-border-color: rgba(255,255,255,.12);
  --bs-table-striped-color: #e6e6e6;
  --bs-table-striped-bg: #1a1e27;
  --bs-table-hover-color: #e6e6e6;
  --bs-table-hover-bg: #1e2330;
  --bs-table-bg-state: transparent;
  --bs-table-bg-type: transparent;
}

/* Dark: .table-dark Zebra + Hover */
body .table-dark{
  --bs-table-color:#e6e6e6;
  --bs-table-bg:#151821;
  --bs-table-border-color:rgba(255,255,255,.12);
  --bs-table-striped-bg:#1a1e27;
  --bs-table-hover-bg:#1e2330;
  --bs-table-bg-state:transparent;
  --bs-table-bg-type:transparent;
}

/* Grundfüllung per inset-Fill */
body .table-dark > :not(caption) > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-bg);
}

/* Zebra */
body .table-dark.table-striped > tbody > tr:nth-of-type(odd) > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-striped-bg);
}

/* Hover */
body .table-dark.table-hover > tbody > tr:hover > *{
  box-shadow: inset 0 0 0 9999px var(--bs-table-hover-bg);
}


/* === Dark mode tooltip contrast fix === */
body .tooltip,
[data-bs-theme="dark"] .tooltip {
  --bs-tooltip-bg: #f8f9fa;
  --bs-tooltip-color: #212529;
  --bs-tooltip-opacity: 1;
  --bs-tooltip-border-color: rgba(0,0,0,.15);
  border: 1px solid var(--bs-tooltip-border-color);
}

/* Unread message row highlight: neutral gray in dark mode */
body .table-primary {
  --bs-table-bg: rgba(255, 255, 255, 0.08);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.10);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.12);
  color: var(--dm-text);
}


/* Badge readability tweaks */
body .badge.bg-warning,
body .badge.text-bg-warning { color: #1f1f1f; }
body .badge.bg-info,
body .badge.text-bg-info { color: #0e0f12; }
body .badge.bg-primary,
body .badge.text-bg-primary { color: #ffffff; }

/* Hintergrundbild für Login und Registrierung im Darkmode beibehalten */
body[style*="background: url"], 
body.login-bg, 
body.register-bg {
  background: url("/verwaltung/static/background/login.webp") center center fixed no-repeat !important;
  background-size: cover !important;
  background-color: transparent !important;
}

/* 1) Gradient nur auf "normalen" Seiten anwenden */
body:not(.login-bg):not(.register-bg):not(.portal-page) {
  background: linear-gradient(135deg, var(--dm-bg) 0%, #14161b 100%) fixed;
}

/* 2) Auf Auth-Seiten das Foto erzwingen */
body.login-bg,
body.register-bg {
  background: url("/verwaltung/static/background/login.webp") center center fixed no-repeat !important;
  background-size: cover !important;
  background-color: transparent !important;
}

body.portal-page {
  background: url("/verwaltung/static/background/login.webp") center center fixed no-repeat !important;
  background-size: cover !important;
  background-color: transparent !important;
}

/* Auth-Seiten: Bild im Darkmode erzwingen */
body:has(.login-card),
body:has(.login-wrap) {
  background: url("/verwaltung/static/background/login.webp") center center fixed no-repeat !important;
  background-size: cover !important;
  background-color: transparent !important;
}

/* Gradient nur auf Seiten ohne Auth-Container */
body:not(.portal-page):not(:has(.login-card)):not(:has(.login-wrap)) {
  background: linear-gradient(135deg, var(--dm-bg) 0%, #14161b 100%) fixed;
}

/* ===== Route-scoped styling (single CSS for login/portal/verwaltung) ===== */
body.login-bg {
  overflow: hidden;
}

body.login-bg .main-content {
  min-height: 100vh;
  padding: 0;
}

body.login-bg .main-content > .container-fluid {
  max-width: none;
  padding: 0 !important;
}

body.login-bg .bg-mask::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  pointer-events: none;
  z-index: 0;
}

body.login-bg .login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 2rem 1rem;
}

body.login-bg .login-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.8rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
  background-color: rgba(17, 17, 17, 0.92);
  color: #eaeaea;
}

body.login-bg .register-card {
  max-width: 484px;
}

body.login-bg .login-card .form-control {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

body.login-bg .login-card .form-control:focus {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: #d3b26c;
  box-shadow: 0 0 0 0.2rem rgba(211, 178, 108, 0.25);
  color: #fff;
}

body.login-bg .login-title {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.portal-page {
  --portal-accent: #d3b26c;
  --portal-accent-2: #f0d79a;
  --portal-text: #e9f1ff;
  --portal-muted: #b8c3d8;
  --portal-card: rgba(255, 255, 255, 0.04);
  --portal-card-border: rgba(255, 255, 255, 0.12);
  --portal-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body.portal-page .main-content > .container-fluid {
  max-width: 1200px;
}

body.portal-page .backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.portal-page .glow {
  position: absolute;
  width: 40vmax;
  height: 40vmax;
  filter: blur(22px);
  opacity: 0.45;
}

body.portal-page .glow-1 {
  background: radial-gradient(circle, rgba(211, 178, 108, 0.2), transparent 60%);
  top: -10vmax;
  left: -5vmax;
}

body.portal-page .glow-2 {
  background: radial-gradient(circle, rgba(240, 215, 154, 0.16), transparent 60%);
  bottom: -12vmax;
  right: -6vmax;
}

body.portal-page .grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.55;
}

body.portal-page .shell {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 28px 48px;
  z-index: 1;
}

body.portal-page header .eyebrow {
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--portal-card);
  font-weight: 600;
  margin: 0 0 8px;
}

body.portal-page header h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: 0.02em;
  color: var(--portal-card);
}

body.portal-page .header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

body.portal-page .header-row h1 {
  flex: 1;
}

body.portal-page .lede {
  margin: 0 0 20px;
  max-width: 640px;
  color: var(--portal-card);
  line-height: 1.5;
}

body.portal-page .grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

body.portal-page .grid .card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 178px;
  padding: 18px 18px 20px;
  border-radius: 16px;
  background: var(--portal-card);
  border: 1px solid var(--portal-card-border);
  text-decoration: none;
  color: var(--portal-text);
  backdrop-filter: blur(8px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body.portal-page .grid .card:hover {
  transform: translateY(-4px);
  border-color: rgba(211, 178, 108, 0.65);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
}

body.portal-page .grid .card.card-locked {
  position: relative;
  cursor: not-allowed;
  padding-bottom: 46px;
  border-color: rgba(211, 178, 108, 0.55);
  background:
    linear-gradient(165deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.46)),
    var(--portal-card);
  box-shadow: inset 0 0 0 1px rgba(211, 178, 108, 0.25), 0 8px 24px rgba(0, 0, 0, 0.28);
}

body.portal-page .grid .card.card-locked::before {
  content: "GESPERRT";
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(211, 178, 108, 0.75);
  background: rgba(13, 18, 28, 0.9);
  color: #e6c988;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

body.portal-page .grid .card.card-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    -45deg,
    rgba(211, 178, 108, 0.04) 0,
    rgba(211, 178, 108, 0.04) 8px,
    rgba(0, 0, 0, 0.02) 8px,
    rgba(0, 0, 0, 0.02) 16px
  );
  pointer-events: none;
}

body.portal-page .grid .card.card-locked:hover {
  transform: none;
  border-color: rgba(211, 178, 108, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

body.portal-page .grid .card.card-locked h2,
body.portal-page .grid .card.card-locked p,
body.portal-page .grid .card.card-locked .status,
body.portal-page .grid .card.card-locked .tag {
  opacity: 0.84;
}

body.portal-page .card .tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-accent);
}

body.portal-page .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.portal-page .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--portal-muted);
}

body.portal-page .status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

body.portal-page .status.online .dot {
  background: #7dffba;
  box-shadow: 0 0 0 4px rgba(125, 255, 186, 0.18);
}

body.portal-page .status.offline .dot {
  background: #ff8a8a;
  box-shadow: 0 0 0 4px rgba(255, 138, 138, 0.18);
}

body.portal-page .status .text {
  white-space: nowrap;
}

body.portal-page .card h2 {
  margin: 12px 0 6px;
  font-size: 22px;
}

body.portal-page .card p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.5;
}

body.portal-page .portal-audio-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.portal-page .portal-audio-btn {
  height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--portal-accent);
  background: linear-gradient(120deg, rgba(211, 178, 108, 0.18), rgba(240, 215, 154, 0.16));
  color: var(--portal-text);
  font-weight: 700;
  box-shadow: var(--portal-shadow);
}

body.portal-page .portal-audio-btn:hover {
  border-color: var(--portal-accent-2);
}

body.portal-page .portal-audio-slider[type=range] {
  width: 140px;
}

body.portal-page .footer-reveal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  transform: translateY(calc(100% - 8px));
  transition: transform 180ms ease;
  z-index: 1040;
}

body.portal-page .footer-reveal-inner {
  width: min(520px, 100%);
  background: rgba(11, 15, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 12px 16px;
  color: var(--portal-muted);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

body.portal-page .footer-reveal:hover,
body.portal-page .footer-reveal:focus-within,
body.footer-reveal-active.portal-page .footer-reveal {
  transform: translateY(0);
}

body.portal-page .footer-reveal a {
  color: var(--portal-accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}

body.portal-page .footer-reveal a:hover {
  border-bottom-color: var(--portal-accent);
}

body.portal-page .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
  z-index: 20;
}

body.portal-page .modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

body.portal-page .modal-card {
  width: min(520px, 100%);
  background: rgba(11, 15, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 24px;
  color: var(--portal-text);
}

body.portal-page .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

body.portal-page .modal-header h2 {
  margin: 0;
  font-size: 22px;
}

body.portal-page .modal-close {
  background: transparent;
  border: 0;
  color: var(--portal-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

body.portal-page .modal-body p {
  margin: 0 0 12px;
  color: var(--portal-muted);
  line-height: 1.5;
}

body.portal-page .modal-body strong {
  color: var(--portal-text);
}

body.portal-page .modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

body.portal-page .modal-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--portal-text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

body.portal-page .modal-action:hover {
  border-color: var(--portal-accent);
  transform: translateY(-1px);
}

@media (max-width: 1100px) {
  body.portal-page .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 600px) {
  body.portal-page .shell {
    padding: 48px 18px 32px;
  }
  body.portal-page .header-row {
    align-items: flex-start;
  }
}

/* ===== Unified Look: dark base + gold accents ===== */
:root {
  --u-bg: #0f1116;
  --u-bg-2: #171a22;
  --u-surface: #1d222c;
  --u-surface-soft: #242a35;
  --u-border: rgba(211, 178, 108, 0.28);
  --u-text: #e7e2d6;
  --u-muted: #beb6a4;
  --u-gold: #d3b26c;
  --u-gold-2: #e6c988;
}

body {
  color: var(--u-text);
  background: linear-gradient(145deg, var(--u-bg), var(--u-bg-2)) fixed !important;
}

.navbar,
body .footer {
  background: linear-gradient(145deg, rgba(19, 22, 30, 0.96), rgba(14, 17, 24, 0.96));
  border-color: var(--u-border);
}

.nav-link,
body .navbar .nav-link {
  color: var(--u-text);
}

.nav-link:hover,
body .navbar .nav-link:hover {
  color: var(--u-gold);
}

body .btn-nav-logout {
  background: linear-gradient(145deg, #463521, #73562f);
  border: 1px solid var(--u-gold);
  color: #fff7e6;
}

.card,
.page-nav,
body .side-nav-card {
  background: linear-gradient(165deg, rgba(30, 35, 46, 0.94), rgba(22, 26, 35, 0.94));
  border: 1px solid var(--u-border);
  color: var(--u-text);
}

.card-header,
body thead th {
  background: linear-gradient(145deg, #2d2418, #3d3120);
  border-color: var(--u-border);
  color: #f4e2b4;
}

body .card-footer {
  background: rgba(18, 22, 30, 0.88);
  border-color: var(--u-border);
}

.btn {
  border-radius: 10px;
}

body .btn-primary {
  background: linear-gradient(145deg, #7a5c30, #a78046);
  border-color: var(--u-gold);
  color: #fff8eb;
}

body .btn-secondary {
  background: linear-gradient(145deg, #2a303c, #1f2430);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--u-text);
}

body .btn-outline-primary {
  border-color: var(--u-gold);
  color: var(--u-gold);
}

body .btn-outline-primary:hover {
  background: var(--u-gold);
  color: #1c1a16;
}

.form-control,
body .form-select {
  background: rgba(20, 24, 32, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--u-text);
}

.form-control:focus,
body .form-select:focus {
  border-color: var(--u-gold);
  box-shadow: 0 0 0 0.2rem rgba(211, 178, 108, 0.22);
}

.table,
.table td,
body .table th {
  color: var(--u-text);
  border-color: rgba(255, 255, 255, 0.14);
}

body .table tbody tr:hover {
  background: rgba(211, 178, 108, 0.08);
}

/* Login/Register */
body.login-bg,
body.register-bg {
  background: url('/verwaltung/static/background/login.webp') center center fixed no-repeat !important;
  background-size: cover !important;
}

body.login-bg .login-card,
body.register-bg .login-card {
  background: rgba(19, 22, 30, 0.92);
  border: 1px solid var(--u-border);
}

body.login-bg .login-title,
body.register-bg .login-title {
  color: #f4e2b4;
}

/* Portal */
body.portal-page {
  background: url('/verwaltung/static/background/login.webp') center center fixed no-repeat !important;
  background-size: cover !important;
}

body.portal-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  pointer-events: none;
  z-index: 0;
}

body.portal-page .main-content,
body.portal-page .main-content > .container-fluid {
  position: relative;
  z-index: 1;
}

body.portal-page header .eyebrow,
body.portal-page header h1,
body.portal-page .lede {
  color: #8a6a2f;
  -webkit-text-stroke: 0.6px rgba(58, 58, 58, 0.95);
  text-shadow:
    -1px -1px 0 rgba(58, 58, 58, 0.9),
    1px -1px 0 rgba(58, 58, 58, 0.9),
    -1px 1px 0 rgba(58, 58, 58, 0.9),
    1px 1px 0 rgba(58, 58, 58, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.65);
}

body.portal-page header {
  text-align: center;
}

body.portal-page header .eyebrow {
  font-size: 1.2rem;
}

body.portal-page header h1 {
  font-size: clamp(52px, 6vw, 72px);
}

body.portal-page .lede {
  font-size: clamp(1.18rem, 1.9vw, 1.38rem);
  margin-left: auto;
  margin-right: auto;
}

body.portal-page .grid .card {
  background: rgba(19, 22, 30, 0.82);
  border: 1px solid var(--u-border);
  backdrop-filter: blur(8px);
}

body.portal-page .card .tag,
body.portal-page .footer-reveal a,
body.portal-page .modal-action:hover {
  color: var(--u-gold);
  border-color: var(--u-gold);
}

body.portal-page .portal-audio-btn {
  background: linear-gradient(145deg, #7a5c30, #a78046);
  border-color: var(--u-gold);
  color: #fff8eb;
}

/* ===== Global font unification (use login font everywhere) ===== */
:root {
  --app-font: 'Lora', Georgia, serif;
}

body,
h1, h2, h3, h4, h5, h6,
p, a, span, li, label, small,
button, .btn,
input, select, textarea,
.form-control, .form-select,
.nav-link, .card, .table {
  font-family: var(--app-font);
}

/* ===== Global reveal footer + impressum modal ===== */
.footer-reveal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  transform: translateY(calc(100% - 8px));
  transition: transform 180ms ease;
  z-index: 1040;
}

.footer-reveal-inner {
  width: min(520px, 100%);
  background: rgba(11, 15, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 12px 16px;
  color: var(--u-muted);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.footer-reveal:hover,
.footer-reveal:focus-within,
body.footer-reveal-active .footer-reveal {
  transform: translateY(0);
}

.footer-reveal a {
  color: var(--u-gold);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s;
}

.footer-reveal a:hover {
  border-bottom-color: var(--u-gold);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 150ms ease;
  z-index: 1050;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: min(520px, 100%);
  background: rgba(11, 15, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  padding: 24px;
  color: var(--u-text);
}

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

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--u-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-body p {
  margin: 0 0 12px;
  color: var(--u-muted);
  line-height: 1.5;
}

.modal-body strong {
  color: var(--u-text);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--u-text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.modal-action:hover {
  border-color: var(--u-gold);
  transform: translateY(-1px);
}

/* ===== Global Bootstrap dark/gold unification (missing spots) ===== */
body .modal-content {
  background: linear-gradient(180deg, rgba(24, 21, 17, 0.98) 0%, rgba(16, 14, 11, 0.98) 100%);
  color: var(--u-text);
  border: 1px solid rgba(211, 178, 108, 0.35);
  box-shadow: 0 0 0 1px rgba(211, 178, 108, 0.12), 0 1rem 2rem rgba(0, 0, 0, 0.35);
}

body .modal-header,
body .modal-footer {
  border-color: rgba(211, 178, 108, 0.22);
  background: rgba(211, 178, 108, 0.05);
}

body .modal-title {
  color: var(--u-gold-2);
}

body .modal-body,
body .modal-body label,
body .modal-body .form-label,
body .modal-body .small {
  color: var(--u-text);
}

body .modal-body .text-muted {
  color: var(--u-muted);
}

body .modal-content .btn-close {
  filter: invert(1) sepia(0.14) saturate(0.8) brightness(1.1);
}

body .modal-content .list-group-item {
  background: rgba(255, 255, 255, 0.02);
  color: var(--u-text);
  border-color: rgba(211, 178, 108, 0.16);
}

body .modal-content .list-group-item.active {
  background: rgba(211, 178, 108, 0.16);
  border-color: rgba(211, 178, 108, 0.42);
  color: #fff6df;
}

body .modal-content .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--u-text);
  --bs-table-border-color: rgba(211, 178, 108, 0.16);
  --bs-table-striped-bg: rgba(211, 178, 108, 0.05);
  --bs-table-striped-color: var(--u-text);
  --bs-table-hover-bg: rgba(211, 178, 108, 0.09);
  --bs-table-hover-color: var(--u-text);
}

body .modal-content .table thead th {
  color: var(--u-gold-2);
  border-bottom-color: rgba(211, 178, 108, 0.3);
}

body .modal-content .form-check-input {
  background-color: rgba(20, 24, 32, 0.95);
  border-color: rgba(211, 178, 108, 0.35);
}

body .modal-content .form-check-input:focus {
  border-color: var(--u-gold);
  box-shadow: 0 0 0 0.2rem rgba(211, 178, 108, 0.18);
}

body .modal-content .form-check-input:checked {
  background-color: var(--u-gold);
  border-color: var(--u-gold);
}

body .dropdown-menu {
  background: linear-gradient(180deg, rgba(24, 21, 17, 0.98) 0%, rgba(16, 14, 11, 0.98) 100%);
  border: 1px solid rgba(211, 178, 108, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body .dropdown-item {
  color: var(--u-text);
}

body .dropdown-item:hover,
body .dropdown-item:focus {
  background: rgba(211, 178, 108, 0.11);
  color: #fff3d0;
}

body .dropdown-divider {
  border-top-color: rgba(211, 178, 108, 0.16);
}

body .page-link {
  background: rgba(20, 24, 32, 0.92);
  border-color: rgba(211, 178, 108, 0.2);
  color: var(--u-text);
}

body .page-link:hover,
body .page-link:focus {
  background: rgba(211, 178, 108, 0.12);
  border-color: rgba(211, 178, 108, 0.38);
  color: #fff4d6;
}

body .page-item.active .page-link {
  background: linear-gradient(145deg, #7a5c30, #a78046);
  border-color: var(--u-gold);
  color: #fff8eb;
}

body .nav-tabs {
  border-bottom-color: rgba(211, 178, 108, 0.22);
}

body .nav-tabs .nav-link {
  color: var(--u-muted);
  border-color: transparent;
}

body .nav-tabs .nav-link:hover,
body .nav-tabs .nav-link:focus {
  color: var(--u-gold);
  border-color: rgba(211, 178, 108, 0.2) rgba(211, 178, 108, 0.2) transparent;
  background: rgba(211, 178, 108, 0.04);
}

body .nav-tabs .nav-link.active {
  color: var(--u-gold-2);
  background: linear-gradient(180deg, rgba(211, 178, 108, 0.08), rgba(211, 178, 108, 0.03));
  border-color: rgba(211, 178, 108, 0.24) rgba(211, 178, 108, 0.24) transparent;
}

/* Global ambience controls (portal + verwaltung) */
.portal-audio-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

body .portal-audio-btn {
  height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--u-gold);
  background: linear-gradient(145deg, #7a5c30, #a78046);
  color: #fff8eb;
  font-weight: 700;
}

.portal-audio-slider[type=range] {
  width: 140px;
}

@media (max-width: 991.98px) {
  .portal-audio-nav {
    width: 100%;
    margin: 0.4rem 0;
  }

  .portal-audio-slider[type=range] {
    width: 100%;
    max-width: 220px;
  }
}

/* Portal embedded content modals */
body.portal-page .modal-card.modal-card-xl {
  width: min(1200px, 96vw);
  height: auto;
  max-height: min(88vh, 920px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.portal-page .modal-body-embed {
  flex: 1;
  min-height: 0;
  max-height: min(88vh, 920px);
  overflow: auto;
  background: rgba(8, 10, 14, 0.88);
  padding: 0;
}

body.portal-page .modal-embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Embedded guide + discord pages (loaded in portal modal) */
body.portal-embedded-page {
  --accent: #6df3ff;
  --accent-2: #d3b26c;
  --text: #e9f1ff;
  --muted: #b8c3d8;
  padding-top: 0;
  min-height: 100vh;
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(145deg, rgba(11, 15, 26, 0.9), rgba(17, 26, 42, 0.9)),
    url("/static/images/background.webp") center/cover no-repeat fixed;
  color: var(--text);
  overflow-x: hidden;
}

body.portal-embedded-page .shell {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 28px 48px;
}

body.portal-embedded-page .wizard-container {
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  max-width: 900px;
  margin: 32px auto 0;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  position: relative;
}

body.portal-embedded-page .wizard-step {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

body.portal-embedded-page .wizard-step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

body.portal-embedded-page .step-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

body.portal-embedded-page .step-title {
  margin: 0;
  font-size: 2.2rem;
  color: #fff;
  background: linear-gradient(90deg, #fff, #b8c3d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.portal-embedded-page .step-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d1d5db;
  margin-bottom: 2.5rem;
}

body.portal-embedded-page .step-content h3,
body.portal-embedded-page .step-content h4 {
  color: #fff;
}

body.portal-embedded-page .step-content p,
body.portal-embedded-page .step-content li {
  color: #d1d5db;
}

body.portal-embedded-page .step-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

body.portal-embedded-page .step-content a {
  color: var(--accent);
}

body.portal-embedded-page .step-content img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.portal-embedded-page .step-content blockquote {
  background: rgba(109, 243, 255, 0.05);
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
}

body.portal-embedded-page .step-content .guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.portal-embedded-page .step-content .guide-table th,
body.portal-embedded-page .step-content .guide-table td {
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

body.portal-embedded-page .step-content .guide-table th {
  color: #ffffff;
  background: rgba(109, 243, 255, 0.08);
  font-weight: 600;
}

body.portal-embedded-page .step-content .guide-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

body.portal-embedded-page .progress-section {
  margin-bottom: 3rem;
}

body.portal-embedded-page .step-indicator {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

body.portal-embedded-page .progress-bar-bg {
  background: rgba(255, 255, 255, 0.12);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

body.portal-embedded-page .progress-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--accent);
}

body.portal-embedded-page .wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.portal-embedded-page .wizard-container .btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

body.portal-embedded-page .wizard-container .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

body.portal-embedded-page .wizard-container .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

body.portal-embedded-page .wizard-container .btn-primary {
  background: linear-gradient(135deg, rgba(109, 243, 255, 0.15), rgba(167, 120, 255, 0.15));
  border-color: var(--accent);
  color: var(--accent);
}

body.portal-embedded-page .wizard-container .btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(109, 243, 255, 0.25), rgba(167, 120, 255, 0.25));
  box-shadow: 0 0 20px rgba(109, 243, 255, 0.15);
}

body.portal-embedded-page .wizard-status {
  margin-top: 16px;
  min-height: 1.2em;
  color: var(--accent);
}

body.portal-embedded-page .wizard-step .form-section {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

body.portal-embedded-page .wizard-step .form-section h3 {
  display: none;
}

body.portal-embedded-page .form-container {
  max-width: 900px;
  margin: 32px auto 0;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body.portal-embedded-page .form-group {
  margin-bottom: 20px;
}

body.portal-embedded-page .form-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.portal-embedded-page .form-section:last-child {
  border-bottom: none;
}

body.portal-embedded-page .form-section h3 {
  color: #fff;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff, #b8c3d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.portal-embedded-page .form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 500;
}

body.portal-embedded-page .form-group .hint {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

body.portal-embedded-page .input-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

body.portal-embedded-page .form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(5, 8, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s;
}

body.portal-embedded-page .form-control:focus {
  outline: none;
  background: rgba(5, 8, 12, 0.85);
  border-color: var(--accent);
}

body.portal-embedded-page textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

body.portal-embedded-page input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

body.portal-embedded-page input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 10px rgba(109, 243, 255, 0.5);
}

body.portal-embedded-page input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

body.portal-embedded-page .slider-group {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 16px;
  align-items: center;
}

body.portal-embedded-page .preview-area {
  margin-top: 40px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

html.embedded-mode,
html.embedded-mode body.portal-embedded-page {
  background: transparent !important;
}

html.embedded-mode body.portal-embedded-page {
  min-height: 100%;
}

html.embedded-mode body.portal-embedded-page .backdrop,
html.embedded-mode body.portal-embedded-page .shell > header {
  display: none !important;
}

html.embedded-mode body.portal-embedded-page .shell {
  max-width: none;
  margin: 0;
  padding: 0;
}

html.embedded-mode body.portal-embedded-page .wizard-container {
  margin: 0;
  max-width: none;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}

@media (max-width: 768px) {
  body.portal-embedded-page .shell {
    padding: 48px 18px 32px;
  }

  body.portal-embedded-page .wizard-container {
    padding: 24px 18px;
    margin: 20px 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  body.portal-embedded-page .step-title {
    font-size: 1.8rem;
  }
}

.footer-sep {
  opacity: 0.7;
  margin: 0 0.4rem;
}

.terms-modal-card {
  width: min(920px, calc(100vw - 2rem));
  max-height: min(90vh, 940px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(165deg, rgba(10, 14, 24, 0.97), rgba(8, 11, 20, 0.98));
  border: 1px solid rgba(211, 178, 108, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(211, 178, 108, 0.12) inset;
}

.modal-overlay#consent-modal {
  z-index: 1200;
}

.modal-overlay#terms-modal {
  z-index: 1300;
}

.terms-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  line-height: 1.55;
  padding: 18px 22px;
  color: rgba(234, 239, 247, 0.92);
}

.terms-modal-body ul {
  margin-left: 1.1rem;
}

.terms-modal-body li {
  margin-bottom: 0.28rem;
}

.terms-modal-body a {
  color: #d3b26c;
}

.terms-modal-body strong {
  color: #f3f6fb;
}

.consent-modal-card {
  width: min(920px, calc(100vw - 2rem));
  max-height: min(90vh, 940px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(165deg, rgba(10, 14, 24, 0.97), rgba(8, 11, 20, 0.98));
  border: 1px solid rgba(211, 178, 108, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(211, 178, 108, 0.12) inset;
}

.consent-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  line-height: 1.55;
  padding: 18px 22px;
  color: rgba(234, 239, 247, 0.92);
}

.consent-modal-body ul {
  margin-left: 1.1rem;
}

.consent-modal-body strong {
  color: #f3f6fb;
}

.consent-modal-card .form-check-label {
  color: rgba(234, 239, 247, 0.94);
}

.consent-modal-card .form-check-input {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(211, 178, 108, 0.55);
}

.consent-modal-card .form-check-input:checked {
  background-color: #8e6c33;
  border-color: #d3b26c;
}

#terms_accept.form-check-input {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(211, 178, 108, 0.55);
}

#terms_accept.form-check-input:checked {
  background-color: #d3b26c;
  border-color: #d3b26c;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%2317140f' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m4 10 4 4 8-8'/%3e%3c/svg%3e");
}

#terms_accept.form-check-input:focus {
  border-color: #d3b26c;
  box-shadow: 0 0 0 0.2rem rgba(211, 178, 108, 0.25);
}

body .consent-modal-footer {
  display: flex !important;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.8rem;
  padding: 14px 22px 18px;
  margin-top: 0;
  width: 100%;
  text-align: center;
}

.terms-modal-card .modal-header,
.consent-modal-card .modal-header {
  margin-bottom: 0;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(211, 178, 108, 0.24);
  background: rgba(255, 255, 255, 0.02);
}

.terms-modal-card .modal-footer {
  margin-top: 0;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(211, 178, 108, 0.24);
  background: rgba(255, 255, 255, 0.02);
}

.consent-modal-footer form {
  margin: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

.consent-more-row {
  text-align: center;
  margin: 6px 0 2px;
}

#consent-show-full {
  min-width: 260px;
}

.consent-modal-footer .modal-action {
  min-width: 240px;
  max-width: 260px;
  padding: 9px 12px;
  font-size: 0.95rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 860px) {
  .consent-modal-footer {
    flex-wrap: wrap;
  }

  .consent-modal-footer .modal-action {
    min-width: 210px;
    max-width: 100%;
  }
}

.modal-action.danger {
  border-color: rgba(211, 91, 91, 0.8);
  color: #ffd6d6;
}

.consent-modal-card .modal-action,
.terms-modal-card .modal-action {
  border-color: rgba(211, 178, 108, 0.5);
}

.consent-modal-card .modal-action:hover,
.terms-modal-card .modal-action:hover {
  border-color: #d3b26c;
}

body.portal-page .terms-modal-card,
body.portal-page .consent-modal-card {
  width: min(920px, calc(100vw - 2rem));
}
