/* ================================================================
   MEMBER ENGAGEMENT PORTAL — Design System & Shell Layout
   Based on DESIGN.md "The Modern Archivist"
   ================================================================ */

/* ── Portal Login Gate ──────────────────────────────────────────── */
.portal-login-screen {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

/* When portal is locked (login gate active), hide shell UI but keep modals accessible */
.portal-shell.portal-locked > .portal-sidebar,
.portal-shell.portal-locked > .portal-content > .portal-mobile-header,
.portal-shell.portal-locked > .portal-content > .top-header,
.portal-shell.portal-locked > .portal-content > .nav-bar,
.portal-shell.portal-locked > .portal-content > .content-wrapper,
.portal-shell.portal-locked > .portal-content > footer,
.portal-shell.portal-locked > .portal-bottom-nav {
    display: none !important;
}

/* Modals must appear above the login screen */
.modal-overlay {
    z-index: 10500 !important;
}

.portal-login-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #022b4d 0%, #204164 40%, #1a365d 70%, #0f172a 100%);
}

.portal-login-bg::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(243,156,18,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(32,65,100,0.15) 0%, transparent 50%);
}

.portal-login-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: loginCardEntry 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardEntry {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.portal-login-logo {
    width: 100%; max-width: 360px; height: auto;
    margin: 0 auto 22px; display: block;
}

.portal-login-title {
    font-family: var(--font-display, 'Manrope', sans-serif);
    font-weight: 800; font-size: 1.3rem;
    color: #0f172a; margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.portal-login-sub {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem; color: #64748b;
    margin: 0 0 24px; line-height: 1.4;
}

.portal-login-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px; border: 1px solid #e2e8f0;
    border-radius: 10px; background: #fff; cursor: pointer;
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
    color: #334155; transition: all 0.2s;
}

.portal-login-google:hover {
    background: #f8fafc; border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.portal-login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0; color: #94a3b8; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.portal-login-divider::before,
.portal-login-divider::after {
    content: ''; flex: 1; height: 1px;
    background: #e2e8f0;
}

.portal-login-field {
    text-align: left; margin-bottom: 14px;
}

.portal-login-field label {
    display: block; font-size: 0.78rem; font-weight: 600;
    color: #475569; margin-bottom: 5px;
}

.portal-login-field input {
    width: 100%; padding: 11px 14px; box-sizing: border-box;
    border: 1px solid #e2e8f0; border-radius: 10px;
    font-family: var(--font-body); font-size: 0.9rem;
    color: #1e293b; background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.portal-login-field input:focus {
    outline: none; border-color: #204164;
    box-shadow: 0 0 0 3px rgba(32, 65, 100, 0.1);
    background: #fff;
}

.portal-login-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #94a3b8; padding: 4px;
}

.portal-login-error {
    background: #fef2f2; color: #dc2626; border-radius: 8px;
    padding: 10px 14px; font-size: 0.82rem; margin-bottom: 12px;
    text-align: left;
}

.portal-login-submit {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg, #022b4d, #204164);
    color: #fff; border: none; border-radius: 10px;
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    letter-spacing: 0.02em;
}

.portal-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(2, 43, 77, 0.3);
}

.portal-login-submit:active {
    transform: translateY(0);
}

.portal-login-links {
    margin-top: 16px; display: flex; justify-content: center;
    gap: 8px; font-size: 0.78rem;
}

.portal-login-links a {
    color: #204164; text-decoration: none; font-weight: 600;
}

