* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
} */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* NEW - ADD ALL THESE BACKGROUND ANIMATION STYLES */

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Floating Icons */
.floating-icon {
    position: absolute;
    font-size: 80px;
    opacity: 0.25;
    animation: float 20s infinite linear;
    color: #ff6b35;
    text-shadow: 0 0 2px currentColor;  /* ADD: Glow effect */
    filter: drop-shadow(0 0 2px currentColor);  /* ADD: Enhanced glow */
}

.floating-icon:nth-child(odd) {
    animation-direction: reverse;
    opacity: 0.15;
}

.floating-icon.music {
    color: #e74c3c;
    animation-duration: 25s;
}

.floating-icon.gaming {
    color: #3498db;
    animation-duration: 18s;
}

.floating-icon.cooking {
    color: #f39c12;
    animation-duration: 22s;
}

.floating-icon.travel {
    color: #2ecc71;
    animation-duration: 28s;
}

.floating-icon.gym {
    color: #9b59b6;
    animation-duration: 20s;
}

.floating-icon.coding {
    color: #1abc9c;
    animation-duration: 24s;
}

/* User Selection Styles */
.user-selection {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid #333;
}

.user-selection h4 {
    margin-bottom: 16px;
    color: #ff6b35;
    font-size: 16px;
}

.user-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: #ff6b35;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #ff6b35;
}

.user-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #333;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
}

/* Checked state */
.checkbox-label input[type="checkbox"]:checked + .user-checkbox-item .user-avatar-small {
    border-color: #ff6b35;
}

.checkbox-label input[type="checkbox"]:checked + .user-checkbox-item .user-name {
    color: #ff6b35;
}


/* Date Input Styling */
input[type="date"] {
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 16px;
    font-family: inherit;
}

input[type="date"]:focus {
    outline: none;
    border-color: #ff6b35;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);                    /* Make calendar icon white */
    cursor: pointer;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@keyframes float {
    from {
        transform: translateY(100vh) rotate(0deg);
    }
    to {
        transform: translateY(-100px) rotate(360deg);
    }
}

/* Matrix-style code rain effect */
.code-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.code-line {
    position: absolute;
    top: -100px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #1abc9c;
    opacity: 0.3;
    animation: rain 15s linear infinite;
    white-space: nowrap;
}

@keyframes rain {
    to {
        transform: translateY(100vh);
    }
}

/* Gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(231, 76, 60, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(52, 152, 219, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, rgba(10, 10, 10, 0.9) 0%, rgba(26, 26, 26, 0.95) 100%);
    z-index: -2;
    pointer-events: none;
}

/* Pulse animation for key areas */
.pulse-effect {
    position: relative;
}

.pulse-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b35, #e74c3c, #3498db, #2ecc71);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.02); }
}

/* END NEW BACKGROUND STYLES */

/* Navigation */
/* .navbar {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
} */

.navbar {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    padding: 0 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-text-short {
    display: none;        /* Hide short text on desktop */
}

.nav-text-full {
    display: inline;      /* Show full text on desktop */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b35;
}

.nav-logo i {
    margin-right: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: #333;
}

/* Cards with glassmorphism effect */
.stat-card, .category-card, .expense-card, .balance-card, .chart-container, .auth-card, .expense-form {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.stat-card:hover, .category-card:hover, .expense-card:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.1);
}

/* Main Content */
.main-content {
    margin-top: 60px;
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    background: #ff6b35;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
}

.auth-card {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #333;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #cccccc;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0a0a0a;
    color: #ffffff;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn-primary {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-primary:hover {
    background: #e55a2b;
}

.btn-secondary {
    background: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.btn-danger:hover {
    background: #c82333;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #333;
}

.stat-icon {
    background: #ff6b35;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-content h3 {
    margin-bottom: 8px;
    color: #cccccc;
}

.stat-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b35;
}

.dashboard-section {
    margin-bottom: 40px;
}

.dashboard-section h2 {
    margin-bottom: 20px;
    color: #ffffff;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #333;
}

.category-icon {
    background: #333;
    color: #ff6b35;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-content h4 {
    margin-bottom: 4px;
    color: #ffffff;
}

.category-content p {
    color: #ff6b35;
    font-weight: bold;
}

