/* 
 * AURA DASHBOARD STYLE SYSTEM
 * Modern, responsive, glassmorphic layout with fluid micro-animations,
 * premium color palettes, and device responsiveness.
 */

/* ==========================================
   1. DESIGN SYSTEM VARIABLES (THEME DEFAULTS)
   ========================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Layout */
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 10px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease;
    --max-width: 1440px;
    
    /* Z-Indices */
    --z-background: -10;
    --z-blobs: -5;
    --z-default: 1;
    --z-overlay: 100;
    --z-drawer: 200;
    --z-modal: 300;
}

/* THEME: Cyber-Glass (Default Deep Neon & Glassmorphism) */
body.theme-cyber-glass {
    --bg-app: #08090d;
    --bg-card: rgba(18, 20, 29, 0.45);
    --bg-subcard: rgba(25, 28, 41, 0.5);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-hover: rgba(255, 255, 255, 0.16);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accent Colors */
    --accent-primary: #a855f7; /* Electric Purple */
    --accent-primary-rgb: 168, 85, 247;
    --accent-secondary: #06b6d4; /* Neon Cyan */
    --accent-secondary-rgb: 6, 182, 212;
    --accent-success: #10b981; /* Emerald Green */
    --accent-success-rgb: 16, 185, 129;
    --accent-error: #ef4444; /* Coral Red */
    
    /* Glow & Shadows */
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glow-primary: 0 0 20px rgba(168, 85, 247, 0.3);
    --glow-secondary: 0 0 20px rgba(6, 182, 212, 0.3);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
    
    /* Background Gradient Blobs */
    --blob-1-color: rgba(124, 58, 237, 0.22);
    --blob-2-color: rgba(6, 182, 212, 0.22);
    --blob-3-color: rgba(219, 39, 119, 0.18);
}

/* THEME: Dark Slate (High Contrast Minimalist Dark) */
body.theme-dark-minimal {
    --bg-app: #0c0e12;
    --bg-card: #151821;
    --bg-subcard: #1d212d;
    --border-card: #272c3b;
    --border-card-hover: #3b435a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --accent-primary: #6366f1; /* Indigo */
    --accent-primary-rgb: 99, 102, 241;
    --accent-secondary: #f43f5e; /* Rose */
    --accent-secondary-rgb: 244, 63, 94;
    --accent-success: #10b981; /* Emerald */
    --accent-success-rgb: 16, 185, 129;
    --accent-error: #f43f5e;
    
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
    --glow-primary: 0 0 10px rgba(99, 102, 241, 0.15);
    --glow-secondary: 0 0 10px rgba(244, 63, 94, 0.15);
    --glow-success: 0 0 10px rgba(16, 185, 129, 0.15);
    
    /* No glowing blobs in slate minimal for cleaner look */
    --blob-1-color: transparent;
    --blob-2-color: transparent;
    --blob-3-color: transparent;
}

/* THEME: Light Glass (Soft Cloud Light) */
body.theme-light-aurora {
    --bg-app: #f1f3f9;
    --bg-card: rgba(255, 255, 255, 0.65);
    --bg-subcard: rgba(255, 255, 255, 0.8);
    --border-card: rgba(255, 255, 255, 0.5);
    --border-card-hover: rgba(99, 102, 241, 0.2);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-primary: #6366f1; /* Soft Indigo */
    --accent-primary-rgb: 99, 102, 241;
    --accent-secondary: #14b8a6; /* Teal */
    --accent-secondary-rgb: 20, 184, 166;
    --accent-success: #10b981; /* Green */
    --accent-success-rgb: 16, 185, 129;
    --accent-error: #ef4444;
    
    --shadow-card: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --glow-primary: 0 0 15px rgba(99, 102, 241, 0.1);
    --glow-secondary: 0 0 15px rgba(20, 184, 166, 0.1);
    --glow-success: 0 0 15px rgba(16, 185, 129, 0.1);
    
    --blob-1-color: rgba(99, 102, 241, 0.12);
    --blob-2-color: rgba(20, 184, 166, 0.12);
    --blob-3-color: rgba(236, 72, 153, 0.08);
}

