/* ============================================================================
   NigamaConnect Admin v5.0 — Family Tree Management & 3D Kinship Studio CSS
   Design System: Cosmic Midnight (#020617), Glassmorphism, Vedic Gold (#F59E0B)
   Kinship Palette: Emerald (#10B981), Cyan (#0FA3D9), Rose (#EC4899)
   Master Spec: PART_05_FAMILY_TREE_3D_KINSHIP_VISUALIZER_STUDIO.md
   ============================================================================ */

/* ===================================
   ROOT PALETTE & OVERRIDES
   =================================== */
:root {
    --ft-bg-base: #020617;
    --ft-card-bg: rgba(11, 21, 40, 0.78);
    --ft-card-blur: blur(20px) saturate(160%);
    --ft-border: rgba(255, 255, 255, 0.12);
    --ft-border-hover: rgba(15, 163, 217, 0.35);
    --ft-text-primary: #F8FAFC;
    --ft-text-secondary: #94A3B8;
    --ft-text-muted: #64748B;

    /* Sacred Lineage Auras */
    --ft-gold-aura: #F59E0B;
    --ft-gold-glow: rgba(245, 158, 11, 0.45);
    --ft-emerald-aura: #10B981;
    --ft-emerald-glow: rgba(16, 185, 129, 0.35);
    --ft-cyan-aura: #0FA3D9;
    --ft-cyan-glow: rgba(15, 163, 217, 0.35);
    --ft-rose-aura: #EC4899;
    --ft-rose-glow: rgba(236, 72, 153, 0.35);

    --ft-radius-lg: 16px;
    --ft-radius-xl: 24px;
    --ft-shadow-card: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
    --ft-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base resets within family tree view */
body {
    background-color: var(--ft-bg-base);
    color: var(--ft-text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    padding: 28px 32px 60px;
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
}

.family-tree-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===================================
   SEARCH SECTION (Frosted Command Deck)
   =================================== */
.search-section {
    background: var(--ft-card-bg);
    backdrop-filter: var(--ft-card-blur);
    -webkit-backdrop-filter: var(--ft-card-blur);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-xl);
    padding: 28px 32px;
    box-shadow: var(--ft-shadow-card);
    transition: border-color var(--ft-transition);
}

.search-section:hover {
    border-color: var(--ft-border-hover);
}

.search-header {
    margin-bottom: 22px;
}

.search-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--ft-text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 24px;
    background: linear-gradient(180deg, var(--ft-cyan-aura), var(--ft-emerald-aura));
    border-radius: 4px;
    box-shadow: 0 0 14px var(--ft-cyan-glow);
}

.search-subtitle {
    color: var(--ft-text-secondary);
    font-size: 0.92rem;
    margin-top: 4px;
}

.search-input-group {
    display: flex;
    gap: 14px;
    align-items: center;
}

.search-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    padding: 14px 20px;
    color: var(--ft-text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    transition: var(--ft-transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--ft-cyan-aura);
    box-shadow: 0 0 0 3px rgba(15, 163, 217, 0.2), 0 0 20px rgba(15, 163, 217, 0.15);
    background: rgba(15, 23, 42, 0.92);
}

.search-input::placeholder {
    color: var(--ft-text-muted);
}

.search-btn {
    background: linear-gradient(135deg, #0FA3D9 0%, #0284C7 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--ft-radius-lg);
    padding: 14px 26px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 18px rgba(15, 163, 217, 0.35);
    transition: var(--ft-transition);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 163, 217, 0.5);
    filter: brightness(1.08);
}

.search-btn svg {
    width: 18px;
    height: 18px;
}

/* ===================================
   GLASS CARDS & DETAIL GRIDS
   =================================== */
.card {
    background: var(--ft-card-bg);
    backdrop-filter: var(--ft-card-blur);
    -webkit-backdrop-filter: var(--ft-card-blur);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-xl);
    box-shadow: var(--ft-shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
    transition: border-color var(--ft-transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-header h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ft-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.card-count {
    background: rgba(15, 163, 217, 0.14);
    color: #38BDF8;
    border: 1px solid rgba(15, 163, 217, 0.3);
    border-radius: 9999px;
    padding: 4px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-body {
    padding: 24px 28px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ft-text-primary);
}

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

.btn {
    border-radius: var(--ft-radius-lg);
    padding: 10px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: var(--ft-transition);
}

.btn-export {
    background: rgba(16, 185, 129, 0.14);
    color: #34D399;
    border-color: rgba(16, 185, 129, 0.35);
}

.btn-export:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10B981;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-edit {
    background: rgba(245, 158, 11, 0.14);
    color: #FBBF24;
    border-color: rgba(245, 158, 11, 0.35);
}

.btn-edit:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #F59E0B;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #0FA3D9, #0284C7);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(15, 163, 217, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ft-text-primary);
    border-color: var(--ft-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(15, 23, 42, 0.5);
    padding: 14px 18px;
    border-radius: var(--ft-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ft-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ft-text-primary);
    word-break: break-all;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===================================
   3D KINSHIP LINEAGE CANVAS STAGE
   =================================== */
.family-tree-canvas-card {
    border: 1px solid rgba(15, 163, 217, 0.25);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(15, 163, 217, 0.1);
}

.tree-canvas-wrapper {
    position: relative;
    width: 100%;
    min-height: 650px;
    background-color: #020617;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden;
    user-select: none;
}

.kinship-svg-stage {
    display: block;
    width: 100%;
    height: 650px;
    cursor: grab;
    transition: transform 0.08s linear;
}

.kinship-svg-stage:active {
    cursor: grabbing;
}

/* Floating Glass Canvas Toolbar */
.tree-floating-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(11, 21, 40, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    padding: 6px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.tree-tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ft-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ft-transition);
}

.tree-tool-btn svg {
    width: 18px;
    height: 18px;
}

.tree-tool-btn:hover {
    background: rgba(15, 163, 217, 0.25);
    border-color: var(--ft-cyan-aura);
    color: #38BDF8;
    transform: scale(1.08);
    box-shadow: 0 0 14px rgba(15, 163, 217, 0.4);
}

.tree-zoom-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ft-text-secondary);
    min-width: 48px;
    text-align: center;
    padding: 0 6px;
}

