/* All existing CSS styles remain the same */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "PT Sans Narrow", sans-serif;
            font-weight: bolder;
            font-style: normal;
        }

        /* ===== SIMPLE & PROFESSIONAL GLASS THEME ===== */

        /* Dark Theme (Default) */
        :root {
            --primary: #3b82f6;
            --secondary: #1d4ed8;
            --success: #22c55e;
            --danger: #ef4444;
            --dark: #0f172a;
            --light: #f8fafc;
            --gray: #94a3b8;
            --card-bg: rgba(30, 41, 59, 0.55);
            --text: #f1f5f9;
            --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
            --border: 1px solid rgba(148, 163, 184, 0.4);
            --transition: all 0.3s ease;
            --app-bg: linear-gradient(135deg, #0f172a, #1e293b);
            --card-border: 1px solid rgba(148, 163, 184, 0.45);
            --input-bg: rgba(255, 255, 255, 0.06);
            --hover-bg: rgba(59, 130, 246, 0.15);
            --modal-bg: rgba(15, 23, 42, 0.96);
            --stat-bg: rgba(255, 255, 255, 0.04);
        }

        /* Light Theme */
        body.light-theme {
            --primary: #2563eb;
            --secondary: #1e40af;
            --success: #16a34a;
            --danger: #dc2626;
            --dark: #1e293b;
            --light: #ffffff;
            --gray: #64748b;
            --card-bg: rgba(255, 255, 255, 0.9);
            --text: #1e293b;
            --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
            --border: 1px solid rgba(100, 116, 139, 0.25);
            --app-bg: linear-gradient(135deg, #f1f5f9, #e2e8f0);
            --card-border: 1px solid rgba(100, 116, 139, 0.25);
            --input-bg: rgba(255, 255, 255, 0.95);
            --hover-bg: rgba(37, 99, 235, 0.08);
            --modal-bg: rgba(255, 255, 255, 0.96);
            --stat-bg: rgba(0, 0, 0, 0.04);
        }

        body {
            background: var(--app-bg);
            color: var(--text);
            min-height: 100vh;
            padding: 0;
            transition: background 0.3s, color 0.3s;
            overflow-x: hidden;
        }

        body.shared-view {
            --text: #000000;
            --card-bg: rgba(0, 0, 0, 0.295);
            --border: 1px solid rgba(0, 0, 0, 0.1);
            --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            --app-bg: #0000002b;
            --card-border: 1px solid rgba(0, 0, 0, 0.1);
            background: var(--app-bg);
            color: var(--text);
        }

        /* Hide header in shared view */
        .shared-view .app-header {
            display: none !important;
        }

        /* Optional: Adjust layout when header is hidden */
        .shared-view .stats-grid {
            margin-top: 20px;
        }

        .shared-view .balance-section {
            margin-top: 10px;
        }

        .app-container {
            max-width: 100%;
            margin: 0 auto;
            position: relative;
            padding: 0;
        }

        /* App Header */
        .app-header {
            position: sticky;
            top: 0;
            z-index: 100;
            background: rgba(26, 42, 108, 0.244);
            backdrop-filter: blur(5px);
            padding: 10px 15px;
            display: flex;
            height: fit-content;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            border-bottom: var(--border);
            transition: var(--transition);
        }


        body.light-theme .app-header {
            background: rgba(255, 255, 255, 0.211);
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }

        body.shared-view .app-header {
            background: #2c3e50;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .profile-pic {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid var(--success);
            cursor: pointer;
            transition: var(--transition);
            display: none;
            /*Profile pic Hidden*/
        }

        .profile-pic:hover {
            transform: scale(1.1);
            transform: rotate(10deg);
            box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.3);
        }

        .app-title {
            font-size: 1.5rem;
            background: linear-gradient(90deg, var(--success), #92fe9d);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            font-weight: 700;
        }

        body.light-theme .app-title {
            background: linear-gradient(90deg, var(--success), #00b894);
            -webkit-background-clip: text;
            background-clip: text;
        }

        body.shared-view .app-title {
            background: #2c3e50;
            -webkit-background-clip: text;
            background-clip: text;
            color: #2c3e50;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-left: auto;
        }

        /* ===== Version 1: Enhanced Hover Animation ===== */
        .menu-container {
            position: relative;
            display: flex;
            align-items: center;
        }

        /* Button for Version 1 */
        .menu-button-v1 {
            background: var(--card-bg);
            border: var(--border);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
            color: var(--text);
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            z-index: 10;
        }

        .menu-button-v1::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            opacity: 0;
            transition: opacity 0.3s ease;
            border-radius: 50%;
            z-index: -1;
        }

        .menu-button-v1:hover {
            background: transparent;
            transform: rotate(180deg) scale(1.1);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        }

        .menu-button-v1:hover::before {
            opacity: 1;
        }

        .menu-button-v1:hover i {
            animation: bounce 0.6s ease;
            color: white;
        }

        @keyframes bounce {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.2);
            }
        }

        /* Dropdown for Version 1 */
        .menu-dropdown-v1 {
            position: absolute;
            top: 50px;
            right: 0;
            background: var(--modal-bg);
            backdrop-filter: blur(15px) saturate(180%);
            border-radius: 16px;
            padding: 10px 0;
            min-width: 200px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
            border: var(--border);
            z-index: 1000;
            display: none;
            opacity: 0;
            transform: translateY(-20px) scale(0.95);
            transform-origin: top right;
            transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            overflow: hidden;
        }

        .menu-dropdown-v1.active {
            display: block;
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        /* ===== Version 2: Professional Grid Layout ===== */
        .menu-button {
            background: linear-gradient(135deg, var(--card-bg), var(--modal-bg));
            border: 3px solid rgb(255, 255, 255);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            color: var(--text);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            position: relative;
            overflow: hidden;
        }

        .menu-button::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            transform: translate(-50%, -50%);
            transition: width 0.4s ease, height 0.4s ease;
        }

        .menu-button:hover::after {
            width: 100%;
            height: 100%;
        }

        .menu-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
            border-color: var(--primary);
        }

        /* Grid Dropdown */
        .menu-grid-dropdown {
            position: absolute;
            top: 50px;
            right: 0;
            background: var(--modal-bg);
            backdrop-filter: blur(20px) saturate(200%);
            border-radius: 20px;
            padding: 20px;
            min-width: 300px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.08);
            z-index: 1000;
            display: none;
            opacity: 0;
            transform: translateY(-10px) scale(0.98);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .menu-grid-dropdown.active {
            display: block;
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .menu-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
        }

        .grid-item {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 14px;
            padding: 16px 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            color: var(--text);
            position: relative;
            overflow: hidden;
        }

        .grid-item::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, var(--primary), transparent 70%);
            opacity: 0;
            transition: opacity 0.3s ease;
            border-radius: 14px;
            z-index: 0;
        }

        .grid-item:hover::before {
            opacity: 0.1;
        }

        .grid-item:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: var(--primary);
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .grid-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--card-bg), transparent);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: var(--primary);
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
        }

        .grid-item:hover .grid-icon {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            transform: rotate(10deg) scale(1.1);
        }

        .grid-label {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text);
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
        }

        .grid-item:hover .grid-label {
            color: var(--primary);
            font-weight: 600;
        }

        /* Tooltip */
        .grid-item[data-tooltip] {
            position: relative;
        }

        .grid-item[data-tooltip]::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(-10px);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 0.75rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .grid-item:hover[data-tooltip]::after {
            opacity: 1;
            transform: translateX(-50%) translateY(-5px);
        }

        /* Traditional menu items (for Version 1) */
        .menu-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 14px 20px;
            background: transparent;
            border: none;
            color: var(--text);
            width: 100%;
            text-align: left;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.95rem;
            border-radius: 0;
            position: relative;
            overflow: hidden;
        }

        .menu-item::before {
            content: '';
            position: absolute;
            left: -100%;
            top: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transition: left 0.7s ease;
        }

        .menu-item:hover::before {
            left: 100%;
        }

        .menu-item:hover {
            background: rgba(var(--primary-rgb, 100, 108, 255), 0.1);
            transform: translateX(8px);
            padding-left: 28px;
        }

        .menu-item:hover i {
            transform: scale(1.2) rotate(-5deg);
            color: var(--primary);
        }

        .menu-item i {
            width: 20px;
            text-align: center;
            font-size: 1rem;
            transition: all 0.3s ease;
            position: relative;
            z-index: 1;
        }

        .menu-item span {
            position: relative;
            z-index: 1;
            font-weight: 500;
        }

        .menu-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--border), transparent);
            margin: 8px 20px;
            opacity: 0.5;
        }

        /* Theme transition */
        .theme-transition {
            transition: background-color 0.5s ease, color 0.5s ease;
        }

        /* App Content */
        .app-content {
            padding: 20px;
            max-width: 1920px;
            margin: 0 auto;
            width: 100%;
        }

        /* Dashboard Styles */
        .dashboard {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .card {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            border-radius: 5%;
            padding: 20px;
            box-shadow: var(--shadow);
            border: var(--card-border);
            transition: var(--transition);
            animation: fadeIn 0.5s ease-out;
        }

        body.light-theme .card {
            background: rgba(255, 255, 255, 0.9);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        body.shared-view .card {
            background: white;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .card:hover {
            border: 2px solid rgb(0, 255, 42);
            transform: translateY(-5px);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
            cursor: pointer;
            transition: 0.1ms;
        }

        body.light-theme .card:hover {
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
        }

        .card-title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
            font-size: 1rem;
            color: var(--success);
        }

        body.light-theme .card-title {
            color: var(--success);
        }

        body.shared-view .card-title {
            color: #4cc9f0;
        }

        .card-title i {
            font-size: 1.2rem;
        }

        .total-amount {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--text);
        }

        body.shared-view .total-amount {
            color: #333;
        }

        .progress-container {
            margin-top: 15px;
            height: 6px;
            background: var(--stat-bg);
            border-radius: 4px;
            overflow: hidden;
        }

        body.shared-view .progress-container {
            background: rgba(0, 0, 0, 0.1);
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--success));
            border-radius: 4px;
            transition: width 0.5s ease;
        }

        /* Budget Section */
        .budget-section {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-bottom: 20px;
        }

        .budget-input {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .budget-input input {
            flex: 1;
            padding: 14px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 12px;
            color: var(--text);
            font-size: 1rem;
            transition: var(--transition);
        }

        body.light-theme .budget-input input {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(0, 0, 0, 0.1);
            color: #333;
        }

        body.shared-view .budget-input input {
            background: white;
            border: 1px solid #ddd;
            color: #333;
        }

        .budget-input input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .budget-display {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            border-radius: 16px;
            padding: 18px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            box-shadow: var(--shadow);
            border: var(--card-border);
        }

        body.light-theme .budget-display {
            background: rgba(255, 255, 255, 0.9);
        }

        body.shared-view .budget-display {
            background: white;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .budget-info {
            display: flex;
            justify-content: space-between;
            font-size: 0.95rem;
        }

        .remaining-budget {
            color: var(--success);
            font-weight: bold;
        }

        .over-budget {
            color: var(--danger);
        }

        /* Filter Section */
        .filter-section {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
        }

        .filter-group label {
            margin-bottom: 8px;
            font-size: 0.85rem;
            opacity: 0.9;
            color: var(--text);
        }

        body.light-theme .filter-group label {
            color: #333;
        }

        body.shared-view .filter-group label {
            color: #333;
        }

        .filter-group input,
        .filter-group select {
            padding: 14px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 12px;
            color: var(--text);
            font-size: 1rem;
            transition: var(--transition);
        }

        body.light-theme .filter-group input,
        body.light-theme .filter-group select {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(0, 0, 0, 0.1);
            color: #333;
        }

        body.shared-view .filter-group input,
        body.shared-view .filter-group select {
            background: white;
            border: 1px solid #ddd;
            color: #333;
        }

        .filter-group select {
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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");
            background-repeat: no-repeat;
            background-position: right 14px center;
            background-size: 16px;
            padding-right: 40px;
        }

        .filter-group input:focus,
        .filter-group select:focus {
            outline: none;
            border-color: var(--primary);
        }

        select option {
            background: var(--modal-bg);
            color: var(--text);
            padding: 10px;
            font-size: 0.95rem;
        }

        /* Expenses Section - Grid Layout */
        .expenses-container {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            border-radius: 16px;
            padding: 20px;
            box-shadow: var(--shadow);
            border: var(--card-border);
            margin-bottom: 25px;
        }

        body.light-theme .expenses-container {
            background: rgba(255, 255, 255, 0.9);
        }

        body.shared-view .expenses-container {
            background: white;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .expense-header {
            display: none;
        }

        #expenses-list {
            display: grid;
            grid-template-columns: repeat(1, 1fr);
            gap: 15px;
        }

        /* EXTRA PADDING ADDED HERE for expense purpose and category icon */
        .expense-item {
            background: var(--stat-bg);
            border-radius: 14px;
            padding: 20px;
            transition: background 0.3s, transform 0.3s;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            gap: 15px;
            min-height: 200px;
            border: var(--card-border);
        }

        body.light-theme .expense-item {
            background: rgba(0, 0, 0, 0.05);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        body.shared-view .expense-item {
            background: #f9f9f9;
            border: 1px solid #ddd;
            cursor: default;
        }

        .expense-item:hover {
            background: var(--hover-bg);
            transform: translateY(-3px);
        }

        body.light-theme .expense-item:hover {
            background: rgba(0, 0, 0, 0.08);
        }

        body.shared-view .expense-item:hover {
            background: #f9f9f9;
            transform: none;
        }

        /* EXTRA PADDING for expense purpose */
        .expense-purpose {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 12px;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 12px;
        }

        /* EXTRA PADDING for category icon */
        .category-icon {
            width: 55px;
            height: 55px;
            border-radius: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(67, 97, 238, 0.2);
            font-size: 20px;
            color: var(--primary);
            flex-shrink: 0;
            padding: 5px;
        }

        body.light-theme .category-icon {
            background: rgba(67, 97, 238, 0.15);
            color: #4361ee;
        }

        body.shared-view .category-icon {
            background: rgba(67, 97, 238, 0.15);
            color: #4361ee;
        }

        .expense-purpose-text {
            font-weight: 600;
            font-size: 0.95rem;
            /* REDUCED FROM 1.3rem TO 0.95rem */
            flex: 1;
            color: var(--text);
            padding: 5px 0;
            /* 🔥 Text Wrap Fix */
            white-space: normal;
            overflow-wrap: break-word;
            word-break: break-word;
            line-height: 1.3;
            /* ADDED FOR BETTER READABILITY */
        }


        body.light-theme .expense-purpose-text {
            color: #333;
        }

        body.shared-view .expense-purpose-text {
            color: #333;
        }

        .expense-details {
            display: flex;
            flex-direction: column;
            gap: 8px;
            /* REDUCED FROM 10px TO 8px */
            flex: 1;
        }

        .expense-detail {
            display: flex;
            justify-content: space-between;
            padding: 6px 0;
            /* REDUCED FROM 8px TO 6px */
        }

        .detail-label {
            font-size: 0.8rem;
            /* REDUCED FROM 1.1rem TO 0.8rem */
            opacity: 0.7;
            color: var(--text);
        }

        body.light-theme .detail-label {
            color: #666;
        }

        body.shared-view .detail-label {
            color: #666;
        }

        .detail-value {
            font-weight: 250;
            font-size: 0.85rem;
            /* REDUCED FROM 1rem TO 0.85rem */
            color: var(--text);
        }

        body.light-theme .detail-value {
            color: #333;
        }

        body.shared-view .detail-value {
            color: #333;
        }

        .expense-amount {
            font-weight: bold;
            color: red;
            font-size: 1.2rem;
            /* REDUCED FROM 1.5rem TO 1.2rem */
        }

        body.shared-view .expense-amount {
            color: red;
        }

        /* Context Menu */
        .context-menu {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--modal-bg);
            backdrop-filter: blur(10px);
            border-radius: 14px;
            display: none;
            z-index: 10;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 15px;
            padding: 15px;
        }

        body.light-theme .context-menu {
            background: rgba(255, 255, 255, 0.98);
        }

        .context-menu-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 18px;
            background: transparent;
            border: none;
            color: var(--text);
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
            font-size: 0.95rem;
            width: 80%;
            max-width: 160px;
            justify-content: center;
        }

        .context-menu-btn:hover {
            background: var(--hover-bg);
        }

        .edit-context {
            background: rgba(67, 97, 238, 0.2);
            color: var(--primary);
            display: block;
        }

        .delete-context {
            background: rgba(247, 37, 133, 0.2);
            color: var(--danger);
            display: block;
        }

        /* FAB Button */
        .fab-menu {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--success));
            color: white;
            font-size: 25px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
            transition: var(--transition);
            z-index: 100;
            display: none;
        }

        .fab-menu:hover {
            transform: none;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
        }

        /* Forms */
        .form-container {
            position: fixed;
            bottom: 90px;
            right: 15px;
            left: 15px;
            background: var(--modal-bg);
            padding: 30px;
            border-radius: 25px;
            box-shadow: var(--shadow);
            z-index: 10000;
            border: var(--border);
            backdrop-filter: blur(10px);
            transform: translateY(150%);
            opacity: 0;
            transition: all 0.4s ease-in-out;
            max-height: 80vh;
            overflow-y: auto;
            /* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
            scrollbar-width: none;
            /* Firefox */
            -ms-overflow-style: none;
            /* IE and Edge */
        }

        /* Hide scrollbar for WebKit browsers */
        .form-container::-webkit-scrollbar {
            display: none;
        }

        body.light-theme .form-container {
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        .form-container.active {
            transform: translateY(0);
            opacity: 1;
        }

        .form-title {
            text-align: center;
            margin-bottom: 20px;
            font-size: 1.3rem;
            color: var(--success);
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 6px;
            font-size: 0.95rem;
            color: var(--text);
        }

        body.light-theme .form-group label {
            color: #333;
        }

        .form-control {
            width: 100%;
            padding: 12px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 12px;
            color: var(--text);
            font-size: 1rem;
            transition: var(--transition);
        }

        body.light-theme .form-control {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(0, 0, 0, 0.1);
            color: #333;
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
        }

        .btn {
            background: linear-gradient(135deg, var(--primary), var(--success));
            color: white;
            border: none;
            padding: 14px 18px;
            border-radius: 12px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.95rem;
            width: 100%;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
        }

        .btn-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.7);
            font-size: 1.3rem;
            cursor: pointer;
        }

        body.light-theme .btn-close {
            color: rgba(0, 0, 0, 0.7);
        }

        .btn-close:hover {
            color: var(--danger);
        }

        /* Action Buttons */
        .action-buttons-container {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
            margin-top: 20px;
        }

        .action-btn {
            padding: 12px;
            border-radius: 12px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            color: white;
            font-size: 0.9rem;
            text-align: center;
        }

        .action-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
        }

        .print-btn {
            background: linear-gradient(135deg, #ff9a9e, #fad0c4);
        }

        .chart-btn {
            background: linear-gradient(135deg, #a18cd1, #fbc2eb);
        }

        .export-btn {
            background: linear-gradient(135deg, #84fab0, #8fd3f4);
        }

        .clear-btn {
            background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
            width: 100%;
        }

        /* Profile Modal - WIDER LAYOUT */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
            padding: 15px;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .profile-modal {
            background: var(--modal-bg);
            border-radius: 20px;
            width: 100%;
            max-width: 1170px;
            padding: 20px;
            box-shadow: var(--shadow);
            border: var(--border);
            backdrop-filter: blur(10px);
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.5s ease;
            max-height: 80vh;
            overflow-y: auto;
            /* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
            scrollbar-width: none;
            /* Firefox */
            -ms-overflow-style: none;
            /* IE and Edge */
        }

        body.light-theme .profile-modal {
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        .modal-overlay.active .profile-modal {
            transform: translateY(0);
            opacity: 1;
        }

        .profile-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .profile-pic-large {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            border: 3px solid var(--success);
            margin: 0 auto 12px;
        }

        .profile-name {
            font-size: 2rem;
            font-weight: bold;
            margin-bottom: 5px;
            color: var(--text);
        }

        body.light-theme .profile-name {
            color: #333;
        }

        .profile-email {
            font-size: 0.95rem;
            opacity: 0.8;
            color: var(--success);
            margin-bottom: 5px;
        }

        .profile-joined {
            font-size: 0.85rem;
            opacity: 0.7;
            color: var(--success);
        }

        .form-row {
            display: flex;
            gap: 12px;
            margin-bottom: 15px;
        }

        .form-group-flex {
            flex: 1;
        }

        .profile-actions {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .profile-action-btn {
            padding: 10px 14px;
            border-radius: 10px;
            background: var(--stat-bg);
            color: var(--text);
            border: none;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            font-size: 0.9rem;
        }

        body.light-theme .profile-action-btn {
            background: rgba(0, 0, 0, 0.05);
            color: #333;
        }

        .profile-action-btn:hover {
            background: var(--hover-bg);
        }

        /* Share Section */
        .share-section {
            margin-top: 20px;
            padding: 15px;
            background: var(--stat-bg);
            border-radius: 12px;
        }

        body.light-theme .share-section {
            background: rgba(0, 0, 0, 0.05);
        }

        .share-title {
            font-size: 1.1rem;
            margin-bottom: 12px;
            color: var(--success);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .share-status {
            margin-bottom: 15px;
            padding: 10px;
            border-radius: 8px;
            background: var(--input-bg);
            font-size: 0.9rem;
            color: var(--text);
        }

        body.light-theme .share-status {
            background: rgba(255, 255, 255, 0.8);
            color: #333;
        }

        .share-link {
            display: flex;
            gap: 8px;
            margin-bottom: 15px;
        }

        .share-link input {
            flex: 1;
            padding: 10px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 8px;
            color: var(--text);
            font-size: 0.9rem;
        }

        body.light-theme .share-link input {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(0, 0, 0, 0.1);
            color: #333;
        }

        .share-link button {
            padding: 10px 14px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: var(--transition);
        }

        .share-link button:hover {
            background: var(--secondary);
        }

        .share-controls {
            display: flex;
            gap: 8px;
        }

        .share-controls button {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.9rem;
        }

        .generate-btn {
            background: var(--success);
            color: white;
        }

        .terminate-btn {
            background: var(--danger);
            color: white;
        }

        /* Chart Modal */
        .chart-modal {
            background: var(--modal-bg);
            border-radius: 20px;
            width: 100%;
            max-width: 95%;
            padding: 25px;
            box-shadow: var(--shadow);
            border: var(--border);
            backdrop-filter: blur(10px);
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.4s ease;
            max-height: 80vh;
            overflow-y: auto;
            /* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
            scrollbar-width: thin;
        }

        body.light-theme .chart-modal {
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        .modal-overlay.active .chart-modal {
            transform: translateY(0);
            opacity: 1;
        }

        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 15px;
        }

        .chart-title {
            font-size: 1.4rem;
            color: var(--success);
            font-weight: bold;
        }

        .chart-controls {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .chart-controls button {
            padding: 10px 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chart-controls button:hover {
            background: var(--secondary);
            transform: translateY(-2px);
        }

        .chart-controls button.active {
            background: var(--success);
        }

        /* ---------- ANALYTICS GRID (1 card per row on all screens) ---------- */
        .analytics-grid {
            display: grid !important;
            grid-template-columns: 1fr !important;
            /* 1 per row */
            gap: 20px !important;
            margin-bottom: 25px;
            grid-auto-rows: 1fr !important;
            /* keeps all cards equal height */
        }

        /* ------------- ANALYTICS CARD ------------- */
        .analytics-card {
            background: var(--card-bg);
            border-radius: 16px;
            padding: 16px;
            box-shadow: var(--shadow);
            border: var(--card-border);
            height: 100%;
            display: flex;
            flex-direction: column;
            transition: var(--transition);
            overflow: hidden;
            min-height: 420px;
            /* fixed height to prevent collapsing */
        }

        .analytics-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
        }

        body.light-theme .analytics-card {
            background: rgba(255, 255, 255, 0.95);
        }

        .analytics-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 15px;
            font-size: 1.1rem;
            color: var(--success);
            padding-bottom: 10px;
            border-bottom: var(--border);
        }

        /* CONTENT AREA */
        .analytics-content {
            flex: 1;
            width: 100%;
            margin-top: 10px;
            overflow: visible;
        }

        /* Chart Period Selector */
        .chart-period-selector {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }

        .period-btn {
            padding: 8px 16px;
            background: var(--card-bg);
            color: var(--text);
            border: var(--border);
            border-radius: 8px;
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.85rem;
        }

        .period-btn.active {
            background: var(--success);
            color: white;
            border-color: var(--success);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .period-btn:hover {
            background: var(--hover-bg);
            transform: translateY(-2px);
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-top: 25px;
        }


        .stat-card {
            background: var(--stat-bg);
            border-radius: 12px;
            padding: 15px;
            text-align: center;
            transition: var(--transition);
        }

        .stat-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        }

        body.light-theme .stat-card {
            background: rgba(0, 0, 0, 0.05);
        }

        .stat-value {
            font-size: 1.5rem;
            font-weight: bold;
            margin: 10px 0;
            color: var(--text);
        }

        body.light-theme .stat-value {
            color: #333;
        }

        .stat-label {
            font-size: 0.85rem;
            opacity: 0.8;
            color: var(--text);
            margin-top: 5px;
        }

        body.light-theme .stat-label {
            color: #666;
        }

        /* Login Container Styles */
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
            background: url('../img/png/Gemini_Generated_Image_rfvdcdrfvdcdrfvd.png') no-repeat center center;
            background-size:cover;
            position: relative;
            overflow: hidden;
        }

        .login-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0);
            backdrop-filter: blur(3px);
        }

        .login-card {
            background: rgba(0, 0, 0, 0);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 35px 25px;
            width: 100%;
            max-width: 600px;
            max-height: fit-content;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
            border: var(--border);
            text-align: center;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            position: relative;
            z-index: 1;
        }

        body.light-theme .login-card {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .login-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
        }

        .login-icon {
            margin-bottom: 15px;
            animation: float 3s ease-in-out infinite;
        }

        .login-icon i {
            font-size: 3.5rem;
            background: linear-gradient(135deg, var(--success), var(--primary));
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            transition: transform 0.3s ease;
            display: inline-block;
        }

        .login-card:hover .login-icon i {
            transform: scale(1.05);
        }

        .login-title {
            font-size: 2rem;
            margin-bottom: 12px;
            background: linear-gradient(135deg, var(--success), #008cff);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            font-weight: 700;
        }

        .login-subtitle {
            font-size: 1rem;
            margin-bottom: 25px;
            opacity: 0.9;
            line-height: 1.5;
            color: var(--text);
        }

        body.light-theme .login-subtitle {
            color: #333;
        }

        .login-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 14px;
            background: linear-gradient(135deg, var(--primary), var(--success));
            color: white;
            border-radius: 50px;
            font-weight: 600;
            font-size: 0.95rem;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
            border: none;
            width: 100%;
            margin: 10px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
            position: relative;
            overflow: hidden;
        }

        .login-btn::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transform: rotate(-45deg);
            transition: all 0.6s ease;
        }

        .login-btn:hover::before {
            transform: rotate(-45deg) translate(50%, 50%);
        }

        .login-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 7px 20px rgba(0, 0, 0, 0.35);
        }

        .login-footer {
            margin-top: 25px;
            font-size: 0.8rem;
            opacity: 0.7;
            line-height: 1.5;
            color: var(--text);
        }

        body.light-theme .login-footer {
            color: #333;
        }

        /* Tabs */
        .auth-tabs {
            display: flex;
            justify-content: space-around;
            margin-bottom: 20px;
            border-bottom: var(--border);
        }

        body.light-theme .auth-tabs {
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }

        .auth-tab {
            flex: 1;
            padding: 10px;
            cursor: pointer;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7);
            transition: all 0.3s ease;
        }

        body.light-theme .auth-tab {
            color: rgba(0, 0, 0, 0.7);
        }

        .auth-tab.active {
            color: var(--light);
            border-bottom: 3px solid var(--primary);
        }

        body.light-theme .auth-tab.active {
            color: #333;
        }

        /* Forms */
        .auth-form {
            display: none;
            text-align: left;
        }

        .auth-form.active {
            display: block;
        }

        /* Divider */
        .login-divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 20px 0;
            color: rgba(255, 255, 255, 0.6);
        }

        body.light-theme .login-divider {
            color: rgba(0, 0, 0, 0.6);
        }

        .login-divider span {
            flex: 1;
            border-bottom: var(--border);
            line-height: 0;
            margin: 0 10px;
        }

        body.light-theme .login-divider span {
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }

        /* No Expenses */
        .no-expenses {
            text-align: center;
            padding: 40px 0;
            color: rgba(255, 255, 255, 0.6);
            grid-column: 1 / -1;
        }

        body.light-theme .no-expenses {
            color: rgba(0, 0, 0, 0.6);
        }

        body.shared-view .no-expenses {
            color: #666;
        }

        .no-expenses i {
            font-size: 2.5rem;
            margin-bottom: 12px;
            display: block;
        }

        /* Password Group with Eye */
        .password-group {
            position: relative;
        }

        .password-group .toggle-password {
            position: absolute;
            right: 12px;
            top: 38px;
            font-size: 1rem;
            color: #888;
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .password-group .toggle-password:hover {
            color: var(--primary);
        }

        /* Reset Password Popup */
        .reset-popup {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.475);
            backdrop-filter: blur(5px);
            justify-content: center;
            align-items: center;
            border-radius: 20px;
        }

        .reset-popup-content {
            background: #fff;
            /* solid white background */
            padding: 25px;
            border-radius: 15px;
            width: 100%;
            max-width: 400px;
            text-align: center;
            position: relative;
            animation: fadeIn 0.3s ease;
            color: #222;
            /* text color dark */
        }

        .reset-popup-content input[type="email"] {
            width: 100%;
            padding: 12px 14px;
            border-radius: 8px;
            border: 1px solid #ccc;
            background: #fff;
            /* ensure background is white */
            color: #222;
            /* text inside input will be dark */
            font-size: 1rem;
            margin-top: 8px;
        }

        .reset-popup-content input[type="email"]::placeholder {
            color: #888;
            /* placeholder color */
        }

        .reset-popup .close-btn {
            position: absolute;
            top: 12px;
            right: 15px;
            font-size: 3rem;
            cursor: pointer;
            color: #444;
        }

        .reset-popup .close-btn:hover {
            color: var(--primary);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Shared View Notice */
        .shared-notice {
            text-align: center;
            padding: 15px;
            background: #2c3e50;
            color: white;
            margin-bottom: 20px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        /* NEW STYLES FOR SOCIAL LINKS */
        .social-links-container {
            margin: 20px 0;
            padding: 15px;
            background: var(--stat-bg);
            border-radius: 12px;
        }

        .social-links-title {
            font-size: 1.1rem;
            margin-bottom: 12px;
            color: var(--success);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .social-links-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px;
            margin-bottom: 15px;
        }

        .social-link-item {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .social-link-item input {
            width: 100%;
            padding: 10px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 8px;
            color: var(--text);
            font-size: 0.9rem;
        }

        .social-icons-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 15px;
            justify-content: center;
        }

        .social-icon-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--primary);
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            transition: var(--transition);
            text-decoration: none;
        }

        .social-icon-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .social-icon-btn.facebook {
            background: #1877F2;
        }

        .social-icon-btn.twitter {
            background: #1DA1F2;
        }

        .social-icon-btn.instagram {
            background: #E4405F;
        }

        .social-icon-btn.linkedin {
            background: #0A66C2;
        }

        .social-icon-btn.github {
            background: #333;
        }

        .social-icon-btn.youtube {
            background: #FF0000;
        }

        .social-icon-btn.whatsapp {
            background: #25D366;
        }

        .social-icon-btn.telegram {
            background: #0088cc;
        }

        /* Cash Management Section */
        .cash-management-section {
            margin: 20px 0;
            padding: 15px;
            background: var(--stat-bg);
            border-radius: 12px;
        }

        .cash-management-title {
            font-size: 1.1rem;
            margin-bottom: 12px;
            color: var(--success);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .current-balance-display {
            background: var(--card-bg);
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
            text-align: center;
            border: var(--card-border);
        }

        .balance-amount {
            font-size: 2rem;
            font-weight: bold;
            margin: 10px 0;
            color: var(--success);
        }

        .balance-label {
            font-size: 0.9rem;
            opacity: 0.8;
            color: var(--text);
        }

        .add-cash-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .add-cash-form input,
        .add-cash-form select {
            padding: 12px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 8px;
            color: var(--text);
            font-size: 0.95rem;
        }

        .add-cash-form input:focus,
        .add-cash-form select:focus {
            outline: none;
            border-color: var(--primary);
        }

        .cash-history-container {
            margin-top: 20px;
        }

        .cash-history-title {
            font-size: 1rem;
            margin-bottom: 10px;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cash-history-list {
            max-height: 200px;
            overflow-y: auto;
            background: var(--input-bg);
            border-radius: 8px;
            padding: 10px;
            scrollbar-width: thin;
        }

        .cash-history-item {
            display: flex;
            justify-content: space-between;
            padding: 8px;
            border-bottom: 1px solid var(--border);
        }

        .cash-history-item:last-child {
            border-bottom: none;
        }

        .cash-history-amount {
            font-weight: bold;
            color: var(--success);
        }

        .cash-history-purpose {
            font-size: 0.85rem;
            opacity: 0.8;
        }

        .cash-history-date {
            font-size: 0.8rem;
            opacity: 0.7;
        }

        /* NEW LOCK FEATURE STYLES */
        .lock-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin: 10px 0;
        }

        .lock-btn {
            background: transparent;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            color: var(--success);
            padding: 5px;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .lock-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: scale(1.1);
        }

        .lock-btn.locked {
            color: var(--danger);
            animation: pulse 2s infinite;
        }

        .lock-status {
            font-size: 0.9rem;
            color: var(--text);
            opacity: 0.8;
        }

        .balance-amount.locked {
            color: var(--danger) !important;
            text-decoration: line-through;
            opacity: 0.7;
        }

        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.1);
            }

            100% {
                transform: scale(1);
            }
        }

        /* NEW CHART SYSTEM STYLES */
        .chart-system-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-bottom: 20px;
        }

        .chart-system-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        .chart-system-title {
            font-size: 1.3rem;
            color: var(--success);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Import/Export Buttons */
        .import-export-container {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }

        .import-export-container button {
            flex: 1;
            padding: 10px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            transition: var(--transition);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .import-btn {
            background: var(--success);
            color: white;
        }

        .export-btn {
            background: var(--primary);
            color: white;
        }

        /* Budget Setting in Profile Modal */
        .budget-setting-section {
            margin: 20px 0;
            padding: 15px;
            background: var(--stat-bg);
            border-radius: 12px;
        }

        .budget-setting-title {
            font-size: 1.1rem;
            margin-bottom: 12px;
            color: var(--success);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .budget-input-group {
            display: flex;
            gap: 10px;
        }

        .budget-input-group input {
            flex: 1;
            padding: 12px;
            background: var(--input-bg);
            border: var(--border);
            border-radius: 8px;
            color: var(--text);
            font-size: 0.95rem;
        }

        /* Offline Indicator */
        .offline-indicator {
            position: fixed;
            top: 70px;
            right: 20px;
            background: #ff9800;
            color: white;
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 12px;
            z-index: 1000;
            display: flex;
            align-items: center;
            gap: 8px;
            animation: slideDown 0.3s ease;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        }

        .offline-indicator i {
            font-size: 14px;
        }

        @keyframes slideDown {
            from {
                transform: translateY(-20px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* Overlay */
        .loading-overlay {
            position: fixed;
            inset: 0;
            background: radial-gradient(circle at center, #08121f 0%, #02060d 70%);
            backdrop-filter: blur(10px);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.4s ease;
        }

        .loading-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        /* Loader Wrapper */
        .expense-loader {
            position: relative;
            width: 240px;
            height: 240px;
        }

        /* Orbit Rings */
        .orbit {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid transparent;
            border-top-color: #00f7ff;
            border-bottom-color: rgba(0, 247, 255, 0.25);
            animation: orbitSpin 2.6s linear infinite;
            filter: drop-shadow(0 0 14px #00f7ff);
        }

        .orbit.delay {
            inset: 18px;
            border-top-color: #7cff00;
            animation-duration: 3.4s;
            animation-direction: reverse;
            filter: drop-shadow(0 0 14px #7cff00);
        }

        /* Center Core */
        .center-core {
            position: absolute;
            inset: 40px;
            background: linear-gradient(145deg, #0b1d2d, #020912);
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow:
                inset 0 0 20px rgba(0, 247, 255, 0.35),
                0 0 50px rgba(0, 247, 255, 0.45);
            animation: corePulse 2.2s ease-in-out infinite;
        }

        /* Dollar PNG */
        .dollar-png {
            width: 64px;
            height: 64px;
            object-fit: contain;
            animation: dollarFloat 1.8s ease-in-out infinite;
            filter:
                drop-shadow(0 0 10px rgba(0, 247, 255, 0.9)) drop-shadow(0 0 20px rgba(0, 247, 255, 0.6));
        }

        /* Animations */
        @keyframes orbitSpin {
            to {
                transform: rotate(360deg);
            }
        }

        @keyframes corePulse {

            0%,
            100% {
                transform: scale(0.95);
            }

            50% {
                transform: scale(1.06);
            }
        }

        @keyframes dollarFloat {

            0%,
            100% {
                transform: translateY(0) scale(1);
            }

            50% {
                transform: translateY(-6px) scale(1.08);
            }
        }


        /* Smooth Fade In Animation */
        .fade-in {
            animation: fadeIn 0.5s ease-out;
        }

        /* Toast Container */
        .toast-container-rl {
            position: fixed;
            bottom: 20px;
            left: 0;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 12px;
            z-index: 9999;
            pointer-events: none;
        }

        .toast {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 22px 14px 22px;
            border-radius: 12px;
            color: #fff;
            font-weight: 600;
            font-size: 15px;
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
            opacity: 0;
            position: relative;
            transform: translateX(100vw);
            transition: transform 0.8s ease, opacity 0.5s ease, transform 0.2s ease-in-out;
            pointer-events: auto;
            cursor: pointer;
            overflow: hidden;
            width: auto;
            min-width: 120px;
            max-width: 320px;
            word-break: break-word;
            margin-left: 20px;
        }

        .toast i {
            font-size: 18px;
        }

        .toast-timer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            border-radius: 12px 12px 0 0;
            transition: none;
            z-index: 1;
            pointer-events: none;
        }

        /* NEW CATEGORY MANAGEMENT MODAL STYLES - UPDATED */
        .category-modal {
            background: var(--modal-bg);
            border-radius: 20px;
            width: 100%;
            max-width: 1170px;
            padding: 25px;
            box-shadow: var(--shadow);
            border: var(--border);
            backdrop-filter: blur(10px);
            transform: translateY(20px);
            opacity: 0;
            transition: all 0.4s ease;
            max-height: 90vh;
            overflow-y: auto;
            scrollbar-width: none;
        }

        .modal-overlay.active .category-modal {
            transform: translateY(0);
            opacity: 1;
        }

        .add-category-section,
        .existing-categories-section {
            margin-bottom: 25px;
        }

        .add-category-section h3,
        .existing-categories-section h3 {
            color: var(--success);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* NEW: Color Picker Section */
        .color-picker-section {
            margin-bottom: 15px;
        }

        .color-picker-container {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 8px;
        }

        .color-picker-input {
            width: 50px;
            height: 50px;
            border-radius: 10px;
            border: 2px solid var(--border);
            cursor: grab;
            padding: 0;
            background: transparent;
        }

        .color-picker-input::-webkit-color-swatch-wrapper {
            padding: 0;
        }

        .color-picker-input::-webkit-color-swatch {
            border: none;
            border-radius: 8px;
        }

        .color-preview {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            border: 2px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            color: white;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        /* ===============================
   ICON PICKER BUTTON
=============================== */
        .icon-picker-button {
            padding: 12px 16px;
            background: linear-gradient(145deg, #f0f3f8, #d9e0f0);
            /* soft gradient */
            border: 1.5px solid #c1c8d4;
            border-radius: 12px;
            color: #1f2937;
            /* dark gray text */
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 0.95rem;
            min-width: 100px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            cursor: cell;
        }

        .icon-picker-button:hover {
            background: linear-gradient(145deg, #e6ebf4, #cdd6e8);
            border-color: #3b82f6;
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        }

        /* ===============================
   ICON PICKER POPUP
=============================== */
        .icon-picker-popup {
            position: fixed;
            /* centered overlay */
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: transparent;
            /*rgba(255, 255, 255, 0.95)*/
            border-radius: 20px;
            padding: 25px;
            width: 90%;
            max-width: 450px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(200, 210, 230, 0.6);
            backdrop-filter: blur(15px);
            z-index: 1001;
            display: none;
            transition: all 0.3s ease;
        }

        .icon-picker-popup.active {
            display: block;
        }

        /* ===============================
   POPUP HEADER
=============================== */
        .icon-picker-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 18px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(200, 210, 230, 0.6);
        }

        .icon-picker-title {
            font-size: 1.15rem;
            font-weight: 600;
            color: #10b981;
            /* professional green */
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .icon-picker-close {
            background: transparent;
            border: none;
            color: #ffffff;
            font-size: 1.3rem;
            cursor: pointer;
            padding: 6px;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .icon-picker-close:hover {
            background: transparent;
            color: #ef4444;
            transform: scale(1.1);
        }

        /* ===============================
   ICON GRID
=============================== */
        .icon-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
            gap: 14px;
            margin-top: 10px;
            max-height: 60vh;
            overflow-y: auto;
            padding: 10px;
            border-radius: 12px;
            background: transparent;
            /*rgba(243, 246, 255, 0.5)*/
            backdrop-filter: blur(8px);
            scrollbar-gutter: stable;
            scrollbar-width: thin;
        }

        /* ===============================
   ICON OPTION
=============================== */
        .icon-option {
            width: 80%;
            aspect-ratio: 1 / 1;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #ffffff;
            border: 2px solid #d1d5db;
            cursor: cell;
            transition: all 0.25s ease;
            font-size: 1.5rem;
            color: #000000;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        .icon-option:hover {
            transform: scale(1.1);
            border-color: #0062ff;
            background: #eff6ff;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
        }

        .icon-option.selected {
            border-color: #10b981;
            background: rgba(16, 185, 129, 0.1);
            transform: scale(1.15);
            box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
        }

        /* Categories List → GRID */
        .categories-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 15px;

            max-height: 220px;
            overflow-y: auto;

            padding: 4px;
            margin: -4px;

            scrollbar-gutter: stable;
        }

        /* Hide scrollbar */
        .categories-list::-webkit-scrollbar {
            width: 0;
            height: 0;
        }

        .categories-list {
            scrollbar-width: none;
        }

        /* Category Item — Compact Card */
        .category-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            /* for hover overlay if needed */

            padding: 8px 6px;
            background: var(--stat-bg);
            border-radius: 6px;
            border: var(--border);

            text-align: center;
            transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        }

        /* Hover effect */
        .category-item:hover {
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
            background: var(--hover-bg);
        }

        /* Info container */
        .category-info {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        /* Icon — Centered */
        .category-icon-preview {
            width: 28px;
            height: 28px;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
        }

        /* Name */
        .category-name {
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--text);
            line-height: 1.1;
        }

        /* Actions — Hidden by default, appear on hover */
        .category-actions {
            display: flex;
            gap: 4px;
            margin-top: 4px;

            opacity: 0;
            /* hidden */
            pointer-events: none;
            /* not clickable */
            transition: opacity 0.25s ease;
        }

        .category-item:hover .category-actions {
            opacity: 1;
            pointer-events: auto;
        }

        /* Action Buttons */
        .category-action-btn {
            width: 24px;
            height: 24px;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;

            background: transparent;
            border: none;
            cursor: pointer;

            font-size: 0.7rem;
            transition: background 0.15s ease, color 0.15s ease;
            color: var(--text);
        }

        /* Hover effects for action buttons */
        .category-action-btn:hover {
            background: rgba(239, 68, 68, 0.12);
            color: var(--danger);
        }

        .category-action-btn.edit:hover {
            background: rgba(59, 130, 246, 0.12);
            color: var(--primary);
        }


        /* Make default categories non-deletable */
        .category-item.default .category-action-btn.delete {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .category-item.default .category-action-btn.delete:hover {
            background: transparent;
            color: var(--text);
        }

        .add-category-btn {
            height: 46px;
            width: 46px;
            border-radius: 8px;
            border: 1.5px solid #2563eb;
            background-color: #2563eb;
            color: #ffffff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s ease,
                box-shadow 0.2s ease,
                transform 0.1s ease;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
        }

        .add-category-btn i {
            font-size: 18px;
        }

        .add-category-btn:hover {
            background-color: #1d4ed8;
        }

        .add-category-btn:active {
            transform: scale(0.97);
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
        }


        /* Responsive adjustments */
        @media (max-width: 768px) {
            .icon-grid {
                grid-template-columns: repeat(4, 1fr);
            }

            .category-modal {
                max-width: 95%;
                padding: 20px;
            }

            .icon-picker-popup {
                max-width: 90%;
                max-height: 350px;
            }
        }

        /* Responsive Design */
        @media (min-width: 480px) {
            .dashboard {
                grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            }

            .action-buttons-container {
                grid-template-columns: 1fr;
            }
        }

        @media (min-width: 576px) {
            .budget-section {
                flex-direction: row;
            }

            .budget-input,
            .budget-display {
                min-width: calc(50% - 8px);
            }

            .filter-section {
                grid-template-columns: repeat(2, 1fr);
            }

            #expenses-list {
                grid-template-columns: repeat(2, 1fr);
            }

            .chart-row {
                grid-template-columns: repeat(2, 1fr);
            }

            .form-row {
                flex-direction: row;
            }
        }

        @media (min-width: 768px) {
            .app-header {
                padding: 15px 25px;
            }

            .app-content {
                padding: 25px;
            }

            .app-title {
                font-size: 1.7rem;
            }

            .filter-section {
                grid-template-columns: repeat(4, 1fr);
            }

            .form-container {
                width: 380px;
                right: 25px;
                left: auto;
            }

            .action-buttons-container {
                grid-template-columns: 1fr;
            }

            .profile-actions {
                flex-direction: row;
            }

            .social-links-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .analytics-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 992px) {
            .dashboard {
                gap: 18px;
                grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            }

            .card {
                padding: 22px;
            }

            .expenses-container {
                padding: 22px;
            }

            #expenses-list {
                grid-template-columns: repeat(3, 1fr);
            }

            .profile-modal {
                max-width: 700px;
            }

            .social-links-grid {
                grid-template-columns: repeat(3, 1fr);
            }

            .analytics-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (min-width: 1200px) {
            .analytics-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* Animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes float {
            0% {
                transform: translateY(0px);
            }

            50% {
                transform: translateY(-8px);
            }

            100% {
                transform: translateY(0px);
            }
        }

        /* ... (all other CSS styles remain exactly the same) ... */

        /* New styles for auth tabs */
        .auth-tabs {
            display: flex;
            margin-bottom: 20px;
            border-radius: 12px;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.1);
        }

        body.light-theme .auth-tabs {
            background: rgba(0, 0, 0, 0.1);
        }

        .auth-tab {
            flex: 1;
            padding: 12px;
            text-align: center;
            cursor: pointer;
            transition: var(--transition);
            font-weight: 600;
        }

        .auth-tab.active {
            background: var(--primary);
        }

        .auth-form {
            display: none;
        }

        .auth-form.active {
            display: block;
        }

        .form-footer {
            margin-top: 20px;
            text-align: center;
            font-size: 0.9rem;
            opacity: 0.8;
            color: var(--text);
        }

        body.light-theme .form-footer {
            color: #333;
        }

        .form-footer a {
            color: var(--success);
            text-decoration: none;
            cursor: pointer;
        }

        .error-message {
            color: var(--danger);
            font-size: 0.85rem;
            margin-top: 5px;
            display: none;
        }

        /* Sharer name in shared expenses */
        .sharer-info {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
            padding: 10px;
            background: var(--stat-bg);
            border-radius: 10px;
        }

        body.light-theme .sharer-info {
            background: rgba(0, 0, 0, 0.05);
        }

        .sharer-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }

        .sharer-details {
            flex: 1;
        }

        .sharer-name {
            font-weight: 600;
            font-size: 1rem;
            color: var(--text);
        }

        body.light-theme .sharer-name {
            color: #333;
        }

        .sharer-email {
            font-size: 0.8rem;
            opacity: 0.8;
            color: var(--text);
        }

        body.light-theme .sharer-email {
            color: #666;
        }

        .offline-badge {
            background: #ff9800;
            color: white;
            padding: 2px 6px;
            border-radius: 10px;
            font-size: 10px;
            margin-left: 8px;
        }

        /* for Printing */
        @media print {

            #budgetSection,
            #fabButton,
            #actionButtons,
            .profile-header,
            .app-header,
            .dashboard,
            .toast-container-rl,
            .filter-section,
            .filter-group {
                display: none !important;
            }

            /* Prevent .expense-item from splitting between pages */
            .expense-item {
                page-break-inside: avoid;
                break-inside: avoid;
                display: block;
            }

            /* Optional: add margin for cleaner separation between items */
            .expense-item {
                margin-bottom: 10mm;
            }

            /* Optional: adjust page size and margins for better printing */
            @page {
                size: A4;
                margin: 15mm;
            }
        }