/* Mom Bucks Phone Simulator */

:root {
    --primary: #3D6B2E;
    --primary-dark: #2A4D1F;
    --primary-light: #e8f5e9;
    --balance-positive: #2e7d32;
    --balance-negative: #c62828;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #212121;
    --text-secondary: #757575;
    --border: #e0e0e0;
    --phone-bezel: #1a1a1a;
    --warning: #ff9800;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #2c2c2c;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text);
}

/* ===== PHONE FRAME ===== */
.phone-frame {
    position: relative;
    width: 375px;
    height: 812px;
    background: var(--phone-bezel);
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 2px #333;
}

.phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 28px;
    background: var(--phone-bezel);
    border-radius: 0 0 16px 16px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
}

.phone-home-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: #666;
    border-radius: 3px;
}

/* ===== RESPONSIVE: Full-screen on mobile ===== */
@media (max-width: 500px) {
    body { background: var(--bg); }
    .phone-frame {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }
    .phone-notch { display: none; }
    .phone-screen { border-radius: 0; }
    .phone-home-indicator { display: none; }
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.active { display: block; }

.screen-content {
    padding: 48px 20px 32px;
    min-height: 100%;
}

/* ===== AUTH SCREENS ===== */
.auth-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    padding-top: 60px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    display: inline-block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 12px;
}

.logo-title {
    font-size: 24px;
    color: var(--text);
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-form { width: 100%; }

.field {
    margin-bottom: 16px;
}

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

.field input, .field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus, .field select:focus {
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

/* ===== HOME SCREEN ===== */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.greeting {
    font-size: 28px;
    font-weight: 700;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    color: var(--text);
    transition: background 0.2s;
}

.icon-btn:hover { background: rgba(0,0,0,0.05); }

.section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.kids-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.kid-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}

.kid-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.kid-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    overflow: hidden;
}

.kid-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kid-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.kid-balance {
    font-size: 16px;
    font-weight: 700;
}

.kid-balance.positive { color: var(--balance-positive); }
.kid-balance.negative { color: var(--balance-negative); }

.add-child-card {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.add-child-card:hover { border-color: var(--primary); }

.plus-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 8px;
}

.add-child-card .plus-circle { width: 64px; height: 64px; font-size: 28px; }

.add-child-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== CHILD DETAIL ===== */
.child-detail-screen {
    padding-bottom: 80px; /* breathing room at bottom */
}

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

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    overflow: hidden;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.child-hero {
    text-align: center;
    margin-bottom: 20px;
}

.child-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    overflow: hidden;
}

.child-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.child-hero-name {
    font-size: 22px;
    font-weight: 700;
}

.child-hero-age {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 16px;
    padding: 24px 20px;
    color: white;
    margin-bottom: 24px;
}

.balance-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
    text-align: left;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.balance-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.balance-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.balance-btn:hover { background: rgba(255,255,255,0.3); }

.balance-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.7;
}

/* Transactions */
.transactions-list {
    margin-bottom: 16px;
}

.txn-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.txn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}

.txn-icon.lodge { background: #e8f5e9; color: var(--balance-positive); }
.txn-icon.withdraw { background: #ffebee; color: var(--balance-negative); }

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

.txn-desc {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.txn-date {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0;
}

.txn-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.txn-author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    flex-shrink: 0;
}

.txn-author-avatar-img {
    object-fit: cover;
    background: none;
}

.txn-meta-sep {
    font-size: 12px;
    color: var(--text-secondary);
}

.txn-amount {
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 8px;
}

.txn-amount.positive { color: var(--balance-positive); }
.txn-amount.negative { color: var(--balance-negative); }

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px 0;
    font-size: 14px;
}

/* ===== BOUNTIES ===== */
.bounties-list { margin-bottom: 16px; }

.bounty-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: default;
    transition: background 0.15s;
    background: var(--surface);
}

.bounty-item.ready { background: var(--primary-light); cursor: pointer; }