/* THEME: Sunset Neon (Dracula/Vaporwave) */
body.theme-dracula-sunset {
    --bg-app: #0e0a17;
    --bg-card: rgba(24, 18, 38, 0.55);
    --bg-subcard: rgba(35, 27, 54, 0.6);
    --border-card: rgba(255, 121, 198, 0.1);
    --border-card-hover: rgba(255, 121, 198, 0.25);
    --text-primary: #f8f8f2;
    --text-secondary: #bd93f9;
    --text-muted: #6272a4;
    
    --accent-primary: #ff79c6; /* Dracula Pink */
    --accent-primary-rgb: 255, 121, 198;
    --accent-secondary: #ffb86c; /* Dracula Orange */
    --accent-secondary-rgb: 255, 184, 108;
    --accent-success: #50fa7b; /* Dracula Green */
    --accent-success-rgb: 80, 250, 123;
    --accent-error: #ff5555;
    
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --glow-primary: 0 0 20px rgba(255, 121, 198, 0.25);
    --glow-secondary: 0 0 20px rgba(255, 184, 108, 0.25);
    --glow-success: 0 0 20px rgba(80, 250, 123, 0.25);
    
    --blob-1-color: rgba(255, 121, 198, 0.15);
    --blob-2-color: rgba(189, 147, 249, 0.15);
    --blob-3-color: rgba(255, 184, 108, 0.12);
}

/* ==========================================
   2. GLOBAL BODY & LAYOUT BASE STYLES
   ========================================== */
html {
    font-size: 14.4px; /* Default tighter 90% zoom */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background-color 0.5s ease, color 0.3s ease;
}

/* Custom Scrollbar for modern look */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   3. ANIMATED GLOWING BACKGROUND BLOBS
   ========================================== */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: var(--z-blobs);
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.8;
    mix-blend-mode: screen;
    will-change: transform;
}

/* Blob Sizes & Animations (GPU-accelerated transforms) */
.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--blob-1-color);
    top: -10%;
    left: -10%;
    animation: floatBlob1 25s infinite alternate ease-in-out;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--blob-2-color);
    bottom: -10%;
    right: -10%;
    animation: floatBlob2 20s infinite alternate ease-in-out;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: var(--blob-3-color);
    top: 40%;
    left: 50%;
    animation: floatBlob3 30s infinite alternate ease-in-out;
}

@keyframes floatBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(150px, 80px) scale(1.15); }
}

@keyframes floatBlob2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-100px, -120px) scale(1.2); }
}

@keyframes floatBlob3 {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    100% { transform: translate(-30%, -20%) rotate(180deg) scale(1.1); }
}

/* Custom Background Image Overlay */
body.has-custom-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--custom-bg-image);
    background-size: cover;
    background-position: center;
    z-index: var(--z-background);
    opacity: 0.35; /* Blended background */
}

/* ==========================================
   4. GLASSMORPHIC CARD FOUNDATION
   ========================================== */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-card-hover);
}

.glass-subcard {
    background: var(--bg-subcard);
    border: 1px solid var(--border-card);
    border-radius: var(--border-radius-md);
    padding: 16px;
    transition: var(--transition-smooth);
}

.glass-subcard:hover {
    border-color: var(--border-card-hover);
}

/* Helper hidden state */
.hidden {
    display: none !important;
}

