:root {
    --aura-bg: linear-gradient(180deg, #f5f5f1 0%, #f8fafc 44%, #eff5f2 100%);
    --aura-surface: rgba(255, 255, 255, 0.86);
    --aura-surface-strong: rgba(255, 255, 255, 0.95);
    --aura-border: rgba(15, 23, 42, 0.08);
    --aura-border-strong: rgba(37, 99, 235, 0.12);
    --aura-text: #0f172a;
    --aura-muted: #64748b;
    --aura-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
    --aura-radius: 24px;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--aura-text);
    background: var(--aura-bg);
    background-attachment: fixed;
}

body.theme-dark {
    --aura-bg: linear-gradient(180deg, #09111d 0%, #0d1624 48%, #102031 100%);
    --aura-surface: rgba(15, 23, 42, 0.82);
    --aura-surface-strong: rgba(15, 23, 42, 0.94);
    --aura-border: rgba(148, 163, 184, 0.16);
    --aura-border-strong: rgba(96, 165, 250, 0.18);
    --aura-text: #e5eef8;
    --aura-muted: #94a3b8;
    --aura-shadow: 0 18px 44px rgba(2, 6, 23, 0.3);
}

.mud-typography,
.mud-button,
.mud-chip,
.mud-input,
.mud-nav-link,
.mud-list-item-text,
.mud-alert,
.mud-snackbar,
.mud-tooltip,
.mud-table {
    font-family: "Manrope", sans-serif;
}

.app-shell {
    min-height: 100vh;
    position: relative;
}

.appbar {
    border-bottom: 1px solid var(--aura-border);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
}

body.theme-dark .appbar {
    background: rgba(8, 17, 31, 0.82);
}

.appbar::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(14, 165, 164, 0), rgba(14, 165, 164, 0.16), rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0));
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: block;
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.05;
}

.brand-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2563eb;
}

.brand-title {
    font-size: 1rem;
    font-weight: 800;
}

.drawer {
    border-right: 1px solid var(--aura-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 248, 250, 0.94) 100%);
}

body.theme-dark .drawer {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
}

.nav-shell {
    padding: 14px 10px;
}

.nav-summary {
    margin: 8px 8px 14px;
    padding: 14px 16px;
    border: 1px solid var(--aura-border);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.76), rgba(241, 245, 249, 0.9));
}

body.theme-dark .nav-summary {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
}

.nav-summary-title {
    margin-bottom: 4px;
    font-size: 0.95rem;
    font-weight: 800;
}

.nav-summary-text {
    font-size: 0.84rem;
    color: var(--aura-muted);
}

.nav-shell .mud-nav-link {
    margin: 4px 8px;
    border-radius: 14px;
    min-height: 46px;
    font-weight: 700;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-shell .mud-nav-link:hover {
    transform: translateX(2px);
    background: rgba(37, 99, 235, 0.08);
}

.nav-shell .mud-nav-link.active {
    color: #0f172a;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 164, 0.08));
}

body.theme-dark .nav-shell .mud-nav-link.active {
    color: var(--aura-text);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.16), rgba(45, 212, 191, 0.12));
}

.main {
    padding: 88px 28px 28px;
}

.content-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.panel {
    border: 1px solid var(--aura-border);
    border-radius: var(--aura-radius);
    background: var(--aura-surface);
    box-shadow: var(--aura-shadow);
    backdrop-filter: blur(12px);
}

.panel-strong {
    background: var(--aura-surface-strong);
}

.section-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--aura-border-strong);
    border-radius: 28px;
    background: linear-gradient(135deg, #fdfefe 0%, #eff4fb 56%, #f2f7f4 100%);
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.07);
}

body.theme-dark .section-hero,
body.theme-dark .public-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 58%, rgba(12, 35, 45, 0.94) 100%);
    box-shadow: 0 22px 48px rgba(2, 6, 23, 0.28);
}

.section-hero::before {
    content: "";
    position: absolute;
    top: -72px;
    right: -42px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0));
}

.section-hero::after {
    content: "";
    position: absolute;
    bottom: -90px;
    left: -50px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(14, 165, 164, 0.1), rgba(14, 165, 164, 0));
}

.section-hero > * {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.78);
}

body.theme-dark .hero-kicker,
body.theme-dark .stat-card,
body.theme-dark .settings-mode-card,
body.theme-dark .hero-stat,
body.theme-dark .upload-zone {
    background: rgba(15, 23, 42, 0.72);
}

.hero-subtle {
    color: var(--aura-muted);
}

.stat-card {
    height: 100%;
    padding: 18px 20px;
    border: 1px solid var(--aura-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    margin-top: 6px;
    color: var(--aura-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.stat-card:hover,
.hero-stat:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.07);
}

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

.empty-state {
    text-align: center;
}

.event-card {
    height: 100%;
    border: 1px solid var(--aura-border);
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

body.theme-dark .event-card,
body.theme-dark .public-grid-card,
body.theme-dark .photo-card {
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.24);
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
}

.event-card-cover {
    min-height: 112px;
    padding: 18px 20px;
    color: #eff6ff;
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 72%, #1d4ed8 100%);
}

.event-card-cover.archived {
    background: linear-gradient(135deg, #334155 0%, #64748b 100%);
}

.event-card-body {
    padding: 22px;
}

.event-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--aura-muted);
    font-size: 0.9rem;
}