.portal-login-links a:hover { text-decoration: underline; }
.portal-login-links span { color: #cbd5e1; }

.portal-login-footer {
    margin-top: 20px; display: flex; align-items: center;
    justify-content: center; gap: 4px;
    font-size: 0.68rem; color: #94a3b8;
}

/* === LOGIN GATE → PUBLIC EVENTS ESCAPE HATCH ==============================
   Catches a guest who got auto-redirected to members.oectahw.com from
   events.oectahw.com but has no member credentials. */
.portal-login-public-cta {
    margin-top: 24px;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid rgba(32, 65, 100, 0.08);
}
.portal-login-public-text {
    font-size: 0.85rem;
    color: #718096;
    margin: 0 0 10px;
}
.portal-login-public-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #fff7e6;
    color: #b7791f;
    border: 1px solid rgba(247, 151, 30, 0.35);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.portal-login-public-btn .material-icons-outlined {
    font-size: 18px;
}
.portal-login-public-btn:hover {
    background: #f39c12;
    color: #fff;
    border-color: #f39c12;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px -8px rgba(243, 156, 18, 0.6);
}

/* ── Design Tokens — Bridge to shared oecta-tokens.css ────────── */
:root {
    /* Typography */
    --font-display:          var(--oecta-font-display);
    --font-body:             var(--oecta-font-body);

    /* Portal layout */
    --sidebar-width:         var(--oecta-sidebar-width);
    --sidebar-collapsed:     var(--oecta-sidebar-collapsed);
    --bottom-nav-height:     var(--oecta-bottom-nav-height);
    --portal-header-height:  var(--oecta-header-height);

    /* Z-index */
    --z-sidebar:             var(--oecta-z-sidebar);
    --z-bottom-nav:          var(--oecta-z-bottom-nav);
}

/* ── Portal Shell Layout ──────────────────────────────────────── */

/* Desktop: sidebar + content side by side */
.portal-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--surface, #f8f9ff);
}

/* Sidebar hidden on mobile, visible on desktop */
.portal-sidebar {
    display: none;
}

/* Content area takes full width */
.portal-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Bottom nav visible on mobile, hidden on desktop */
.portal-bottom-nav {
    display: flex;
}

/* ── Desktop Sidebar (>=768px) — AMP-style dark navy ────────────── */
@media (min-width: 768px) {
    .portal-sidebar {
        display: flex;
        flex-direction: column;
        width: var(--oecta-sidebar-collapsed, 64px);
        min-height: 100vh;
        min-height: 100dvh;
        background: var(--oecta-gradient-navy-deep);
        flex-shrink: 0;
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: var(--oecta-z-sidebar);
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.12) transparent;
    }
    .portal-sidebar::-webkit-scrollbar { width: 4px; }
    .portal-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

    /* Expanded state — when user clicks hamburger */
    .portal-sidebar.expanded {
        width: var(--oecta-sidebar-width, 240px);
    }

    .portal-bottom-nav {
        display: none !important;
    }

    /* Remove old top header and nav-bar on desktop portal */
    .portal-shell .top-header {
        display: none;
    }
    .portal-shell .nav-bar {
        display: none;
    }

    /* Content no longer needs max-width constraint when sidebar is present */
    .portal-shell .content-wrapper {
        max-width: none;
        padding: 0 32px;
    }
}

/* ── Sidebar Brand — header area with hamburger ────────────────── */
.sidebar-brand {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 56px;
    justify-content: center;
}
.portal-sidebar.expanded .sidebar-brand {
    justify-content: flex-start;
    padding: 8px 12px;
}

/* Sidebar hamburger button */
.sidebar-hamburger {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s;
}
.sidebar-hamburger:hover {
    background: rgba(255,255,255,0.1);
}
.sidebar-hamburger .material-icons,
.sidebar-hamburger .material-icons-outlined {
    font-size: 22px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    display: none;
}
.portal-sidebar.expanded .sidebar-logo {
    display: block;
}

.sidebar-brand-text {
    overflow: hidden;
    white-space: nowrap;
    display: none;
}
.portal-sidebar.expanded .sidebar-brand-text {
    display: block;
}

.sidebar-brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    letter-spacing: -0.01em;
}

.sidebar-brand-sub {
    font-family: var(--font-body);
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    margin-top: 1px;
}

/* ── Sidebar Navigation Items — dark theme ──────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--oecta-radius-md, 8px);
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    position: relative;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.portal-sidebar.expanded .sidebar-item {
    justify-content: flex-start;
    padding: 9px 12px;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.sidebar-item.active {
    background: var(--oecta-gradient-navy, linear-gradient(135deg, #1a3554, #204164));
    color: #fff;
    font-weight: 600;
    box-shadow: var(--oecta-shadow-sm, 0 1px 3px rgba(0,0,0,0.12));
}

.sidebar-item.active .material-icons-outlined,
.sidebar-item.active .material-icons {
    color: #fff;
}

.sidebar-item .material-icons-outlined,
.sidebar-item .material-icons {
    font-size: 22px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}
.portal-sidebar.expanded .sidebar-item-label {
    display: inline;
}

/* Badge on sidebar item */
.sidebar-badge {
    background: #e53e3e;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-badge:empty { display: none; }
.collapsed .sidebar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
}

