/* =============================================
   EWC Sign Wallboard - Custom Theme
   Motorsport-inspired dark UI
   ============================================= */

/* --- CSS Variables --- */
:root {
    --color-bg-primary: #0f0f1a;
    --color-bg-secondary: #1a1a2e;
    --color-bg-card: #16213e;
    --color-bg-card-hover: #1c2a4a;
    --color-accent: #e94560;
    --color-accent-hover: #ff6b81;
    --color-accent-soft: rgba(233, 69, 96, 0.15);
    --color-gold: #f39c12;
    --color-text: #e8e8f0;
    --color-text-muted: #8892a4;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-glass: rgba(22, 33, 62, 0.85);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(233, 69, 96, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
    --color-bg-primary: #f5f7fb;
    --color-bg-secondary: #ffffff;
    --color-bg-card: #ffffff;
    --color-bg-card-hover: #f3f6ff;
    --color-accent: #cf294a;
    --color-accent-hover: #e54c69;
    --color-accent-soft: rgba(207, 41, 74, 0.12);
    --color-gold: #b7791f;
    --color-text: #141b2d;
    --color-text-muted: #5f6b84;
    --color-border: rgba(20, 27, 45, 0.10);
    --color-glass: rgba(255, 255, 255, 0.88);
    --shadow-card: 0 8px 28px rgba(20, 27, 45, 0.08);
    --shadow-card-hover: 0 12px 36px rgba(207, 41, 74, 0.10);
}

/* --- Base --- */
* {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary) url('../img/flap.webp') center center / cover no-repeat fixed;
    color: var(--color-text);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 26, 0.92);
    z-index: 0;
    pointer-events: none;
}

html[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 15% 15%, rgba(207, 41, 74, 0.06), transparent 35%),
        radial-gradient(circle at 85% 10%, rgba(23, 162, 184, 0.04), transparent 30%),
        rgba(245, 247, 251, 0.90);
}

body > * {
    position: relative;
    z-index: 1;
}

.text-accent {
    color: var(--color-accent) !important;
}

.text-muted-light {
    color: var(--color-text-muted) !important;
}

.flash-toast-stack {
    position: fixed;
    top: 5.2rem;
    right: 1rem;
    z-index: 2000;
    display: grid;
    gap: 0.55rem;
    width: min(24rem, calc(100vw - 1.5rem));
    pointer-events: none;
}

.flash-toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
    animation: flash-toast-in 180ms ease-out;
}

.flash-toast--success {
    background: rgba(8, 67, 44, 0.88);
    border-color: rgba(87, 211, 151, 0.28);
    color: #d7f7e8;
}

.flash-toast--error {
    background: rgba(91, 22, 33, 0.9);
    border-color: rgba(255, 134, 154, 0.24);
    color: #ffe2e8;
}

.flash-toast__icon {
    width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.95rem;
    margin-top: 0.05rem;
}

.flash-toast--success .flash-toast__icon {
    color: #8cf0bd;
}

.flash-toast--error .flash-toast__icon {
    color: #ff9db0;
}

.flash-toast__body {
    font-size: 0.88rem;
    line-height: 1.3;
    font-weight: 500;
}

.flash-toast__close {
    border: 0;
    background: transparent;
    color: currentColor;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    opacity: 0.8;
}

.flash-toast__close:hover,
.flash-toast__close:focus {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.flash-toast.is-hiding {
    animation: flash-toast-out 180ms ease-in forwards;
}

@keyframes flash-toast-in {
    from {
        opacity: 0;
        transform: translate3d(0, -10px, 0) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes flash-toast-out {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(0, -8px, 0) scale(0.98);
    }
}

/* --- Navbar --- */
.navbar {
    background: var(--color-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
    z-index: 1030;
}

html[data-theme="light"] .navbar {
    box-shadow: 0 6px 24px rgba(20, 27, 45, 0.06);
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 2px;
}

.navbar-brand__logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.navbar-live-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
    background: transparent;
    border: 0;
}

.navbar-live-link__logo {
    height: 40px;
    width: auto;
    display: block;
    transform-origin: 50% 50%;
    animation: navbar-live-ticktock 0.7s steps(1, end) infinite;
    will-change: transform, filter;
}

@keyframes navbar-live-ticktock {
    0% {
        transform: rotate(-7deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(233, 69, 96, 0));
    }
    20% {
        transform: rotate(-7deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(233, 69, 96, 0));
    }
    35% {
        transform: rotate(7deg) scale(1.04);
        filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.28));
    }
    55% {
        transform: rotate(7deg) scale(1.04);
        filter: drop-shadow(0 0 10px rgba(233, 69, 96, 0.28));
    }
    70% {
        transform: rotate(-7deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(233, 69, 96, 0));
    }
    100% {
        transform: rotate(-7deg) scale(1);
        filter: drop-shadow(0 0 0 rgba(233, 69, 96, 0));
    }
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-actions__main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: var(--color-accent-soft);
    color: var(--color-accent) !important;
}

.nav-link--with-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-link__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.32rem;
    border-radius: 999px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.12);
}

html[data-theme="light"] .navbar-brand,
html[data-theme="light"] .nav-link {
    color: var(--color-text) !important;
}

html[data-theme="light"] .navbar .btn-outline-light {
    color: var(--color-text) !important;
    border-color: rgba(20, 27, 45, 0.18) !important;
    background: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .navbar .btn-outline-light:hover,
html[data-theme="light"] .navbar .btn-outline-light:focus {
    color: var(--color-accent) !important;
    border-color: rgba(233, 69, 96, 0.26) !important;
    background: rgba(233, 69, 96, 0.08);
}

html[data-theme="light"] .navbar-brand__logo {
    filter: drop-shadow(0 4px 8px rgba(20, 27, 45, 0.12));
}

.avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--color-accent);
}

.theme-toggle-btn {
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
    background: rgba(255, 255, 255, 0.03);
}

.theme-toggle-btn:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent) !important;
    border-color: rgba(233, 69, 96, 0.25) !important;
}

.user-menu-trigger {
    color: var(--color-text) !important;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus {
    color: var(--color-accent) !important;
}

/* --- Main Content --- */
.main-content {
    padding-top: 60px;
    flex: 1 0 auto;
}

/* --- Hero --- */
.hero {
    position: relative;
    padding: 1rem 0 0.6rem;
    overflow: hidden;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.hero__background {
    position: absolute;
    inset: 0;
    background: transparent;
}

html[data-theme="light"] .hero__background {
    background: transparent;
}

.hero__background::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(233, 69, 96, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(243, 156, 18, 0.05) 0%, transparent 50%);
}

.hero__background::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.3;
}

.hero .container-fluid {
    position: relative;
    z-index: 1;
    padding: 0.5rem 1.5rem;
}

.hero__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
}

.hero__intro {
    min-width: 0;
}

.hero__visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__metrics {
    min-width: 0;
}

.hero__badge .badge {
    font-size: calc(0.95rem * var(--hero-badge-scale, 1));
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, calc(5vw * var(--hero-title-scale, 1)), 3.5rem);
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1.1;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.hero__subtitle {
    font-size: calc(1.15rem * var(--hero-subtitle-scale, 1));
    color: var(--color-text-muted);
    max-width: 440px;
    line-height: 1.6;
}