/* Helper visual transitions */
.animate-float {
    animation: floatY 4s ease-in-out infinite;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ==========================================
   5. CONTAINER & RESPONSIVE GRID LAYOUT
   ========================================== */
.app-container {
    width: 100%;
    max-width: var(--max-width);
    padding: 14px 24px 8px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100vh;
    overflow: hidden;
}

/* GRID SETUP */
.app-main-grid {
    display: grid;
    grid-template-columns: 240px 1fr 310px 240px;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.column-left, .column-right, .column-bookmarks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.column-center {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* ==========================================
   6. HEADER MODULE: CLOCK, DATE, WEATHER
   ========================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 24px;
}

/* Left side greeting info */
.greeting-text {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2px;
}

.date-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Center clock display */
.clock-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.digital-clock {
    font-family: var(--font-heading);
    font-size: 3.6rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.15);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.digital-clock:hover {
    transform: scale(1.03);
}

.clock-ampm {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
}

/* Right side weather card */
.weather-card-widget {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
}

.weather-icon-svg {
    width: 32px;
    height: 32px;
    color: var(--accent-secondary);
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.weather-temp {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.weather-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.weather-city {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── 3-day weather forecast strip ── */
.weather-forecast {
    display: flex;
    gap: 12px;
    margin-top: 0;
    padding-left: 16px;
    border-left: 1px solid var(--border-card);
    flex-shrink: 0;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.forecast-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.forecast-icon { font-size: 15px; line-height: 1.4; }

.forecast-temp {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Weather card — single row with forecast */
.weather-card-widget {
    flex-wrap: nowrap;
    align-items: center;
}

/* ==========================================
   7. SEARCH BAR COMPONENT
   ========================================== */
.search-section {
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 680px;
    padding: 6px 14px;
    border-radius: 40px;
    gap: 10px;
}

.search-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

/* Engine Selector Button */
.search-engine-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: var(--transition-fast);
}

.search-engine-select:hover {
    background: rgba(255, 255, 255, 0.05);
}

.engine-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-secondary);
}

.chevron-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* Engine Dropdown */
.engine-dropdown {
    position: absolute;
    top: 46px;
    left: 0;
    width: 160px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    z-index: var(--z-overlay);
    padding: 6px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--accent-secondary);
}

/* Search Form Input */
.search-form {
    display: flex;
    flex-grow: 1;
    align-items: center;
}

.search-form input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    padding: 8px 0;
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.search-submit-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.search-submit-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    transform: translateX(2px);
}

.search-submit-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================
   8. WIDGET COMMON CARDS
   ========================================== */
.widget-card {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-primary);
}

.accent-glow {
    filter: drop-shadow(0 0 6px var(--accent-primary));
}

.widget-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.widget-action-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding: 6px;
    border-radius: 8px;
    display: flex;
}

.widget-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.widget-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   9. CHECKLIST FOCUS WIDGET
   ========================================== */
.checklist-widget {
    flex-grow: 1.2;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
    user-select: none;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Custom styled checkboxes */
.checkbox-container {
    display: block;
    position: relative;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    transition: var(--transition-smooth);
}

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

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

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

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

.checklist-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Strikethrough effect on check */
.checklist-item.completed .checklist-text {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--accent-primary);
}

.item-delete-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition-fast);
    padding: 2px;
}

.checklist-item:hover .item-delete-btn {
    opacity: 1;
}

.item-delete-btn:hover {
    color: var(--accent-error);
}

.item-delete-btn svg {
    width: 14px;
    height: 14px;
}

/* Checklist form input */
.widget-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.widget-form input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.widget-form input:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.form-add-btn {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    outline: none;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-primary);
    transition: var(--transition-smooth);
}

.form-add-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.form-add-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   10. STICKY NOTEPAD WIDGET
   ========================================== */
.notes-widget {
    flex-grow: 1.5;
}

.save-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.save-status.saving {
    color: var(--accent-secondary);
    background: rgba(6, 182, 212, 0.1);
}

.notes-widget textarea {
    width: 100%;
    flex: 1;
    min-height: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    transition: var(--transition-smooth);
}

.notes-widget textarea:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* ==========================================
   11. SUPABASE INCOME DASHBOARD WIDGET
   ========================================== */
.income-dashboard-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.income-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.income-icon-glow {
    width: 24px;
    height: 24px;
    color: var(--accent-success);
    filter: drop-shadow(0 0 6px var(--accent-success));
}

.income-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

/* Supabase status labels */
.badge-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
}

