/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Mitr:wght@300;400;500;600&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #FF7597;          /* ชมพูพาสเทลน่ารัก */
    --primary-light: #FFEBF0;
    --primary-dark: #E05375;
    
    --secondary: #4ECDC4;        /* เขียวมิ้นต์สดใส */
    --secondary-light: #EBFBFA;
    --secondary-dark: #37B2A9;
    
    --accent: #FFD166;           /* เหลืองพาสเทล */
    --accent-light: #FFF8E7;
    
    --bg-app: #FAF9F6;           /* พื้นหลังครีมอ่อน สบายตา */
    --bg-card: #FFFFFF;
    --text-main: #2D3748;
    --text-muted: #718096;
    
    --income: #4CAF50;           /* เขียวรายรับ */
    --income-light: #E8F5E9;
    --expense: #FF5252;          /* แดงรายจ่าย */
    --expense-light: #FFEBEE;
    --savings: #3F51B5;          /* น้ำเงินเงินออม */
    --savings-light: #E8EAF6;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px rgba(255, 117, 151, 0.08);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    
    --font-family: 'Outfit', 'Mitr', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-app: #121214;
    --bg-card: #1E1E24;
    --text-main: #F7FAFC;
    --text-muted: #A0AEC0;
    
    --primary-light: #2D1B22;
    --secondary-light: #162B2A;
    --accent-light: #2D271A;
    --income-light: #1B2E1E;
    --expense-light: #321C1C;
    --savings-light: #1A1C2E;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #FFEBF0 0%, #EBFBFA 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1C0F13 0%, #0F1C1B 100%);
}

/* App Viewport Container */
.app-container {
    width: 100%;
    max-width: 485px; /* ขนาดจำลองสำหรับโมบายล์บนเดสก์ท็อป */
    min-height: 100vh;
    background-color: var(--bg-app);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 90px; /* เว้นที่ว่างสำหรับ Bottom Navigation */
    overflow-x: hidden; /* ป้องกันเนื้อหาล้นหน้าจอขวาบนโมบายล์ */
    transition: var(--transition);
}

@media (min-width: 500px) {
    .app-container {
        margin: 20px 0;
        min-height: calc(100vh - 40px);
        border-radius: var(--radius-lg);
        overflow: hidden;
        border: 4px solid var(--bg-card);
    }
}

/* Header Section */
header {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg-app) 100%);
    padding: 24px 20px 16px;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.app-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
}

.app-logo span {
    font-size: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle, .btn-icon {
    background: var(--bg-card);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    transition: var(--transition);
}

.theme-toggle:hover, .btn-icon:hover {
    transform: scale(1.08);
}

/* Mascot Section */
.mascot-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.mascot-pig {
    font-size: 32px;
    animation: bounce 2s infinite ease-in-out;
    cursor: pointer;
}

.mascot-pig:hover {
    animation: wiggle 0.5s ease-in-out infinite;
}

.mascot-bubble {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
}

.mascot-bubble strong {
    color: var(--primary-dark);
}

/* Calendar Month Picker */
.month-picker-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
}

.month-picker-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--primary-dark);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.month-picker-btn:hover {
    background: var(--primary-light);
}

.current-month-display {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    border: none;
    background: transparent;
    text-align: center;
    font-family: var(--font-family);
    cursor: pointer;
}