.event-card-actions {
    padding: 0 22px 22px;
}

.pill-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.72);
}

.public-shell {
    max-width: 1160px;
}

.public-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--aura-border-strong);
    border-radius: 30px;
    background: linear-gradient(135deg, #fbfcfe 0%, #f1f6fb 58%, #f7f4ee 100%);
    box-shadow: 0 22px 52px rgba(37, 99, 235, 0.08);
}

.public-hero::after {
    content: "";
    position: absolute;
    inset: auto -90px -120px auto;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0));
    pointer-events: none;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hero-stat {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--aura-border);
    background: rgba(255, 255, 255, 0.7);
    min-width: 0;
    min-height: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.hero-stat-label {
    margin-top: 4px;
    color: var(--aura-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.upload-panel {
    border: 1px solid rgba(14, 165, 164, 0.14);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(244, 251, 249, 0.94), rgba(255, 255, 255, 0.96));
}

body.theme-dark .upload-panel {
    background: linear-gradient(180deg, rgba(9, 41, 45, 0.92), rgba(15, 23, 42, 0.96));
}

.upload-zone {
    padding: 18px;
    border: 1px dashed rgba(14, 165, 164, 0.28);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
}

.upload-zone .upload-input {
    width: 100%;
}

.public-grid-card,
.photo-card {
    border: 1px solid var(--aura-border);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.public-thumb-shell,
.photo-thumb-shell {
    position: relative;
    overflow: hidden;
    background: #e5edf8;
    cursor: pointer;
}

.public-thumb-shell::after,
.photo-thumb-shell::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 44px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.32));
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.public-thumb-shell:hover::after,
.photo-thumb-shell:hover::after {
    opacity: 1;
}

.public-side-panel {
    position: sticky;
    top: 96px;
}

.external-login-form {
    width: 100%;
}

.external-login-card {
    padding: 22px;
    border: 1px solid var(--aura-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.96));
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

body.theme-dark .external-login-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(11, 18, 32, 0.96));
}

.external-login-header {
    margin-bottom: 16px;
}

.external-login-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
}

.external-login-title {
    margin: 14px 0 6px;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.1;
}

.external-login-copy {
    margin: 0;
    color: var(--aura-muted);
    line-height: 1.55;
}

.external-login-actions {
    display: grid;
    gap: 12px;
}

.external-login-button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--aura-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--aura-text);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

body.theme-dark .external-login-button {
    background: rgba(15, 23, 42, 0.9);
}

.external-login-button:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.07);
}

.external-login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.external-login-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.provider-google .external-login-icon {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.provider-microsoft .external-login-icon {
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
}

.provider-default .external-login-icon {
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
}

.external-login-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.2;
}

.external-login-title-line {
    font-weight: 800;
}

.external-login-subline {
    color: var(--aura-muted);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.4;
}

body.ui-compact .main {
    padding: 76px 18px 18px;
}

body.ui-compact .nav-shell .mud-nav-link {
    min-height: 40px;
}

body.ui-compact .nav-summary {
    padding: 12px 14px;
}

body.ui-compact .mud-button-root {
    min-height: 34px;
}

body.ui-compact .mud-input-control {
    margin-bottom: 0.35rem;
}

body.ui-compact .mud-input-slot {
    min-height: 40px;
}

body.ui-compact .mud-chip {
    min-height: 26px;
}

body.ui-compact .page-actions {
    gap: 8px;
}

body.ui-compact .hero-stat,
body.ui-compact .stat-card,
body.ui-compact .dashboard-quick-card,
body.ui-compact .dashboard-step,
body.ui-compact .preference-card,
body.ui-compact .settings-mode-card,
body.ui-compact .new-event-access-card,
body.ui-compact .upload-side-item {
    padding: 14px 16px;
}

body.ui-compact .event-card-body,
body.ui-compact .event-card-actions,
body.ui-compact .moderation-card-body {
    padding: 16px;
}

body.ui-compact .pa-8 {
    padding: 1.5rem !important;
}

body.ui-compact .pa-6 {
    padding: 1.2rem !important;
}

body.ui-compact .pa-5 {
    padding: 1rem !important;
}

body.ui-compact .pa-4 {
    padding: 0.85rem !important;
}

body.ui-compact .panel,
body.ui-compact .event-card,
body.ui-compact .public-grid-card,
body.ui-compact .photo-card {
    border-radius: 18px;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

@media (max-width: 959.98px) {
    .main {
        padding: 80px 16px 20px;
    }

    .content-shell,
    .public-shell {
        max-width: 100%;
    }

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

    .public-side-panel {
        position: static;
    }
}