/* Sidebar divider */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 14px;
}

/* Sidebar section label — dark theme */
.sidebar-section-label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    padding: 16px 12px 4px;
    display: none;
}
.portal-sidebar.expanded .sidebar-section-label {
    display: block;
}

/* Sidebar collapse toggle (legacy, hidden) */
.sidebar-collapse-btn {
    display: none;
}

/* Sidebar footer (user info) */
.sidebar-footer {
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    justify-content: center;
}
.portal-sidebar.expanded .sidebar-footer {
    justify-content: flex-start;
    padding: 8px 12px;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: none;
}
.portal-sidebar.expanded .sidebar-user-info {
    display: block;
}

.sidebar-user-name {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bottom Navigation (Mobile) ────────────────────────────────── */
.portal-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(195, 198, 207, 0.2);
    z-index: var(--z-bottom-nav);
    align-items: stretch;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    padding: 6px 0;
    color: var(--on-surface-variant, #718096);
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
    opacity: 0.7;
}

.bottom-nav-item.active {
    color: var(--primary-color, #204164);
    font-weight: 700;
}

.bottom-nav-item .material-icons-outlined {
    font-size: 24px;
}

.bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    background: #e53e3e;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-badge:empty { display: none; }

/* Add bottom padding to content so it's not hidden behind bottom nav */
@media (max-width: 767px) {
    .portal-content {
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0) + 12px);
    }
}

/* ── MEP Header Bar (always visible) — glass nav ─────────────────── */
.mep-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    background: var(--oecta-glass-bg);
    backdrop-filter: blur(var(--oecta-glass-blur));
    -webkit-backdrop-filter: blur(var(--oecta-glass-blur));
    border-bottom: 1px solid var(--oecta-glass-border);
    position: sticky;
    top: 0;
    z-index: 600;
    min-height: var(--oecta-header-height);
}

.mep-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mep-header-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.mep-header-brand-text {
    display: flex;
    flex-direction: column;
}

.mep-header-title {
    font-family: var(--font-display, 'Manrope', sans-serif);
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--on-surface, #181c21);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.mep-header-sub {
    font-size: 0.62rem;
    color: var(--on-surface-variant, #718096);
    font-weight: 500;
}

/* Search bar */
.mep-header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
}

.mep-search-icon {
    position: absolute;
    left: 14px;
    font-size: 20px;
    color: var(--on-surface-variant, #718096);
    pointer-events: none;
}

.mep-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border: none;
    border-radius: 99px;
    background: var(--surface-container-low, #f2f3fa);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    color: var(--on-surface, #181c21);
    transition: background 0.15s, box-shadow 0.15s;
}

.mep-search-input:focus {
    outline: none;
    background: var(--surface-container-lowest, #fff);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(32,65,100,0.12);
}

.mep-search-input::placeholder {
    color: var(--on-surface-variant, #94a3b8);
}

/* Action buttons */
.mep-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mep-header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--on-surface-variant, #718096);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
    position: relative;
}

.mep-header-icon-btn:hover {
    background: rgba(0,0,0,0.04);
}

.mep-header-icon-btn .material-icons-outlined {
    font-size: 22px;
}

.mep-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mep-notif-badge:empty { display: none; }

/* Profile avatar */
.mep-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color, #204164);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    transition: box-shadow 0.15s;
}

.mep-header-avatar:hover {
    box-shadow: 0 0 0 3px rgba(32,65,100,0.15);
}

/* Waffle panel — consistent with admin portal */
.mep-waffle-panel {
    position: fixed;
    top: calc(var(--oecta-header-height) + 8px);
    right: 16px;
    width: 340px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--oecta-surface-low);
    border-radius: var(--oecta-radius-2xl);
    box-shadow: var(--oecta-shadow-xl), 0 0 0 1px rgba(0,0,0,0.04);
    z-index: var(--oecta-z-overlay);
    padding: 16px 10px 20px;
    animation: portalFadeIn 0.2s ease-out;
}