.badge-status.mock-badge {
    background: rgba(255, 184, 108, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-status.live-badge {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.badge-status.error-badge {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.subtitle-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Sync rotating button */
.sync-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    cursor: pointer;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.sync-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-color: var(--accent-success);
    box-shadow: var(--glow-success);
}

.sync-action-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.6s ease;
}

/* Spinner class for fetching state */
.syncing svg {
    animation: rotateCW 1.2s infinite linear;
}

@keyframes rotateCW {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid layout for financials */
.income-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 6px 8px; /* Tighter horizontal padding to maximize text space */
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.metric-label {
    font-size: 0.68rem; /* Slightly smaller for perfect fit */
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap; /* Prevent "THIS QUARTER" from ever wrapping */
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
    transition: var(--transition-smooth);
}

/* Dynamic Goal Progress Gauge ("Where I'm Up To") */
.income-goal-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-header, .goal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.goal-ratio {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.goal-progress-bar-outer {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.goal-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-success) 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    width: 0%; /* Dynamic */
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-percentage {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-success);
}

.goal-remaining {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ledger transactions styling */
.ledger-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.ledger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ledger-header h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.ledger-add-btn {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ledger-add-btn:hover {
    background: var(--accent-success);
    color: #ffffff;
    box-shadow: var(--glow-success);
}

.ledger-add-btn svg {
    width: 12px;
    height: 12px;
}

.ledger-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition-fast);
}

.ledger-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.ledger-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ledger-desc {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.ledger-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ledger-amount {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-success);
}

.ledger-row-delete-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    opacity: 0;
    transition: var(--transition-fast);
}

.ledger-item:hover .ledger-row-delete-btn {
    opacity: 1;
}

.ledger-row-delete-btn:hover {
    color: var(--accent-error);
}

.ledger-row-delete-btn svg {
    width: 13px;
    height: 13px;
}

/* Supabase configuration prompt overlay */
.supabase-setup-alert {
    position: absolute;
    top: 80px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px;
    gap: 16px;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.alert-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: var(--glow-primary);
}

.alert-icon svg {
    width: 24px;
    height: 24px;
}

.alert-content h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.alert-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 260px;
}

.alert-connect-btn {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 10px 22px;
    border-radius: 20px;
    box-shadow: var(--glow-primary);
    transition: var(--transition-smooth);
}

.alert-connect-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* ==========================================
   12. QUICK BOOKMARKS COMPONENT
   ========================================== */
.bookmarks-widget {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 16px 18px;
}

.bookmarks-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced category gap from 14px */
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
}

/* Compact Overrides for Single Column Bookmarks Widget */
.bookmarks-widget .bookmark-links-grid {
    grid-template-columns: 1fr; /* Single column inside the Bookmarks Widget */
    gap: 6px; /* Tight gap between cards */
}

.bookmarks-widget .bookmark-category-section {
    gap: 6px;
}

.bookmarks-widget .category-name-header {
    font-size: 0.72rem;
    padding-bottom: 2px;
}

.bookmarks-widget .bookmark-link-card {
    padding: 6px 10px; /* Highly compact padding */
    border-radius: var(--border-radius-sm); /* Tight rounded corners */
}

.bookmarks-widget .bookmark-icon-badge {
    width: 24px; /* Reduced icon container size */
    height: 24px;
}

.bookmarks-widget .bookmark-icon-badge svg {
    width: 12px; /* Thinner, cleaner vector icons */
    height: 12px;
}

.bookmarks-widget .bookmark-link-title {
    font-size: 0.8rem; /* Highly legible but compact typography */
}

.bookmarks-widget .bookmark-edit-btn {
    padding: 2px;
}

.bookmarks-widget .bookmark-edit-btn svg {
    width: 11px;
    height: 11px;
}

.bookmarks-dashboard-card {
    flex: 1;
    min-height: 0;
    padding: 16px 18px;
    overflow: hidden;
}

.bookmarks-categories-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
}

.bookmark-category-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-name-header {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 4px;
}

.bookmark-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Individual Link Card */
.bookmark-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.bookmark-link-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.bookmark-link-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0; /* Prevents text overflow inside flex */
}

/* Circular Icon Badge */
.bookmark-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.bookmark-link-card:hover .bookmark-icon-badge {
    background: var(--accent-secondary);
    color: #000000;
    box-shadow: var(--glow-secondary);
}

.bookmark-icon-badge svg {
    width: 15px;
    height: 15px;
}

.bookmark-link-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Edit action for links */
.bookmark-edit-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition-fast);
    padding: 4px;
    border-radius: 4px;
    display: flex;
}

.bookmark-link-card:hover .bookmark-edit-btn {
    opacity: 1;
}

.bookmark-edit-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.bookmark-edit-btn svg {
    width: 13px;
    height: 13px;
}

/* ==========================================
   13. FOOTER & SETTINGS TRIGGER BUTTON
   ========================================== */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
    flex-shrink: 0;
}

.settings-floating-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    transition: var(--transition-smooth);
}

.settings-floating-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
    background: rgba(255, 255, 255, 0.05);
}

.settings-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

.settings-floating-btn span {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.footer-attribution {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================
   14. SIDE SETTINGS DRAWER COMPONENT
   ========================================== */
.settings-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    z-index: var(--z-drawer);
    border-radius: 0;
    border-left: 1px solid var(--border-card);
    border-top: none;
    border-bottom: none;
    border-right: none;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateX(100%);
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-drawer.active {
    transform: translateX(0);
}

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

.drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding: 6px;
    border-radius: 8px;
    display: flex;
}

.drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.drawer-close-btn svg {
    width: 18px;
    height: 18px;
}

/* Settings Nav Tabs */
.settings-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 4px;
    width: 100%;
}