/* Kinship Legend */
.tree-kinship-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: rgba(11, 21, 40, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--ft-radius-lg);
    padding: 10px 18px;
    font-size: 0.8rem;
    color: var(--ft-text-secondary);
    z-index: 10;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.self-dot {
    background: var(--ft-gold-aura);
    box-shadow: 0 0 8px var(--ft-gold-glow);
}

.paternal-dot {
    background: var(--ft-emerald-aura);
    box-shadow: 0 0 8px var(--ft-emerald-glow);
}

.maternal-dot {
    background: var(--ft-cyan-aura);
    box-shadow: 0 0 8px var(--ft-cyan-glow);
}

.spouse-dot {
    background: var(--ft-rose-aura);
    box-shadow: 0 0 8px var(--ft-rose-glow);
}

/* Mini-Map Radar */
.tree-minimap-radar {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 140px;
    height: 90px;
    background: rgba(11, 21, 40, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--ft-radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.tree-minimap-radar canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.minimap-viewport-indicator {
    position: absolute;
    border: 1.5px solid var(--ft-cyan-aura);
    background: rgba(15, 163, 217, 0.18);
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 0 8px var(--ft-cyan-glow);
}

/* Connector Lines */
.tree-connector-branch {
    fill: none;
    stroke: rgba(15, 163, 217, 0.55);
    stroke-width: 2.2;
    stroke-dasharray: 6 3;
    animation: connectorPulse 30s linear infinite;
}

@keyframes connectorPulse {
    to {
        stroke-dashoffset: -400;
    }
}

.tree-connector-spouse {
    fill: none;
    stroke: var(--ft-rose-aura);
    stroke-width: 2.4;
    stroke-dasharray: 4 2;
    filter: drop-shadow(0 0 6px var(--ft-rose-glow));
}

.tree-connector-spouse-marker {
    fill: var(--ft-rose-aura);
    stroke: #FFFFFF;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 8px var(--ft-rose-glow));
}

/* SVG Node Cards */
.tree-node-group {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.tree-node-group:hover {
    filter: brightness(1.2) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.8));
}

.tree-node-group .node-rect {
    transition: all 0.2s ease;
}

.tree-node-group:hover .node-rect {
    stroke-width: 2.8;
}

/* Error State */
.tree-error-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--ft-text-secondary);
}

.tree-error-state svg {
    stroke: var(--ft-text-muted);
    margin-bottom: 16px;
}

.tree-error-state h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    color: var(--ft-text-primary);
    margin-bottom: 8px;
}

/* ===================================
   TABS & DATA TABLES
   =================================== */