.hero-feature-card {
    margin-top: 1.5rem;
    padding: 1.2rem 1.25rem;
    border-radius: 20px;
    border: 1px solid rgba(233, 69, 96, 0.18);
    background:
        linear-gradient(135deg, rgba(233, 69, 96, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(12, 10, 24, 0.42);
    box-shadow: 0 18px 48px rgba(5, 4, 10, 0.22);
    max-width: 520px;
}

.hero-feature-card__eyebrow,
.hero-selection__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.hero-feature-card__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.hero-feature-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-size: 0.92rem;
    color: var(--color-text-muted);
    margin-bottom: 0.8rem;
}

.hero-feature-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-feature-card__text {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.65;
}

html[data-theme="light"] .hero-feature-card {
    border: 1px solid rgba(233, 69, 96, 0.14);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(244, 233, 237, 0.92)),
        rgba(255, 255, 255, 0.92);
    box-shadow:
        0 22px 48px rgba(35, 28, 43, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .hero-feature-card__title {
    color: #1f2940;
}

html[data-theme="light"] .hero-feature-card__meta,
html[data-theme="light"] .hero-feature-card__text {
    color: rgba(46, 58, 82, 0.78);
}

html[data-theme="light"] .hero-feature-card .btn.btn-accent {
    box-shadow: 0 10px 24px rgba(233, 69, 96, 0.18);
}

.min-vh-40 {
    min-height: 24vh;
}

/* --- Hero Logo --- */
.hero__logo {
    width: 240px;
    height: 240px;
    object-fit: contain;
    filter: drop-shadow(0 8px 32px rgba(233, 69, 96, 0.3));
    animation: hero-logo-float 4s ease-in-out infinite;
}

@keyframes hero-logo-float {
    0%, 100% { transform: translateY(0);   filter: drop-shadow(0 8px 32px rgba(233, 69, 96, 0.3)); }
    50%       { transform: translateY(-8px); filter: drop-shadow(0 16px 40px rgba(233, 69, 96, 0.5)); }
}

/* --- Stat Cards Grid --- */
.hero__stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.hero-selection {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-selection__title {
    font-size: 1.1rem;
    margin: 0;
}

.hero-selection__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.hero-selection-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 100%;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.hero-selection-card:hover,
.hero-selection-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(233, 69, 96, 0.28);
}

.hero-selection-card strong {
    font-size: 0.98rem;
}

.hero-selection-card small,
.hero-selection-card span:not(.hero-selection-card__status) {
    color: var(--color-text-muted);
}

.hero-selection-card__status {
    align-self: flex-start;
}

.stat-card {
    background: var(--color-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card--link {
    color: inherit;
    text-decoration: none;
}

.stat-card:hover {
    border-color: rgba(233, 69, 96, 0.3);
    transform: translateY(-2px);
}

.stat-card--link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card__number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Mobile Responsive --- */
@media (max-width: 767.98px) {
    .stat-card__number {
        display: block;
        text-align: center;
    }
    
    .stat-card__label {
        display: block;
        text-align: center;
    }
}

/* --- Soft Backgrounds --- */
.bg-accent-soft {
    background-color: var(--color-accent-soft) !important;
}

.bg-success-soft {
    background-color: rgba(25, 135, 84, 0.15) !important;
}

.bg-warning-soft {
    background-color: rgba(243, 156, 18, 0.15) !important;
}

.bg-info-soft {
    background-color: rgba(13, 202, 240, 0.15) !important;
}

.section-anchor {
    position: relative;
    top: -84px;
    height: 0;
    pointer-events: none;
}

.documents-library {
    display: grid;
    gap: 1rem;
}

.documents-library__toolbar {
    display: grid;
    gap: 0.75rem;
}

.documents-library__meta {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.documents-library .table > :not(caption) > * > * {
    background: transparent;
}

.documents-library__empty {
    border-top: 1px solid var(--color-border);
}

/* --- Sections --- */
.section {
    padding: 1.4rem 0;
}

.section--muted {
    background: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .section--muted {
    background: rgba(20, 27, 45, 0.03);
}

.section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.section__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.section__subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* --- Event Cards --- */
.event-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.event-card-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: var(--radius-lg);
}

.event-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.event-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.event-card--past {
    opacity: 0.75;
}

.event-card--past:hover {
    opacity: 1;
}

.event-card__image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.event-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-card__image {
    transform: scale(1.05);
}

.event-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg-card));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.event-card__placeholder i {
    font-size: 2.5rem;
    color: var(--color-accent);
    opacity: 0.5;
}

.event-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.event-card__badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.35em 0.75em;
}

.event-card__countdown {
    text-align: center;
    background: var(--color-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
}

.event-card__countdown-number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

.event-card__countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
}

.event-card__countdown--imminent .event-card__countdown-number {
    color: var(--color-gold);
    animation: pulse-glow 2s ease-in-out infinite;
}

.event-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.event-card__meta-item {
    font-size: 0.825rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.event-card__meta-item i {
    font-size: 0.75rem;
}

/* --- Buttons --- */
.btn-accent {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-accent:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn-outline-light {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

html[data-theme="light"] .admin-main .btn-outline-light,
html[data-theme="light"] .admin-wrapper .btn-outline-light,
html[data-theme="light"] .table .btn-outline-light {
    color: #22304a !important;
    border-color: rgba(34, 48, 74, 0.28) !important;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 2px rgba(20, 27, 45, 0.06);
}

html[data-theme="light"] .admin-main .btn-outline-light:hover,
html[data-theme="light"] .admin-main .btn-outline-light:focus,
html[data-theme="light"] .admin-wrapper .btn-outline-light:hover,
html[data-theme="light"] .admin-wrapper .btn-outline-light:focus,
html[data-theme="light"] .table .btn-outline-light:hover,
html[data-theme="light"] .table .btn-outline-light:focus {
    color: #152033 !important;
    border-color: rgba(233, 69, 96, 0.42) !important;
    background: rgba(233, 69, 96, 0.08);
    box-shadow: 0 4px 10px rgba(20, 27, 45, 0.08);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h5 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* --- Footer --- */
.footer {
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
    margin-top: auto;
    flex-shrink: 0;
}

.footer__link {
    color: var(--color-text-muted);
    text-decoration: none;
}

.footer__link:hover {
    color: var(--color-accent);
}

.cookie-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    width: min(32rem, calc(100vw - 2rem));
}

.cookie-banner__inner {
    display: grid;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: rgba(15, 15, 26, 0.94);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
}

.cookie-banner__content {
    max-width: none;
}

.cookie-banner__title {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.cookie-banner__text {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.cookie-banner__actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.static-page {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 2rem 2.25rem;
    min-height: 62vh;
}

.static-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url('../img/logo.webp') center center / min(62vw, 560px) no-repeat;
    opacity: 0.07;
    filter: grayscale(1) saturate(0.8);
    pointer-events: none;
    z-index: 0;
}

.static-page > * {
    position: relative;
    z-index: 1;
}

html[data-theme="light"] .static-page::before {
    opacity: 0.08;
}

.static-page__content {
    display: grid;
    gap: 1.5rem;
}

.static-page .section__header {
    margin-bottom: 2rem !important;
    padding-bottom: 0.75rem;
}

.static-page .section__title {
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    line-height: 0.95;
    margin-bottom: 1rem;
}

.static-page__section-title {
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.error-page {
    padding: 4rem 1.5rem;
}

.error-page__code {
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 800;
    line-height: 1;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.error-page__title {
    margin-bottom: 0.75rem;
}

.error-page__message {
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

/* --- Dropdown dark override --- */
.dropdown-menu-dark {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.dropdown-item:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

html[data-theme="light"] .dropdown-menu-dark {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(31, 42, 68, 0.14);
    box-shadow: 0 22px 50px rgba(31, 42, 68, 0.16);
}

html[data-theme="light"] .dropdown-menu-dark .dropdown-item {
    color: #24324d;
}

html[data-theme="light"] .dropdown-menu-dark .dropdown-item i {
    color: #62708d;
}

html[data-theme="light"] .dropdown-menu-dark .dropdown-item:hover,
html[data-theme="light"] .dropdown-menu-dark .dropdown-item:focus {
    background: rgba(228, 59, 91, 0.1);
    color: #c33253;
}

html[data-theme="light"] .dropdown-menu-dark .dropdown-item:hover i,
html[data-theme="light"] .dropdown-menu-dark .dropdown-item:focus i {
    color: #c33253;
}

html[data-theme="light"] .dropdown-menu-dark .dropdown-divider {
    border-top-color: rgba(31, 42, 68, 0.12);
}

/* --- Animations --- */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; text-shadow: 0 0 10px var(--color-gold); }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* --- Card Entrance Animation --- */
.card--animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card--visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Navbar scroll effect --- */
.navbar--scrolled {
    background: rgba(15, 15, 26, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] .navbar--scrolled {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom-color: rgba(20, 27, 45, 0.08);
    box-shadow: 0 10px 28px rgba(20, 27, 45, 0.10);
}

/* --- Auth Section --- */
.auth-section {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.auth-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.auth-card__logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    display: block;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 4px 24px rgba(233, 69, 96, 0.25));
}

.auth-card__icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.auth-card__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.auth-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover,
.auth-link:focus {
    color: var(--color-accent-strong);
    text-decoration: underline;
}

/* --- Schedule / Planning --- */
.schedule-section {
    padding: 0 0 1.5rem;
}

.schedule-section__title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.schedule-col {
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
}

.schedule-col:last-child {
    border-right: none;
}

.schedule-col__header {
    background: var(--color-bg-secondary);
    padding: 0.6rem 1rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    border-bottom: 1px solid var(--color-border);
}

.schedule-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.schedule-row__time {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-muted);
    min-width: 3.5rem;
    white-space: nowrap;
}

.schedule-row__name {
    flex: 1;
    font-size: 0.85rem;
    text-align: right;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-row__icon {
    font-size: 0.75rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.schedule-row--mancheQualif .schedule-row__name {
    color: var(--color-accent);
    font-weight: 600;
}

.schedule-row--mancheQualif .schedule-row__icon {
    color: var(--color-accent);
}

.schedule-row--chronos .schedule-row__icon {
    color: var(--color-gold);
}

/* --- Profile --- */
.profile-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.profile-card__avatar-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-accent);
}

.profile-card__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card__avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-soft);
    font-size: 3rem;
    color: var(--color-accent);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.22fr);
    gap: 1.5rem;
    align-items: start;
}

.profile-layout__summary {
    padding-right: 1rem;
    border-right: 1px solid var(--color-border);
}

.profile-layout__details {
    min-width: 0;
}

.profile-file-dropzone {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 0.28rem;
    border: 1px dashed rgba(233, 69, 96, 0.32);
    border-radius: 16px;
    padding: 1.05rem 1rem;
    background:
        radial-gradient(circle at top, rgba(233, 69, 96, 0.09), transparent 55%),
        rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.profile-file-dropzone::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.08), transparent 45%, rgba(255, 255, 255, 0.03));
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
}

.profile-file-dropzone:hover {
    border-color: rgba(233, 69, 96, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.12);
}

.profile-file-dropzone:hover::after,
.profile-file-dropzone:focus-within::after,
.profile-file-dropzone:focus::after,
.profile-file-dropzone.is-dragover::after,
.profile-file-dropzone.is-filled::after {
    opacity: 1;
}

.profile-file-dropzone:focus,
.profile-file-dropzone:focus-within {
    outline: none;
    border-color: rgba(233, 69, 96, 0.72);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.12);
}

.profile-file-dropzone.is-dragover {
    border-color: rgba(233, 69, 96, 0.78);
    background:
        radial-gradient(circle at top, rgba(233, 69, 96, 0.16), transparent 58%),
        rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.22) inset;
}

.profile-file-dropzone.is-filled {
    border-style: solid;
    border-color: rgba(233, 69, 96, 0.48);
}

.profile-file-dropzone__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(233, 69, 96, 0.14);
    color: var(--color-accent);
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
    position: relative;
    z-index: 1;
}