.mep-waffle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.mep-waffle-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 4px 10px;
    border-radius: var(--oecta-radius-lg);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background var(--oecta-duration-fast) var(--oecta-ease);
    gap: var(--oecta-space-sm);
    color: inherit;
}

.mep-waffle-tile:hover {
    background: rgba(255,255,255,0.8);
}

.mep-waffle-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--oecta-radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mep-waffle-tile-icon .material-icons-outlined {
    font-size: 22px;
    color: #fff;
}

.mep-waffle-tile-label {
    font-family: var(--oecta-font-body);
    font-size: var(--oecta-text-xs);
    font-weight: var(--oecta-weight-medium);
    color: var(--oecta-on-surface-variant);
    line-height: 1.2;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .mep-header {
        padding: 8px 12px;
        gap: 8px;
    }

    .mep-header-brand-text {
        display: none;
    }

    .mep-header-search {
        max-width: none;
    }

    .mep-search-input {
        font-size: 0.82rem;
        padding: 8px 12px 8px 38px;
    }

    /* Hide old top header and nav on mobile when portal shell is active */
    .portal-shell .top-header,
    .portal-shell .nav-bar {
        display: none;
    }
}

/* Hide old top header on desktop too (replaced by mep-header) */
@media (min-width: 768px) {
    .portal-shell .top-header,
    .portal-shell .nav-bar {
        display: none;
    }
}

/* ── Coming Soon Placeholder ───────────────────────────────────── */
.portal-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: var(--on-surface-variant);
}

.portal-coming-soon .material-icons-outlined {
    font-size: 56px;
    color: var(--outline-variant);
    margin-bottom: 16px;
}

.portal-coming-soon h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--on-surface);
    margin: 0 0 8px;
}

.portal-coming-soon p {
    font-size: 0.9rem;
    color: var(--on-surface-variant);
    margin: 0;
    max-width: 320px;
}

/* ── Skeleton Loader ───────────────────────────────────────────── */
.portal-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.portal-skeleton-bar {
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface-container-low) 25%, var(--surface-container-high) 50%, var(--surface-container-low) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

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

