/* =============================================
   PERSONAL HUB - style.css
   Design: Dark Glass Premium Mobile UI
   ============================================= */

/* ---- IMPORT FONT ---- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS VARIABLES ---- */
:root {
    --bg-base: #0a0a14;
    --bg-card: #13131f;
    --bg-card2: #1a1a2e;
    --bg-glass: rgba(255,255,255,0.04);
    --bg-glass2: rgba(255,255,255,0.07);
    --border: rgba(255,255,255,0.08);
    --border2: rgba(255,255,255,0.12);

    --purple: #8b5cf6;
    --purple-light: #a78bfa;
    --purple-dark: #6d28d9;
    --purple-glow: rgba(139,92,246,0.3);

    --yellow: #f59e0b;
    --yellow-light: #fbbf24;
    --yellow-dark: #d97706;
    --yellow-glow: rgba(245,158,11,0.3);

    --green: #10b981;
    --green-light: #34d399;
    --green-dark: #059669;
    --green-glow: rgba(16,185,129,0.3);

    --red: #ef4444;
    --red-light: #f87171;
    --orange: #f97316;

    --text-primary: #f0f0ff;
    --text-secondary: #a0a0c0;
    --text-muted: #5a5a80;

    --urgent-high: #ef4444;
    --urgent-medium: #f59e0b;
    --urgent-normal: #10b981;

    --nav-h: 72px;
    --header-h: 60px;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea, select { user-select: auto; -webkit-user-select: auto; }

/* ---- HEADER ---- */
#app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(10,10,20,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.25rem;
    max-width: 480px;
    margin: 0 auto;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.header-logo {
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--purple), var(--yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
    from { filter: hue-rotate(0deg); }
    to   { filter: hue-rotate(360deg); }
}

#page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.status-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--bg-glass2);
    border: 1px solid var(--border2);
    color: var(--green-light);
    font-weight: 500;
}

/* ---- MAIN CONTENT ---- */
#main-content {
    padding-top: var(--header-h);
    padding-bottom: calc(var(--nav-h) + 0.5rem);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
}

.app-tab {
    padding: 1rem 1rem 5rem;
    animation: fadeIn 0.3s ease;
}

.app-tab.hidden { display: none; }

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

/* ---- BOTTOM NAV ---- */
#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(13,13,25,0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 100;
    padding: 0 0.5rem;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    padding: 6px 0;
    position: relative;
}

.nav-icon-wrap {
    width: 42px; height: 32px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-btn.active { color: var(--text-primary); }
.nav-btn[data-tab="tab-tasks"].active .nav-icon-wrap { background: var(--purple-glow); color: var(--purple-light); }
.nav-btn[data-tab="tab-forget"].active .nav-icon-wrap { background: var(--yellow-glow); color: var(--yellow-light); }
.nav-btn[data-tab="tab-finance"].active .nav-icon-wrap { background: var(--green-glow); color: var(--green-light); }

/* ---- FAB ---- */
.fab {
    position: fixed;
    bottom: calc(var(--nav-h) + 1rem);
    right: 1.25rem;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    transition: var(--transition);
    z-index: 90;
}
.fab:active { transform: scale(0.92); }

.fab-purple { background: linear-gradient(135deg, var(--purple-dark), var(--purple)); box-shadow: 0 8px 24px var(--purple-glow); }
.fab-yellow { background: linear-gradient(135deg, var(--yellow-dark), var(--yellow)); box-shadow: 0 8px 24px var(--yellow-glow); }
.fab-green  { background: linear-gradient(135deg, var(--green-dark), var(--green));  box-shadow: 0 8px 24px var(--green-glow); }

/* ---- FILTER BAR (Tags) ---- */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border2);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.filter-chip.active {
    background: var(--purple-glow);
    border-color: var(--purple);
    color: var(--purple-light);
}

/* ---- ITEM LIST ---- */
.item-list { display: flex; flex-direction: column; gap: 0.65rem; }

