:root {
    --bg-dark: #050711;
    --card-glass: rgba(13, 19, 36, 0.72);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-glow: rgba(56, 189, 248, 0.12);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --text-muted: #64748b;
    --emerald-primary: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.4);
    --cyan-accent: #06b6d4;
    --gold-accent: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.25);
    --danger-red: #f87171;
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Background Canvas */
#shiva-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* App Viewport Container */
#app-viewport {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* View Screens */
.view-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 1. LOGIN EXPERIENCE */
#login-screen {
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-panel {
    width: 100%;
    max-width: 440px;
    padding: 40px 28px;
    border-radius: 24px;
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px var(--card-glow);
    display: flex;
    flex-direction: column;
    gap: 32px;
    text-align: center;
}

.spiritual-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.divine-aura-mark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16,185,129,0.2) 0%, rgba(6,182,212,0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--emerald-glow);
}

.login-brand-title {
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 6vw, 2.75rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 70%, var(--gold-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-brand-tagline {
    font-size: 0.95rem;
    color: var(--text-sub);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Auth Form Controls */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.input-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 0.825rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sub);
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    outline: none;
    transition: all 0.25s ease;
}

.auth-select {
    cursor: pointer;
    background-color: #0b1120;
}

.auth-select option {
    background-color: #0b1120;
    color: #f8fafc;
}

.auth-input:focus {
    border-color: var(--emerald-primary);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.auth-textarea {
    resize: vertical;
    min-height: 80px;
}

.empty-records-state {
    padding: 36px 20px;
    text-align: center;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.empty-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.empty-desc {
    font-size: 0.875rem;
    color: var(--text-sub);
    max-width: 400px;
    line-height: 1.5;
}


/* Error Banner */
.auth-error-message {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger-red);
    font-size: 0.875rem;
    line-height: 1.4;
    display: none;
}

/* Divine Button */
.btn-primary-divine {
    width: 100%;
    padding: 14px 20px;
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #04140e;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    border: 1px solid rgba(167, 243, 208, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px var(--emerald-glow);
}

.btn-primary-divine:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.btn-primary-divine:active {
    transform: translateY(0);
}

.btn-primary-divine:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer-links {
    text-align: center;
    margin-top: 4px;
}

.btn-link-forgot {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 0.875rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn-link-forgot:hover {
    color: var(--emerald-primary);
}

/* 2. PROTECTED DASHBOARD */
.dashboard-navbar {
    width: 100%;
    padding: 18px 24px;
    background: rgba(13, 19, 36, 0.85);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-brand-group {
    display: flex;
    flex-direction: column;
}

.nav-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-subtitle {
    font-size: 0.75rem;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 0.85rem;
    color: var(--emerald-primary);
    font-weight: 600;
}

.user-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--emerald-primary);
}

.btn-sign-out {
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-sub);
    font-size: 0.85rem;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sign-out:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger-red);
}

.dashboard-content {
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Welcome Banner */
.welcome-banner {
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 182, 212, 0.06) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    text-align: center;
}

.welcome-greeting {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--emerald-primary);
    margin-bottom: 4px;
}

.welcome-text {
    font-size: 0.95rem;
    color: var(--text-sub);
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.action-card {
    padding: 24px 20px;
    border-radius: 18px;
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: var(--emerald-primary);
    box-shadow: 0 10px 30px var(--card-glow);
}

.action-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 2px;
}

.action-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.4;
}

/* Records List */
.records-preview-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.section-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
}

.section-count {
    font-size: 0.75rem;
    color: var(--gold-accent);
    background: rgba(251, 191, 36, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.person-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.person-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.person-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.person-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.person-origin {
    font-size: 0.85rem;
    color: var(--emerald-primary);
    font-weight: 500;
}

.person-context {
    font-size: 0.875rem;
    color: var(--text-sub);
    font-style: italic;
    margin-top: 2px;
}

.person-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.category-tag {
    font-size: 0.725rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
}

/* Modals */
.app-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    background: rgba(3, 4, 9, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

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

.modal-glass-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 32px 24px;
    border-radius: 20px;
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-wide {
    max-width: 620px;
}

.modal-close-trigger {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-sub);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-sub);
    margin-top: 2px;
}

.recovery-email-info {
    font-size: 0.9rem;
    color: var(--text-sub);

    code {
        color: var(--emerald-primary);
        word-break: break-all;
    }
}

.modal-status-area {
    margin-top: 12px;
    font-size: 0.875rem;
}

.status-success {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.status-error {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--danger-red);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.location-group-box {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.box-label {
    font-size: 0.8rem;
    color: var(--gold-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.span-full {
    grid-column: 1 / -1;
}

.category-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.category-pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: var(--text-sub);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.category-pill-label:hover {
    border-color: var(--emerald-primary);
    color: var(--text-main);
}

.category-pill-label:has(.category-checkbox:checked) {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--emerald-primary);
    color: #a7f3d0;
    font-weight: 600;
}

.category-checkbox {
    accent-color: var(--emerald-primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.filter-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 18px;
}

.search-results-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

.search-result-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.result-location {
    font-size: 0.825rem;
    color: var(--emerald-primary);
}

.result-meta {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-style: italic;
}

.no-search-results {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 0;
}

.person-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.card-menu-container {
    position: relative;
}

.card-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.card-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.card-dropdown-menu {
    position: absolute;
    top: 40px;
    right: 0;
    width: 150px;
    background: #0f172a;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: all 0.2s ease;
}

.card-dropdown-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: var(--font-body);
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.item-delete:hover {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger-red);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    padding: 12px 20px;
    border-radius: 12px;
    background: #064e3b;
    border: 1px solid #10b981;
    color: #a7f3d0;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast-notification.active {
    opacity: 1;
    transform: translateY(0);
}

.filter-section-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.filter-category-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-danger-confirm {
    padding: 8px 16px;
    border-radius: 8px;
    background: #dc2626;
    border: 1px solid #ef4444;
    color: #ffffff;
    font-size: 0.875rem;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-confirm:hover {
    background: #b91c1c;
}

/* Animations & Responsive */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

@media (max-width: 600px) {
    .login-panel {
        padding: 32px 20px;
        gap: 24px;
    }

    .dashboard-navbar {
        padding: 14px 16px;
    }

    .dashboard-content {
        padding: 20px 14px 40px;
        gap: 24px;
    }

    .action-card {
        padding: 18px 16px;
    }

    .filter-controls-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toast-notification {
        left: 16px;
        right: 16px;
        bottom: 16px;
        text-align: center;
    }
}