.profile-file-dropzone__title {
    font-weight: 700;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.profile-file-dropzone__hint,
.profile-file-dropzone__meta {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}

.profile-file-dropzone__filename {
    margin-top: 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    padding: 0.18rem 0.6rem;
    font-size: 0.78rem;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.profile-file-dropzone.is-filled .profile-file-dropzone__filename {
    border-color: rgba(233, 69, 96, 0.3);
    background: rgba(233, 69, 96, 0.12);
    color: var(--color-text);
}

.profile-file-dropzone__preview {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.55rem;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.profile-file-dropzone__preview--avatar {
    max-width: 140px;
    aspect-ratio: 1 / 1;
}

.profile-file-dropzone__preview--signature {
    min-height: 88px;
    max-width: 320px;
    background: #f8f9fb;
}

.profile-file-dropzone__preview img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

html[data-theme="light"] .profile-card .btn-outline-light {
    color: #22304a !important;
    border-color: rgba(34, 48, 74, 0.28) !important;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 2px rgba(20, 27, 45, 0.06);
}

html[data-theme="light"] .profile-card .btn-outline-light:hover,
html[data-theme="light"] .profile-card .btn-outline-light:focus {
    color: #152033 !important;
    border-color: rgba(233, 69, 96, 0.42) !important;
    background: rgba(233, 69, 96, 0.08);
}

.profile-crop-modal {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.profile-crop-modal-shell {
    background: transparent !important;
    pointer-events: none;
}

.profile-crop-modal-shell .modal-dialog {
    pointer-events: none;
}

.profile-crop-modal-shell .modal-content,
.profile-crop-modal-shell .btn,
.profile-crop-modal-shell .cropper-container {
    pointer-events: auto;
}

.event-modal-shell {
    background: transparent !important;
    pointer-events: none;
}

.event-modal-shell .modal-dialog {
    pointer-events: none;
}

.event-modal-shell .modal-content,
.event-modal-shell .modal-content *,
.event-modal-shell .btn {
    pointer-events: auto;
}

.profile-crop-modal__viewport {
    min-height: 340px;
    max-height: 72vh;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
        rgba(0, 0, 0, 0.16);
    background-position: 0 0, 16px 16px, 0 0;
    background-size: 32px 32px, 32px 32px, auto;
}

.profile-crop-modal__viewport img {
    display: block;
    max-width: 100%;
}

html[data-theme="light"] .profile-crop-modal {
    background: var(--color-bg-card);
}

/* --- Event Detail Hero --- */
.event-hero {
    position: relative;
    padding: 2.4rem 0 1.15rem;
    min-height: 0;
}

.event-hero__background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-bg-primary), var(--color-bg-secondary));
}

.event-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.event-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--color-bg-primary), transparent 60%);
}

.event-hero__content {
    position: relative;
    z-index: 1;
}

.event-hero__title {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 0.45rem;
}

.event-hero__meta {
    color: var(--color-text-muted);
    font-size: 0.96rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
}

.event-hero__summary {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(260px, 0.72fr);
    gap: 0.8rem;
    align-items: start;
}

.event-hero__summary-col {
    min-width: 0;
}

.event-hero__summary-col--description,
.event-hero__summary-col--dates {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(24, 33, 63, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 0.95rem;
}

.event-hero__summary-text {
    color: var(--color-text);
    font-size: 0.94rem;
    line-height: 1.45;
}

.event-hero__badges {
    margin-bottom: 0.8rem;
}

.event-hero__info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.15rem;
}

.event-hero__info-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.42rem 0;
    border-bottom: 1px solid var(--color-border);
}

.event-hero__info-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.event-hero__info-list span {
    color: var(--color-text-muted);
    font-size: 0.84rem;
}

.event-hero__info-list strong {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
}

html[data-theme="light"] .event-hero__summary-col--description,
html[data-theme="light"] .event-hero__summary-col--dates {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(35, 49, 77, 0.12);
    box-shadow: 0 10px 30px rgba(31, 42, 68, 0.08);
}

html[data-theme="light"] .event-hero__summary-text,
html[data-theme="light"] .event-hero__info-list strong {
    color: #1f2a44;
}

html[data-theme="light"] .event-hero__info-list span {
    color: #62708d;
}

/* --- Detail Card --- */
.detail-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1rem;
    margin-bottom: 0;
}

.admin-form-section {
    padding: 1.1rem;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
}

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

.detail-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.detail-list li:last-child {
    border-bottom: none;
}

.detail-list__label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.detail-list__value {
    font-weight: 500;
}

/* --- Admin --- */
.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 72px);
}