.transaction-list {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    background: #333;
    color: #ff6b35;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.transaction-content {
    flex: 1;
}

.transaction-content h4 {
    margin-bottom: 4px;
    color: #ffffff;
}

.transaction-content p {
    color: #888;
    font-size: 14px;
}

.transaction-amount {
    font-weight: bold;
    color: #ff6b35;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.expense-form {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #333;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
}

.custom-split {
    margin-top: 20px;
    padding: 20px;
    background: #0a0a0a;
    border-radius: 8px;
    border: 1px solid #333;
}

.custom-split h4 {
    margin-bottom: 16px;
    color: #ff6b35;
}

/* Expenses List */
.expenses-container {
    max-width: 1400px;        /* INCREASE FROM: 800px TO: 1400px */
    margin: 0 auto;
    width: 100%;   
}

.expenses-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.expenses-header h2 {
    color: #ff6b35;
}

.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.expense-card {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #333;
}

.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.expense-header h3 {
    color: #ffffff;
}



.expense-details {
    margin-bottom: 16px;
}

.expense-details p {
    margin-bottom: 8px;
    color: #cccccc;
}

.expense-splits {
    border-top: 1px solid #333;
    padding-top: 16px;
}

.expense-splits h4 {
    margin-bottom: 12px;
    color: #ff6b35;
}

.split-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.split-item:last-child {
    border-bottom: none;
}

/* Profile */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 30px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #ff6b35;
}

.payer-info:hover .payer-avatar {
    border-color: #e55a2b;        /* ADD: Hover effect */
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.payer-info:hover .payer-name {
    color: #ff6b35;               /* ADD: Highlight name on hover */
    transition: color 0.3s ease;
}

.profile-info h2 {
    color: #ff6b35;
    margin-bottom: 8px;
}

.profile-info p {
    color: #cccccc;
    margin-bottom: 4px;
}

.profile-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.profile-section {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #333;
}

.profile-section h3 {
    color: #ff6b35;
    margin-bottom: 20px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: #ff6b35;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.monthly-totals-container {
    margin-bottom: 20px;
}

.monthly-totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid #333;
}

.monthly-card {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease;
}

.monthly-card:hover {
    transform: translateY(-2px);
    border-color: #ff6b35;
}

.monthly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.monthly-header h3 {
    color: #ff6b35;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.btn-month-details {
    background: rgba(255, 107, 53, 0.2);
    border: 1px solid rgba(255, 107, 53, 0.3);
    color: #ff6b35;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-month-details:hover {
    background: rgba(255, 107, 53, 0.3);
    transform: scale(1.1);
}

.monthly-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.monthly-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.house-icon {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
}

.user-icon {
    background: rgba(69, 183, 209, 0.2);
    color: #45b7d1;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-amount {
    font-size: 16px;
    font-weight: bold;
    margin-top: 2px;
}

.house-amount {
    color: #ff6b35;
}

.user-amount {
    color: #45b7d1;
}

.monthly-percentage {
    border-top: 1px solid #333;
    padding-top: 12px;
}

.percentage-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #45b7d1);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.percentage-text {
    font-size: 11px;
    color: #888;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .monthly-totals-grid {
        grid-template-columns: 1fr;
        max-height: 300px;
    }
    
    .monthly-card {
        padding: 16px;
    }
    
    .monthly-stats {
        gap: 8px;
    }
    
    .monthly-stat {
        padding: 6px;
    }
    
    .stat-amount {
        font-size: 14px;
    }
}

/* Scrollbar Styling for Monthly Grid */
.monthly-totals-grid::-webkit-scrollbar {
    width: 6px;
}

.monthly-totals-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.monthly-totals-grid::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 3px;
}

