/* ==========================================================================
   Haddad Family Tree - Design System & Stylesheet
   Theme: Luxury Modern Dark Mode & Glassmorphism
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #0b0f19;
    --bg-surface: rgba(18, 26, 43, 0.75);
    --bg-surface-elevated: rgba(28, 39, 64, 0.85);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(99, 102, 241, 0.35);

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --accent-gold: #f59e0b;
    --accent-teal: #14b8a6;
    --accent-rose: #f43f5e;
    --accent-cyan: #06b6d4;

    /* Generation Colors */
    --gen-0: #f59e0b; /* Root (Gold) */
    --gen-1: #6366f1; /* Gen 1 (Indigo) */
    --gen-2: #14b8a6; /* Gen 2 (Teal) */
    --gen-3: #ec4899; /* Gen 3 (Pink/Rose) */
    --gen-4: #8b5cf6; /* Gen 4 (Purple) */

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Typography - Premium Google Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    /* Shadows & Effects */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --backdrop-blur: blur(20px);
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

/* Background Ambient Glows */
.bg-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #14b8a6 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
    top: 40%;
    left: 60%;
}

/* Application Layout Container */
#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Header Navbar */
.app-header {
    height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-surface);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    z-index: 10;
    transition: padding 0.3s ease, height 0.3s ease;
}

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

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-gold), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    flex-shrink: 0;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Header Middle - Search & Filter */
.header-search-container {
    position: relative;
    flex: 1;
    max-width: 360px;
    min-width: 130px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(15, 23, 42, 0.9);
}

/* Search Dropdown Results */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-surface-elevated);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    z-index: 100;
    display: none;
}

.search-results.active {
    display: block;
}

.search-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.search-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.search-item-info strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-main);
}

.search-item-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Header Controls Right */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-glow);
    transform: translateY(-1px);
}

.btn-pill {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-pill:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.sheet-btn.connected {
    background: rgba(16, 124, 65, 0.18);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.sheet-btn.connected:hover {
    background: rgba(16, 124, 65, 0.35);
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.3);
}

.live-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    display: inline-block;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Toast Notifications */
.live-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 440px;
    padding: 14px 20px;
    background: rgba(18, 20, 32, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    transform: translateY(30px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-toast.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.live-toast.error {
    background: rgba(30, 12, 16, 0.95);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
}

.live-toast.error i {
    color: #f87171 !important;
}

.live-toast.success {
    background: rgba(8, 28, 24, 0.95);
    border-color: rgba(16, 185, 129, 0.5);
    color: #a7f3d0;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.live-toast.success i {
    color: #34d399 !important;
}

.live-toast.warning {
    background: rgba(30, 24, 10, 0.95);
    border-color: rgba(245, 158, 11, 0.5);
    color: #fef08a;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.2);
}

.live-toast.warning i {
    color: #fbbf24 !important;
}

.live-toast.info {
    background: rgba(15, 20, 36, 0.95);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
}

.live-toast.info i {
    color: #818cf8 !important;
}

@media (max-width: 600px) {
    .live-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
        justify-content: center;
    }
}

/* Stats Group & Pills */
.stats-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: var(--radius-full);
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--accent-teal);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.stats-badge:hover {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.5);
    transform: translateY(-1px);
}

.stats-badge.branches-badge {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}

.stats-badge.branches-badge:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.55);
}

.stats-badge.generations-badge {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.stats-badge.generations-badge:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.55);
}

/* Main Content Area */
.main-viewport {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Canvas Viewport */
#canvas-container {
    flex: 1;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#canvas-container:active {
    cursor: grabbing;
}

#tree-svg {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* Floating Controls Bar (Bottom Left/Center) */
.floating-toolbar {
    position: absolute;
    bottom: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    z-index: 10;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-glass);
    margin: 0 4px;
}

.toolbar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 4px;
}

/* D3 Tree SVG Elements */
.link {
    fill: none;
    stroke: rgba(148, 163, 184, 0.25);
    stroke-width: 2px;
    transition: stroke 0.3s, stroke-width 0.3s;
}

.link.highlighted {
    stroke: var(--primary-light);
    stroke-width: 3.5px;
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
}

/* Tree Nodes */
.node {
    cursor: pointer;
}

.node foreignObject {
    overflow: visible;
}