.admin-sidebar {
    width: 260px;
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.admin-sidebar__header {
    padding: 1.5rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-sidebar__nav {
    padding: 1rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    font-family: var(--font-display);
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    transition: var(--transition);
}

.admin-sidebar__link:hover,
.admin-sidebar__link.active {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.admin-sidebar__footer {
    padding: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.homepage-feature-events {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.homepage-feature-events__option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.homepage-feature-events__option .form-check-input {
    margin-top: 0.25rem;
    flex: 0 0 auto;
}

.homepage-feature-events__body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.homepage-feature-events__body small {
    color: var(--color-text-muted);
    line-height: 1.5;
}

.admin-main {
    flex: 1;
    overflow-x: auto;
}

.admin-main__content {
    padding: 2rem;
    max-width: 1200px;
}

.admin-events-browser {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.admin-events-browser__toolbar {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
        rgba(0, 0, 0, 0.14);
}

.admin-events-browser__filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(150px, 1fr));
    gap: 0.85rem;
}

.admin-events-browser__filter {
    min-width: 0;
}

.admin-events-browser__search-wrap {
    position: relative;
}

.admin-events-browser__search-wrap i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.admin-events-browser__search-wrap .form-control {
    padding-left: 2.5rem;
}

.admin-events-browser__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-events-browser .table {
    margin-bottom: 0;
}

.admin-events-browser__empty {
    display: grid;
    place-items: center;
    gap: 0.4rem;
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--color-border);
}

.admin-events-browser__empty i {
    font-size: 1.8rem;
    color: var(--color-accent);
}

.admin-events-browser__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem 1.15rem;
    border-top: 1px solid var(--color-border);
}

.admin-events-browser__pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.admin-events-browser__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 5.5rem;
}

.admin-events-browser__actions .btn {
    width: 2.75rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.admin-events-browser__delete-form {
    margin: 0;
}

/* --- Tables --- */
.table-dark {
    --bs-table-bg: var(--color-bg-card);
    --bs-table-border-color: var(--color-border);
}

.table-dark thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    font-weight: 600;
}

html[data-theme="light"] .table-dark {
    --bs-table-bg: rgba(255, 255, 255, 0.88);
    --bs-table-striped-bg: rgba(15, 23, 42, 0.025);
    --bs-table-hover-bg: rgba(15, 23, 42, 0.055);
    --bs-table-color: #23314d;
    --bs-table-border-color: rgba(35, 49, 77, 0.12);
}

html[data-theme="light"] .table-dark > :not(caption) > * > * {
    color: #23314d;
}

html[data-theme="light"] .table-dark thead th {
    color: #5f6f8d;
}

html[data-theme="light"] .table-dark tbody tr {
    color: #23314d;
}

html[data-theme="light"] .table-dark tbody td,
html[data-theme="light"] .table-dark tbody td .fw-semibold,
html[data-theme="light"] .table-dark tbody td .text-muted-light,
html[data-theme="light"] .table-dark tbody td .event-name,
html[data-theme="light"] .table-dark tbody td .event-championship,
html[data-theme="light"] .table-dark tbody td .event-circuit,
html[data-theme="light"] .table-dark tbody td .event-country,
html[data-theme="light"] .table-dark tbody td a:not(.btn),
html[data-theme="light"] .table-dark tbody td strong,
html[data-theme="light"] .table-dark tbody td small {
    color: #23314d !important;
}

html[data-theme="light"] .table-dark tbody td .text-muted-light,
html[data-theme="light"] .table-dark tbody td .event-championship {
    opacity: 0.82;
}

/* --- Form controls dark override --- */
.form-control,
.form-select {
    background-color: var(--color-bg-secondary);
    border-color: var(--color-border);
    color: var(--color-text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--color-bg-secondary);
    border-color: var(--color-accent);
    color: var(--color-text);
    box-shadow: 0 0 0 0.2rem var(--color-accent-soft);
}

.input-group-text {
    background-color: var(--color-bg-card);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .navbar {
        position: fixed;
        z-index: 1050;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .navbar-collapse {
        position: fixed;
        top: 72px;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-width: none;
        transform: none;
        margin: 0;
        padding: 2rem 1.5rem 2rem;
        overflow: hidden;
        background: rgba(10, 14, 28, 0.16) !important;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: calc(100dvh - 72px);
        z-index: 1040;
    }

    .navbar-collapse::before {
        content: none;
    }

    .navbar-collapse .navbar-nav {
        width: 100%;
        align-items: center;
        gap: 0.5rem;
        padding-block: 0.85rem 1rem;
        text-align: center;
    }

    .navbar-collapse .nav-link {
        font-size: 1.8rem;
    }

    html[data-theme="dark"] .navbar-collapse .nav-link {
        color: #fff !important;
    }

    html[data-theme="dark"] .navbar-collapse .nav-link:hover,
    html[data-theme="dark"] .navbar-collapse .nav-link.active {
        color: #fff !important;
    }

    .navbar-collapse > div {
        justify-content: center;
    }

    .navbar-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0;
    }

    .navbar-actions__main {
        order: 1;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.9rem !important;
    }

    .navbar-live-link {
        order: 2;
        width: 100%;
        margin-top: 1.5rem;
    }

    .navbar-live-link__logo {
        height: 120px;
        margin-inline: auto;
    }

    .navbar-actions__main .btn,
    .navbar-actions__main .user-avatar-link {
        min-height: 3.25rem;
        min-width: 3.25rem;
        font-size: 1.05rem;
        padding: 0.75rem 1rem;
        border-radius: 1rem;
        justify-content: center;
    }

    .navbar-actions__main .user-avatar-link {
        display: inline-flex !important;
    }

    .navbar-actions__main > .btn-accent {
        flex: 0 0 100%;
        max-width: 18rem;
        margin-top: 0.25rem;
    }

    html[data-theme="light"] .navbar-collapse {
        background: rgba(248, 249, 252, 0.24) !important;
    }

    .hero {
        padding: 0.9rem 0 0.55rem;
    }

    .hero__layout {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .hero__title {
        font-size: calc(2rem * var(--hero-title-scale, 1));
    }

    .hero__subtitle {
        max-width: 100%;
        margin-inline: auto;
    }

    .hero__stats-grid {
        max-width: 700px;
        margin-inline: auto;
    }

    .hero-selection__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section__header {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .admin-sidebar__nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.5rem;
    }

    .admin-sidebar__footer {
        display: none;
    }

    .admin-events-browser__filters {
        grid-template-columns: 1fr;
    }

    .admin-events-browser__meta,
    .admin-events-browser__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-events-browser__pagination {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner__actions {
        justify-content: stretch;
    }

    .cookie-banner__actions .btn {
        width: 100%;
    }

    .homepage-feature-events {
        grid-template-columns: 1fr;
    }

    .homepage-feature-typography__layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .hero {
        padding: 0.75rem 0 0.45rem;
    }

    .hero__title {
        font-size: calc(1.75rem * var(--hero-title-scale, 1));
    }

    .hero__stats-grid {
        grid-template-columns: 1fr;
    }

    .hero__logo {
        width: 190px;
        height: 190px;
    }

    .hero-selection__grid {
        grid-template-columns: 1fr;
    }

    .event-card__image-wrapper {
        height: 160px;
    }

    .section {
        padding: 2rem 0;
    }
}

/* --- PDF Signature Workbench --- */
.pdf-workbench {
    padding: 2.25rem 0 3rem;
}

.pdf-workbench__hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.35rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 85% 15%, rgba(233, 69, 96, 0.12), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(243, 156, 18, 0.08), transparent 50%),
        rgba(22, 33, 62, 0.72);
    backdrop-filter: blur(14px);
}

.pdf-workbench__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(233, 69, 96, 0.25);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.pdf-workbench__title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 1.5px;
    margin-bottom: 0.6rem;
}

.pdf-workbench__subtitle {
    color: var(--color-text-muted);
    max-width: 70ch;
    line-height: 1.55;
    margin-bottom: 0;
}

.pdf-workbench__hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    min-width: min(100%, 340px);
}

.pdf-workbench__layout {
    display: grid;
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.pdf-panel,
.pdf-stage-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(22, 33, 62, 0.72);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
}

.pdf-panel {
    padding: 1rem;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 96px);
    overflow: auto;
}

.pdf-panel__section + .pdf-panel__section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.pdf-panel__section-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.upload-tile {
    display: block;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.85rem;
}

.upload-tile:hover {
    border-color: rgba(233, 69, 96, 0.35);
    background: rgba(233, 69, 96, 0.05);
    transform: translateY(-1px);
}

.upload-tile--compact {
    padding: 0.9rem;
}

.upload-tile__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(233, 69, 96, 0.12);
    color: var(--color-accent);
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.upload-tile__title {
    font-weight: 600;
}

.upload-tile__hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.pdf-meta {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.16);
}

.pdf-meta__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.pdf-meta__row + .pdf-meta__row {
    margin-top: 0.35rem;
}

.pdf-meta__row span {
    color: var(--color-text-muted);
}

.pdf-meta__row strong {
    text-align: right;
    word-break: break-word;
}

.pdf-nudge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.pdf-stage-panel {
    min-height: 720px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pdf-stage-panel__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.16);
}

.pdf-stage-panel__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.legend-chip--date {
    border-color: rgba(13, 202, 240, 0.25);
    color: #91e4f7;
}

.legend-chip--signature {
    border-color: rgba(233, 69, 96, 0.25);
    color: #ff97a8;
}

.pdf-stage-panel__zoomhint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: right;
}

.pdf-stage-shell {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 560px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.005)),
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 12px,
            transparent 12px,
            transparent 24px
        );
    overflow: auto;
    padding: 0.75rem;
}

.pdf-stage-empty {
    display: grid;
    place-items: center;
    text-align: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    padding: 1.5rem;
}

.pdf-stage-empty i {
    font-size: 2rem;
    color: var(--color-accent);
}

.pdf-stage {
    position: relative;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    background: #fff;
    border-radius: 4px;
    outline: none;
}

.pdf-stage:focus-visible {
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 0 0 3px rgba(233, 69, 96, 0.35);
}

.pdf-stage__canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

.pdf-overlay {
    position: absolute;
    border: 1px dashed rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.08);
    padding: 0;
    margin: 0;
    cursor: move;
    touch-action: none;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pdf-overlay.is-active {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.pdf-overlay__badge {
    position: absolute;
    left: 6px;
    top: -14px;
    font-size: 0.65rem;
    line-height: 1;
    padding: 0.2rem 0.35rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    pointer-events: none;
}

.pdf-overlay--date {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border-style: dashed;
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(255, 255, 255, 0.78);
    padding: 0.2rem 0.45rem;
    min-width: 70px;
}

.pdf-overlay--date .pdf-overlay__content {
    line-height: 1.1;
    white-space: nowrap;
}

.pdf-overlay--signature {
    display: grid;
    place-items: center;
    border-style: dashed;
    border-color: rgba(233, 69, 96, 0.4);
    background:
        linear-gradient(45deg, rgba(233, 69, 96, 0.05), rgba(233, 69, 96, 0.02)),
        rgba(255, 255, 255, 0.72);
    padding: 0.25rem;
}

.pdf-overlay--signature img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

.pdf-status {
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 0.9rem;
    color: var(--color-text-muted);
}

.pdf-status--success {
    border-color: rgba(25, 135, 84, 0.25);
    color: #90e0b5;
}

.pdf-status--error {
    border-color: rgba(220, 53, 69, 0.25);
    color: #ff98a5;
}

.pdf-status--info {
    border-color: rgba(13, 202, 240, 0.2);
    color: #9ceafa;
}

.pdf-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pdf-spec-grid > div {
    border: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.16);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
}

.pdf-spec-grid span {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.pdf-spec-grid strong {
    font-size: 0.9rem;
}

.signer-stack {
    display: grid;
    gap: 0.85rem;
}

.signer-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.16);
    padding: 0.75rem;
}