/* ── Notification Inbox ────────────────────────────────────────── */
.notif-inbox-list { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.notif-inbox-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 14px 12px; border-radius: 10px; cursor: pointer;
    transition: background 0.1s;
}
.notif-inbox-item:hover { background: rgba(32,65,100,0.04); }
.notif-unread { background: rgba(32,65,100,0.03); }
.notif-inbox-indicator { width: 12px; padding-top: 6px; flex-shrink: 0; }
.notif-unread-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary-color, #204164); display: block;
}
.notif-inbox-content { flex: 1; min-width: 0; }
.notif-inbox-title {
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
    color: var(--on-surface, #181c21);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center;
}
.notif-unread .notif-inbox-title { font-weight: 700; }
.notif-inbox-preview {
    font-size: 0.82rem; color: var(--on-surface-variant, #718096);
    margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.notif-inbox-meta {
    font-size: 0.72rem; color: var(--outline-variant, #c3c6cf);
    margin-top: 4px; text-transform: capitalize;
}

/* ── Ticket Styling ────────────────────────────────────────────── */
.ticket-label { display:block; font-size:0.82rem; font-weight:600; color:#334155; margin-bottom:5px; }
.ticket-input {
    width:100%; padding:11px 14px; box-sizing:border-box;
    border:1px solid #e2e8f0; border-radius:10px;
    font-family:var(--font-body); font-size:0.9rem;
    color:#1e293b; background:#f8fafc; transition:border-color 0.2s;
}
.ticket-input:focus { outline:none; border-color:#204164; background:#fff; box-shadow:0 0 0 3px rgba(32,65,100,0.1); }
.ticket-waiting { border-left:3px solid #ea580c !important; }

/* Message Thread */
.ticket-msg {
    padding:14px 16px; border-radius:12px; margin-bottom:8px;
}
.ticket-msg-member {
    background:var(--surface-container-lowest,#fff);
    box-shadow:0 1px 4px rgba(0,0,0,0.03);
}
.ticket-msg-admin {
    background:linear-gradient(135deg, rgba(32,65,100,0.04), rgba(32,65,100,0.02));
    border-left:3px solid var(--primary-color,#204164);
}
.ticket-msg-header {
    display:flex; align-items:center; gap:8px; margin-bottom:6px;
}
.ticket-msg-author { font-weight:600; font-size:0.85rem; color:#1e293b; }
.ticket-msg-badge {
    font-size:0.65rem; font-weight:700; padding:1px 6px;
    border-radius:99px; background:#204164; color:#fff;
}
.ticket-msg-time { font-size:0.72rem; color:#94a3b8; margin-left:auto; }
.ticket-msg-body { font-size:0.88rem; color:#334155; line-height:1.5; white-space:pre-wrap; }

/* ── Auth Gate (unauthenticated users) ─────────────────────────── */
.portal-auth-gate {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px 24px; text-align: center;
    min-height: 50vh;
}

.portal-auth-gate-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(32,65,100,0.08), rgba(32,65,100,0.03));
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    animation: authGatePulse 2s ease-in-out infinite;
}

@keyframes authGatePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(32,65,100,0.1); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(32,65,100,0); }
}

.portal-auth-gate-icon .material-icons-outlined {
    font-size: 36px; color: var(--primary-color, #204164);
}

.portal-auth-gate h3 {
    font-family: var(--font-display);
    font-weight: 700; font-size: 1.2rem;
    color: var(--on-surface); margin: 0 0 8px;
}

.portal-auth-gate p {
    font-size: 0.9rem; color: var(--on-surface-variant);
    margin: 0 0 20px; max-width: 320px; line-height: 1.5;
}

.portal-auth-gate .btn-primary {
    padding: 12px 32px; font-size: 0.9rem;
    border-radius: 12px; display: flex; align-items: center; gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-auth-gate .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(32, 65, 100, 0.25);
}

/* ── Page Transitions ──────────────────────────────────────────── */
.tab-section {
    animation: portalFadeIn 0.3s ease-out;
}

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

/* ── Card Hover Effects ────────────────────────────────────────── */
.portal-shell .event-card {
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.portal-shell .event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(24, 28, 33, 0.1);
}

/* ── Sidebar Item Transitions ──────────────────────────────────── */
.sidebar-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item:active {
    transform: scale(0.97);
}

/* ── Stat Cards ────────────────────────────────────────────────── */
.portal-shell .data-card {
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.portal-shell .data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(24, 28, 33, 0.08);
}

/* ── Glassmorphic Accent Bar (desktop sidebar top) ─────────────── */
@media (min-width: 768px) {
    .portal-sidebar::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color, #204164), var(--accent-color, #f39c12), var(--primary-color, #204164));
        background-size: 200% 100%;
        animation: accentShimmer 4s ease infinite;
    }

    @keyframes accentShimmer {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }
}

/* ── Expense Cards ─────────────────────────────────────────────── */
.exp-member-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 10px; cursor: pointer;
    background: var(--surface-container-lowest, #fff);
    box-shadow: 0 1px 4px rgba(24, 28, 33, 0.04);
    margin-bottom: 6px; transition: box-shadow 0.15s;
}
.exp-member-card:hover { box-shadow: 0 4px 16px rgba(24, 28, 33, 0.08); }
.exp-member-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface-container-low, #f2f3fa);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.exp-member-icon .material-icons-outlined { font-size: 22px; color: var(--primary-color); }
.exp-member-info { flex: 1; min-width: 0; }
.exp-member-title {
    font-weight: 600; font-size: 0.9rem; color: var(--on-surface, #181c21);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.exp-member-meta { font-size: 0.78rem; color: var(--on-surface-variant, #718096); margin-top: 1px; }
.exp-member-right { text-align: right; flex-shrink: 0; }
.exp-member-amount { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--on-surface); }
.exp-member-status { font-size: 0.72rem; font-weight: 600; }

/* ── Design System Overrides ("The Modern Archivist") ──────────── */

/* Typography: Manrope for display/headlines, Inter for body */
h1, h2, h3, .card-title, .hero-name, .data-card-header,
.pref-bar-title, .nav-title, .micro-hero-title {
    font-family: var(--font-display, 'Manrope', sans-serif);
}

/* Surface hierarchy: cards use surface-container-lowest */
.data-card, .card, .card-fused, .profile-hero, .profile-pref-bar,
.profile-reg-history .data-card, .profile-notif-prefs .data-card {
    background: var(--surface-container-lowest, #ffffff);
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(24, 28, 33, 0.04);
}

/* No-line rule: remove explicit borders from cards and sections */
.data-card { border: none !important; }
.data-card-header { border-bottom: none; padding-bottom: 8px; }
.profile-row { border-bottom: none; }

/* Ambient shadows only */
.card, .data-card, .profile-hero {
    box-shadow: 0 8px 32px rgba(24, 28, 33, 0.06);
}

/* Input fields: surface-container-low background, bottom-only ghost border */
.portal-shell input[type="text"],
.portal-shell input[type="email"],
.portal-shell input[type="password"],
.portal-shell select,
.portal-shell textarea {
    background: var(--surface-container-low, #f2f3fa);
    border: none;
    border-bottom: 1px solid rgba(195, 198, 207, 0.2);
    border-radius: 6px 6px 0 0;
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--on-surface);
    transition: border-color 0.15s;
}

.portal-shell input:focus,
.portal-shell select:focus,
.portal-shell textarea:focus {
    outline: none;
    border-bottom-color: var(--secondary, #fea520);
    border-bottom-width: 2px;
}

/* Primary buttons: signature gradient */
.portal-shell .btn-primary,
.portal-content .btn-primary {
    background: linear-gradient(135deg, #022b4d, #204164);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 600;
}

.portal-shell .btn-primary:hover {
    opacity: 0.92;
}

/* Secondary buttons: surface-container-highest, no border */
.portal-shell .btn-secondary,
.portal-content .btn-secondary {
    background: var(--surface-container-high, #e6e8ef);
    border: none;
    color: var(--primary-color, #204164);
    border-radius: 8px;
    font-family: var(--font-body);
}

/* Event cards: tonal separation instead of borders */
@media (min-width: 768px) {
    .portal-shell .event-card {
        border: none;
        background: var(--surface-container-lowest, #fff);
        box-shadow: 0 2px 12px rgba(24, 28, 33, 0.04);
        border-radius: 12px;
    }
}

/* ── Portal Section Hero ──────────────────────────────────────── */
.portal-hero {
    background: var(--oecta-gradient-navy-deep);
    border-radius: var(--oecta-radius-xl);
    padding: 28px 28px 24px;
    margin-bottom: var(--oecta-space-xl);
    position: relative;
    overflow: hidden;
    color: #fff;
}

.portal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 600px 400px at 80% 20%, rgba(243,156,18,0.08) 0%, transparent 70%),
                radial-gradient(ellipse 400px 300px at 20% 80%, rgba(32,65,100,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.portal-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-hero-text {
    flex: 1;
    min-width: 0;
}

.portal-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
}

.portal-hero-label .material-icons-outlined {
    font-size: 13px;
}

.portal-hero-title {
    font-family: var(--oecta-font-display);
    font-weight: var(--oecta-weight-extrabold);
    font-size: var(--oecta-text-xl);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    line-height: 1.2;
}

.portal-hero-subtitle {
    font-family: var(--oecta-font-body);
    font-size: var(--oecta-text-base);
    color: rgba(255,255,255,0.7);
    margin: 0;
    line-height: 1.4;
}

.portal-hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.portal-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.12);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.portal-hero-chip .material-icons-outlined {
    font-size: 13px;
}

.portal-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-hero-icon .material-icons-outlined {
    font-size: 28px;
    color: rgba(255,255,255,0.9);
}

.portal-hero-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.portal-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.portal-hero-btn-primary {
    background: rgba(255,255,255,0.95);
    color: #022b4d;
}

.portal-hero-btn-primary:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.portal-hero-btn-secondary {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.2);
}

.portal-hero-btn-secondary:hover {
    background: rgba(255,255,255,0.18);
}

.portal-hero-btn .material-icons-outlined {
    font-size: 16px;
}

/* Compact hero variant for smaller sections */
.portal-hero-compact {
    padding: 20px 24px 18px;
}

.portal-hero-compact .portal-hero-title {
    font-size: 1.25rem;
}

.portal-hero-compact .portal-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
}

.portal-hero-compact .portal-hero-icon .material-icons-outlined {
    font-size: 22px;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .portal-hero {
        border-radius: 0;
        margin: 0 -16px 20px;
        padding: 24px 20px 20px;
    }

    .portal-hero-title {
        font-size: 1.3rem;
    }

    .portal-hero-icon {
        width: 44px;
        height: 44px;
    }

    .portal-hero-icon .material-icons-outlined {
        font-size: 22px;
    }

    .portal-hero-actions {
        flex-wrap: wrap;
    }
}

/* Profile data grid: wider on desktop with sidebar */
@media (min-width: 768px) {
    .portal-shell .profile-data-grid {
        grid-template-columns: 1fr 1fr;
    }
    .portal-shell .full-width-card {
        grid-column: 1 / -1;
    }
}

/* ── Native Event Detail (NED) ────────────────────────────────────── */
.ned-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.ned-toolbar {
    padding: 8px 0;
}

.ned-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color, #204164);
    border-radius: 8px;
    transition: background 0.12s;
}

.ned-back-btn:hover { background: rgba(32, 65, 100, 0.06); }
.ned-back-btn .material-icons-outlined { font-size: 18px; }

.ned-loading, .ned-error {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.ned-error .material-icons-outlined {
    font-size: 48px;
    color: #e53e3e;
    display: block;
    margin-bottom: 12px;
}

.ned-error h3 { margin: 0 0 6px; color: #2d3748; }
.ned-error p { margin: 0; }

/* Tab bar */
.ned-tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0 0;
    padding: 0 4px;
}

.ned-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    color: #718096;
    border-radius: 10px 10px 0 0;
    transition: background 0.15s, color 0.15s;
}

.ned-tab .material-icons-outlined { font-size: 17px; }

.ned-tab:hover { background: rgba(32, 65, 100, 0.04); color: #4a5568; }

.ned-tab.active {
    background: var(--surface-container-lowest, #fff);
    color: var(--primary-color, #204164);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

/* Tab panels */
.ned-panel {
    display: none;
    background: var(--surface-container-lowest, #fff);
    border-radius: 0 12px 12px 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(24, 28, 33, 0.04);
}

.ned-panel.active { display: block; }

/* Overview */
.ned-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.ned-info-card {
    background: var(--surface-container-low, #f2f3fa);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.12s;
}

.ned-info-card-clickable { cursor: pointer; }
.ned-info-card-clickable:hover { transform: translateY(-2px); }

.ned-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #022b4d, #204164);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.ned-info-icon .material-icons-outlined { font-size: 18px; color: #fff; }

.ned-info-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    margin-bottom: 4px;
}

.ned-info-value {
    font-family: var(--font-display, 'Manrope', sans-serif);
    font-weight: 700;
    font-size: 1rem;
    color: var(--on-surface, #181c21);
    margin-bottom: 2px;
}

.ned-info-sub {
    font-size: 0.82rem;
    color: #718096;
    margin-top: 2px;
}

.ned-info-action {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color, #204164);
    margin-top: 8px;
}

.ned-register-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #022b4d, #204164);
    color: #fff;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.12s;
}

.ned-register-btn:hover { opacity: 0.9; }
.ned-register-btn .material-icons-outlined { font-size: 16px; }

/* Map */
.ned-map-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 20px;
    height: 160px;
}

.ned-map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ned-map-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px 16px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.ned-map-card:hover .ned-map-overlay { opacity: 1; }
.ned-map-overlay .material-icons-outlined { font-size: 15px; }

/* Notes */
.ned-notes-card {
    background: var(--surface-container-low, #f2f3fa);
    border-radius: 12px;
    padding: 20px;
}

.ned-notes-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 12px;
}

.ned-notes-header .material-icons-outlined { font-size: 18px; }

.ned-notes-body {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--on-surface, #181c21);
}

/* Registration form styles — inherit from style2.css reg-form-* classes */
#ned-register .reg-form-card { margin: 0; }

/* Mobile */
@media (max-width: 768px) {
    .ned-wrap { padding: 0 8px 32px; }
    .ned-info-grid { grid-template-columns: 1fr; }
    .ned-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ned-tab { white-space: nowrap; padding: 8px 14px; font-size: 0.78rem; }
    .ned-panel { padding: 16px; border-radius: 0 0 12px 12px; }
    .ned-map-card { height: 120px; }
}