/* Balance Card (Dashboard Summary) */
.dashboard-card {
    background: linear-gradient(135deg, var(--primary) 0%, #FF92AE 100%);
    color: white;
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    margin: 16px 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.dashboard-card .card-title {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 4px;
}

.dashboard-card .card-balance {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.dashboard-card .card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 16px;
}

.dashboard-card .card-grid-three {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 16px;
}

.card-grid-item {
    display: flex;
    flex-direction: column;
}

.card-grid-item .label {
    font-size: 10px;
    opacity: 0.85;
    margin-bottom: 2px;
}

.card-grid-item .value {
    font-size: 16px;
    font-weight: 600;
}

/* Warning banner for missing salary */
.warning-banner {
    background-color: var(--accent-light);
    border: 1.5px solid var(--accent);
    color: #856404;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin: 0 20px 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .warning-banner {
    background-color: #2D271A;
    border-color: #B28900;
    color: #FEEBC8;
}

.warning-banner .banner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
}

.warning-banner .btn-banner-action {
    background: #FFD166;
    color: #4A3B00;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-family);
    transition: var(--transition);
    align-self: flex-start;
}

.warning-banner .btn-banner-action:hover {
    background: #FFC033;
    transform: translateY(-1px);
}

/* Daily Budget Helper Box */
.daily-helper-card {
    background: var(--bg-card);
    margin: 0 20px 20px;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 2px dashed var(--accent);
}

.daily-helper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.daily-helper-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.daily-helper-badge {
    background: var(--accent-light);
    color: #B28900;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.daily-helper-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.daily-helper-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.daily-helper-progress-bar {
    height: 8px;
    background: #EDF2F7;
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.daily-helper-progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Navigation Tabs & Scroll View */
.tab-content {
    padding: 0 20px;
    flex-grow: 1;
}

/* Card Elements */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

/* Chart Container */
.chart-box {
    position: relative;
    width: 100%;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lists and Items */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-day-group {
    margin-bottom: 16px;
}

.day-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 4px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.transaction-item:hover {
    background: var(--primary-light);
}

.item-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--bg-app);
}

.item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.item-note {
    font-size: 11px;
    color: var(--text-muted);
}

.item-badges {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.badge-fixed {
    background: var(--savings-light);
    color: var(--savings);
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}

.item-value {
    font-size: 16px;
    font-weight: 600;
    text-align: right;
}

.item-value.income {
    color: var(--income);
}

.item-value.expense {
    color: var(--expense);
}

.btn-delete-trans {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: none; /* แสดงเมื่อ Hover หรือกดเลือก */
    transition: var(--transition);
}

.transaction-item:hover .btn-delete-trans {
    display: block;
}

.btn-delete-trans:hover {
    color: var(--expense);
}

/* Savings Goal Progress UI */
.goal-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goal-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
}

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

.goal-icon {
    font-size: 26px;
    width: 46px;
    height: 46px;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-details {
    flex-grow: 1;
}

.goal-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.goal-date {
    font-size: 11px;
    color: var(--text-muted);
}

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

.goal-current {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-dark);
}

.goal-target {
    font-size: 11px;
    color: var(--text-muted);
}

.goal-progress {
    height: 10px;
    background: var(--bg-app);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 5px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: var(--transition);
}

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

.btn-small.primary:hover {
    background: var(--primary-dark);
}

.btn-small.danger-text {
    background: transparent;
    color: var(--expense);
}

.btn-small.danger-text:hover {
    background: var(--expense-light);
}

/* Floating Add Action Button */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 485px;
    height: 74px;
    background: var(--bg-card);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    padding: 0 10px;
}

@media (min-width: 500px) {
    .bottom-nav {
        border-bottom-left-radius: var(--radius-lg);
        border-bottom-right-radius: var(--radius-lg);
        /* ให้อยู่พอดีกับกล่องจำลองมือถือ */
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    width: 60px;
    height: 100%;
    transition: var(--transition);
}

.nav-item span.icon {
    font-size: 20px;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary-dark);
}

.nav-item.active span.icon {
    transform: scale(1.15);
}

.nav-item-fab {
    position: relative;
    top: -18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 20px rgba(255, 117, 151, 0.4);
    border: 4px solid var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    z-index: 105;
}

.nav-item-fab:hover {
    transform: translateY(-4px) rotate(90deg);
    box-shadow: 0 12px 24px rgba(255, 117, 151, 0.5);
}

/* Modals (Mobile bottom sheet style) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-sheet {
    width: 100%;
    max-width: 485px;
    background: var(--bg-card);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

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

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

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

/* Forms UI */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    background: var(--bg-app);
    border: 2px solid transparent;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}

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