.tabs {
    display: flex;
    gap: 8px;
    background: rgba(11, 21, 40, 0.6);
    backdrop-filter: var(--ft-card-blur);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    padding: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--ft-text-secondary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--ft-transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--ft-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(15, 163, 217, 0.25), rgba(2, 132, 199, 0.15));
    color: #38BDF8;
    border: 1px solid rgba(15, 163, 217, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.tab-content .tab-pane {
    display: none;
}

.tab-content .tab-pane.active {
    display: block;
    animation: paneFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.table-container {
    overflow-x: auto;
    border-radius: var(--ft-radius-lg);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th {
    background: rgba(15, 23, 42, 0.85);
    color: var(--ft-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--ft-border);
}

.users-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--ft-text-primary);
    vertical-align: middle;
}

.users-table tbody tr {
    transition: background 0.15s ease;
}

.users-table tbody tr:hover {
    background: rgba(15, 163, 217, 0.06);
}

.btn-action-table,
.action-btn,
.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(15, 163, 217, 0.12);
    border: 1px solid rgba(15, 163, 217, 0.35);
    border-radius: 8px;
    padding: 7px 16px;
    color: #38BDF8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.action-btn svg,
.btn-view svg,
.btn-action-table svg {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-shrink: 0;
    stroke: currentColor;
    display: inline-block;
}

.action-btn:hover,
.btn-view:hover,
.btn-action-table:hover {
    background: rgba(15, 163, 217, 0.3);
    border-color: #0FA3D9;
    color: #FFFFFF;
    box-shadow: 0 0 16px rgba(15, 163, 217, 0.4);
    transform: translateY(-1px);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.status-active,
.status-badge.connected {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34D399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-badge.status-inactive,
.status-badge.not-connected {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}


/* ===================================
   NO DATA PLACEHOLDER
   =================================== */
.no-data-section {
    background: var(--ft-card-bg);
    backdrop-filter: var(--ft-card-blur);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: var(--ft-radius-xl);
    padding: 80px 24px;
    text-align: center;
}

.no-data-content svg {
    width: 64px;
    height: 64px;
    stroke: var(--ft-text-muted);
    margin-bottom: 20px;
}

.no-data-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    color: var(--ft-text-primary);
    margin-bottom: 8px;
}

.no-data-content p {
    color: var(--ft-text-secondary);
    font-size: 0.95rem;
}

/* ===================================
   SPATIAL GLASS MODALS & EDIT WIZARD
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.modal-container {
    position: relative;
    background: rgba(11, 21, 40, 0.95);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--ft-radius-xl);
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(15, 163, 217, 0.15);
    width: 90%;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    z-index: 10;
    animation: modalSpring 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-container.large {
    max-width: 960px;
}

@keyframes modalSpring {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ft-text-primary);
    margin: 0;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ft-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ft-transition);
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #EF4444;
}

.modal-body {
    padding: 24px 28px;
}

/* Step Wizard in Edit Modal */
.edit-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 24px;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--ft-border);
    color: var(--ft-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--ft-transition);
}

.step.active .step-number {
    background: linear-gradient(135deg, #0FA3D9, #0284C7);
    border-color: #38BDF8;
    color: #FFFFFF;
    box-shadow: 0 0 16px rgba(15, 163, 217, 0.5);
}

.step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ft-text-muted);
}

.step.active .step-label {
    color: var(--ft-text-primary);
}

.edit-step {
    display: none;
}

.edit-step.active {
    display: block;
    animation: paneFadeIn 0.3s ease;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ft-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--ft-border);
    border-radius: var(--ft-radius-lg);
    padding: 12px 18px;
    color: var(--ft-text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: var(--ft-transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--ft-cyan-aura);
    box-shadow: 0 0 0 3px rgba(15, 163, 217, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Edit Tabs */
.edit-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.edit-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ft-border);
    border-radius: 10px;
    padding: 8px 16px;
    color: var(--ft-text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ft-transition);
}

.edit-tab-btn.active {
    background: rgba(15, 163, 217, 0.2);
    border-color: var(--ft-cyan-aura);
    color: #38BDF8;
}

.edit-tab-pane {
    display: none;
}

.edit-tab-pane.active {
    display: block;
}

/* Fullscreen Photo Lightbox */
.fullscreen-image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.94);
    backdrop-filter: blur(24px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.fullscreen-image-modal.show {
    display: flex;
}

.fullscreen-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--ft-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.close-fullscreen-btn {
    position: absolute;
    top: -48px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   =================================== */
@media (max-width: 1024px) {
    .container {
        padding: 20px 20px 60px;
    }
    .kinship-svg-stage {
        height: 540px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px 14px 100px;
    }
    .search-section {
        padding: 20px 18px;
    }
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    .search-btn {
        justify-content: center;
    }
    .kinship-svg-stage {
        height: 480px;
    }
    .tree-minimap-radar {
        display: none;
    }
    .tree-kinship-legend {
        bottom: 12px;
        left: 12px;
        right: 12px;
        font-size: 0.75rem;
        padding: 8px 12px;
    }
    .modal-container {
        width: 95%;
        max-height: 92vh;
    }
}

/* ── Light Theme Overrides ───────────────────────────────────────────── */
:root[data-theme="light"] .container {
    color: #0F172A;
}

:root[data-theme="light"] .search-section,
:root[data-theme="light"] .tree-section,
:root[data-theme="light"] .relatives-section,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .tabs {
    background: #FFFFFF !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

:root[data-theme="light"] .section-title {
    color: #0F172A !important;
}

:root[data-theme="light"] .kinship-svg-stage {
    background: #F8FAFC !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

:root[data-theme="light"] .tab {
    color: #64748B !important;
}

:root[data-theme="light"] .tab.active {
    background: #FFFFFF !important;
    color: #0284C7 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] .custom-relatives-table {
    background: #FFFFFF !important;
}

:root[data-theme="light"] .custom-relatives-table th {
    background: #F8FAFC !important;
    color: #475569 !important;
}

:root[data-theme="light"] .custom-relatives-table td {
    color: #1E293B !important;
}

