/* ==========================================
   KabirFamBucks Design System & Stylesheet
   ========================================== */

/* 1. Global Custom Properties & Themes */
:root {
    --bg-main: #0b0f19;
    --bg-sidebar: #0f1626;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-input: #151e33;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-dim: #6b7280;
    
    /* Neon Accents */
    --color-violet: #8b5cf6;
    --color-violet-glow: rgba(139, 92, 246, 0.3);
    --color-violet-hover: #a78bfa;
    
    --color-emerald: #10b981;
    --color-emerald-glow: rgba(16, 185, 129, 0.3);
    
    --color-orange: #f97316;
    --color-orange-glow: rgba(249, 115, 22, 0.3);
    --color-orange-hover: #fb923c;
    
    --color-blue: #3b82f6;
    --color-rose: #f43f5e;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px var(--color-violet-glow);
}

/* Parent mode active styles override elements */
body.parent-mode-active {
    --color-primary-theme: var(--color-orange);
    --color-primary-theme-glow: var(--color-orange-glow);
}

body.child-mode-active {
    --color-primary-theme: var(--color-violet);
    --color-primary-theme-glow: var(--color-violet-glow);
}

/* 2. Base Reset & Structure */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(249, 115, 22, 0.05) 0px, transparent 50%);
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* 3. Sidebar Layout */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-violet), var(--color-orange));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    overflow: hidden;
}

.brand-logo i {
    color: white;
    font-size: 20px;
}

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

.logo-title {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-tag {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Role Profile Display Card */
.active-profile-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.active-profile-avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border-color);
}

.active-profile-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.active-profile-role {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-profile-name {
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.switch-profile-mini-btn {
    background: none;
    border: none;
    color: var(--color-violet);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.switch-profile-mini-btn:hover {
    color: var(--color-violet-hover);
    transform: scale(1.1);
}

.parent-mode-active .switch-profile-mini-btn {
    color: var(--color-orange);
}

.parent-mode-active .switch-profile-mini-btn:hover {
    color: var(--color-orange);
    transform: translateY(-1px);
}

/* Utility hidden class */
.hidden {
    display: none !important;
}

/* ==========================================
   Login Page — Full Screen
   ========================================== */
.login-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0f19;
    background-image:
        radial-gradient(at 20% 20%, rgba(139, 92, 246, 0.25) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(249, 115, 22, 0.15) 0px, transparent 50%);
    transition: opacity 0.6s ease;
}

.login-fullscreen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(139,92,246,0.1);
    animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(139,92,246,0.4);
    border: 2px solid rgba(139,92,246,0.3);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-title {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.login-sub {
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 36px;
}

.login-field {
    width: 100%;
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.25s ease;
}

.login-field input:focus {
    border-color: var(--color-violet);
    background: rgba(139,92,246,0.08);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

.login-field input.input-error {
    border-color: var(--color-rose);
    box-shadow: 0 0 0 3px rgba(244,63,94,0.15);
}

.login-error {
    font-size: 12px;
    color: var(--color-rose);
    margin-top: 6px;
    min-height: 18px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--color-violet), #6d28d9);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(139,92,246,0.4);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(139,92,246,0.5);
}

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

/* OTP Step */
.otp-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-violet);
    box-shadow: 0 0 30px rgba(139,92,246,0.4);
    margin-bottom: 16px;
    animation: avatarPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes avatarPop {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

.otp-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.otp-sub {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.otp-code-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 16px;
    padding: 20px 40px;
    margin-bottom: 16px;
}

.otp-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-violet);
    margin-bottom: 8px;
    font-weight: 600;
}

.otp-code {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 12px;
    color: #fff;
}

.otp-note {
    font-size: 13px;
    color: var(--text-dim);
}


.switch-profile-mini-btn:hover {
    color: var(--color-orange-hover);
}

/* Sidebar Nav Links */
.nav-menu {
    flex-grow: 1;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.02);
}

.child-mode-active .nav-link.active {
    color: white;
    background-color: rgba(139, 92, 246, 0.12);
    border-left: 3px solid var(--color-violet);
}