.settings-tab-btn {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.settings-tab-btn:hover {
    color: #ffffff;
}

.settings-tab-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Body scrollable setup */
.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 4px;
}

.settings-tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.settings-tab-content.active {
    display: flex;
}

/* Individual form items */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-group input, 
.settings-group select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.settings-group select {
    cursor: pointer;
}

.settings-group select option {
    background: #11131c;
    color: #ffffff;
}

.settings-group input:focus, 
.settings-group select:focus {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.hint-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
}

/* Password eye button layout */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    width: 100%;
    padding-right: 42px;
}

.visibility-toggle-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    padding: 4px;
}

.visibility-toggle-btn:hover {
    color: var(--text-primary);
}

.visibility-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* Column layout inside settings */
.schema-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.settings-divider {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 6px;
    margin-top: 8px;
}

/* Toggle Switches */
.toggle-group {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    transition: .3s;
    border-radius: 34px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .slider-toggle {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.switch-toggle input:checked + .slider-toggle:before {
    transform: translateX(20px);
    background-color: #ffffff;
}

/* Theme Options Picker Grid */
.theme-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    padding: 10px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-card-hover);
    color: #ffffff;
}

.theme-option.active {
    border-color: var(--accent-primary);
    background: rgba(168, 85, 247, 0.05);
    color: #ffffff;
}

.theme-preview {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cyber-glass-preview {
    background: linear-gradient(135deg, #0f1016 0%, #15102a 100%);
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.4);
}

.dark-minimal-preview {
    background: #0c0e12;
    border-color: #272c3b;
}

.light-aurora-preview {
    background: #eef1f6;
    border-color: #b9c1d6;
}

.dracula-preview {
    background: #0e0a17;
    box-shadow: inset 0 0 10px rgba(255, 121, 198, 0.4);
}

/* Save / Reset buttons */
.drawer-footer {
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-card);
    padding-top: 16px;
}

.drawer-reset-btn {
    flex-grow: 1;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.drawer-reset-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.drawer-save-btn {
    flex-grow: 1.5;
    background: var(--accent-success);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: var(--glow-success);
    transition: var(--transition-smooth);
}

.drawer-save-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    animation: fadeIn 0.3s ease;
}

/* ==========================================
   15. MODAL DIALOGS COMPONENT
   ========================================== */
.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 440px;
    z-index: var(--z-modal);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.modal-close-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding: 6px;
    border-radius: 8px;
    display: flex;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.modal-close-btn svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.modal-actions-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.modal-delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 10px 16px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.modal-delete-btn:hover {
    background: var(--accent-error);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.modal-cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
    border-radius: var(--border-radius-sm);
    padding: 10px 16px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.modal-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.modal-submit-btn {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 10px 18px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--glow-primary);
    transition: var(--transition-smooth);
}

.modal-submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Modal Overlay backdrop */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-overlay);
    animation: fadeIn 0.3s ease;
}

/* ==========================================
   16. MEDIA QUERIES (BREAKPOINTS & RESPONSIVENESS)
   ========================================== */

/* Tablet & Smaller Desktop Size (Double Column layout) */
@media (max-width: 1200px) {
    .app-container {
        padding: 24px 16px;
    }
    
    .app-main-grid {
        grid-template-columns: 1fr 1fr; /* Switch to 2 columns */
        gap: 20px;
    }
    
    .column-center {
        grid-column: span 2; /* Stretch the main income tracker full width */
        order: -1; /* Place on top */
    }
    
    .column-left {
        grid-column: span 1;
    }
    
    .column-right {
        grid-column: span 1;
    }
    
    .column-bookmarks {
        grid-column: span 2; /* Stretch bookmarks full-width at the bottom on tablet */
    }
}

