:root {
    /* Color Palette - Light Theme */
    --bg-main: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    
    --primary: #10B981; /* Emerald Green */
    --primary-hover: #059669;
    --primary-light: #D1FAE5;
    
    --text-dark: #111827;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    
    --border-light: #E5E7EB;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    
    /* Layout */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease-in-out;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.5;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-main);
    color: var(--text-dark);
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.price-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.price-widget label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.price-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.75rem;
    box-shadow: var(--shadow-sm);
}

.price-input-wrapper span {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.25rem;
}

.price-input-wrapper input {
    border: none;
    outline: none;
    width: 70px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
}

.profile-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    width: 40px;
    height: 40px;
    box-shadow: var(--shadow-sm);
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.column-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.column-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Cards Base */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header.border-bottom {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.25rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
}

.card-body.p-0 {
    padding: 0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.metric-card {
    transition: var(--transition);
}

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

.metric-card.primary-card {
    background: var(--primary);
    color: white;
}

.metric-card.primary-card h3,
.metric-card.primary-card .card-header h3 {
    color: rgba(255, 255, 255, 0.9);
}

.icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

.primary-card .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.metric-card h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}

.metric-card .unit {
    font-size: 1rem;
    opacity: 0.9;
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.trend.positive i {
    color: var(--primary);
}

/* History Card */
.btn-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-text:hover {
    text-decoration: underline;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

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

.history-item:hover {
    background: var(--bg-main);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-details {
    display: flex;
    flex-direction: column;
}

.history-amount {
    font-weight: 600;
    color: var(--text-dark);
}

.history-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-status {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.btn-delete {
    background: transparent;
    border: none;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.empty-state {
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 2.5rem;
    color: var(--border-light);
    margin-bottom: 1rem;
}

/* Progress Card */
.badge {
    background: var(--bg-main);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.progress-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.progress-percent {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.progress-remaining {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.progress-track-wrapper {
    margin-top: 1.5rem;
}

.progress-track {
    height: 14px;
    background: var(--bg-main);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 20px;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add Entry Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-wrapper i {
    color: var(--text-light);
    margin-right: 0.75rem;
}

.input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.input-suffix {
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Calendar icon fix */
::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
}

.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(16, 185, 129, 0.3);
}

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

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 1rem 1.5rem;
    }
    
    .nav-menu {
        flex-direction: row;
        justify-content: center;
        margin-top: -2rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Fwog Interactive Pet */
#fwog {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 120px;
    z-index: 9999;
    cursor: grab;
    user-select: none;
    transform-origin: center center;
    will-change: transform;
}

#fwog.dragging {
    cursor: grabbing;
}

.fwog-body {
    position: absolute;
    width: 70px;
    height: 70px;
    background-color: #2ECC71; /* Fwog Green */
    border-radius: 40% 40% 45% 45%;
    top: 10px;
    left: 5px;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.1);
}

.fwog-eye {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: #000;
    border-radius: 50%;
    top: 10px;
}

.fwog-eye.left {
    left: 8px;
}

.fwog-eye.right {
    right: 8px;
}

.fwog-eye .highlight {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #FFF;
    border-radius: 50%;
    top: 3px;
    right: 4px;
}

.fwog-eye .pupil {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: #FFF;
    border-radius: 50%;
    bottom: 5px;
    left: 6px;
}

.fwog-mouth {
    position: absolute;
    width: 20px;
    height: 6px;
    background-color: #FF6B81; /* Pinkish mouth */
    border-radius: 10px;
    top: 40px;
    left: 25px;
    border: 1px solid #c0392b;
}

.fwog-leg {
    position: absolute;
    width: 10px;
    height: 50px;
    background-color: #2ECC71;
    border-radius: 5px;
    top: 60px;
    z-index: -1;
}

.fwog-leg.left {
    left: 15px;
}

.fwog-leg.right {
    right: 15px;
}

.fwog-arm {
    position: absolute;
    width: 10px;
    height: 35px;
    background-color: #2ECC71;
    border-radius: 5px;
    top: 35px;
    z-index: -1;
    transform-origin: top center;
}

.fwog-arm.left {
    left: -5px;
    transform: rotate(30deg);
}

.fwog-arm.right {
    right: -5px;
    transform: rotate(-30deg);
}

/* Fwog Chat Bubble */
#fwog-bubble {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: #FFF;
    border: 3px solid #000;
    border-radius: 15px;
    padding: 10px 15px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    box-shadow: 4px 4px 0px rgba(0,0,0,1);
    z-index: 10000;
}

#fwog-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #FFF transparent transparent transparent;
    z-index: 2;
}

#fwog-bubble::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 12px 12px 0;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
    z-index: 1;
}

#fwog-bubble.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