.monthly-totals-grid::-webkit-scrollbar-thumb:hover {
    background: #e55a2b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .auth-card {
        padding: 20px;
        margin: 0 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-badge {
        font-size: 9px;                         /* ADD: Smaller font on mobile */
        padding: 4px 6px;                       /* ADD: Reduced padding */
        max-width: 70px;                        /* ADD: Maximum width */
    }
    
    .expenses-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .expense-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .expense-actions {
        justify-content: center;
        text-align: center;
        width: 100%;                   
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .radio-group {
        flex-direction: column;
    }

    .balance-grid {
        grid-template-columns: 1fr;
    }
    
    .balance-item {
        padding: 12px 16px;
    }
    
    .balance-empty {
        padding: 30px 16px;
    }

    /* Table Mobile Styles */
    .table-container {
        margin: 0 -10px;
        border-radius: 0;
        overflow-x: auto;
    }
    
    .expenses-table {
        font-size: 12px;
        min-width: 700px; 
    }
    
    .expenses-table th,
    .expenses-table td {
        padding: 8px 6px;
    }
    
    .expenses-table th:nth-child(3),
    .expenses-table td:nth-child(3) { 
        width: 15%;                             /* CHANGE: From 12% to 15% */
        min-width: 80px;                        /* ADD: Minimum width */
    }

    .expense-title {
        min-width: 120px;
        max-width: 150px;
    }
    
    .expense-splits {
        min-width: 120px;
        max-width: 150px;
    }
    
    .splits-container {
        gap: 2px;
    }
    
    .split-item {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .payer-info {
        flex-direction: column;   /* ADD: Stack avatar and name on mobile */
        gap: 4px;
    }
    
    .payer-avatar {
        width: 28px;              /* ADD: Smaller avatar on mobile */
        height: 28px;
    }
    
    .payer-name {
        font-size: 11px;          /* ADD: Smaller text on mobile */
    }

    .user-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .checkbox-label {
        padding: 10px;
    }
    
    .user-name {
        font-size: 13px;
    }

    .settlement-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .settlement-actions {
        justify-content: space-between;
        align-items: center;
    }
    
    .settlement-actions .settlement-amount {
        font-size: 1.1rem;
    }
    
    .settlement-actions .btn-action {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        grid-template-columns: repeat(3, 1fr);      /* NEW: 3 columns on small screens */
        grid-gap: 2px;                              /* NEW: Smaller gap */
    }
    
    .nav-link {
        padding: 4px 1px;                           /* NEW: Even smaller padding */
        font-size: 8px;                             /* NEW: Smaller font */
    }
    
    .nav-link i {
        font-size: 12px;                            /* NEW: Smaller icons */
        margin-bottom: 1px;                         /* NEW: Minimal spacing */
    }
    
    .nav-link span {
        font-size: 7px;                             /* NEW: Very small text */
    }
    
    .main-content {
        margin-bottom: 90px;                        /* NEW: More space for 3-column layout */
    }

    .nav-logo {
        font-size: 1.2rem;
    }
    
    .nav-logo span {
        display: none;
    }
    
    .transaction-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .transaction-content {
        text-align: center;
    }
    
    .transaction-amount {
        text-align: center;
        font-size: 1.2rem;
    }

    /* Very Small Screens - Hide some columns */
    .expenses-table th:nth-child(4),
    .expenses-table td:nth-child(4),
    .expenses-table th:nth-child(5),
    .expenses-table td:nth-child(5) {
        display: none;
    }
    
    .expense-title {
        min-width: 100px;
    }
    
    .amount-value {
        font-size: 14px;
    }
}

.expenses-table th:nth-child(1),
.expenses-table td:nth-child(1) { width: 20%; }  /* Title */

.expenses-table th:nth-child(2),
.expenses-table td:nth-child(2) { width: 12%; }  /* Amount */

.expenses-table th:nth-child(3),
.expenses-table td:nth-child(3) { width: 12%; }  /* Category */

.expenses-table th:nth-child(4),
.expenses-table td:nth-child(4) { width: 12%; }  /* Date */

.expenses-table th:nth-child(5),
.expenses-table td:nth-child(5) { width: 12%; }  /* Paid By */

.expenses-table th:nth-child(6),
.expenses-table td:nth-child(6) { width: 22%; }  /* Split Details */

.expenses-table th:nth-child(7),
.expenses-table td:nth-child(7) { width: 10%; }  /* Actions */

/* Bottom Navigation for Mobile */
@media (max-width: 768px) {
.navbar {
        top: auto;
        bottom: 0;
        padding: 0;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(15px);
        height: auto;                               /* CHANGED: Allow flexible height */
    }
    
    .nav-container {
        height: auto;                               /* CHANGED: Remove fixed height */
        max-width: 100%;
        padding: 8px 4px;                           /* CHANGED: Add padding */
    }
    
    .nav-logo {
        display: none;
    }
    
    .nav-links {
        display: grid;                              /* CHANGED: From flex to grid */
        grid-template-columns: repeat(4, 1fr);      /* NEW: 4 columns per row */
        grid-gap: 4px;                              /* NEW: Gap between items */
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .nav-link {
        flex-direction: column;
        padding: 6px 2px;                           /* CHANGED: Smaller padding */
        font-size: 9px;                             /* CHANGED: Smaller font */
        min-width: auto;                            /* CHANGED: Remove min-width */
        border-radius: 6px;                         /* CHANGED: Smaller radius */
        margin: 0;                                  /* CHANGED: Remove margins */
        text-align: center;
        position: relative;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link i {
        font-size: 14px;                            /* CHANGED: Smaller icons */
        margin-bottom: 2px;                         /* CHANGED: Less spacing */
        display: block;
    }
    
    .nav-link span {
        display: block;
        font-size: 8px;                             /* CHANGED: Smaller text */
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    /* NEW: Mobile Text Display */
    .nav-text-full {
        display: none;                              /* NEW: Hide full text on mobile */
    }
    
    .nav-text-short {
        display: block;                             /* NEW: Show short text on mobile */
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 107, 53, 0.2);
        color: #ff6b35;
        transform: translateY(-1px);
    }
    
    .main-content {
        margin-top: 0;
        margin-bottom: 80px;                        /* CHANGED: More space for taller nav */
        padding-top: 20px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
        padding: 16px;
    }
    
    .chart-container canvas {
        max-height: 220px;
    }
    
    /* Section Headers Mobile */
    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    /* Settlement Mobile */
    .settlement-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .settlement-info {
        justify-content: center;
    }
    
    .settlement-amount {
        text-align: center;
    }
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.balance-card {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
}

.balance-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #333;
}

.balance-header i {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.owes-you .balance-header i {
    background: #28a745;
    color: white;
}

.you-owe .balance-header i {
    background: #dc3545;
    color: white;
}

.balance-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
}

.balance-list {
    padding: 0;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.balance-item:last-child {
    border-bottom: none;
}

.balance-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #333;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: #ffffff;
}

.balance-amount {
    font-weight: bold;
    font-size: 1.1rem;
}

.balance-amount.positive {
    color: #28a745;
}

.balance-amount.negative {
    color: #dc3545;
}

.balance-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

.balance-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #28a745;
}

.balance-empty p {
    margin: 0;
    font-style: italic;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #333;
    height: 350px;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #ff6b35;
    text-align: center;
}

.chart-container canvas {
    max-height: 280px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    color: #ffffff;
}

/* Settlement Styles */
.settlement-card {
    border-left: 4px solid #ff6b35;
}

.settlement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.settlement-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settlement-info h3 {
    margin: 0;
    color: #ffffff;
}

.settlement-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.settlement-badge.paid {
    background: #dc3545;
    color: white;
}

.settlement-badge.received {
    background: #28a745;
    color: white;
}

.settlement-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff6b35;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #333;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #ffffff;
}

.empty-state p {
    margin: 0;
    font-style: italic;
}

/* Settlement Actions Styling */
.settlement-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settlement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* Changed from center to flex-start */
    margin-bottom: 16px;
}

.settlement-actions .action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.settlement-actions .btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.settlement-actions .btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.settlement-actions .btn-delete:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
}