/* ── Mobile ── */
/* ── Mobile ── */
@media (max-width: 1024px) {

    /* Allow scrolling on mobile — no fixed viewport lock */
    body {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        background: var(--bg-app);
    }

    .app-container {
        width: 100%;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
        padding: 20px 14px 30px;
        gap: 16px;
    }
    
    .glass-card, .app-main-grid {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ambient Background Blobs optimization for mobile performance and placement */
    .ambient-bg {
        filter: blur(80px);
        opacity: 0.6;
    }
    
    .blob-1 { width: 250px; height: 250px; top: -50px; left: -50px; }
    .blob-2 { width: 250px; height: 250px; bottom: 50px; right: -50px; }
    .blob-3 { display: none; } /* hide third blob for mobile CPU/GPU performance */

    /* Header: clock on top, greeting below, weather full-width below that */
    .app-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        margin-bottom: 4px;
    }
    
    .header-left  { 
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }
    
    .header-center { 
        order: 1;
        margin-bottom: 2px;
    }
    
    .header-right {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 4px;
    }

    .greeting-text { 
        font-size: 1.6rem; 
        letter-spacing: -0.02em;
        font-weight: 800;
    }
    
    .date-text { 
        font-size: 0.85rem; 
        opacity: 0.7;
    }
    
    .digital-clock { 
        font-size: 3.6rem; 
        letter-spacing: -2px;
        font-weight: 800;
        text-shadow: 0 0 25px rgba(var(--accent-primary-rgb), 0.25);
    }

    /* Weather: full-width on mobile — stacked with forecast below */
    .weather-card-widget {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-radius: var(--border-radius-md);
        box-sizing: border-box;
        flex-wrap: wrap !important;
    }

    .weather-forecast {
        width: 100%;
        border-left: none !important;
        border-top: 1px solid var(--border-card) !important;
        padding-left: 0 !important;
        padding-top: 12px !important;
        margin-left: 0 !important;
        margin-top: 4px !important;
        justify-content: space-around !important;
        flex: none !important;
        flex-shrink: 0 !important;
    }

    /* Search engine input polished for mobile */
    .search-section {
        width: 100%;
        margin-bottom: 4px;
    }

    .search-container {
        padding: 10px 14px;
        border-radius: var(--border-radius-md);
    }

    .search-form input {
        font-size: 0.85rem;
    }

    /* Single-column grid, income first */
    .app-main-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        flex: none;
        min-height: unset;
        max-width: 100%;
    }

    .column-center,
    .column-left,
    .column-right,
    .column-bookmarks {
        grid-column: 1 / -1;  /* clear the tablet span-2 that creates a phantom column */
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: unset;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .column-center { order: -1; }

    /* Income metrics: 2+2+1 grid */
    .income-metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .metric-card:last-child {
        grid-column: span 2;
    }

    /* Income card: auto height, overflow-safe */
    .income-dashboard-card {
        flex: none;
        height: auto;
        overflow: hidden;
        max-width: 100%;
        padding: 18px 16px;
    }

    .ledger-container {
        flex: none;
        margin-top: 14px;
    }

    .ledger-list {
        max-height: 180px;
        flex: none;
    }

    /* Widget cards: auto height */
    .widget-card {
        flex: none;
        height: auto;
        min-height: unset;
        padding: 16px 18px;
    }
    
    .checklist-items { 
        flex: none; 
        max-height: 220px; 
    }
    
    .notes-widget textarea { 
        min-height: 120px; 
        flex: none; 
    }

    /* Habit tracker mobile optimization */
    .habit-tracker-card {
        flex: none;
        height: auto;
        min-height: unset;
        padding: 16px 16px 14px;
    }
    
    .habits-list {
        gap: 8px;
    }
    
    .habit-row {
        padding: 10px 10px;
        gap: 10px;
    }
    
    .habit-name {
        font-size: 0.9rem;
    }
    
    .habit-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    /* UX fix: make delete buttons visible on touchscreens */
    .habit-row .habit-delete-btn {
        opacity: 0.45;
        padding: 5px;
    }
    
    .habit-days-row {
        gap: 3px;
    }
    
    .habit-day-btn {
        height: 30px;
        border-radius: 5px;
    }
    
    .habit-day-btn .day-letter {
        font-size: 0.48rem;
    }
    
    .habit-day-btn .day-num {
        font-size: 0.58rem;
    }

    /* Settings & Modals */
    .settings-drawer { 
        width: 100%; 
        border-radius: 0;
    }
    
    .modal-dialog { 
        width: 92%; 
        padding: 20px; 
        border-radius: var(--border-radius-md);
    }

    .app-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        margin-top: 10px;
    }

    /* ── Calendar: force square cells (height:36px + width:100% → ellipses) ── */
    .habit-cal-grid {
        grid-auto-rows: auto;
        gap: 3px;
    }
    .cal-day {
        height: auto;
        aspect-ratio: 1;
        font-size: 0.72rem;
        border-radius: 50%;
    }

    /* DOW row: slightly more readable */
    .habit-dow-row { gap: 3px; }
    .habit-dow { font-size: 0.62rem; }

    /* Habit tabs: smaller chips on mobile */
    .habit-tab {
        font-size: 0.68rem;
        padding: 4px 9px 4px 7px;
    }

    /* Metric labels: strip letter-spacing so "THIS QUARTER" doesn't overflow */
    .metric-label {
        font-size: 0.66rem;
        letter-spacing: 0;
    }
    .metric-card { padding: 8px 8px 6px; }

    /* Income header: let LIVE badge wrap on tiny screens */
    .title-row {
        flex-wrap: wrap;
        gap: 6px;
        row-gap: 3px;
    }
    .income-header h2 { font-size: 1.15rem; }
    .subtitle-text { font-size: 0.8rem; }

    /* Weather forecast text sizes (stacked layout) */
    .forecast-label { font-size: 0.6rem; }
    .forecast-temp  { font-size: 0.73rem; }

    /* Habit stats: full-width row */
    .habit-stats { margin-top: 4px; }
    .habit-stat  { padding: 8px 6px; }
    .habit-stat-value { font-size: 1.05rem; }
    .habit-stat-label { font-size: 0.58rem; }
}