.parent-mode-active .nav-link.active {
    color: white;
    background-color: rgba(249, 115, 22, 0.12);
    border-left: 3px solid var(--color-orange);
}

.nav-link i {
    font-size: 18px;
}

/* Sidebar Wallet */
.sidebar-wallet {
    margin-top: auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
}

.wallet-compact {
    display: flex;
    flex-direction: column;
}

.wallet-title {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.wallet-amount {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wallet-pending {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* 4. Main Workspace Layout */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
    padding: 40px;
}

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

.app-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 14px;
}

.parent-badge {
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.3);
    color: var(--color-orange);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lock-exit-btn {
    background: none;
    border: none;
    color: var(--color-orange);
    cursor: pointer;
    margin-left: 8px;
    font-size: 14px;
    padding: 2px 4px;
    transition: var(--transition);
}

.lock-exit-btn:hover {
    color: #ff9d5c;
    transform: scale(1.1);
}

/* Tab Containers */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* 5. Stats Grid Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.stat-card.wallet-card {
    border-color: rgba(139, 92, 246, 0.2);
}

.gradient-bg-violet {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(15, 22, 38, 0.8));
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 20px;
    opacity: 0.8;
}

.text-violet { color: var(--color-violet); }
.text-emerald { color: var(--color-emerald); }
.text-orange { color: var(--color-orange); }

.stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.wallet-card .stat-value {
    color: var(--color-emerald);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.stat-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.footer-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 6. Dashboard Split & Panels */
.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.gradient-border {
    border-image: linear-gradient(135deg, var(--color-orange), var(--color-violet)) 1;
    border-style: solid;
    border-width: 1px;
    border-radius: var(--radius-lg); /* Fallback */
}

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

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header-link {
    background: none;
    border: none;
    color: var(--color-violet);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.panel-header-link:hover {
    color: var(--color-violet-hover);
    text-decoration: underline;
}

.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
}

.badge-violet { background: rgba(139, 92, 246, 0.15); color: var(--color-violet); border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-orange { background: rgba(249, 115, 22, 0.15); color: var(--color-orange); border: 1px solid rgba(249, 115, 22, 0.2); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--color-blue); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: var(--color-rose); border: 1px solid rgba(244, 63, 94, 0.2); }

.panel-body {
    padding: 24px;
}

.panel-body.list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 450px;
    overflow-y: auto;
}

/* 7. Task Card / Items Styles */
.chore-card-wide {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: var(--transition);
}

.chore-card-wide:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateX(3px);
}

.chore-info-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chore-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chore-title-row h4 {
    font-size: 15px;
    font-weight: 600;
}

.chore-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.revision-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-rose);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(244, 63, 94, 0.08);
    padding: 6px 12px;
    border-radius: 6px;
    border-left: 2px solid var(--color-rose);
}

.chore-action-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chore-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-emerald);
}

/* Chores Grid (Chore Market) */
.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.chores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chore-card-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    transition: var(--transition);
}

.chore-card-box:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card-box-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-box-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.card-box-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.card-box-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
}

.card-box-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-emerald);
}

/* 8. Buttons UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 18px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-primary {
    background-color: var(--color-violet);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-violet-hover);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.btn-orange {
    background-color: var(--color-orange);
    color: white;
}

.btn-orange:hover {
    background-color: var(--color-orange-hover);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.btn-success {
    background-color: var(--color-emerald);
    color: white;
}

.btn-success:hover {
    background-color: #34d399;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

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

.btn-outline:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-orange-outline {
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--color-orange);
}

.btn-orange-outline:hover {
    background-color: rgba(249, 115, 22, 0.05);
    border-color: var(--color-orange);
}

.btn-violet-outline {
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--color-violet);
}

.btn-violet-outline:hover {
    background-color: rgba(139, 92, 246, 0.05);
    border-color: var(--color-violet);
}

.btn-dimmed {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none !important;
}

.w-100 { width: 100%; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

/* 9. Timeline / Recent Activity */
.timeline-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 450px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    gap: 12px;
    position: relative;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: -16px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.timeline-icon.success { color: var(--color-emerald); background-color: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2); }