.settlement-actions .settlement-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff6b35;
    margin: 0;  /* Remove default margins */
}

/* NEW TABLE STYLES - ADD ALL OF THIS */

/* Table Styles for Expenses */
.table-container {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    overflow-x: auto;
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
    table-layout: fixed;           
}

.expenses-table thead {
    background: rgba(255, 107, 53, 0.1);
    border-bottom: 2px solid #ff6b35;
}

.expenses-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #ff6b35;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    vertical-align: middle;        /* ADD: This line */
    border-right: 1px solid #333;  /* ADD: This line */

}

.expenses-table th:last-child {
    border-right: none;            /* ADD: Remove border from last column */
}

.expenses-table td {
    padding: 20px 12px;            /* CHANGE FROM: 16px 12px TO: 20px 12px */
    border-bottom: 1px solid #333;
    border-right: 1px solid #333;  /* ADD: This line */
    vertical-align: middle;        /* CHANGE FROM: top TO: middle */
    text-align: left;             /* ADD: This line */
    word-wrap: break-word;        /* ADD: This line */
    height: auto;                  /* ADD: This line */
    box-sizing: border-box;        /* ADD: This line */
}

.expenses-table td:last-child {
    border-right: none;            /* ADD: Remove border from last column */
    padding: auto;
}