/* ==========================================
   THEME: Blossom (Light — Pink & Purple)
   ========================================== */
body.theme-blossom {
    --bg-app: #f0e8ff;
    --bg-card: rgba(255, 245, 255, 0.72);
    --bg-subcard: rgba(255, 248, 255, 0.88);
    --border-card: rgba(210, 100, 240, 0.30);
    --border-card-hover: rgba(210, 100, 240, 0.55);
    --text-primary: #1a0a2e;
    --text-secondary: #6b4fa0;
    --text-muted: #b09ccc;

    --accent-primary: #d946ef;
    --accent-primary-rgb: 217, 70, 239;
    --accent-secondary: #9333ea;
    --accent-secondary-rgb: 147, 51, 234;
    --accent-success: #a855f7;
    --accent-success-rgb: 168, 85, 247;
    --accent-error: #e11d48;

    --shadow-card: 0 8px 32px 0 rgba(168, 85, 247, 0.18);
    --glow-primary:   0 0 24px rgba(217, 70, 239, 0.30);
    --glow-secondary: 0 0 24px rgba(147, 51, 234, 0.30);
    --glow-success:   0 0 24px rgba(168, 85, 247, 0.30);

    --blob-1-color: rgba(217, 70, 239, 0.28);
    --blob-2-color: rgba(147, 51, 234, 0.24);
    --blob-3-color: rgba(244, 114, 182, 0.22);
}

body.theme-blossom .blob { mix-blend-mode: multiply; }

