:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent: #14b8a6;
    --highlight: #f472b6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Dark Mode Defaults */
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.95);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 24px;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(15, 23, 42, 0.85);

    /* Secondary Elements for Dark Mode */
    --rest-box-bg: rgba(255, 255, 255, 0.05);
    --category-bg: rgba(255, 255, 255, 0.1);
    --progress-track: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(15, 23, 42, 0.85);
}

body.light-mode {
    --bg: #fdfcfd;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1e1b4b;
    --text-muted: #6366f1;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --header-bg: rgba(253, 252, 253, 0.85);

    /* Secondary Elements for Light Mode */
    --rest-box-bg: #f8fafc;
    --category-bg: #f1f5f9;
    --progress-track: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    transition: background-color 0.3s, color 0.3s;
}

/* --- LOGIN SCREEN --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14b8a6 0%, #8b5cf6 50%, #f472b6 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 30px 20px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.branding {
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: center;
}

.app-logo {
    width: 110px;
    height: 110px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 24px;
}

.login-form {
    margin-top: 0;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.app-name-small {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-weight: 900;
    font-size: 2.2rem;
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 1rem;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* --- DASHBOARD --- */
nav {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.stats {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 5px 10px;
    border-radius: 50px;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.2);
    text-align: center;
    border: none;
    color: white;
}

#total-stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    line-height: 1;
}

#grand-total {
    font-weight: 800;
    font-size: 1.2rem;
}

.currency {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
}

.btn-icon:hover {
    background: #e2e8f0;
    transform: none;
}