.expense-row {
    transition: background 0.3s ease;
}

.expense-row:hover {
    background: rgba(255, 107, 53, 0.05);
}

.expense-row:last-child td {
    border-bottom: none;
}

/* Table Cell Specific Styles */
/* .expense-title {
    min-width: 150px;
    max-width: 200px;
} */

.title-content strong {
    color: #ffffff;
    display: block;
    margin-bottom: 4px;
}

.expense-description {
    color: #888;
    font-size: 12px;
    font-style: italic;
}

.expense-amount {
    text-align: center;            /* CHANGE FROM: right TO: center */
    width: 100%;                   
}

.amount-value {
    font-weight: bold;
    color: #ff6b35;
    font-size: 18px;               /* CHANGE FROM: 16px TO: 18px */
    display: block;      
}

.expense-category {
    text-align: center;            /* ADD: This line */
    width: 100%; 
}

.category-badge {
    padding: 6px 8px;                          /* CHANGE: Reduced padding */
    border-radius: 12px;
    font-size: 11px;                           /* CHANGE: Smaller font */
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;                          /* ADD: Handle overflow */
    text-overflow: ellipsis;                   /* ADD: Show ellipsis */
    max-width: 100%;                           /* ADD: Constrain width */
    box-sizing: border-box;                    /* ADD: Include padding */
}

.category-food { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.category-utilities { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.category-rent { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.category-entertainment { background: rgba(230, 126, 34, 0.2); color: #e67e22; }
.category-shopping { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.category-transportation { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.category-other { background: rgba(149, 165, 166, 0.2); color: #95a5a6; }

.expense-date {
    text-align: center;            /* ADD: This line */
    color: #cccccc;
    font-size: 14px;               /* CHANGE FROM: 13px TO: 14px */
    width: 100%;  
}

.expense-payer {
    text-align: center;            /* ADD: This line */
    width: 100%;
}

.payer-info {
    display: flex;
    align-items: center;
    justify-content: center;       /* ADD: This line */
    gap: 8px;
    color: #cccccc;
}

.payer-info i {
    color: #ff6b35;
    font-size: 12px;
}

.payer-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;                    /* CHANGED: Increased gap for avatar */
    color: #cccccc;
}

.payer-avatar {
    width: 32px;                 /* ADD: Avatar container */
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ff6b35;
    flex-shrink: 0;
}

.payer-avatar img {
    width: 100%;                 /* ADD: Avatar image styling */
    height: 100%;
    object-fit: cover;
}

.payer-name {
    font-size: 13px;             /* ADD: Username styling */
    font-weight: 500;
    color: #ffffff;
    text-align: center;
}

.expense-splits {
    min-width: 150px;
    max-width: 200px;
}

.splits-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.split-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
}

.split-user {
    color: #cccccc;
    flex: 1;
}

.split-amount {
    color: #ff6b35;
    font-weight: bold;
    font-size: 11px;
}

.expense-actions {
    min-width: 100%;
    
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    height: 100%;                  /* ADD: This line */
    margin: 0;                     /* ADD: This line */
    padding: 0; 
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-edit {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.btn-edit:hover {
    background: rgba(52, 152, 219, 0.3);
    transform: translateY(-1px);
}

.btn-delete {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-delete:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: translateY(-1px);
}

/* Empty Table State */
.empty-table {
    padding: 60px 20px;
}

.empty-table .empty-state {
    text-align: center;
    color: #888;
}

.empty-table .empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #333;
}

.empty-table .empty-state h3 {
    margin-bottom: 10px;
    color: #ffffff;
}

.empty-table .empty-state p {
    margin-bottom: 20px;
    font-style: italic;
}

/* END NEW TABLE STYLES */