body.theme-blossom .greeting-text {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-blossom .digital-clock {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

body.theme-blossom .clock-ampm,
body.theme-blossom .widget-header h2,
body.theme-blossom .income-header h2,
body.theme-blossom .ledger-header h3,
body.theme-blossom .drawer-header h3,
body.theme-blossom .modal-header h3,
body.theme-blossom .goal-ratio,
body.theme-blossom .ledger-desc,
body.theme-blossom .weather-temp,
body.theme-blossom .bookmark-link-title,
body.theme-blossom .settings-floating-btn span,
body.theme-blossom .settings-tab-btn.active,
body.theme-blossom .checklist-text,
body.theme-blossom .search-form input { color: var(--text-primary) !important; }

body.theme-blossom .metric-value { color: var(--text-primary) !important; }

body.theme-blossom .widget-form input,
body.theme-blossom .notes-widget textarea,
body.theme-blossom .settings-group input,
body.theme-blossom .settings-group select {
    background: rgba(147, 51, 234, 0.04);
    border-color: rgba(147, 51, 234, 0.16);
    color: var(--text-primary);
}

body.theme-blossom .widget-form input:focus,
body.theme-blossom .notes-widget textarea:focus,
body.theme-blossom .settings-group input:focus,
body.theme-blossom .settings-group select:focus {
    background: rgba(147, 51, 234, 0.07);
}

body.theme-blossom .settings-group select option {
    background: #f5efff;
    color: var(--text-primary);
}

body.theme-blossom .checklist-item {
    background: rgba(147, 51, 234, 0.03);
    border-color: rgba(147, 51, 234, 0.08);
}

body.theme-blossom .ledger-item {
    background: rgba(147, 51, 234, 0.025);
    border-color: rgba(147, 51, 234, 0.06);
}

body.theme-blossom .bookmark-link-card {
    background: rgba(147, 51, 234, 0.03);
    border-color: rgba(147, 51, 234, 0.09);
}

body.theme-blossom .save-status {
    background: rgba(168, 85, 247, 0.10);
    color: var(--accent-success);
}
body.theme-blossom .save-status.saving {
    background: rgba(217, 70, 239, 0.10);
    color: var(--accent-primary);
}
body.theme-blossom .ledger-add-btn {
    background: rgba(168, 85, 247, 0.10);
    border-color: rgba(168, 85, 247, 0.20);
}
body.theme-blossom .ledger-add-btn:hover {
    background: var(--accent-success);
    box-shadow: var(--glow-success);
}
body.theme-blossom .badge-status.live-badge {
    background: rgba(168, 85, 247, 0.12);
    color: var(--accent-success);
    border-color: rgba(168, 85, 247, 0.30);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

body.theme-blossom .settings-tabs { background: rgba(147, 51, 234, 0.04); }
body.theme-blossom .settings-tab-btn { color: var(--text-secondary); }

/* ── Habit Tracker ── */
.habit-tracker-card {
    flex: 1;
    min-height: 480px; /* give it a stable height for list scrolling */
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.habit-week-label {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.habits-list::-webkit-scrollbar {
    width: 6px;
}
.habits-list::-webkit-scrollbar-track {
    background: transparent;
}
.habits-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
}
.habits-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

.habit-row {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-card);
    transition: var(--transition-smooth);
    gap: 6px;
}

.habit-row:hover {
    transform: translateY(-2px);
    border-color: var(--border-card-hover);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.habit-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.habit-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 10px;
    min-width: 0;
}

.habit-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.habit-stats-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.habit-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.habit-badge.progress {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.habit-delete-btn {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0; /* Hidden by default, appears on hover */
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 10px;
}

.habit-delete-btn:hover {
    color: var(--accent-error);
    background: rgba(239, 68, 68, 0.2);
}

.habit-row:hover .habit-delete-btn {
    opacity: 0.6;
}

.habit-delete-btn:hover {
    opacity: 1 !important;
}

.habit-delete-btn svg {
    width: 13px;
    height: 13px;
}

.habit-days-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.habit-day-btn {
    flex: 1;
    min-width: 0;
    height: 32px;
    border-radius: 6px; /* soft squares / squircle shape */
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
    outline: none;
    position: relative;
    overflow: hidden;
    color: var(--text-secondary);
    user-select: none;
}

.habit-day-btn:hover:not(.future) {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-card-hover);
    color: var(--text-primary);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.habit-day-btn .day-letter {
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.5;
    line-height: 1;
}

.habit-day-btn .day-num {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
}

.habit-day-btn.today:not(.done) {
    box-shadow: inset 0 0 0 1px currentColor;
    background: rgba(255, 255, 255, 0.03);
}

.habit-day-btn.done {
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), inset 0 1px 2px rgba(255, 255, 255, 0.2) !important;
}

.habit-day-btn.done::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 65%);
    pointer-events: none;
}

.habit-day-btn.future {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
    background: transparent;
    border-color: transparent;
}

/* ── Per-metric progress bars ── */
.metric-prog-wrap {
    width: 100%;
    height: 4px;
    background: var(--border-card);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.metric-prog-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-success) 100%);
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-prog-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
}

/* Todoist overdue task label */
.todoist-overdue { color: #e11d48 !important; }

.blossom-preview {
    background: linear-gradient(135deg, #f7f2ff 0%, #eddeff 100%);
    border: 1px solid rgba(168, 85, 247, 0.25) !important;
    box-shadow: inset 0 0 12px rgba(217, 70, 239, 0.18);
}

/* ── Manual Cloud Backup styles ── */
.manual-backup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-card);
    background: rgba(var(--accent-primary-rgb), 0.05);
    color: var(--accent-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 8px;
    outline: none;
}

.manual-backup-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.12);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--accent-primary-rgb), 0.2);
}

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

.manual-backup-btn.success {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: var(--accent-success) !important;
    color: var(--accent-success) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2) !important;
}

.manual-backup-btn.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.border-top-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    margin-top: 14px;
}

.animate-spin {
    animation: rotateCW 1.5s linear infinite;
}
