:root {
    --bg: #f5f0e7;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #fffdf8;
    --text: #18222a;
    --muted: #5f6e72;
    --line: rgba(24, 34, 42, 0.08);
    --brand: #1b6b70;
    --brand-soft: #d8efed;
    --accent: #f08a5d;
    --danger: #ba4a3f;
    --success: #2f8d5d;
    --shadow: 0 20px 48px rgba(27, 35, 42, 0.12);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Aptos", "Segoe UI Variable Display", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(240, 138, 93, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(27, 107, 112, 0.15), transparent 32%),
        linear-gradient(180deg, #fcf7ef 0%, #f5f0e7 100%);
    color: var(--text);
}

body {
    overscroll-behavior-y: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

#app {
    min-height: 100vh;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 999;
    padding: 1rem 1.25rem calc(1rem + var(--safe-bottom));
    background: #fef6ea;
    border-top: 1px solid rgba(24, 34, 42, 0.1);
}

#blazor-error-ui .dismiss {
    margin-left: 1rem;
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    padding: 1rem 1rem calc(6.5rem + var(--safe-bottom));
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-header h1,
.hero-card h1,
.event-card__title,
.detail-header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.sync-pill,
.chip,
.stat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(24, 34, 42, 0.06);
    font-size: 0.9rem;
}

.sync-pill.is-online,
.sync-banner.is-online {
    color: var(--success);
}

.sync-pill.is-offline,
.sync-banner.is-offline {
    color: var(--danger);
}

.sync-banner {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    font-size: 0.92rem;
}

.app-content,
.page-shell {
    display: grid;
    gap: 1rem;
}

.hero-card,
.card,
.form-card,
.summary-card,
.list-card {
    padding: 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.48);
    box-shadow: var(--shadow);
}

.hero-card p,
.card-subtitle,
.muted,
.empty-state p {
    color: var(--muted);
}

.button-row,
.inline-actions,
.quick-actions,
.tabs,
.grid-two,
.stack {
    display: grid;
    gap: 0.75rem;
}

.button-row,
.quick-actions,
.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
    width: 100%;
    min-height: 3.2rem;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    border: 0;
    cursor: pointer;
}

.primary-btn {
    background: linear-gradient(135deg, var(--brand), #285b9f);
    color: #fff;
    box-shadow: 0 14px 28px rgba(27, 107, 112, 0.24);
}

.secondary-btn {
    background: var(--brand-soft);
    color: var(--brand);
}

.ghost-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.danger-btn {
    background: rgba(186, 74, 63, 0.12);
    color: var(--danger);
}

.field,
.field-inline,
.selection-list,
.event-list,
.movement-list,
.member-list,
.suggestions-list {
    display: grid;
    gap: 0.75rem;
}

.field label {
    font-size: 0.92rem;
    color: var(--muted);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 3.1rem;
    padding: 0.8rem 0.95rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
}

.field textarea {
    min-height: 6.8rem;
    resize: vertical;
}

.validation-message {
    color: var(--danger);
    font-size: 0.84rem;
}

.empty-state {
    padding: 1.2rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(24, 34, 42, 0.16);
    background: rgba(255, 255, 255, 0.42);
    text-align: center;
}

.event-card,
.movement-card,
.member-card,
.suggestion-card,
.selection-row {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.event-card__meta,
.movement-card__meta,
.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.event-card__amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.detail-header,
.detail-section-head {
    display: grid;
    gap: 0.75rem;
}

.detail-section-head {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.summary-box {
    padding: 0.95rem;
    border-radius: 18px;
    background: rgba(27, 107, 112, 0.08);
    border: 1px solid rgba(27, 107, 112, 0.12);
}

.summary-box strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.2rem;
}

.tabs {
    grid-auto-flow: column;
    grid-auto-columns: minmax(8rem, 1fr);
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.tab-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.tab-link.active {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
}

.bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.7rem 0.85rem calc(0.7rem + var(--safe-bottom));
    background: rgba(255, 253, 248, 0.92);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(24, 34, 42, 0.08);
}

.bottom-nav__link {
    display: grid;
    justify-items: center;
    gap: 0.22rem;
    padding: 0.6rem 0.35rem;
    border-radius: 16px;
    color: var(--muted);
    font-size: 0.76rem;
}

.bottom-nav__link.active {
    background: rgba(27, 107, 112, 0.12);
    color: var(--brand);
    font-weight: 700;
}

.bottom-nav__icon {
    font-size: 1rem;
}

.fab {
    position: fixed;
    right: 1rem;
    bottom: calc(5.8rem + var(--safe-bottom));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.6rem;
    min-height: 3.6rem;
    padding: 0 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #ef6b64);
    color: #fff;
    box-shadow: 0 18px 34px rgba(240, 138, 93, 0.28);
}

.splash-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.splash-card {
    width: min(100%, 24rem);
    padding: 1.8rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow);
    text-align: center;
}

.splash-logo {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 0.8rem;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--brand), #285b9f);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.skeleton-bar {
    width: 100%;
    height: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(27, 107, 112, 0.14), rgba(240, 138, 93, 0.28), rgba(27, 107, 112, 0.14));
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (min-width: 768px) {
    .app-shell {
        width: min(100%, 62rem);
        margin: 0 auto;
        padding-inline: 1.25rem;
    }

    .button-row,
    .quick-actions,
    .summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: min(100%, 62rem);
        border-radius: 22px 22px 0 0;
    }
}