/* Node HTML Card Styling */
.node-card {
    width: 190px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.node-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary-light);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.3);
}

.node-card.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px var(--accent-gold), 0 0 20px rgba(245, 158, 11, 0.4);
}

.node-card.highlighted-search {
    animation: pulseHighlight 1.5s infinite alternate;
}

@keyframes pulseHighlight {
    0% { border-color: var(--accent-teal); box-shadow: 0 0 10px var(--accent-teal); }
    100% { border-color: var(--accent-cyan); box-shadow: 0 0 25px var(--accent-cyan); }
}

.node-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Generation Avatar Gradients */
.node-card[data-gen="0"] .node-avatar { background: linear-gradient(135deg, #f59e0b, #d97706); }
.node-card[data-gen="1"] .node-avatar { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.node-card[data-gen="2"] .node-avatar { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.node-card[data-gen="3"] .node-avatar { background: linear-gradient(135deg, #ec4899, #db2777); }
.node-card[data-gen="4"] .node-avatar { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.node-info {
    flex: 1;
    min-width: 0;
}

.node-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.node-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Badges on Card */
.node-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.node-card.is-pet {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(30, 25, 15, 0.85);
}

.node-pet-badge {
    position: absolute;
    top: -6px;
    left: 8px;
    background: rgba(245, 158, 11, 0.9);
    color: #fff;
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.node-rip-badge {
    position: absolute;
    top: -6px;
    right: 8px;
    background: rgba(244, 63, 94, 0.9);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.node-toggle-btn {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: var(--transition-fast);
}

.node-toggle-btn:hover {
    background: var(--primary-light);
    transform: translateX(-50%) scale(1.2);
}

/* Horizontal Layout Node adjustment */
.layout-horizontal .node-toggle-btn {
    bottom: auto;
    left: auto;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
}
.layout-horizontal .node-toggle-btn:hover {
    transform: translateY(-50%) scale(1.2);
}

/* Compact Density View Styles */
.density-compact .node-card {
    width: 124px;
    height: 38px;
    padding: 4px 8px;
    gap: 6px;
    border-radius: var(--radius-sm);
}

.density-compact .node-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
}

.density-compact .node-name {
    font-size: 0.76rem;
}

.density-compact .node-subtext {
    display: none;
}

.density-compact .node-rip-badge {
    top: -4px;
    right: 4px;
    font-size: 0.55rem;
    padding: 1px 4px;
}

.density-compact .node-toggle-btn {
    width: 16px;
    height: 16px;
    font-size: 10px;
    bottom: -8px;
}

.density-compact.layout-horizontal .node-toggle-btn {
    right: -8px;
    top: 50%;
    bottom: auto;
}

/* Slide-out Details Drawer */
.details-drawer {
    position: absolute;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: var(--bg-surface-elevated);
    backdrop-filter: var(--backdrop-blur);
    border-left: 1px solid var(--border-glass);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 20;
    transition: right var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.details-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.drawer-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Profile Card inside Drawer */
.drawer-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-glass);
}

.drawer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.drawer-name-group h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.drawer-name-group p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.drawer-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-section label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    font-weight: 600;
}

.drawer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.tag-pill.deceased {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
    color: var(--accent-rose);
}

.relatives-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.relative-card {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-fast);
}

.relative-card:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.relative-card strong {
    font-size: 0.85rem;
    color: var(--text-main);
}

.relative-card span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Modal Windows */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body textarea {
    width: 100%;
    height: 280px;
    background: #090d16;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    color: #a5b4fc;
    font-family: monospace;
    font-size: 0.82rem;
    resize: vertical;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Google Sheet Action Button & Connection Badge */
.sheet-btn {
    background: rgba(16, 124, 65, 0.15);
    border: 1px solid rgba(16, 124, 65, 0.35);
    color: #4ade80;
    transition: var(--transition-fast);
}

.sheet-btn:hover {
    background: rgba(16, 124, 65, 0.3);
    border-color: #4ade80;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

/* Mobile Hamburger Menu Toggle & Dropdown */
.mobile-menu-toggle {
    display: none;
}

.mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 12px;
    width: 230px;
    background: rgba(22, 31, 51, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
}

.mobile-dropdown-menu.active {
    display: flex;
}

.mobile-menu-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-fast);
}

.mobile-menu-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
}

.mobile-menu-item.stats {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
    padding-top: 10px;
    color: var(--primary-light);
    font-weight: 600;
    cursor: default;
}

/* Mobile Ancestry Breadcrumbs Bar */
.mobile-breadcrumb-bar {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(18, 26, 43, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 8;
    max-width: 90vw;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.mobile-breadcrumb-bar.active {
    display: flex;
}

.breadcrumb-pill {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-pill:hover, .breadcrumb-pill.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.3);
}

.breadcrumb-separator {
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* ==========================================================================
   Mobile & Tablet Responsive Styles (< 900px, < 768px, < 480px)
   ========================================================================== */

.drawer-drag-handle {
    display: none;
}

@media (max-width: 900px) {
    .brand-text p {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide desktop actions in header bar on mobile, moving them into hamburger menu */
    .header-actions .stats-badge,
    .header-actions #sheet-sync-btn,
    .header-actions #view-data-btn,
    .header-actions #export-btn {
        display: none !important;
    }

    .app-header {
        height: 60px;
        padding: 0 12px;
        gap: 10px;
        position: relative;
    }

    .header-brand {
        gap: 8px;
    }

    .brand-text h1 {
        font-size: 1.05rem;
    }

    .header-search-container {
        flex: 1;
        max-width: 100%;
        min-width: 0;
    }

    .search-input {
        height: 38px;
        font-size: 0.82rem;
        padding: 6px 12px 6px 34px;
    }

    .search-icon {
        left: 10px;
        font-size: 0.8rem;
    }

    /* Convert Side Panel into Mobile Bottom Sheet Drawer */
    .details-drawer {
        position: fixed;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100vw;
        max-height: 82vh;
        border-left: none;
        border-top: 1px solid var(--border-glass);
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform var(--transition-smooth);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
        background: rgba(22, 31, 51, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .details-drawer.open {
        transform: translateY(0);
        right: 0;
    }

    .drawer-drag-handle {
        display: block;
        width: 44px;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: var(--radius-full);
        margin: 10px auto 4px auto;
        cursor: grab;
        flex-shrink: 0;
    }

    .drawer-header {
        padding: 12px 20px;
    }

    .drawer-content {
        padding: 16px 20px 30px 20px;
    }

    .floating-toolbar {
        bottom: 16px;
        left: 16px;
        padding: 6px 10px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .brand-text h1 {
        font-size: 0.95rem;
    }

    .node-card {
        width: 170px;
        height: 58px;
        padding: 6px 10px;
    }

    .node-name {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   AUTHENTICATION & ACCESS CONTROL STYLES
   ========================================================================== */

/* Header User Profile Pill */
.user-profile-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.user-profile-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.user-avatar-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-meta span:first-child {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.role-badge.admin {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-badge.member {
    background: rgba(20, 184, 166, 0.2);
    color: #2dd4bf;
    border: 1px solid rgba(20, 184, 166, 0.4);
}

.role-badge.pending {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.role-badge.blocked {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* User Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-surface-elevated);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    padding: 8px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 4px;
    animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-menu.active {
    display: flex;
}

.user-dropdown-header {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
}

.user-dropdown-header strong {
    font-size: 0.85rem;
    color: var(--text-main);
}

.user-dropdown-header span {
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 4px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ==========================================================================
   DEDICATED LUXURY LANDING & MEMBER AUTHENTICATION PORTAL
   ========================================================================== */
.landing-page-container {
    position: relative;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-x: hidden;
    overflow-y: auto;
    background: radial-gradient(circle at 50% -10%, rgba(99, 102, 241, 0.18), transparent 55%),
                radial-gradient(circle at 90% 90%, rgba(20, 184, 166, 0.12), transparent 45%),
                radial-gradient(circle at 10% 80%, rgba(245, 158, 11, 0.08), transparent 40%),
                #070b14;
    color: var(--text-main);
    font-family: var(--font-body);
}

.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(7, 11, 20, 0.7);
    position: sticky;
    top: 0;
    z-index: 50;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-crest-mini {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(99, 102, 241, 0.35));
    border: 1px solid rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    font-size: 16px;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.landing-brand .brand-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    display: block;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.landing-brand .brand-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.landing-header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.25);
    color: var(--accent-teal);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #14b8a6;
    box-shadow: 0 0 8px #14b8a6;
    animation: livePulse 2s infinite;
}

/* Landing Main Layout */
.landing-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 64px;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 32px 80px 32px;
    align-items: center;
}

.landing-hero-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: left;
}

.hero-crest-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 8px;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    color: #c7d2fe;
    font-size: 0.78rem;
    font-weight: 600;
    width: fit-content;
}

.hero-crest-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ffffff;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.1rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 70%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.08rem;
    color: #94a3b8;
    line-height: 1.65;
    max-width: 540px;
    font-weight: 400;
}

/* Feature Stat Cards */
.heritage-stats-row {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(18, 26, 43, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    transition: all var(--transition-smooth);
}

.stat-pill:hover {
    background: rgba(28, 39, 64, 0.75);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon.gold {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stat-icon.teal {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.stat-icon.indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.stat-pill div {
    display: flex;
    flex-direction: column;
}

.stat-pill strong {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-pill span {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 1px;
}

/* Landing Auth Card */
.landing-auth-card {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.16);
    padding: 38px 34px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    animation: zoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-shield-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    margin: 0 auto 16px auto;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.45);
}

.auth-shield-icon.pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
}

.auth-shield-icon.request {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.45);
}

.auth-shield-icon.blocked {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
}

.auth-card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.auth-card-header p {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Social Buttons */
.social-login-stack {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 18px;
}

.social-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-family: var(--font-body);
}

.social-auth-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
}

.social-auth-btn .social-icon {
    width: 20px;
    height: 20px;
    font-size: 18px;
    flex-shrink: 0;
}

.social-auth-btn.google:hover {
    border-color: rgba(66, 133, 244, 0.6);
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.3);
}

.social-auth-btn.apple:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.social-auth-btn.microsoft:hover {
    border-color: rgba(0, 164, 239, 0.6);
    box-shadow: 0 0 20px rgba(0, 164, 239, 0.3);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 12px;
}

/* Form Styles */
.email-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    height: 44px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 0.88rem;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

.input-with-icon .form-input {
    padding-left: 42px;
}

textarea.form-input {
    height: auto;
    padding-top: 12px;
    resize: vertical;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px;
    padding-right: 32px;
}
select.form-input option {
    background: #0f172a;
    color: #fff;
}

.btn-primary-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.55);
}

.btn-secondary-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary-auth:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Security Footnote */

.auth-security-footnote {
    margin-top: 18px;
    font-size: 0.73rem;
    color: #64748b;
    text-align: center;
    line-height: 1.45;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-security-footnote code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Pending & Request User Cards */
.pending-user-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.pending-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.pending-field .lbl {
    color: var(--text-muted);
}

.auth-action-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Request Access Form */
.request-access-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Admin Users Table */
.admin-users-table-container {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.3);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    position: sticky;
    top: 0;
}

.admin-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-main);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

/* Responsive Breakpoints for Landing Page */
@media (max-width: 960px) {
    .landing-header {
        padding: 18px 24px;
    }

    .landing-main {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 32px 20px 60px 20px;
        text-align: center;
    }

    .landing-hero-content {
        align-items: center;
        text-align: center;
    }

    .hero-title {
        font-size: 2.35rem;
    }

    .heritage-stats-row {
        justify-content: center;
    }
}

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

/* ── Magic Link Sent & Clean Centered Login Styles ────────────────────────── */
.landing-page-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.auth-shield-icon.magic-sent {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #0d9488 100%);
    box-shadow: 0 6px 24px rgba(20, 184, 166, 0.35);
}

.email-sent-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--accent-teal);
    margin-bottom: 16px;
    word-break: break-all;
}

.email-sent-badge i { font-size: 1.1rem; }

.email-sent-instructions {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.email-sent-instructions p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.email-sent-instructions p:last-child { margin-bottom: 0; }
.email-sent-instructions i { color: var(--accent-teal); }

.auth-status-toast {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.78rem;
    margin-bottom: 14px;
    animation: fadeInDown 0.2s ease;
}

.consent-notice-box {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 10px 0 14px;
}

.consent-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.74rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
}

.consent-checkbox-row input {
    margin-top: 3px;
    accent-color: var(--primary);
    cursor: pointer;
}