/* Category Grid Picker in Modals */
.category-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ปรับเป็น 3 คอลัมน์เพื่อให้พาสเทลและตัวหนังสือแสดงได้ครบถ้วน */
    gap: 10px;
    margin-bottom: 16px;
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}

.category-option .cat-icon {
    font-size: 22px;
}

.category-option:hover {
    background: var(--primary-light);
}

.category-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Quick Amount Picker */
.quick-amount-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding: 4px 0;
}

.quick-amount-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--primary-light);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--primary-dark);
    font-family: var(--font-family);
    flex-shrink: 0;
    transition: var(--transition);
}

.quick-amount-btn:hover {
    background: var(--primary);
    color: white;
}

/* Button UI */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 117, 151, 0.2);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 117, 151, 0.3);
}

.btn.secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.2);
}

.btn.secondary:hover {
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.3);
}

/* Type Selector Buttons (Income/Expense Toggle) */
.type-toggle-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-app);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.type-toggle-btn {
    border: none;
    background: transparent;
    padding: 10px;
    border-radius: 10px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.type-toggle-btn.active.expense {
    background: var(--expense);
    color: white;
}

.type-toggle-btn.active.income {
    background: var(--income);
    color: white;
}

/* Settings List items */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.setting-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.setting-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.fixed-expense-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    width: 100%;
}

.fixed-expense-row input {
    min-width: 0; /* ป้องกันอินพุตดึงขนาดบราวเซอร์ไม่ยอมย่อตัว ซึ่งดันปุ่มลบเลยขอบจอ */
    width: 100%;
}

.btn-remove-fixed {
    background: none;
    border: none;
    color: var(--expense);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary-dark);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: var(--transition);
}

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

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
    100% { transform: rotate(0deg); }
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.badge-pill {
    background: var(--bg-app);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}

.badge-pill:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-pill.active {
    background: var(--primary);
    color: white;
}

/* Backup and Import buttons container */
.backup-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.backup-actions .btn {
    flex: 1;
}

/* Custom Checkbox Toggle for fixed expenses in modal */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 500;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: var(--bg-app);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    border: 2px solid #CBD5E0;
    transition: var(--transition);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.empty-icon {
    font-size: 48px;
    animation: bounce 3s infinite ease-in-out;
}

.empty-text {
    font-size: 14px;
    font-weight: 500;
}

/* Smart Insights Cards styling */
.insight-card {
    background: var(--accent-light);
    border-left: 5px solid var(--accent);
    color: #8C6D00;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.insight-card.danger {
    background: var(--expense-light);
    border-left-color: var(--expense);
    color: #C53030;
}

.insight-card.success {
    background: var(--secondary-light);
    border-left-color: var(--secondary);
    color: #22543D;
}

/* Auth Screens Styling */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 30px 20px;
    text-align: center;
    flex-grow: 1;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: 30px;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border: 3px solid transparent;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.profile-avatar {
    font-size: 44px;
    width: 76px;
    height: 76px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.profile-card:hover .profile-avatar {
    transform: scale(1.1) rotate(5deg);
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

/* PIN entry view */
.pin-user-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.pin-dots-container {
    display: flex;
    gap: 14px;
    margin: 20px 0 30px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #CBD5E0;
    background: transparent;
    transition: var(--transition);
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.2);
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 280px;
    margin-bottom: 24px;
}

.keypad-btn {
    background: var(--bg-card);
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    font-family: var(--font-family);
    margin: 0 auto;
}

.keypad-btn:active {
    background: var(--primary-light);
    transform: scale(0.9);
}

.keypad-btn.action {
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
}

.keypad-btn.action:active {
    background: rgba(0, 0, 0, 0.05);
}

.auth-back-link {
    margin-top: 14px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.auth-back-link:hover {
    color: var(--primary-dark);
}

/* Loader Styling */
.loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    justify-content: center;
    min-height: 50vh;
    color: var(--text-muted);
    font-weight: 500;
}

.loader-piggy {
    font-size: 56px;
    animation: bounce 1.5s infinite ease-in-out;
}