.signer-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.signer-card__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.signer-card__title-wrap > i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(233, 69, 96, 0.12);
    color: var(--color-accent);
}

.signer-card__title {
    font-weight: 700;
    line-height: 1.1;
}

.signer-card__subtitle {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.signer-card__footer {
    margin-top: 0.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.signer-card__status {
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.pdf-panel__section--hidden {
    display: none;
}

.pdf-cartouche-overlay {
    position: absolute;
    border: none;
    background: transparent;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    overflow: visible;
    pointer-events: none;
}

.pdf-cartouche-overlay__header {
    display: none;
}

.pdf-cartouche-overlay__grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 3%;
}

.pdf-cartouche-cell {
    position: relative;
    min-width: 0;
    min-height: 0;
}

.pdf-cartouche-cell.is-disabled {
    opacity: 0.5;
}

.pdf-cartouche-cell.is-omitted {
    visibility: hidden;
    opacity: 0;
}

.pdf-cartouche-cell__role {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 26%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #243946;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    text-align: center;
    line-height: 1;
    padding: 0 0.12rem;
}

.pdf-cartouche-cell__name {
    position: absolute;
    left: 1%;
    right: 1%;
    top: 76%;
    font-size: 0.72rem;
    color: #27323b;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-cartouche-cell__sigbox {
    position: absolute;
    left: 4%;
    top: 26%;
    width: 92%;
    height: 50%;
    border: 2px solid rgba(24, 53, 66, 0.95);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 0.1rem 0.2rem;
}

.pdf-cartouche-cell__sigbox img {
    max-width: 78%;
    max-height: 68%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.pdf-cartouche-cell__sigbox span {
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    padding: 0.1rem 0.25rem;
}

.pdf-cartouche-cell__cross {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -56%);
    font-size: 2rem;
    line-height: 1;
    font-weight: 300;
    color: rgba(36, 57, 70, 0.75);
    pointer-events: none;
}

.pdf-cartouche-cell__datetime {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    color: #2f3a44;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-accent:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 6px;
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
}

@media (max-width: 1199.98px) {
    .pdf-workbench__layout {
        grid-template-columns: 1fr;
    }

    .pdf-panel {
        position: static;
        max-height: none;
    }

    .pdf-stage-panel {
        min-height: 620px;
    }
}

@media (max-width: 767.98px) {
    .pdf-workbench {
        padding-top: 1.25rem;
    }

    .pdf-workbench__hero {
        flex-direction: column;
        padding: 1rem;
    }

    .pdf-workbench__hero-actions {
        min-width: 100%;
        width: 100%;
    }

    .pdf-stage-panel__toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdf-stage-panel__zoomhint {
        text-align: left;
    }

    .pdf-stage-shell {
        min-height: 420px;
        padding: 0.5rem;
    }

    .pdf-stage-panel {
        padding: 0.75rem;
        min-height: 520px;
    }

    .pdf-nudge-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pdf-spec-grid {
        grid-template-columns: 1fr;
    }

    .signer-card__header,
    .signer-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Hierarchy Prototype */
.hierarchy-proto {
    padding-top: 1.25rem;
}

.hierarchy-proto__hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hierarchy-proto__title {
    margin: 0;
    font-size: clamp(1.45rem, 1.8vw + 1rem, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hierarchy-proto__subtitle {
    margin: 0.5rem 0 0;
    color: var(--color-text-muted);
    max-width: 62ch;
}

.hierarchy-proto__meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    min-width: 280px;
}

.hierarchy-proto__meta-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        var(--color-surface);
    display: grid;
    gap: 0.2rem;
}

.hierarchy-proto__filters {
    padding: 1rem;
}

.hierarchy-proto__filters-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.8rem;
}

.hierarchy-filter {
    grid-column: span 3;
}

.hierarchy-filter--wide {
    grid-column: span 6;
}

.hierarchy-proto__breadcrumb {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.hierarchy-proto__breadcrumb .bi-chevron-right {
    font-size: 0.7rem;
    opacity: 0.7;
}

.hierarchy-crumb {
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.hierarchy-crumb--active {
    border-color: rgba(233, 69, 96, 0.35);
    color: var(--color-text);
    background: rgba(233, 69, 96, 0.08);
}

.hierarchy-proto__layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.hierarchy-sidebar {
    position: sticky;
    top: 84px;
}

.hierarchy-tree {
    display: grid;
    gap: 0.8rem;
}

.hierarchy-tree__node {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.015);
}

.hierarchy-tree__node.is-active {
    border-color: rgba(233, 69, 96, 0.35);
    box-shadow: inset 0 0 0 1px rgba(233, 69, 96, 0.14);
}

.hierarchy-tree__node-head {
    margin-bottom: 0.6rem;
}

.hierarchy-tree__node-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.hierarchy-tree__node-title i {
    color: var(--color-accent);
}

.hierarchy-tree__children {
    display: grid;
    gap: 0.4rem;
}

.hierarchy-tree__leaf {
    width: 100%;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: left;
}

.hierarchy-tree__leaf:hover {
    border-color: rgba(233, 69, 96, 0.25);
}

.hierarchy-tree__leaf.is-active {
    border-color: rgba(233, 69, 96, 0.35);
    background: rgba(233, 69, 96, 0.07);
}

.hierarchy-tree__leaf-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hierarchy-tree__leaf-label i {
    color: var(--color-text-muted);
}

.hierarchy-tree__count {
    border-radius: 999px;
    border: 1px solid var(--color-border);
    padding: 0.1rem 0.42rem;
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.hierarchy-content__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.hierarchy-content__header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.hierarchy-day-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.hierarchy-day-card {
    min-height: 100%;
    padding: 0.9rem;
}

.hierarchy-day-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
}

.hierarchy-day-card__count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.hierarchy-day-card__body {
    display: grid;
    gap: 0.85rem;
}

.hierarchy-slot {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.015);
    border-radius: 12px;
    padding: 0.65rem;
}

.hierarchy-slot__time {
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: -0.02em;
}

.hierarchy-slot__titles {
    margin-bottom: 0.5rem;
}

.hierarchy-slot__chapter {
    font-weight: 700;
    line-height: 1.2;
}

.hierarchy-slot__subchapter {
    color: var(--color-text-muted);
    font-size: 0.86rem;
}

.hierarchy-doc-list {
    display: grid;
    gap: 0.45rem;
}

.hierarchy-doc-row {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.5rem;
    display: grid;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.02);
}

.hierarchy-doc-row__main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
}

.hierarchy-doc-row__title {
    font-weight: 600;
    line-height: 1.2;
}

