:root {
    /* Colors */
    --primary-purple: #764ba2;
    --primary-blue: #667eea;
    --primary-gradient: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
    --bg-white-translucent: rgba(255, 255, 255, 0.95);

    --text-dark: #2d3748;
    --text-medium: #4a5568;
    --text-light: #718096;

    --border-color: #e2e8f0;
    --border-hover-color: #cbd5e0;

    --bg-light: #f7fafc;
    --bg-hover: #edf2f7;
    --bg-disabled: #cbd5e0;

    --color-green: #38a169;
    --color-green-light: #48bb78;
    --color-red: #e53e3e;
    --color-red-light: #f56565;
    --color-yellow: #d69e2e;
    --color-yellow-light: #ecc94b;

    /* Sizing & Spacing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --padding-card: 25px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-focus: 0 0 0 3px rgba(118, 75, 162, 0.1);

    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-base: all 0.3s ease;
}

/* =======================================================================
   FORM LABELS AND INPUTS
   ======================================================================= */
.form-label {
    font-size: 0.85rem;
    color: var(--text-medium);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    transition: var(--transition-fast);
}

.form-label:hover {
    color: var(--primary-purple);
}

.add-habit-form input {
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.add-habit-form input:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: white;
    box-shadow: var(--shadow-focus);
}

.add-habit-form input::placeholder {
    color: var(--text-light);
    font-weight: 500;
}

.habit-form-input-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    width: 100%;
    margin-bottom: 12px;
}

.habit-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.habit-form-row input {
    width: 80px;
    text-align: center;
    font-size: 0.9rem;
}

.habit-form-row span {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

/* =======================================================================
   WEALTH SPEND INPUT
   ======================================================================= */
.wealth-spend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.wealth-spend-input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    font-family: inherit;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    width: 100px;
}

.wealth-spend-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    background: white;
    box-shadow: var(--shadow-focus);
}

.wealth-spend-input::placeholder {
    color: var(--text-light);
    font-weight: 500;
}

/* =======================================================================
   BASE & LAYOUT
   ======================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--primary-gradient);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--bg-white-translucent);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 15px var(--padding-card);
    margin-bottom: 15px;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-medium);
    text-align: center;
}

/* =======================================================================
   NAVIGATION
   ======================================================================= */
.dashboard-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--radius-sm);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    flex: 1;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-medium);
    box-shadow: var(--shadow-md);
}

.nav-icon { font-size: 20px; }
.nav-btn span:last-child { font-size: 14px; }

/* =======================================================================
   CONTENT & CARDS
   ======================================================================= */
.content-section { display: none; }
.content-section.active { display: block; }

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

.section-header h2 {
    font-size: 1.6rem;
    color: white;
    font-weight: 600;
}

.card {
    background: var(--bg-white-translucent);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--padding-card);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

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

.card h3 {
    color: var(--text-medium);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =======================================================================
   FORMS & BUTTONS
   ======================================================================= */
.form-add-task-minimal textarea {
    padding: 12px 16px;
    border: 2px solid transparent;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition-base);
    font-family: inherit;
}

.form-add-task-minimal textarea:focus {
    outline: none;
    background-color: white;
    border-color: var(--primary-purple);
    box-shadow: var(--shadow-focus);
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: var(--bg-disabled);
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover-color);
    transform: translateY(-1px);
}

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

.btn-danger { background: var(--color-red); color: white; border: none; }
.btn-success { background: var(--color-green); color: white; border: none; }
.btn-warning { background: var(--color-yellow); color: white; border: none; }