/* --- CHART --- */
.overview-section {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-section {
    width: 100%;
    padding: 32px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 60px;
    border: 1px solid var(--input-border);
}

.search-section {
    width: 100%;
    padding: 0; /* Handled by overview-section */
}

/* --- CARDS --- */
.card, .overview-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

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

.card.over-budget {
    border: 2px solid var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    z-index: 10;
}

.card-header {
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.category {
    font-size: 0.75rem;
    background: var(--category-bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-main);
    text-transform: uppercase;
    font-weight: 600;
}

.progress-container {
    margin-bottom: 24px;
}

.progress-bg {
    background: var(--progress-track);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.bar {
    background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
    height: 100%;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rest-box {
    text-align: center;
    background: var(--rest-box-bg);
    padding: 12px;
    border-radius: 12px;
}

.rest-box .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.rest-box b {
    font-size: 1.25rem;
    font-weight: 800;
}

.actions {
    display: flex;
    gap: 8px;
}

.actions input {
    flex: 1;
}

.actions button {
    width: auto;
    padding: 0 16px;
}

/* --- PHYSICS --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--input-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

#scan-date::-webkit-date-and-time-value {
    text-align: left;
}

.close-btn {
    background: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.admin-item {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.btn-danger {
    background: var(--danger);
}

.btn-secondary {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 15px 0 0 0;
}

@media (max-width: 640px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.btn-primary-large {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3);
}

.btn-primary-large:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.4);
}

.settings-subheader {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: var(--category-bg);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    font-size: 1.1rem;
}
.settings-subheader.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-left: none;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.settings-subheader.orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-left: none;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.settings-subheader.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: none;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* --- UPDATED ADMIN UI --- */
.admin-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr 0.8fr 0.5fr;
    gap: 10px;
    padding: 10px;
    background: var(--category-bg);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.admin-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr 0.8fr 0.5fr;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--input-border);
    align-items: center;
}
.admin-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.admin-item input[type="text"], .admin-item input[type="number"], .admin-item select {
    padding: 6px 10px;
    font-size: 0.9rem;
}

/* --- TOGGLE SWITCH --- */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.1);
  transition: .3s;
  border-radius: 20px;
}
.light-mode .slider {
    background-color: rgba(0,0,0,0.15);
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

.btn-toggle {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 14px;
}

/* Nav Icon Styling */
.btn-icon {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,0,0,0.05);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* --- SEARCH SECTION --- */
.overview-section {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-section {
    width: 100%;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#budget-search {
    padding-left: 48px;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    box-shadow: var(--shadow);
    height: 50px;
    border-radius: 15px;
}

/* White Trash Icon */
.admin-item .btn-danger {
    background: #ef4444;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-item .btn-danger svg, .admin-item .btn-danger i {
    color: white !important;
}

/* Monochromatic Nav Buttons */
.btn-icon svg {
    color: var(--text-main);
}

.btn-icon:hover svg {
    color: white;
}

.chart-container {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

.chart-legend {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.legend-item {
    display: flex;
    flex-direction: column;
}

.legend-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.legend-item .value {
    font-size: 1.1rem;
    font-weight: 800;
}

.legend-item .percent {
    font-size: 0.8rem;
    color: var(--primary);
}

.btn-toggle {
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--input-border);
    height: 48px;
    padding: 0 20px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-toggle.paid {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- MONTH PICKER --- */
.month-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 0 0 0;
}

.btn-month {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-month:hover:not(:disabled) {
    background: var(--primary) !important;
    color: white !important;
}

.btn-month:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.current-month-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.month-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: capitalize;
}

.badge-today {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: -4px;
}

.history-view-only {
    padding: 8px 16px;
    background: #f1f5f9;
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- SCANNER & RECEIPTS --- */
.scanner-view {
    position: relative;
    margin: 0 auto;
    border-radius: 15px;
    width: 100%;
    aspect-ratio: 3/4;
    background: #000;
    overflow: hidden;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 20px solid rgba(0,0,0,0.3);
    box-sizing: border-box;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.scanner-controls {
    padding: 20px;
    background: transparent;
}

.scan-processing {
    width: 100%;
    min-height: 300px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 100;
}

.scan-processing span {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    animation: pulseText 1.5s infinite ease-in-out;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

.scan-processing .spinner {
    width: 60px;
    height: 60px;
    border-width: 5px;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.scan-result-form {
    padding: 0;
    background: transparent;
}

.receipts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--rest-box-bg);
    border-radius: 12px;
    border: 1px solid var(--input-border);
}

.receipt-info h4 { margin: 0; font-size: 1rem; }
.receipt-info span { font-size: 0.75rem; color: var(--text-muted); }
.receipt-meta { text-align: right; }
.receipt-amount { font-weight: 800; font-size: 1.1rem; color: var(--text-main); }

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.scan-close {
    position: absolute;
    top: 15px; right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 200;
    border: none;
    transition: all 0.2s;
}

.scan-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* --- FILTER BAR --- */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: white;
    font-weight: 700;
}

.item-count {
    opacity: 0.9;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-control select {
    background: none;
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
}

#budget-search {
    width: 100%;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {
    nav {
        height: auto;
        padding: 10px 0;
    }

    .nav-content {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    .nav-actions {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .stats {
        order: 3;
    }

    #total-stat {
        padding: 8px 20px;
    }

    .chart-section {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
    }

    .chart-container {
        width: 200px;
        height: 200px;
    }

    .chart-legend {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .card {
        padding: 20px;
    }

    .overview-section {
        padding: 0 10px;
    }

    .month-picker {
        gap: 10px;
    }

    .month-name {
        font-size: 1rem;
    }

    /* Modal Mobile Adjustments */
    .modal-content {
        width: 95% !important;
        padding: 15px !important;
    }

    .admin-item {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .admin-table-header {
        display: none;
    }
}

.scan-result-form input,
.scan-result-form select {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 1rem;
    height: 50px;
    outline: none;
    background: #f8fafc;
    color: var(--text-main);
    display: block;
}

#scan-budget-id {
    appearance: none;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 16px center;
}

#scan-date {
    appearance: none;
    -webkit-appearance: none;
    text-align: left !important;
}

.receipt-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.receipt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.receipt-thumb:hover img {
    transform: scale(1.1);
}

.receipt-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--input-border);
}

.receipt-info {
    flex: 1;
}

/* Essential Scanner Styles */
#scanner-video {
    width: 100%;
    max-height: 70vh;
    background: #000;
    display: block;
    object-fit: cover;
}

.scanner-view {
    position: relative;
    background: #000;
    overflow: hidden;
    min-height: 200px;
}

.scan-processing {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 20px;
    color: var(--primary);
    font-weight: 600;
}

.dashboard-page {
    background: linear-gradient(135deg, #14b8a6 0%, #8b5cf6 50%, #f472b6 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: auto;
    padding: 0 5px;
}

.search-clear:hover {
    color: var(--primary);
    background: none;
    transform: translateY(-50%) scale(1.1);
}

.history-icon {
    color: var(--text-muted);
    opacity: 0.5;
    transition: all 0.2s;
}

.card:hover .history-icon {
    opacity: 1;
    color: var(--primary);
    transform: rotate(-15deg);
}

/* --- CUSTOM NAV ICON COLORS --- */
.btn-icon.logout {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-icon.logout:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-icon.settings {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}
.btn-icon.settings:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-icon.camera {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}
.btn-icon.camera:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-icon.receipts {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-icon.receipts:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-icon.fire {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.05));
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}
.btn-icon.fire:hover {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
}

.btn-icon.budget {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.05));
    color: #14b8a6;
    border-color: rgba(20, 184, 166, 0.2);
}
.btn-icon.budget:hover {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
}