.timeline-icon.pending { color: var(--color-orange); background-color: rgba(249, 115, 22, 0.08); border-color: rgba(249, 115, 22, 0.2); }
.timeline-icon.payout { color: var(--color-violet); background-color: rgba(139, 92, 246, 0.08); border-color: rgba(139, 92, 246, 0.2); }

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.timeline-text {
    font-size: 13px;
    font-weight: 500;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-dim);
}

/* 10. Ledger Tab Styles */
.ledger-header-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(15, 22, 38, 0.9));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.ledger-total {
    flex: 1;
}

.ledger-total span {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ledger-total h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-emerald);
    margin-top: 6px;
}

.ledger-divider {
    width: 1px;
    height: 70px;
    background-color: var(--border-color);
    margin: 0 40px;
}

.ledger-stats {
    display: flex;
    gap: 40px;
}

.ledger-stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ledger-stat-title {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.ledger-stat-val {
    font-size: 18px;
    font-weight: 700;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ledger-table th {
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.ledger-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.ledger-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
    color: white;
}

.text-right { text-align: right; }

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state i {
    font-size: 32px;
}

/* 11. Modals Overlay & Modals Content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

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

.modal-card {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-card.modal-sm {
    max-width: 380px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.review-footer {
    justify-content: space-between;
}

/* Forms Elements */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-primary-theme);
    box-shadow: 0 0 0 3px var(--color-primary-theme-glow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.input-money-container {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 14px;
}

.input-money-container input {
    padding-left: 28px !important;
}

/* PIN Screen details */
.pin-display-container {
    display: flex;
    justify-content: center;
}

.pin-display-container input {
    width: 160px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 32px;
    text-align: center;
    letter-spacing: 12px;
    padding: 10px;
    outline: none;
}

.pin-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 220px;
    margin: 0 auto;
}

.pin-key {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 18px;
    font-weight: 700;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pin-key:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.pin-key.clear {
    color: var(--color-rose);
}

.pin-key.submit {
    color: var(--color-emerald);
}

.pin-hint {
    font-size: 12px;
    color: var(--text-dim);
}

.error-text {
    color: var(--color-rose);
    font-size: 13px;
    font-weight: 500;
}

/* File Upload proof zone */
.photo-upload-container {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.01);
    transition: var(--transition);
}

.photo-upload-container:hover {
    border-color: var(--color-violet);
    background-color: rgba(139, 92, 246, 0.02);
}

.photo-upload-container input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.upload-icon {
    font-size: 28px;
    color: var(--text-dim);
}

.preview-container {
    position: relative;
    width: 100%;
    max-height: 160px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}

/* Chore review content info styling */
.task-details-preview {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.details-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.details-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: var(--text-dim);
}

.details-desc-box {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Parent Review content styling */
.review-task-summary {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.summary-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.summary-line span {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
}

.user-badge {
    color: var(--color-violet);
    font-weight: 600;
}

.review-block-title {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 700;
}

.review-text-box {
    background-color: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.review-text-box.highlight-box {
    border-left: 3px solid var(--color-violet);
    background-color: rgba(139, 92, 246, 0.03);
}

.review-photo-wrapper {
    max-height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: zoom-in;
}

.review-photo-wrapper img {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.payout-balance-info {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

/* Image preview full resolution modal */
.fullscreen-img-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.fullscreen-img-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
}

.fullscreen-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
    cursor: pointer;
}

/* Toast System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 280px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

.toast.success { border-left: 4px solid var(--color-emerald); }
.toast.info { border-left: 4px solid var(--color-blue); }
.toast.warning { border-left: 4px solid var(--color-orange); }
.toast.error { border-left: 4px solid var(--color-rose); }

.toast-icon { font-size: 16px; }
.toast.success .toast-icon { color: var(--color-emerald); }
.toast.info .toast-icon { color: var(--color-blue); }
.toast.warning .toast-icon { color: var(--color-orange); }
.toast.error .toast-icon { color: var(--color-rose); }

.toast-message { font-size: 13px; font-weight: 500; }

/* 12. Market Toolbar & Filters */
.market-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 320px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    padding: 10px 14px 10px 38px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--color-primary-theme);
}

.filter-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.filter-btn {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-btn:hover {
    color: white;
    border-color: var(--border-hover);
}

.child-mode-active .filter-btn.active {
    background-color: var(--color-violet);
    color: white;
    border-color: var(--color-violet);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.parent-mode-active .filter-btn.active {
    background-color: var(--color-orange);
    color: white;
    border-color: var(--color-orange);
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

/* Empty State / Hidden elements based on state helper */
.child-mode-active .parent-only-block {
    display: none !important;
}

.parent-mode-active .child-only-block {
    display: none !important;
}

/* ==========================================
   13. Profile Switcher Screen (Netflix Style)
   ========================================== */
.profile-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #090c15;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-out;
}

.profile-picker-overlay.hidden {
    display: none !important;
}

.profile-picker-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, white, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-card-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 900px;
    padding: 20px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 140px;
    transition: var(--transition);
}

.profile-avatar-box {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    background-color: #141b2e;
    border: 3px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.profile-avatar-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), transparent);
    pointer-events: none;
}

.profile-card:hover {
    transform: translateY(-8px);
}

.profile-card:hover .profile-avatar-box {
    border-color: var(--color-violet);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.4);
}