/* ---- TASK CARD ---- */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}
.task-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}
.task-card.urgent-high::before   { background: var(--red); }
.task-card.urgent-medium::before { background: var(--yellow); }
.task-card.urgent-normal::before { background: var(--green); }
.task-card:active { transform: scale(0.985); background: var(--bg-card2); }
.task-card.done { opacity: 0.5; }
.task-card.done .task-title { text-decoration: line-through; }

.task-card-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.5rem; }

.task-checkbox {
    width: 22px; height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--border2);
    background: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    margin-top: 2px;
}
.task-checkbox.checked { background: var(--green); border-color: var(--green); }
.task-checkbox.checked::after { content: '✓'; color: white; font-size: 0.75rem; font-weight: 700; }

.task-title { font-size: 0.95rem; font-weight: 600; line-height: 1.35; flex: 1; }

.task-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }

.tag-chip {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--purple-glow);
    color: var(--purple-light);
    border: 1px solid rgba(139,92,246,0.2);
    font-weight: 500;
}

.deadline-chip {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 4px;
}

.deadline-chip.overdue { background: rgba(239,68,68,0.15); color: var(--red-light); border-color: rgba(239,68,68,0.3); }
.deadline-chip.soon    { background: rgba(245,158,11,0.15); color: var(--yellow-light); border-color: rgba(245,158,11,0.3); }

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}

.subtask-progress { font-size: 0.75rem; color: var(--text-muted); }
.subtask-progress-bar {
    display: flex; gap: 3px; margin-top: 3px;
}
.subtask-dot {
    width: 20px; height: 4px;
    border-radius: 2px;
    background: var(--border2);
    transition: var(--transition);
}
.subtask-dot.done { background: var(--green); }

.task-actions { display: flex; gap: 0.5rem; }
.action-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-glass2);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
}
.action-btn:active { transform: scale(0.9); }
.action-btn.edit:hover { color: var(--purple-light); background: var(--purple-glow); }
.action-btn.delete:hover { color: var(--red-light); background: rgba(239,68,68,0.15); }

/* ---- FORGET CARDS ---- */
.forget-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.forget-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}
.forget-card:active { transform: scale(0.97); }

.forget-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    display: block;
}