.bounty-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.bounty-icon.ready { background: var(--balance-positive); color: white; }
.bounty-icon.locked { background: var(--text-secondary); color: white; }
.bounty-icon.claimed { background: var(--text-secondary); color: white; }

.bounty-info { flex: 1; }
.bounty-title { font-size: 14px; font-weight: 600; }
.bounty-status { font-size: 12px; color: var(--text-secondary); }

.bounty-amount {
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 8px;
}

.btn-edit-rewards {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    font-size: 14px;
    transition: background 0.15s;
}

.btn-edit-rewards:hover { background: var(--primary-light); }

.btn-icon-del {
    background: none;
    border: none;
    color: var(--error, #e53935);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
    border-radius: 4px;
}
.btn-icon-del:hover { background: rgba(229, 57, 53, 0.1); }

/* ===== EDIT REWARDS — Sections & Cards ===== */
.rewards-section {
    margin-bottom: 20px;
}

.rewards-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}

.info-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.info-disclosure {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    background: #e3f2fd;
    border-radius: 8px;
    padding: 0 12px;
    margin-bottom: 0;
}

.info-disclosure.open {
    max-height: 200px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.info-disclosure p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.allowance-card-empty {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s;
}

.allowance-card-empty:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.allowance-card-filled {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.allowance-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.allowance-card-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.allowance-card-freq {
    font-size: 13px;
    color: var(--text-secondary);
}

.allowance-card-edit {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: background 0.15s;
}

.allowance-card-edit:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Allowance modal (inside phone screen) */
.ac-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: 28px;
}

.ac-modal-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    max-height: 80%;
    overflow-y: auto;
}

.ac-modal-content .field {
    margin-bottom: 14px;
}

.btn-danger-text {
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: #e53935;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.btn-danger-text:hover {
    background: rgba(229, 57, 53, 0.08);
}

/* ===== SEGMENTED BUTTONS ===== */
.segmented-buttons {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.seg-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-right: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.seg-btn:last-child { border-right: none; }

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

/* ===== BOTTOM SHEET ===== */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transform: translateY(calc(100% - 56px));
    transition: transform 0.3s ease;
    z-index: 5;
    max-height: 60%;
}

.bottom-sheet.expanded {
    transform: translateY(0);
}

.sheet-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px 8px;
    cursor: pointer;
}

.handle-bar {
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin-bottom: 8px;
}

.sheet-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.sheet-content {
    padding: 0 20px 20px;
    overflow-y: auto;
    max-height: calc(60vh - 56px);
}

.family-list { margin-bottom: 12px; }

.family-member {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-right: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info { flex: 1; }
.member-name { font-size: 14px; font-weight: 600; }
.member-role { font-size: 12px; color: var(--text-secondary); }

.btn-add-member {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: none;
    border: 2px dashed var(--border);
    border-radius: 10px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-add-member:hover { border-color: var(--primary); }
.btn-add-member .plus-circle { width: 28px; height: 28px; font-size: 16px; margin-bottom: 0; }

/* ===== SETTINGS ===== */
.settings-profile {
    text-align: center;
    margin-bottom: 24px;
}

.profile-photo-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
}

.profile-photo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    overflow: hidden;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--surface);
}

.profile-name { font-size: 18px; font-weight: 700; }
.profile-email { font-size: 14px; color: var(--text-secondary); }
.edit-photo-hint { font-size: 13px; color: var(--text-secondary); text-align: center; margin-top: 4px; }