/* Parent profile card hover glow orange */
.profile-card.parent-profile-picker-card:hover .profile-avatar-box {
    border-color: var(--color-orange);
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.4);
}

.profile-name-lbl {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.profile-card:hover .profile-name-lbl {
    color: white;
}

/* Roster / Leaderboard for Parents */
.family-roster-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roster-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    transition: var(--transition);
}

.roster-card:hover {
    border-color: var(--border-hover);
    background-color: rgba(255, 255, 255, 0.04);
}

.roster-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roster-avatar {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid var(--border-color);
}

.roster-info {
    display: flex;
    flex-direction: column;
}

.roster-name {
    font-size: 14px;
    font-weight: 700;
}

.roster-lifetime {
    font-size: 11px;
    color: var(--text-dim);
}

.roster-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roster-balances-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.roster-balance {
    font-size: 15px;
    font-weight: 800;
    color: var(--color-emerald);
}

.roster-cash-equiv {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Add profile item button in Netflix picker */
.profile-card.add-profile-picker-card .profile-avatar-box {
    border: 3px dashed var(--border-color);
    background: none;
    color: var(--text-dim);
}

.profile-card.add-profile-picker-card:hover .profile-avatar-box {
    border-color: var(--text-secondary);
    color: white;
    box-shadow: none;
}

/* ==========================================
   14. Responsive Adaptations
   ========================================== */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .brand {
        margin-bottom: 0;
    }
    
    .active-profile-card {
        margin-bottom: 0;
        padding: 4px;
        background: none;
        border: none;
    }
    
    .active-profile-role {
        display: none;
    }
    
    .nav-menu {
        width: 100%;
        order: 3;
    }
    
    .nav-menu ul {
        display: flex;
        justify-content: space-around;
        gap: 8px;
    }
    
    .nav-link {
        padding: 10px 14px;
        font-size: 13px;
        flex: 1;
        justify-content: center;
    }
    
    .sidebar-wallet {
        order: 2;
        margin-top: 0;
        padding: 8px 12px;
    }
    
    .wallet-amount {
        font-size: 16px;
    }
    
    .wallet-pending {
        display: none;
    }
    
    .main-content {
        padding: 20px;
        height: auto;
        overflow-y: visible;
    }
    
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sidebar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .brand {
        justify-content: center;
    }
    
    .sidebar-wallet {
        display: flex;
        justify-content: center;
        text-align: center;
    }
    
    .nav-menu ul {
        flex-wrap: wrap;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 12px;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-right {
        width: 100%;
    }
    
    .header-right button {
        width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .ledger-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ledger-divider {
        display: none;
    }
    
    .ledger-stats {
        width: 100%;
        justify-content: space-between;
    }
}