.forget-card-text {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forget-deadline {
    font-size: 0.7rem;
    color: var(--yellow);
    display: flex; align-items: center; gap: 4px;
    margin-top: 0.4rem;
}
.forget-deadline.overdue { color: var(--red-light); }

.forget-card-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

/* ---- FINANCE SUMMARY ---- */
.finance-summary-card {
    background: linear-gradient(145deg, #1a1030, #0d1a20);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}
.finance-summary-card::after {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.finance-period-selector {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.period-btn {
    flex: 1;
    padding: 6px 0;
    border-radius: 100px;
    border: 1px solid var(--border2);
    background: var(--bg-glass);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.period-btn.active {
    background: var(--bg-glass2);
    border-color: var(--purple);
    color: var(--purple-light);
}

.finance-balance { text-align: center; margin-bottom: 1.25rem; }
.balance-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.balance-amount {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.finance-split { display: flex; align-items: center; gap: 1rem; }
.split-item { display: flex; align-items: center; gap: 0.6rem; flex: 1; }
.split-item.income i { color: var(--green); font-size: 1.1rem; }
.split-item.expense i { color: var(--red); font-size: 1.1rem; }
.split-label { font-size: 0.72rem; color: var(--text-muted); }
.split-amount { font-size: 1rem; font-weight: 700; }
.split-item.income .split-amount { color: var(--green-light); }
.split-item.expense .split-amount { color: var(--red-light); }
.split-divider { width: 1px; height: 36px; background: var(--border2); }

/* ---- FINANCE VIEW TABS ---- */
.finance-view-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.view-tab {
    flex: 1;
    padding: 8px 4px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-glass);
    color: var(--text-muted);
    font-size: 0.73rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.view-tab.active {
    background: var(--green-glow);
    border-color: var(--green);
    color: var(--green-light);
}

/* ---- FINANCE CARD ---- */
.finance-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: var(--transition);
}
.finance-card:active { background: var(--bg-card2); }

.finance-cat-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.finance-cat-icon.income { background: rgba(16,185,129,0.15); }
.finance-cat-icon.expense { background: rgba(239,68,68,0.15); }

.finance-card-info { flex: 1; min-width: 0; }
.finance-card-name { font-size: 0.9rem; font-weight: 600; }
.finance-card-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.finance-card-amount {
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.finance-card-amount.income { color: var(--green-light); }
.finance-card-amount.expense { color: var(--red-light); }

.finance-card-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

/* ---- CATEGORY SUMMARY ---- */
.category-summary-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
}
.cat-sum-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.cat-sum-icon { font-size: 1.3rem; }
.cat-sum-name { font-size: 0.9rem; font-weight: 600; flex: 1; }
.cat-sum-amount { font-size: 1rem; font-weight: 700; }
.cat-sum-amount.income { color: var(--green-light); }
.cat-sum-amount.expense { color: var(--red-light); }
.cat-sum-bar-bg { height: 4px; border-radius: 2px; background: var(--border2); }
.cat-sum-bar { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.cat-sum-bar.income { background: var(--green); }
.cat-sum-bar.expense { background: var(--red); }

/* ---- CATEGORIES MANAGE ---- */
.categories-manage-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}
.categories-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.income-text { color: var(--green-light); }
.expense-text { color: var(--red-light); }

.categories-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.category-chip-manage {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 100px;
    background: var(--bg-glass2);
    border: 1px solid var(--border2);
    font-size: 0.8rem;
}
.category-chip-manage button {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 0.7rem; padding: 0;
    transition: var(--transition);
}
.category-chip-manage button:hover { color: var(--red); }

.add-category-btn {
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px dashed var(--border2);
    background: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}
.add-category-btn:hover { border-color: var(--green); color: var(--green-light); }

/* ---- CATEGORY CHIPS (Finance Form) ---- */
.category-chips-container { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cat-chip {
    padding: 7px 14px;
    border-radius: 100px;
    border: 1px solid var(--border2);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.cat-chip.selected.expense-cat { background: rgba(239,68,68,0.15); border-color: var(--red); color: var(--red-light); }
.cat-chip.selected.income-cat { background: rgba(16,185,129,0.15); border-color: var(--green); color: var(--green-light); }

/* ---- MODALS ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    animation: overlayIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-sheet {
    background: var(--bg-card2);
    border: 1px solid var(--border2);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    max-height: 92vh;
    overflow-y: auto;
    animation: sheetUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: none;
}
.modal-sheet::-webkit-scrollbar { display: none; }
.modal-sheet.modal-small { max-height: 60vh; }

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-handle {
    width: 40px; height: 4px;
    border-radius: 2px;
    background: var(--border2);
    margin: 0.75rem auto 0;
}

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

.modal-header h2 { font-size: 1rem; font-weight: 700; }

.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-glass2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.2); color: var(--red-light); }

.modal-body { padding: 1.25rem; }

/* ---- FORM ELEMENTS ---- */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0; }
.form-row .form-group { margin-bottom: 0; }

label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.required { color: var(--red); }

input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
textarea,
select {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border2);
    border-radius: var(--radius-xs);
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--purple);
    background: rgba(139,92,246,0.05);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }

/* ---- NOTI SETTINGS ---- */
.noti-settings { background: var(--bg-glass); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 0.75rem; }
.noti-row { display: flex; align-items: center; gap: 0.4rem; }
.noti-row input { flex: 1; min-width: 0; padding: 8px 8px; text-align: center; }
.noti-row span { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

/* ---- SUBTASKS ---- */
.subtask-field {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: flex-start;
}
.subtask-field input { flex: 1; }
.subtask-field textarea { flex: 1; min-height: 60px; }
.subtask-field-group { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.subtask-remove {
    width: 32px; height: 36px;
    flex-shrink: 0;
    border: none;
    background: rgba(239,68,68,0.15);
    color: var(--red-light);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    margin-top: 0;
}

.add-subtask-btn {
    width: 100%;
    padding: 8px;
    border: 1px dashed var(--border2);
    background: none;
    color: var(--text-muted);
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.3rem;
}
.add-subtask-btn:hover { border-color: var(--purple); color: var(--purple-light); }

/* ---- BUTTONS ---- */
.btn-primary {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    margin-top: 0.5rem;
}
.btn-primary:active { transform: scale(0.97); }

.btn-purple { background: linear-gradient(135deg, var(--purple-dark), var(--purple)); color: white; box-shadow: 0 4px 16px var(--purple-glow); }
.btn-yellow { background: linear-gradient(135deg, var(--yellow-dark), var(--yellow)); color: white; box-shadow: 0 4px 16px var(--yellow-glow); }
.btn-green  { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: white; box-shadow: 0 4px 16px var(--green-glow); }

.btn-secondary {
    padding: 10px 16px;
    border: 1px solid var(--border2);
    background: var(--bg-glass);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-danger {
    padding: 10px 16px;
    border: none;
    background: var(--red);
    color: white;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-danger-sm {
    padding: 6px 12px;
    border: none;
    background: rgba(239,68,68,0.15);
    color: var(--red-light);
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    margin-top: 0.4rem;
}

/* ---- TYPE TOGGLE (Finance) ---- */
.type-toggle { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.type-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border2);
    background: var(--bg-glass);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.type-btn.expense-btn.active { background: rgba(239,68,68,0.2); border-color: var(--red); color: var(--red-light); }
.type-btn.income-btn.active  { background: rgba(16,185,129,0.2); border-color: var(--green); color: var(--green-light); }

/* ---- IMAGE UPLOAD ---- */
.image-upload-area {
    border: 2px dashed var(--border2);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}
.image-upload-area:hover { border-color: var(--yellow); color: var(--yellow); }
.image-upload-area i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.image-upload-area p { font-size: 0.82rem; }

.image-preview {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 200px;
    object-fit: cover;
    margin-top: 0.5rem;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; line-height: 1.7; }
.empty-state span { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }
.empty-state.hidden { display: none; }

/* ---- CONFIRM MODAL ---- */
.confirm-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(245,158,11,0.15);
    color: var(--yellow);
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}

/* ---- TOAST ---- */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 4.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card2);
    border: 1px solid var(--border2);
    border-radius: 100px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 999;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.toast.hidden { display: none; }
.toast i { color: var(--green); }
.toast.error i { color: var(--red); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---- TASK DETAIL VIEW ---- */
.detail-section { margin-bottom: 1.25rem; }
.detail-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.detail-value { font-size: 0.9rem; color: var(--text-primary); }

.subtask-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}
.subtask-detail-item:last-child { border-bottom: none; }

.subtask-cb {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    flex-shrink: 0;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.subtask-cb.checked { background: var(--green); border-color: var(--green); }
.subtask-cb.checked::after { content: '✓'; font-size: 0.65rem; color: white; font-weight: 700; }

.subtask-info { flex: 1; }
.subtask-name { font-size: 0.87rem; }
.subtask-name.done { text-decoration: line-through; color: var(--text-muted); }
.subtask-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ---- DATE GROUP HEADER ---- */
.date-group-header {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.6rem 0 0.3rem;
}

/* ---- SUB ITEMS (Finance) ---- */
.sub-item-field { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.sub-item-field input { flex: 1; }
.sub-item-field input:last-of-type { max-width: 80px; }

/* ---- URGENCY BADGE ---- */
.urgency-badge {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 100px;
    font-weight: 600;
}
.urgency-badge.high { background: rgba(239,68,68,0.2); color: var(--red-light); }
.urgency-badge.medium { background: rgba(245,158,11,0.2); color: var(--yellow-light); }
.urgency-badge.normal { background: rgba(16,185,129,0.15); color: var(--green-light); }

/* ---- SCROLLBAR ---- */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ---- SAFE AREA for iPhone X+ ---- */
@supports (padding: max(0px)) {
    body { padding-bottom: env(safe-area-inset-bottom); }
}