.hierarchy-doc-row__meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hierarchy-doc-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.hierarchy-format-btn {
    min-width: 50px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-soft {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.22rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-soft--success {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
}

.badge-soft--warning {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}

.badge-soft--secondary {
    color: #d1d5db;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}

.badge-soft--dark,
.badge-soft--slate {
    color: #cbd5e1;
    background: rgba(71, 85, 105, 0.14);
    border-color: rgba(100, 116, 139, 0.22);
}

.badge-soft--info {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.22);
}

.system-list {
    display: grid;
    gap: 0.85rem;
}

.system-list div {
    display: grid;
    grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.system-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.system-list dt {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.system-list dd {
    margin: 0;
    word-break: break-word;
}

.system-extension-grid {
    display: grid;
    gap: 0.75rem;
}

.system-extension-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.homepage-feature-current-image {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.homepage-feature-current-image img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.homepage-feature-typography__presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.homepage-feature-typography__presets .btn.active,
.homepage-feature-typography__presets .btn[aria-pressed="true"] {
    border-color: rgba(233, 69, 96, 0.45);
    background: rgba(233, 69, 96, 0.16);
    color: var(--color-text);
}

.homepage-feature-typography__layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
    gap: 1.5rem;
    align-items: stretch;
}

.homepage-feature-typography__preview {
    --hero-badge-scale: 1;
    --hero-title-scale: 1;
    --hero-subtitle-scale: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    padding: 1.4rem;
    border-radius: 24px;
    border: 1px solid rgba(233, 69, 96, 0.18);
    background:
        radial-gradient(circle at top right, rgba(233, 69, 96, 0.18), transparent 36%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        rgba(14, 20, 40, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .homepage-feature-typography__preview {
    border-color: rgba(233, 69, 96, 0.14);
    background:
        radial-gradient(circle at top right, rgba(233, 69, 96, 0.12), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 239, 242, 0.94)),
        rgba(255, 255, 255, 0.95);
    box-shadow:
        0 18px 42px rgba(35, 28, 43, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.homepage-feature-typography__preview .hero__badge {
    margin-bottom: 1rem !important;
}

.homepage-feature-typography__preview-title {
    margin-bottom: 0.9rem;
}

.homepage-feature-typography__preview .hero__title {
    font-size: calc(2.35rem * var(--hero-title-scale, 1));
}

.homepage-feature-typography__preview-subtitle {
    max-width: 34ch;
}

html[data-theme="light"] .homepage-feature-typography__preview .hero__title {
    color: #1f2940;
}

html[data-theme="light"] .homepage-feature-typography__preview .hero__subtitle {
    color: rgba(46, 58, 82, 0.78);
}

.homepage-feature-typography__controls {
    display: grid;
    gap: 1rem;
}

.homepage-feature-scale-control {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.025);
}

.homepage-feature-scale-control__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.homepage-feature-scale-control__header strong {
    color: var(--color-accent);
}

.homepage-feature-scale-control input[type="range"] {
    width: 100%;
}

[data-theme="light"] .hierarchy-crumb,
[data-theme="light"] .hierarchy-tree__node,
[data-theme="light"] .hierarchy-tree__leaf,
[data-theme="light"] .hierarchy-slot,
[data-theme="light"] .hierarchy-doc-row {
    background: rgba(15, 23, 42, 0.02);
}

@media (max-width: 1399.98px) {
    .hierarchy-day-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1199.98px) {
    .hierarchy-proto__hero {
        flex-direction: column;
    }

    .hierarchy-proto__meta {
        min-width: 0;
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .hierarchy-proto__layout {
        grid-template-columns: 1fr;
    }

    .hierarchy-sidebar {
        position: static;
    }
}

@media (max-width: 991.98px) {
    .hierarchy-filter {
        grid-column: span 6;
    }

    .hierarchy-filter--wide {
        grid-column: span 12;
    }

    .hierarchy-day-grid {
        grid-template-columns: 1fr;
    }

    .hierarchy-content__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .hierarchy-proto__meta {
        grid-template-columns: 1fr;
    }

    .hierarchy-slot {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .hierarchy-doc-row__main {
        flex-direction: column;
    }

    .hierarchy-doc-row__meta {
        justify-content: flex-start;
    }
}

/* Event hierarchy board */
.event-hierarchy__selectors {
    padding: 0.7rem 0.8rem;
}

.event-hierarchy__selectors-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1.6fr 1fr;
    gap: 0.7rem 0.85rem;
    align-items: start;
}

.event-hierarchy__select-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.22rem;
}

.event-hierarchy__select-value {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    font-size: 0.92rem;
}

.event-hierarchy__pills,
.event-hierarchy__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.event-hierarchy__pill,
.event-hierarchy__link {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.24rem 0.58rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.84rem;
}

.event-hierarchy__pill.is-active,
.event-hierarchy__link.is-active {
    border-color: rgba(233, 69, 96, 0.35);
    background: rgba(233, 69, 96, 0.08);
}

.event-hierarchy__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    align-items: center;
    margin-top: 0.55rem;
}

.event-category-block + .event-category-block {
    margin-top: 0.75rem;
}

.event-hierarchy {
    padding-top: 0.7rem;
    padding-bottom: 1rem;
}

.event-free-docs-launcher {
    margin-bottom: 0.75rem !important;
}

.event-category-block__shell {
    background:
        linear-gradient(180deg, rgba(26, 38, 74, 0.94), rgba(18, 27, 55, 0.96)),
        rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(126, 146, 196, 0.18);
    border-radius: 28px;
    padding: 0.85rem;
    box-shadow: 0 20px 42px rgba(6, 10, 22, 0.22);
}

.event-category-block__banner {
    margin-bottom: 0.7rem !important;
    padding: 0.75rem 0.95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.event-category-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.event-category-block__header h3 {
    font-size: 0.98rem;
    margin-bottom: 0.08rem !important;
}

.event-category-block__header p {
    font-size: 0.76rem;
}

.event-board__days {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.event-day-column {
    padding: 0.45rem 0.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: none;
}

.event-day-column__header {
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-border);
}

.event-pdf-modal {
    background:
        linear-gradient(180deg, rgba(24, 35, 67, 0.96), rgba(18, 24, 46, 0.98)),
        rgba(15, 23, 42, 0.98);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.event-pdf-modal .modal-header {
    border-bottom-color: var(--color-border);
}

.event-pdf-modal .modal-footer {
    border-top-color: var(--color-border);
}

.event-pdf-modal__body {
    padding: 0.75rem;
}

.event-pdf-modal__frame {
    width: 100%;
    min-height: min(82vh, 1100px);
    border: 0;
    border-radius: 12px;
    background: #fff;
}

.event-free-docs {
    display: grid;
    gap: 1rem;
}

.event-free-docs-launcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.event-free-docs-launcher .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

html[data-theme="light"] .profile-crop-modal,
html[data-theme="light"] .event-pdf-modal {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 252, 0.98)),
        rgba(255, 255, 255, 0.98);
    border-color: rgba(35, 49, 77, 0.14);
    color: #1f2a44;
    box-shadow: 0 24px 60px rgba(31, 42, 68, 0.18);
}

html[data-theme="light"] .event-category-block__shell {
    background:
        linear-gradient(180deg, rgba(214, 227, 247, 0.95), rgba(201, 218, 242, 0.98)),
        rgba(210, 223, 243, 0.96);
    border-color: rgba(125, 149, 185, 0.28);
    box-shadow: 0 20px 36px rgba(110, 134, 170, 0.16);
}

html[data-theme="light"] .event-category-block__banner,
html[data-theme="light"] .event-day-column {
    background: rgba(255, 255, 255, 0.38);
}

html[data-theme="light"] .event-pdf-modal .modal-header,
html[data-theme="light"] .event-pdf-modal .modal-footer,
html[data-theme="light"] .profile-crop-modal .modal-header,
html[data-theme="light"] .profile-crop-modal .modal-footer {
    border-color: rgba(35, 49, 77, 0.12);
}

html[data-theme="light"] .event-pdf-modal .modal-title,
html[data-theme="light"] .event-pdf-modal .modal-body,
html[data-theme="light"] .event-pdf-modal .modal-body p,
html[data-theme="light"] .event-pdf-modal .modal-body label,
html[data-theme="light"] .profile-crop-modal .modal-title,
html[data-theme="light"] .profile-crop-modal .modal-body,
html[data-theme="light"] .profile-crop-modal .modal-body p,
html[data-theme="light"] .profile-crop-modal .modal-body label {
    color: #1f2a44;
}

html[data-theme="light"] .event-pdf-modal .text-muted-light,
html[data-theme="light"] .profile-crop-modal .text-muted-light {
    color: #62708d !important;
}

html[data-theme="light"] .event-pdf-modal .btn-outline-light,
html[data-theme="light"] .profile-crop-modal .btn-outline-light {
    color: #2c3c59;
    border-color: rgba(44, 60, 89, 0.24);
    background: rgba(44, 60, 89, 0.04);
}

html[data-theme="light"] .event-pdf-modal .btn-outline-light:hover,
html[data-theme="light"] .event-pdf-modal .btn-outline-light:focus,
html[data-theme="light"] .profile-crop-modal .btn-outline-light:hover,
html[data-theme="light"] .profile-crop-modal .btn-outline-light:focus {
    color: #1f2a44;
    border-color: rgba(44, 60, 89, 0.34);
    background: rgba(44, 60, 89, 0.1);
}

html[data-theme="light"] .event-pdf-modal .btn-close-white,
html[data-theme="light"] .profile-crop-modal .btn-close-white {
    filter: none;
    opacity: 0.72;
}

html[data-theme="light"] .event-pdf-modal .btn-close-white:hover,
html[data-theme="light"] .event-pdf-modal .btn-close-white:focus,
html[data-theme="light"] .profile-crop-modal .btn-close-white:hover,
html[data-theme="light"] .profile-crop-modal .btn-close-white:focus {
    opacity: 1;
}

html[data-theme="light"] .event-pdf-modal .alert-warning,
html[data-theme="light"] .profile-crop-modal .alert-warning {
    color: #7c5200;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.28);
}

.event-free-docs-launcher .btn .badge {
    font-size: 0.74rem;
}

.event-free-docs__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.event-free-docs__form {
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
}

.event-pdf-upload-modal__form {
    display: grid;
    gap: 0.8rem;
}

.event-pdf-upload-modal__dialog {
    max-width: 560px;
}

.event-pdf-upload-modal__summary {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.62rem 0.78rem;
    background: rgba(255, 255, 255, 0.03);
}

.event-pdf-upload-modal__eyebrow {
    color: var(--color-text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.event-pdf-upload-modal__title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 0.08rem;
}

.event-pdf-upload-modal__meta {
    color: var(--color-text-muted);
    font-size: 0.74rem;
    margin-top: 0.1rem;
}

.event-pdf-upload-modal__fieldset {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.62rem 0.7rem 0.7rem;
    background: rgba(255, 255, 255, 0.02);
}

.event-pdf-upload-modal__legend {
    width: auto;
    margin: 0;
    padding: 0 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.event-pdf-upload-modal__options {
    display: grid;
    gap: 0.3rem;
}

.event-pdf-upload-modal__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start;
    padding: 0.46rem 0.56rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.event-pdf-upload-modal__option input {
    margin-top: 0.1rem;
}

.event-pdf-upload-modal__option span {
    display: grid;
    gap: 0.02rem;
}

.event-pdf-upload-modal__option strong {
    line-height: 1.2;
    font-size: 0.86rem;
}

.event-pdf-upload-modal__option small {
    color: var(--color-text-muted);
    line-height: 1.2;
    font-size: 0.72rem;
}

.event-pdf-upload-modal__option:has(input:checked) {
    border-color: rgba(233, 69, 96, 0.55);
    background: rgba(233, 69, 96, 0.08);
    box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.16) inset;
}

.event-pdf-upload-modal__visibility-row {
    border: 1px solid rgba(233, 69, 96, 0.28);
    border-radius: 12px;
    overflow: hidden;
}

.event-pdf-upload-modal__file {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.62rem 0.78rem;
    background: rgba(255, 255, 255, 0.02);
}

.event-pdf-upload-modal__file .form-label {
    margin-bottom: 0.32rem;
}

.event-free-docs__list {
    display: grid;
    gap: 0.6rem;
}

.event-free-docs__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.event-free-docs__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: flex-end;
}

.event-free-docs__visibility-toggle {
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.event-free-docs__visibility-toggle:hover,
.event-free-docs__visibility-toggle:focus-visible {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.event-free-docs__visibility-toggle:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.event-day-column__body {
    display: grid;
    gap: 0.4rem;
}

.event-slot {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.34rem 0.4rem;
    background: rgba(255, 255, 255, 0.02);
}

.event-slot__time {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
}

.event-slot__rows {
    display: grid;
    gap: 0.25rem;
}

.event-doc-group {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.28rem 0.32rem;
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 0.22rem;
}

.event-doc-group__chapter {
    color: var(--color-accent);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.15;
}

.event-doc-group__subchapter {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.15;
    margin-top: -0.04rem;
}

.event-doc-group__rows {
    display: grid;
    gap: 0.25rem;
}

.event-doc-line {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.3rem 0.34rem;
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 0.18rem;
}

.event-doc-line__titles {
    display: grid;
    gap: 0.02rem;
}

.event-doc-line__chapter {
    color: var(--color-accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.15;
}

.event-doc-line__subchapter {
    color: var(--color-text-muted);
    font-size: 0.7rem;
    line-height: 1.15;
}

.event-doc-line__name {
    font-weight: 700;
    line-height: 1.1;
    font-size: 0.82rem;
}

.event-doc-line__assets {
    display: flex;
    align-items: center;
    gap: 0.22rem;
    flex-wrap: wrap;
}

.event-doc-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.08rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.event-doc-inline-form {
    margin: 0;
}

.event-doc-line__placeholder {
    color: var(--color-text-muted);
    font-size: 0.74rem;
}

.event-doc-upload {
    margin: 0;
}

.event-doc-upload.is-uploading {
    opacity: 0.8;
}

.event-doc-upload__feedback {
    margin-top: 0.22rem;
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.event-doc-upload__feedback--info {
    color: #9ceafa;
}

.event-doc-upload__feedback--error {
    color: #ff98a5;
}

.profile-signature-preview {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0.75rem;
    background: #f8fafc;
    min-height: 110px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.profile-signature-preview img {
    max-width: 100%;
    width: min(100%, 280px);
    max-height: 90px;
    object-fit: contain;
}

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

    .profile-layout__summary {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 1.25rem;
    }
}

.event-doc-line__workflow {
    display: flex;
    gap: 0.18rem;
    margin-right: 0.1rem;
}

.event-sign-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.event-sign-dot--success {
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.25);
}

.event-sign-dot--warning {
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.25);
}

.event-sign-dot--secondary {
    background: rgba(148, 163, 184, 0.14);
    color: #d1d5db;
    border-color: rgba(148, 163, 184, 0.22);
}

.event-sign-dot--dark {
    background: rgba(71, 85, 105, 0.18);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.22);
}

.event-sign-dot--public {
    background: rgba(14, 165, 233, 0.14);
    color: #93c5fd;
    border-color: rgba(14, 165, 233, 0.28);
}

.event-doc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    border-radius: 999px;
    font-weight: 700;
    min-width: 46px;
    min-height: 30px;
    font-size: 0.74rem;
    padding: 0.18rem 0.55rem;
}

.event-doc-btn--icon {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
}

.event-doc-btn--icon-pair {
    min-width: 44px;
    height: 32px;
    padding: 0 0.55rem;
    cursor: pointer;
}

.event-doc-btn--icon-pair input {
    display: none;
}

.event-doc-btn--icon-pair i:last-of-type {
    font-size: 0.95em;
}

html[data-theme="light"] .event-doc-action-group {
    background: rgba(15, 23, 42, 0.055);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

html[data-theme="light"] .event-sign-dot--success {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.42);
}

html[data-theme="light"] .event-sign-dot--warning {
    background: rgba(245, 158, 11, 0.22);
    color: #9a6700;
    border-color: rgba(245, 158, 11, 0.42);
}

html[data-theme="light"] .event-sign-dot--secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #475569;
    border-color: rgba(100, 116, 139, 0.34);
}

html[data-theme="light"] .event-sign-dot--dark {
    background: rgba(71, 85, 105, 0.16);
    color: #334155;
    border-color: rgba(71, 85, 105, 0.3);
}

html[data-theme="light"] .event-sign-dot--public {
    background: rgba(14, 165, 233, 0.16);
    color: #0369a1;
    border-color: rgba(14, 165, 233, 0.32);
}

.event-doc-btn--success {
    background: rgba(16, 185, 129, 0.16);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.24);
}

.event-doc-btn--warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.event-doc-btn--secondary {
    background: rgba(148, 163, 184, 0.14);
    color: #d1d5db;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.event-doc-btn--slate,
.event-doc-btn--dark {
    background: rgba(71, 85, 105, 0.16);
    color: #cbd5e1;
    border: 1px solid rgba(100, 116, 139, 0.22);
}

.event-doc-btn--danger {
    background: rgba(233, 69, 96, 0.12);
    color: #ff8ca0;
    border: 1px solid rgba(233, 69, 96, 0.24);
}

html[data-theme="light"] .event-doc-btn--success {
    background: rgba(16, 185, 129, 0.22);
    color: #046c4e;
    border-color: rgba(16, 185, 129, 0.44);
}

html[data-theme="light"] .event-doc-btn--warning {
    background: rgba(245, 158, 11, 0.24);
    color: #7c5200;
    border-color: rgba(245, 158, 11, 0.48);
}

html[data-theme="light"] .event-doc-btn--secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #334155;
    border-color: rgba(100, 116, 139, 0.36);
}

html[data-theme="light"] .event-doc-btn--slate,
html[data-theme="light"] .event-doc-btn--dark {
    background: rgba(71, 85, 105, 0.16);
    color: #243447;
    border-color: rgba(71, 85, 105, 0.34);
}

html[data-theme="light"] .event-doc-btn--danger {
    background: rgba(207, 41, 74, 0.16);
    color: #9f1239;
    border-color: rgba(207, 41, 74, 0.38);
}

html[data-theme="light"] .event-doc-btn:hover,
html[data-theme="light"] .event-doc-btn:focus-visible {
    filter: brightness(0.96) saturate(1.06);
}

@media (min-width: 992px) {
    .event-doc-line {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.4rem;
        align-items: center;
    }

    .event-doc-line__assets {
        justify-content: flex-end;
    }
}

@media (min-width: 1600px) {
    .event-board__days {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.signature-flow-card {
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
}

.signature-flow-card__topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.signature-flow-card__workflow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.signature-flow-step {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
}

.signature-flow-step__label {
    font-weight: 700;
}

.signature-flow-step__status {
    color: var(--color-text-muted);
}

.signature-flow-step--success {
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.12);
}

.signature-flow-step--warning {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.12);
}

.signature-flow-step--secondary,
.signature-flow-step--dark {
    border-color: rgba(100, 116, 139, 0.22);
    background: rgba(71, 85, 105, 0.14);
}

.signature-review-card__viewer {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.signature-review-app {
    position: relative;
    overflow: hidden;
    min-height: 620px;
}

.signature-review-state {
    display: grid;
    gap: 0.9rem;
    transition:
        opacity 220ms ease,
        transform 260ms ease,
        visibility 220ms ease;
}

.signature-review-state__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.signature-review-state__footer {
    display: grid;
    gap: 0.9rem;
    justify-items: center;
}

.signature-review-state__footer--preview {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    text-align: center;
}

.signature-flow-card[data-mode="review"] .signature-review-state--preview {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    visibility: hidden;
    pointer-events: none;
}

.signature-flow-card[data-mode="preview"] .signature-review-state--review {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(-18px) scale(0.985);
    visibility: hidden;
    pointer-events: none;
}

.signature-flow-card[data-mode="preview"] .signature-review-state--preview,
.signature-flow-card[data-mode="review"] .signature-review-state--review {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}

.signature-review-app__specimen-shell {
    min-height: 88px;
    border-radius: 12px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    padding: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.signature-review-app__specimen-image {
    max-width: 240px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.signature-review-app__confirm {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    margin: 0;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: rgba(0, 0, 0, 0.14);
}

.signature-review-app__confirm .form-check-input {
    margin-top: 0;
    margin-left: 0;
    flex: 0 0 auto;
}

.signature-review-app__confirm .form-check-label {
    margin: 0;
}

.signature-review-preview {
    display: grid;
    gap: 0.45rem;
    justify-items: stretch;
}

.signature-review-preview__frame {
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        rgba(0, 0, 0, 0.18);
    min-height: 360px;
    overflow: hidden;
    padding: 0.7rem;
    width: 100%;
}

.signature-review-preview__empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.signature-review-preview__stage {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.signature-review-preview__surface {
    position: relative;
    will-change: transform;
    transition: transform 260ms ease;
}

.signature-review-preview__canvas {
    display: block;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
    max-width: 100%;
    height: auto;
}

.pdf-cartouche-overlay--compact .pdf-cartouche-cell__role {
    font-size: 0.78rem;
}

.pdf-cartouche-overlay--compact .pdf-cartouche-cell__name,
.pdf-cartouche-overlay--compact .pdf-cartouche-cell__datetime {
    font-size: 0.66rem;
}

.signature-review-app__status[data-tone="success"] {
    color: #90e0b5 !important;
}

.signature-review-app__status[data-tone="error"] {
    color: #ff98a5 !important;
}

.signature-review-state__footer--preview .signature-review-app__status {
    max-width: 52rem;
    text-align: center;
}

.signature-flow-card[data-mode="preview"] .signature-review-preview__frame {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.admin-planning__hero,
.admin-planning__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.admin-planning__hero {
    position: relative;
    overflow: hidden;
}

.admin-planning__hero > * {
    position: relative;
    z-index: 1;
}

.admin-planning__hero--with-image {
    background:
        linear-gradient(120deg, rgba(16, 24, 46, 0.9), rgba(24, 35, 67, 0.78)),
        var(--admin-planning-hero-image) center/cover no-repeat;
    border-color: rgba(255, 255, 255, 0.08);
}

.admin-planning__hero--with-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(90deg, rgba(10, 15, 30, 0.42), rgba(10, 15, 30, 0.16));
    pointer-events: none;
}

.admin-planning__event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    color: var(--color-text-muted);
}

.admin-planning__hero-actions,
.admin-planning__toolbar-actions,
.admin-planning__sort-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-planning__inline-create,
.admin-planning__new-slot,
.admin-planning__slot-form,
.admin-planning__day-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-planning__add-day-button {
    min-width: 16rem;
    justify-content: center;
}

.admin-planning__inline-create--aligned {
    width: 100%;
    justify-content: flex-end;
}

.admin-planning__inline-create--aligned input[type="date"] {
    width: 16rem;
    flex: 0 0 16rem;
}

.admin-planning__toolbar-actions {
    align-items: center;
    justify-content: flex-end;
}

.admin-planning__toolbar-copy {
    flex: 1;
    min-width: 0;
}

.admin-planning__toolbar-actions--stacked {
    flex-direction: column;
    align-items: flex-end;
}

.admin-planning__days {
    display: grid;
    gap: 0;
}

.admin-planning__day {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
}

.admin-planning__day--create {
    padding: 0.75rem 1.1rem;
}

.admin-planning__day-header,
.admin-planning__slot-header,
.admin-planning__item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.admin-planning__day-form {
    flex: 1;
}

.admin-planning__slots {
    display: grid;
    gap: 0.9rem;
}

.admin-planning__slot {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.9rem;
    background: rgba(12, 18, 42, 0.3);
    display: grid;
    gap: 0.8rem;
}

.admin-planning__slot-form {
    flex: 1;
    max-width: 18rem;
}

.admin-planning__items {
    display: grid;
    gap: 0.75rem;
}

.admin-planning__item {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.9rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
}

.admin-planning__item-form {
    flex: 1;
    display: grid;
    gap: 0.6rem;
}

.admin-planning__item-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 1.4fr auto;
    gap: 0.6rem;
}

.admin-planning__category-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
}

.admin-planning__category-field .btn {
    min-width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.admin-planning__item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-planning [data-planning-autosave] .form-control,
.admin-planning [data-planning-autosave] .form-select {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-image 0.18s ease;
}

.admin-planning .planning-autosave-field--saved {
    border-color: #198754;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23198754' d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem 1rem;
}

.admin-planning .planning-autosave-field--saving {
    border-color: rgba(243, 156, 18, 0.95);
    box-shadow: 0 0 0 0.15rem rgba(243, 156, 18, 0.12);
}

.admin-planning .planning-autosave-field--error {
    border-color: rgba(220, 53, 69, 0.95);
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.12);
}

.admin-planning__new-item {
    display: grid;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.admin-planning__new-item-submit {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
}

html[data-theme="light"] .admin-planning__hero--with-image {
    background:
        linear-gradient(120deg, rgba(17, 25, 47, 0.9), rgba(34, 46, 82, 0.82)),
        var(--admin-planning-hero-image) center/cover no-repeat;
    border-color: rgba(31, 42, 68, 0.1);
}

html[data-theme="light"] .admin-planning__hero--with-image::after {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(90deg, rgba(12, 19, 36, 0.5), rgba(12, 19, 36, 0.18));
}

html[data-theme="light"] .admin-planning__hero--with-image,
html[data-theme="light"] .admin-planning__hero--with-image .text-muted-light,
html[data-theme="light"] .admin-planning__hero--with-image .admin-planning__toolbar-copy {
    color: rgba(244, 247, 255, 0.92) !important;
}

html[data-theme="light"] .admin-planning__hero--with-image .btn-outline-light {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.88) !important;
    color: #22304c !important;
    box-shadow: 0 10px 24px rgba(18, 25, 44, 0.18);
}

html[data-theme="light"] .admin-planning__hero--with-image .btn-outline-light:hover,
html[data-theme="light"] .admin-planning__hero--with-image .btn-outline-light:focus {
    background: #ffffff;
    color: #15213b !important;
}

html[data-theme="light"] .admin-planning__toolbar,
html[data-theme="light"] .admin-planning__day,
html[data-theme="light"] .admin-planning__day--create {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(29, 39, 63, 0.06);
}

html[data-theme="light"] .admin-planning__slot {
    border-color: rgba(31, 42, 68, 0.1);
    background:
        linear-gradient(180deg, rgba(246, 248, 252, 0.98), rgba(239, 243, 249, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .admin-planning__item {
    border-color: rgba(31, 42, 68, 0.08);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 18px rgba(29, 39, 63, 0.04);
}

html[data-theme="light"] .admin-planning__new-item {
    border-top-color: rgba(31, 42, 68, 0.12);
}

html[data-theme="light"] .admin-planning .form-control,
html[data-theme="light"] .admin-planning .form-select {
    background-color: rgba(255, 255, 255, 0.98);
    border-color: rgba(31, 42, 68, 0.14);
    color: #24324d;
}

html[data-theme="light"] .admin-planning .form-control::placeholder {
    color: rgba(88, 102, 128, 0.7);
}

html[data-theme="light"] .admin-planning__toolbar-copy,
html[data-theme="light"] .admin-planning__slot-header,
html[data-theme="light"] .admin-planning__item-actions {
    color: #51607c;
}

@media (max-width: 1399.98px) {
    .event-board__days {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1199.98px) {
    .event-hero {
        padding: 1.8rem 0 0.95rem;
    }

    .event-hero__summary {
        grid-template-columns: 1fr;
    }

    .event-hierarchy__selectors-grid {
        grid-template-columns: 1fr;
    }

    .signature-review-card__viewer iframe {
        height: 58vh !important;
        min-height: 460px !important;
    }

    .admin-planning__hero,
    .admin-planning__toolbar,
    .admin-planning__day-header,
    .admin-planning__slot-header,
    .admin-planning__item {
        flex-direction: column;
    }

    .admin-planning__toolbar-actions {
        justify-content: flex-start;
    }

    .admin-planning__slot-form,
    .admin-planning__day-form {
        max-width: none;
        width: 100%;
    }

    .admin-planning__item-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .event-hero__title {
        font-size: 1.5rem;
    }

    .event-hero__meta {
        font-size: 0.88rem;
    }

    .event-hero__summary-col--description,
    .event-hero__summary-col--dates {
        padding: 0.7rem 0.8rem;
    }

    .event-hero__info-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .event-hero__info-list strong {
        text-align: left;
    }

    .event-board__days {
        grid-template-columns: 1fr;
    }

    .signature-review-state__header,
    .signature-flow-card__topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .signature-review-state__footer--preview {
        grid-template-columns: 1fr;
    }

    .event-category-block__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-category-block__shell {
        border-radius: 22px;
        padding: 0.7rem;
    }

    .admin-planning__item-grid,
    .admin-planning__inline-create,
    .admin-planning__new-slot,
    .admin-planning__slot-form,
    .admin-planning__day-form {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
}