.settings-list {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child { border-bottom: none; }

.settings-label {
    font-size: 15px;
    font-weight: 500;
}

.settings-item select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    bottom: 3px;
    left: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.btn-logout {
    width: 100%;
    padding: 14px;
    background: none;
    border: 2px solid var(--balance-negative);
    color: var(--balance-negative);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover { background: #ffebee; }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 340px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
}

.modal-close:hover { background: rgba(0,0,0,0.05); }

/* ===== TOAST ===== */
.toast {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.success { background: var(--primary-light); color: var(--balance-positive); opacity: 1; }
.toast.error { background: #ffebee; color: var(--balance-negative); opacity: 1; }

/* ===== LOADING ===== */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TRANSACTION DETAIL DRAWER ===== */
.txn-item { cursor: pointer; transition: background 0.15s; }
.txn-item:active { background: var(--primary-light); }

.txn-detail-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.3s;
    border-radius: 28px;
}
.txn-detail-backdrop.open { opacity: 1; pointer-events: auto; }

.txn-detail-drawer {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-radius: 20px 20px 0 0;
    z-index: 91; transform: translateY(100%); transition: transform 0.3s ease;
    padding: 8px 20px 24px; max-height: 70%;
    overflow-y: auto;
}
.txn-detail-drawer.open { transform: translateY(0); }

.txn-detail-handle {
    display: flex; justify-content: center; padding: 8px 0; cursor: pointer;
}
.txn-detail-handle span {
    width: 36px; height: 4px; background: var(--border); border-radius: 2px;
}

.txn-detail-title {
    font-size: 16px; font-weight: 600; margin-bottom: 16px; text-align: center;
}

.txn-detail-amount {
    font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 8px;
}
.txn-detail-amount.positive { color: var(--balance-positive); }
.txn-detail-amount.negative { color: var(--balance-negative); }

.txn-detail-desc {
    font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 4px;
}

.txn-detail-date {
    font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 16px;
}

.txn-detail-source {
    font-size: 13px; color: var(--text-secondary); text-align: center;
    margin-bottom: 16px; font-style: italic;
}

.txn-detail-author {
    background: var(--bg); border-radius: 12px; padding: 12px; margin-bottom: 20px;
}
.txn-detail-author-label {
    font-size: 11px; text-transform: uppercase; color: var(--text-secondary);
    letter-spacing: 0.5px; margin-bottom: 8px;
}
.txn-detail-author-info { display: flex; align-items: center; gap: 10px; }
.txn-detail-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}
.txn-detail-avatar-initial {
    background: var(--primary); color: white; display: flex;
    align-items: center; justify-content: center; font-weight: 600; font-size: 16px;
}
.txn-detail-author-name { font-weight: 600; font-size: 14px; }
.txn-detail-author-email { font-size: 12px; color: var(--text-secondary); }

.txn-detail-revert {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: #fdecea; color: #c62828; font-weight: 600; font-size: 15px;
    cursor: pointer; transition: background 0.15s;
}
.txn-detail-revert:active { background: #f8d7da; }

/* Revert confirmation */
.txn-revert-confirm {
    position: absolute; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 100; display: flex; align-items: center; justify-content: center;
    border-radius: 28px;
}
.txn-revert-confirm-content {
    background: var(--surface); border-radius: 16px; padding: 24px;
    width: 80%; max-width: 300px; text-align: center;
}
.txn-revert-confirm-content h3 { margin-bottom: 12px; font-size: 18px; }
.txn-revert-confirm-content p { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.txn-revert-confirm-actions { display: flex; gap: 12px; }
.txn-revert-confirm-actions button { flex: 1; padding: 10px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-secondary { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: #c62828; border: none; color: white; }

.hidden { display: none !important; }

/* ===== VAULT TILE (separate card below balance) ===== */
.vault-tile {
    background: linear-gradient(135deg, #4A7023, #6B9B3A);
    border-radius: 16px;
    padding: 20px;
    color: white;
    margin-bottom: 24px;
}

.vault-tile-header {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.vault-tile-header .vault-goal-name {
    font-style: italic;
}

.vault-tile-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.vault-safe-icon {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    opacity: 0.3;
    /* Invert black lines to white, then the white bg blends with green */
    filter: invert(1);
    mix-blend-mode: screen;
}

.vault-tile-right {
    flex: 1;
    min-width: 0;
}

/* Segmented progress bar */
.vault-progress-bar {
    position: relative;
    height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    overflow: hidden;
}

.vault-progress-segments {
    position: absolute;
    inset: 0;
    display: flex;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vault-segment-lodged {
    height: 100%;
    background: #4CAF50;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vault-segment-interest {
    height: 100%;
    background: #FFD700;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vault-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.vault-balance-current {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.vault-balance-target {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}

/* Interest pill + Add Money row */
.vault-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.vault-interest-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255,215,0,0.35);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.vault-add-money-btn {
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.vault-add-money-btn:hover { background: rgba(255,255,255,0.3); }

/* Vault empty state (inside tile) */
.vault-tile-empty {
    text-align: center;
    padding: 16px 8px;
    cursor: pointer;
}

.vault-tile-empty-text {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

/* Vault completed state */
.vault-completed-banner {
    background: linear-gradient(90deg, #FFA000, #FFD700);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    animation: vaultPulse 2s ease-in-out infinite;
}

.vault-completed-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.vault-completed-sub {
    font-size: 13px;
    color: rgba(0,0,0,0.7);
    margin-top: 2px;
}

.vault-unlock-btn {
    margin-top: 8px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.2);
    color: #333;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.vault-pulse { animation: vaultPulse 2s ease-in-out infinite; }
@keyframes vaultPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); } 50% { box-shadow: 0 0 12px 4px rgba(255, 215, 0, 0.2); } }

/* Legacy vault-section hidden — vault is now a separate tile */
.vault-section { display: none !important; }

/* ===== BOUNTY CAROUSEL (horizontal scroll) ===== */
.bounties-carousel {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 48px;
}

.bounties-carousel::-webkit-scrollbar { display: none; }

.bounty-card {
    flex-shrink: 0;
    width: 160px;
    min-height: 120px;
    background: #D5E8C0;
    border-radius: 16px;
    padding: 14px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: default;
}

.bounty-card.ready {
    background: #E8F5E9;
    cursor: pointer;
}

.bounty-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bounty-card-icon.ready { background: var(--balance-positive); color: white; }
.bounty-card-icon.locked { background: var(--text-secondary); color: white; }

.bounty-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bounty-card-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.bounty-card-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.bounty-card-recurrence {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* ===== VAULT SECTION (Edit Rewards) ===== */
.vault-edit-card { background: #f8f8f8; border-radius: 10px; padding: 14px; }
.vault-edit-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.vault-edit-name { font-weight: 600; font-size: 15px; }
.vault-edit-target { font-size: 13px; color: #666; }
.vault-edit-bar { height: 4px; background: #e0e0e0; border-radius: 2px; margin-top: 6px; }
.vault-edit-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #4CAF50, #81C784); }

/* Vault summary card (Edit Rewards) — clickable card that opens modal */
.vault-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.vault-summary-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.vault-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.vault-summary-name {
    font-size: 15px;
    font-weight: 600;
}

.vault-summary-progress {
    font-size: 13px;
    color: var(--text-secondary);
}

.vault-summary-interest {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.vault-summary-interest .interest-badge {
    display: inline-block;
    background: rgba(255,215,0,0.35);
    border-radius: 8px;
    padding: 2px 8px;
    font-weight: 700;
    color: var(--text);
}

/* Vault modal (Edit Rewards) */
.vault-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    border-radius: 28px;
}

.vault-modal-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    max-height: 80%;
    overflow-y: auto;
}

.vault-modal-content .modal-header {
    margin-bottom: 16px;
}

/* Interest toggle row */
.interest-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.interest-toggle-label {
    font-size: 14px;
    font-weight: 500;
}

/* Interest rate stepper */
.interest-rate-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.interest-stepper-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.interest-stepper-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.interest-rate-input-wrap {
    flex: 1;
    position: relative;
}

.interest-rate-input-wrap input {
    width: 100%;
    padding: 10px 28px 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.interest-rate-input-wrap input:focus {
    border-color: var(--primary);
}

.interest-rate-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

.interest-tooltip {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 16px;
}

.vault-target-readonly {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vault-target-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.vault-target-value {
    font-size: 16px;
    font-weight: 700;
}