.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    margin: 0 2px;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ui-btn:hover { background-color: #e0e0e0; }
.ui-btn--danger { background-color: #ffe5e5; }
.ui-btn--danger:hover { background-color: #ffcccc; }
.ui-btn--info { background-color: #e8f4ff; }
.ui-btn--info:hover { background-color: #cfeaff; }
.ui-btn--success { background-color: #e6ffe6; }
.ui-btn--success:hover { background-color: #ccffcc; }
.ui-btn--warning { background-color: #fff0e6; }
.ui-btn--warning:hover { background-color: #ffe0cc; }

/* =======================================================================
   DATA LISTS & ITEMS
   ======================================================================= */
.data-list {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-item {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg-light);
    transition: var(--transition-base);
    flex-shrink: 0;
}

.data-item:hover {
    border-color: var(--border-hover-color);
    background: var(--bg-hover);
}

.data-item h4 {
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.data-item p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 5px;
}

.data-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.loading-placeholder {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 40px 20px;
}

/* =======================================================================
   HABITS
   ======================================================================= */
.habit-item { display: flex; align-items: center; gap: 20px; }
.habit-image { width: 60px; height: 60px; border-radius: var(--radius-lg); object-fit: cover; background-color: var(--border-color); flex-shrink: 0; }
.habit-details { flex: 1; min-width: 0; }
.progress-bar-container { width: 100%; height: 12px; background-color: var(--border-color); border-radius: var(--radius-sm); overflow: hidden; margin: 8px 0 4px; }
.progress-bar-fill { height: 100%; background: var(--primary-gradient); border-radius: var(--radius-sm); transition: width 0.4s ease, background-color 0.4s ease; }
.progress-text { font-size: 12px; color: var(--text-medium); font-weight: 600; }
.time-ago { font-size: 13px; color: var(--text-light); margin-top: 6px; }
.progress-controls { display: flex; gap: 8px; margin-top: 12px; }
.habit-item.invisible { filter: grayscale(50%); position: relative; }
.habit-item.invisible::before { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,0.5); pointer-events: none; z-index: 0; }
.habit-item.invisible > * { position: relative; z-index: 1; }
.habit-item.invisible .btn { filter: none !important; opacity: 1 !important; position: relative; z-index: 2; color: #222; background-color: #f9f9f9; box-shadow: 0 0 6px rgba(0,0,0,0.2); transition: background-color 0.3s, box-shadow 0.3s; }
.habit-item.invisible .btn:hover { background-color: #e0e0e0; box-shadow: 0 0 10px rgba(0,0,0,0.3); }

/* Habit Status Colors */
.habit-red { border-left-color: var(--color-red-light) !important; background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%) !important; }
.habit-red:hover { background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%) !important; }
.habit-red .progress-bar-fill { background: linear-gradient(135deg, var(--color-red-light) 0%, var(--color-red) 100%); }
.habit-yellow { border-left-color: var(--color-yellow-light) !important; background: linear-gradient(135deg, #fffff0 0%, #fefcbf 100%) !important; }
.habit-yellow:hover { background: linear-gradient(135deg, #fefcbf 0%, #faf089 100%) !important; }
.habit-yellow .progress-bar-fill { background: linear-gradient(135deg, var(--color-yellow-light) 0%, var(--color-yellow) 100%); }
.habit-green { border-left-color: var(--color-green-light) !important; background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%) !important; }
.habit-green:hover { background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%) !important; }
.habit-green .progress-bar-fill { background: linear-gradient(135deg, var(--color-green-light) 0%, var(--color-green) 100%); }

.add-habit-form {
    background: #f8f9ff;
    border: 2px dashed var(--border-hover-color);
}

.add-habit-form:hover {
    border-color: var(--primary-blue);
}

/* Styles for the image upload area to match the habit image */
.habit-image-upload {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-light);
    border: 2px dashed var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.2;
}

.habit-image-upload:hover {
    border-color: var(--primary-purple);
    color: var(--text-medium);
    background-color: var(--bg-hover);
}

.habit-image-upload span {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Hides the actual file input element */
.hidden {
    display: none;
}

/* General styles for inputs within the form card */
.add-habit-form input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.add-habit-form input:focus {
    outline: none;
    border-bottom-color: var(--primary-purple);
}

/* Style for the main title input */
.habit-form-input-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    width: 100%;
    margin-bottom: 12px; /* Spacing */
}

.habit-form-input-title::placeholder {
    color: var(--text-light);
    font-weight: 500;
}

/* Flex container for the amount/period inputs */
.habit-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.habit-form-row input {
    width: 70px; /* Fixed width for number inputs */
    text-align: center;
    font-size: 0.9rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 6px;
}

.habit-form-row span {
    color: var(--text-light);
    font-weight: 600;
}

/* Style for the full-width add button */
.btn-add-full {
    width: 100%;
}

/* Habit header with title and award */
.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.habit-header h4 {
    margin: 0;
    flex: 1;
    min-width: 0; /* Allow text to wrap/truncate */
}

/* Award display styles */
.habit-award {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid #f0ad4e;
    font-size: 12px;
    font-weight: 600;
    color: #856404;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.award-icon {
    font-size: 14px;
    line-height: 1;
}

.award-value {
    line-height: 1;
    min-width: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .habit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .habit-award {
        align-self: flex-end;
    }
}

/* Special styling for completed habits */
.habit-green .habit-award {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
}

/* Special styling for habits in progress */
.habit-yellow .habit-award {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
    color: #856404;
}

/* Special styling for habits not started */
.habit-red .habit-award {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    color: #721c24;
}

/* =======================================================================
   SKILLS
   ======================================================================= */
.linked-habits-container { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.linked-habit { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: var(--radius-sm); background: #eee; }
.add-habit-chip { position: relative; background: #e0e0e0; }
.plus-btn { border: none; background: transparent; font-size: 1.2em; cursor: pointer; }
.add-habit-dropdown { position: absolute; top: 100%; left: 0; background: white; border: 1px solid #ccc; padding: 4px; border-radius: var(--radius-sm); display: flex; gap: 4px; margin-top: 4px; }
.habit-icon { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; }
.hidden { display: none; }

/* =======================================================================
   TASKS
   ======================================================================= */
.add-task-wrapper { padding-top: 15px; margin-top: 10px; border-top: 2px solid #f0f2f5; }
.form-add-task-minimal { display: flex; gap: 10px; align-items: flex-start; }
.form-add-task-minimal textarea { flex-grow: 1; resize: none; }
.form-add-task-minimal .btn-primary { flex-shrink: 0; border-radius: var(--radius-md); padding: 12px 20px; font-weight: 600; align-self: flex-start; }
.task-item { display: flex; align-items: center; gap: 15px; padding: 12px 15px; background: white; border: 1px solid var(--border-color); border-left: 5px solid var(--primary-blue); box-shadow: var(--shadow-sm); }
.task-item:hover { border-color: var(--primary-blue); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); transform: translateY(-2px); }
.task-item .task-description { flex-grow: 1; color: var(--text-dark); font-size: 1rem; margin: 0; }
.task-item .task-meta { flex-shrink: 0; color: var(--text-light); }
.task-item .data-actions { margin-top: 0; }
.complete-task-btn { background: var(--border-color); color: var(--text-light); border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 16px; font-weight: bold; line-height: 1; transition: var(--transition-base); }
.complete-task-btn:hover { background: var(--color-green); color: white; transform: scale(1.1); }

/* =======================================================================
   OVERVIEW
   ======================================================================= */
.overview-content { display: flex; flex-direction: column; gap: var(--padding-card); }
.summary-stats { display: flex; justify-content: space-around; gap: 20px; background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%); padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); }
.stat-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--text-medium); line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--text-light); font-weight: 500; margin-top: 5px; }
.habits-grid, .skills-grid { display: grid; gap: 12px; padding: 15px 0; justify-content: center; margin: 0 auto; }
.habits-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); max-width: 600px; }
.skills-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-width: 800px; }
.habit-square { aspect-ratio: 1; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition-fast); box-shadow: var(--shadow-sm); }
.habit-square:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.habit-square.completed { background: var(--color-green-light); }
.habit-square.incomplete { background: var(--color-red-light); }
.skill-indicator { aspect-ratio: 1; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition-fast); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; background: #f0f0f0; height: 60px; padding: 5px; min-width: 200px; }
.skill-indicator .arrows { font-size: 20px; font-weight: bold; width: 30px; text-align: center; display: inline-block; }
.skill-indicator .arrows.red { color: var(--color-red-light); }
.skill-indicator .arrows.yellow { color: var(--color-yellow-light); }
.skill-indicator .arrows.green { color: var(--color-green-light); }
.skill-indicator .skill-name { font-size: 14px; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1; padding-left: 10px; }
.skill-indicator:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.habit-highlighted { animation: highlight 1.5s ease; }

@keyframes highlight {
    0% { background: rgba(255, 255, 0, 0.3); }
    100% { background: transparent; }
}

/* =======================================================================
   OVERLAYS & MODALS
   ======================================================================= */
.loading-overlay { position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(5px); }
.loading-overlay.hidden { display: none; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.3); border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.loading-overlay p { color: white; font-size: 18px; font-weight: 500; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 1001; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 15px 20px; border-radius: var(--radius-md); color: white; font-weight: 500; box-shadow: var(--shadow-md); animation: slideIn 0.3s ease; min-width: 300px; }
.toast.success { background: linear-gradient(135deg, var(--color-green), var(--color-green-light)); }
.toast.error { background: linear-gradient(135deg, var(--color-red), var(--color-red-light)); }
.toast.info { background: linear-gradient(135deg, #3182ce, #4299e1); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.modal { position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 1002; backdrop-filter: blur(5px); }
.modal.hidden { display: none; }
.modal-content { background: white; border-radius: var(--radius-xl); max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px var(--padding-card); border-bottom: 1px solid var(--border-color); }
.modal-header h3 { color: var(--text-dark); font-size: 1.3rem; margin: 0; }
.close-btn { background: none; border: none; font-size: 24px; color: var(--text-light); cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background-color 0.2s; }
.close-btn:hover { background: var(--bg-light); }
.modal-body { padding: var(--padding-card); }

/* =======================================================================
   RESPONSIVE DESIGN
   ======================================================================= */
@media (max-width: 768px) {
    .container { padding: 15px; }
    header { padding: 12px 20px; margin-bottom: 12px; }
    header h1 { font-size: 1.5rem; }
    .dashboard-nav { padding: 8px; margin-bottom: 15px; }
    .nav-btn { flex-direction: row; justify-content: center; padding: 10px 12px; gap: 8px; }
    .nav-icon { font-size: 18px; }
    .nav-btn span:last-child { font-size: 13px; }
    .section-header h2 { font-size: 1.4rem; }
    .habits-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .summary-stats { flex-direction: column; gap: 15px; }
    .stat-number { font-size: 2rem; }
    .wealth-spend { flex-direction: column; align-items: stretch; }
    .wealth-spend-input { width: 100%; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.3rem; }
    .card { padding: 20px; }
    .nav-icon { font-size: 16px; }
    .nav-btn span:last-child { font-size: 12px; }
    .habits-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .stat-number { font-size: 1.8rem; }
    .wealth-spend-input { font-size: 0.85rem; }
}

/* Updated Image Preview Styles for Add Habit Form */

/* Main container for the image area */
.habit-image-container {
    width: 60px;
    height: 80px; /* Slightly taller to accommodate button */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Image preview area */
.habit-image-preview-area {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-light);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: var(--transition-base);
}

.habit-image-preview-area:empty::before {
    content: "🖼️";
    font-size: 24px;
    color: var(--text-light);
}

.habit-image-preview-area.has-image {
    border-color: var(--primary-purple);
    border-style: solid;
    background-color: transparent;
}

.habit-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* Image selection button */
.habit-image-button {
    padding: 4px 8px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-align: center;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.habit-image-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Ensure the hidden input remains hidden */
.hidden {
    display: none !important;
}

/* Optional: Add a subtle animation for when image is loaded */
.habit-image-preview-area.has-image {
    animation: imageLoaded 0.3s ease;
}

@keyframes imageLoaded {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}