/* === style.css === */
/* Phiên bản đầy đủ - Bao gồm Auth Placeholders, User Menu & All Fixes + Project Prepayment UI */

/* --- 1. Variables & Base Setup --- */
:root {
    /* Colors - Light Mode (Default) */
    --bg-color: #f9fafb;        /* Gray 50 */
    --surface-color: #ffffff;   /* White */
    --primary-accent: #10b981;  /* Emerald 500 */
    --primary-accent-darker: #059669; /* Emerald 600 */
    --primary-accent-light: #ecfdf5; /* Emerald 50 */
    --text-primary: #1f2937;    /* Gray 800 */
    --text-secondary: #4b5563;  /* Gray 600 */
    --text-muted: #9ca3af;     /* Gray 400 */
    --border-color: #e5e7eb;    /* Gray 200 */
    --input-bg: var(--surface-color);
    --error-color: #ef4444;     /* Red 500 */
    --error-bg-color: #fee2e2;  /* Red 50 */
    --link-color: #2563eb;      /* Blue 600 */
    --focus-ring-color: rgba(16, 185, 129, 0.3);
    --button-primary-text: var(--surface-color);
    --section-header-bg: transparent;
    --section-header-bg-expanded: #f9fafb;
    --item-hover-bg: #f9fafb;
    /* Chart Colors */
    --chart-green: rgba(16, 185, 129, 0.6);
    --chart-green-border: rgb(16, 185, 129);
    --chart-red: rgba(239, 68, 68, 0.6);
    --chart-red-border: rgb(239, 68, 68);
    --chart-grid-color: var(--border-color);
    --chart-tick-color: var(--text-secondary);
    --chart-tooltip-bg: rgba(31, 41, 55, 0.85);
    --chart-tooltip-text: #ffffff;
    /* Tag Colors */
    --tag-bg-color: var(--primary-accent-light);
    --tag-text-color: var(--primary-accent-darker);

    /* Typography */
    --font-sans: 'Roboto', sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.6;

    /* Spacing */
    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
    --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;

    /* Borders & Shadows */
    --border-radius-sm: 4px; --border-radius-md: 6px; --border-radius-lg: 8px; --border-radius-full: 9999px;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-speed-fast: 0.15s;
    --transition-speed-normal: 0.3s;
    --transition-timing: ease-in-out;
    --transition-colors: background-color var(--transition-speed-normal) var(--transition-timing),
                         color var(--transition-speed-normal) var(--transition-timing),
                         border-color var(--transition-speed-normal) var(--transition-timing);
}

/* --- Dark Mode Variables --- */
body.dark-mode {
    --bg-color: #111827;
    --surface-color: #1f2937;
    --primary-accent-light: rgba(16, 185, 129, 0.1);
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    --border-color: #4b5563;
    --input-bg: #374151;
    --error-color: #f87171;
    --error-bg-color: rgba(239, 68, 68, 0.1);
    --link-color: #60a5fa;
    --focus-ring-color: rgba(16, 185, 129, 0.4);
    --section-header-bg-expanded: #1f2937;
    --item-hover-bg: #374151;
    /* Chart Colors Dark */
    --chart-green: rgba(16, 185, 129, 0.7);
    --chart-green-border: rgb(16, 185, 129);
    --chart-red: rgba(248, 113, 113, 0.7);
    --chart-red-border: rgb(248, 113, 113);
    --chart-grid-color: var(--border-color);
    --chart-tick-color: var(--text-secondary);
    --chart-tooltip-bg: rgba(243, 244, 246, 0.9);
    --chart-tooltip-text: #1f2937;
    /* Tag Colors Dark */
    --tag-bg-color: rgba(16, 185, 129, 0.2);
    --tag-text-color: #6ee7b7;
    /* Dark shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.15), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Base Setup */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: var(--font-size-base); }
body { font-family: var(--font-sans); background-color: var(--bg-color); color: var(--text-primary); line-height: var(--line-height-base); padding-bottom: var(--space-12); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transition: var(--transition-colors); }
.container { max-width: 700px; margin: var(--space-8) auto; padding: 0 var(--space-4); }

/* --- 2. Header & Actions --- */
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); padding: 0 var(--space-2); }
h1 { font-size: 1.875rem; font-weight: 700; color: var(--primary-accent-darker); margin: 0; transition: color var(--transition-speed-normal); display: inline-flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
body.dark-mode h1 { color: var(--primary-accent); }
h1 svg { width: 1em; height: 1em; opacity: 0.8;}
.header-actions { display: flex; align-items: center; gap: var(--space-2); }
/* User Menu Styles */
.user-menu { position: relative; }
.user-menu-trigger { display: inline-flex; align-items: center; gap: var(--space-2); background: none; border: none; padding: var(--space-1) var(--space-2); border-radius: var(--border-radius-md); cursor: pointer; transition: background-color var(--transition-speed-fast); text-align: left; }
.user-menu-trigger:hover, .user-menu-trigger[aria-expanded="true"] { background-color: var(--item-hover-bg); }
body.dark-mode .user-menu-trigger:hover, body.dark-mode .user-menu-trigger[aria-expanded="true"] { background-color: var(--surface-color); }
.user-menu-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring-color); }
.user-avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--border-radius-full); background-color: var(--border-color); color: var(--text-secondary); overflow: hidden; }
.user-avatar-placeholder svg { width: 65%; height: 65%; }
body.dark-mode .user-avatar-placeholder { background-color: var(--text-muted); color: var(--surface-color); }
.user-avatar-placeholder.small { width: 36px; height: 36px; flex-shrink: 0; }
.user-menu-trigger .user-name { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); transition: color var(--transition-speed-normal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
body.dark-mode .user-menu-trigger .user-name { color: var(--text-primary); }
/* Dropdown Menu Content */
.dropdown-menu { position: absolute; top: calc(100% + var(--space-2)); right: 0; z-index: 50; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); min-width: 240px; padding: var(--space-3) 0; opacity: 1; visibility: visible; /* Controlled by display: none/block in JS */ }
.dropdown-header { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-1); }
.dropdown-header .user-details { display: flex; flex-direction: column; min-width: 0; }
.dropdown-header .user-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-header .user-email { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
body.dark-mode .dropdown-header .user-name { color: var(--text-primary); } body.dark-mode .dropdown-header .user-email { color: var(--text-muted); }
.dropdown-divider { border: none; border-top: 1px solid var(--border-color); margin: var(--space-3) 0; }
.dropdown-item { display: flex; align-items: center; width: 100%; padding: var(--space-3) var(--space-4); font-size: 0.9rem; color: var(--text-secondary); background: none; border: none; text-align: left; cursor: pointer; white-space: nowrap; transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast); text-decoration: none; }
.dropdown-item svg { margin-right: var(--space-3); opacity: 0.6; color: currentColor; flex-shrink: 0; width: 16px; height: 16px; }
.dropdown-item:hover { background-color: var(--item-hover-bg); color: var(--text-primary); } .dropdown-item:hover svg { opacity: 0.8; }
.dropdown-item:focus-visible { outline: none; background-color: var(--item-hover-bg); color: var(--text-primary); box-shadow: inset 0 0 0 2px var(--focus-ring-color); } .dropdown-item:focus-visible svg { opacity: 0.8; }
body.dark-mode .dropdown-item { color: var(--text-secondary); } body.dark-mode .dropdown-item:hover { background-color: var(--surface-color); color: var(--text-primary); } body.dark-mode .dropdown-item:focus-visible { background-color: var(--surface-color); color: var(--text-primary); }
#logout-btn-dropdown:hover, #logout-btn-dropdown:focus-visible { color: var(--error-color); background-color: var(--error-bg-color); }
#logout-btn-dropdown:hover svg, #logout-btn-dropdown:focus-visible svg { color: var(--error-color); opacity: 1; }
body.dark-mode #logout-btn-dropdown:hover, body.dark-mode #logout-btn-dropdown:focus-visible { color: var(--error-color); background-color: var(--error-bg-color); }
body.dark-mode #logout-btn-dropdown:hover svg, body.dark-mode #logout-btn-dropdown:focus-visible svg { color: var(--error-color); opacity: 1; }
/* Base Icon Button Style */
.icon-button { background: none; border: none; padding: var(--space-2); cursor: pointer; color: var(--text-secondary); border-radius: var(--border-radius-full); display: flex; align-items: center; justify-content: center; transition: background-color var(--transition-speed-fast), color var(--transition-speed-fast); line-height: 1; box-shadow: none !important; flex-shrink: 0; }
.icon-button:hover { background-color: var(--border-color); color: var(--text-primary); } .icon-button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring-color) !important; } .icon-button svg { width: 20px; height: 20px; display: block; } body.dark-mode .icon-button:hover { background-color: var(--surface-color); color: var(--text-primary); }
/* Theme Toggle Specific */
.theme-toggle svg { transition: transform var(--transition-speed-normal) ease; } .theme-toggle:hover svg { transform: rotate(15deg) scale(1.1); } .theme-toggle .moon-icon { display: none; } .theme-toggle .sun-icon { display: block; } body.dark-mode .theme-toggle .moon-icon { display: block; } body.dark-mode .theme-toggle .sun-icon { display: none; }

/* --- 3. Typography --- */
h2 { font-size: 1.25rem; font-weight: 500; text-align: left; color: var(--text-primary); transition: color var(--transition-speed-normal); }
h3 { font-size: 1.125rem; font-weight: 500; margin-top: var(--space-6); margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-color); color: var(--text-secondary); transition: color var(--transition-speed-normal), border-color var(--transition-speed-normal); }
label { display: block; margin-bottom: var(--space-2); font-weight: 500; font-size: 0.875rem; color: var(--text-secondary); transition: color var(--transition-speed-normal); }
small { display: block; font-size: 0.875rem; color: var(--text-muted); margin-top: var(--space-1); transition: color var(--transition-speed-normal); }
a { color: var(--link-color); text-decoration: none; } a:hover { text-decoration: underline; }

/* --- 4. Buttons (Standard - Not Icon Buttons) --- */
button:not(.icon-button), input[type="submit"] { display: inline-flex; align-items: center; justify-content: center; padding: var(--space-3) var(--space-5); border: 1px solid transparent; border-radius: var(--border-radius-md); font-family: inherit; font-size: 0.9375rem; font-weight: 500; line-height: 1.25; cursor: pointer; transition: background-color var(--transition-speed-fast) var(--transition-timing), border-color var(--transition-speed-fast) var(--transition-timing), color var(--transition-speed-fast) var(--transition-timing), box-shadow var(--transition-speed-fast) var(--transition-timing), transform var(--transition-speed-fast) ease; text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; }
button:not(.icon-button):focus-visible, input[type="submit"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring-color); }
button:not(.icon-button):disabled, input[type="submit"]:disabled { opacity: 0.65; cursor: not-allowed; box-shadow: none; }
#save-expense-btn, #save-participant-btn, #save-group-btn, #save-project-btn { background-color: var(--primary-accent); color: var(--button-primary-text); box-shadow: var(--shadow-sm); } /* Add save-project-btn */
#save-expense-btn:hover, #save-participant-btn:hover, #save-group-btn:hover, #save-project-btn:hover { background-color: var(--primary-accent-darker); box-shadow: var(--shadow-md); transform: translateY(-1px); }
#save-expense-btn:active, #save-participant-btn:active, #save-group-btn:active, #save-project-btn:active { transform: translateY(0) scale(0.98); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); }
#cancel-edit-btn, #cancel-edit-participant-btn, #cancel-edit-group-btn, #cancel-edit-project-btn { background-color: var(--surface-color); color: var(--text-secondary); border: 1px solid var(--border-color); box-shadow: var(--shadow-xs); } /* Add cancel-edit-project-btn */
#cancel-edit-btn:hover, #cancel-edit-participant-btn:hover, #cancel-edit-group-btn:hover, #cancel-edit-project-btn:hover { background-color: var(--bg-color); border-color: var(--text-muted); box-shadow: var(--shadow-sm); }
#cancel-edit-btn:active, #cancel-edit-participant-btn:active, #cancel-edit-group-btn:active, #cancel-edit-project-btn:active { transform: scale(0.98); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
.expense-actions button, .participant-setting-actions button, .group-setting-actions button, .project-setting-actions button { background-color: transparent; border: none; color: var(--text-muted); padding: var(--space-1); margin: 0; margin-left: var(--space-1); font-size: 1rem; border-radius: var(--border-radius-sm); line-height: 1; vertical-align: middle; box-shadow: none !important; transition: color var(--transition-speed-fast), background-color var(--transition-speed-fast); } /* Add project-setting-actions */
.expense-actions button:hover, .participant-setting-actions button:hover, .group-setting-actions button:hover, .project-setting-actions button:hover { color: var(--text-primary); background-color: var(--border-color); transform: none; }
.expense-actions .delete-btn:hover, .participant-setting-actions .delete-participant-btn:hover, .group-setting-actions .delete-group-btn:hover, .project-setting-actions .delete-project-btn:hover { color: var(--error-color) !important; background-color: var(--error-bg-color) !important; } /* Add project delete hover */
.close-qr-btn { font-size: 0.875rem; padding: var(--space-1) var(--space-2); color: var(--text-secondary); background-color: var(--surface-color); border: 1px solid var(--border-color); box-shadow: var(--shadow-xs); margin-top: var(--space-3); }
.close-qr-btn:hover { background-color: var(--bg-color); border-color: var(--text-muted); box-shadow: var(--shadow-sm); color: var(--text-primary); }

/* --- 5. Forms & Inputs --- */
.form-group { margin-bottom: var(--space-5); }
/* Style chung cho input thường */
input[type="text"]:not(.tagify__input):not(.member-search-input):not(.settings-search-input),
input[type="email"], input[type="tel"], input[type="number"], input[type="datetime-local"],
input[type="search"], input[type="date"], select, textarea {
    display: block; width: 100%; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: var(--space-3) var(--space-4);
    font-size: 1rem; color: var(--text-primary); background-color: var(--input-bg); box-shadow: var(--shadow-xs);
    transition: var(--transition-colors), box-shadow var(--transition-speed-fast), border-color var(--transition-speed-fast);
    line-height: 1.5; box-sizing: border-box;
}
/* Password Input Wrapper */ .password-wrapper { display: flex; align-items: center; width: 100%; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); background-color: var(--input-bg); transition: border-color var(--transition-speed-fast), box-shadow var(--transition-speed-fast); position: relative; box-sizing: border-box; height: auto; line-height: normal; }
.password-wrapper:focus-within { border-color: var(--primary-accent); box-shadow: 0 0 0 3px var(--focus-ring-color); } .password-wrapper.invalid-wrapper { border-color: var(--error-color) !important; box-shadow: 0 0 0 1px var(--error-color) !important; }
/* Input bên trong wrapper */ .password-wrapper input[type="password"], .password-wrapper input[type="text"] { flex: 1 1 0; min-width: 0; width: auto; border: none; border-radius: 0; background-color: transparent; box-shadow: none; outline: none; padding: var(--space-3) var(--space-4); font-size: 1rem; color: var(--text-primary); line-height: 1.5; box-sizing: border-box; height: auto; opacity: 1; visibility: visible; z-index: 1; pointer-events: auto; }
/* Nút toggle */ .toggle-password { flex-shrink: 0; width: auto; align-self: stretch; background: none; border: none; border-left: 1px solid var(--border-color); border-radius: 0; padding: 0 var(--space-3); margin: 0; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: color var(--transition-speed-fast), background-color var(--transition-speed-fast); box-sizing: border-box; z-index: 2; min-height: calc(1rem * 1.5 + var(--space-3) * 2); }
.toggle-password:hover { color: var(--text-secondary); } .toggle-password:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus-ring-color); } body.dark-mode .toggle-password:hover { background-color: rgba(255,255,255,0.05); }
/* Các loại input khác */ textarea { resize: vertical; } input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
/* Placeholder chung */ input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; font-style: normal; transition: color var(--transition-speed-normal); }
body.dark-mode input::placeholder, body.dark-mode textarea::placeholder { color: var(--text-muted); opacity: 0.8; }
/* Focus chung */ input:not(.tagify__input):not(.password-wrapper input):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 0 3px var(--focus-ring-color); }
/* Invalid chung */ input:not(.password-wrapper input).invalid, select.invalid, textarea.invalid { border-color: var(--error-color) !important; background-color: var(--error-bg-color) !important; box-shadow: 0 0 0 1px var(--error-color) !important; }
.error-message { color: var(--error-color); font-size: 0.875rem; margin-top: var(--space-1); min-height: 1.25em; }

/* --- Tagify Input Styling --- */
.tagify { display: flex; flex-wrap: wrap; align-items: start; gap: var(--space-1); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: var(--space-2); background-color: var(--input-bg); min-height: calc(1rem * 1.5 + var(--space-3) * 2 + 2px); box-shadow: var(--shadow-xs); width: 100%; box-sizing: border-box; transition: var(--transition-colors), border-color var(--transition-speed-fast), box-shadow var(--transition-speed-fast); --tags-border-color: var(--border-color); --tags-hover-border-color: var(--primary-accent); --tags-focus-border-color: var(--primary-accent); --tag-bg: var(--primary-accent-light); --tag-text-color: var(--primary-accent-darker); --tag-pad: var(--space-1) var(--space-2); --tag-border-radius: var(--border-radius-full); --tags-placeholder-color: var(--text-muted); --tagify-dd-color-primary: var(--primary-accent); --tagify-dd-bg-color: var(--surface-color); --tagify-dd-text-color: var(--text-primary); --tagify-dd-text-color-secondary: var(--text-secondary); }
.tagify:focus-within, .tagify.tagify--focus { border-color: var(--tags-focus-border-color); box-shadow: 0 0 0 3px var(--focus-ring-color); }
.tagify__tag { margin: 0; padding: var(--tag-pad); background-color: var(--tag-bg); color: var(--tag-text-color); border-radius: var(--tag-border-radius); transition: var(--transition-colors); font-size: 0.875rem; font-weight: 500; display: inline-flex; align-items: center; }
.tagify__tag__removeBtn { color: var(--tag-remove-btn-color); opacity: 0.6; width: 18px; height: 18px; margin-left: var(--space-1); transition: opacity var(--transition-speed-fast), background-color var(--transition-speed-fast); order: 1; background: none; cursor: pointer; }
.tagify__tag__removeBtn:hover { color: var(--error-color); background-color: rgba(210, 50, 50, 0.2); opacity: 1; }
.tagify__input { padding: var(--tag-pad); margin: 0; color: var(--text-primary); background-color: transparent; min-width: 100px; line-height: 1.5; flex-grow: 1; width: auto; box-sizing: border-box; font-size: 1rem; }
/* Placeholder Styling */ .tagify__input::placeholder { color: var(--tags-placeholder-color); opacity: 1; font-style: normal; font-size: 1rem; transition: color var(--transition-speed-normal); }
/* Dark Mode Placeholder - Simulate */ body.dark-mode .tagify:not(.tagify--focus) .tagify__input:empty { color: var(--text-muted); opacity: 0.8; font-style: normal; } body.dark-mode .tagify.tagify--focus .tagify__input, body.dark-mode .tagify .tagify__input:not(:empty) { color: var(--text-primary); opacity: 1; }
/* Tagify Dropdown */ .tagify__dropdown { border-radius: var(--border-radius-md); border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); background-color: var(--tagify-dd-bg-color); transition: var(--transition-colors); z-index: 10; } .tagify__dropdown__item { padding: var(--space-2) var(--space-3); color: var(--tagify-dd-text-color); transition: background-color var(--transition-speed-fast); } .tagify__dropdown__item--active { background-color: var(--primary-accent); color: var(--button-primary-text); } .tagify__dropdown__item:hover { background-color: var(--item-hover-bg); color: var(--text-primary); } body.dark-mode .tagify__dropdown__item:hover { color: var(--text-primary); } body.dark-mode .tagify__dropdown__item--active { color: var(--button-primary-text); }

/* --- 6. iOS Toggle Switch --- */
.toggle-group { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0; } .toggle-group label:first-child { margin-bottom: 0; } .switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #d1d5db; transition: .3s; } .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } input:checked + .slider { background-color: var(--primary-accent); } input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--focus-ring-color); } input:checked + .slider:before { transform: translateX(20px); } .slider.round { border-radius: 34px; } .slider.round:before { border-radius: 50%; } body.dark-mode .slider { background-color: var(--text-muted); } body.dark-mode input:checked + .slider { background-color: var(--primary-accent); }

/* --- 7. Collapsible Sections --- */
.collapsible-section { background-color: var(--surface-color); border-radius: var(--border-radius-lg); margin-bottom: var(--space-6); box-shadow: var(--shadow-md); overflow: hidden; border: 1px solid var(--border-color); transition: var(--transition-colors), box-shadow var(--transition-speed-normal); } .section-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); cursor: pointer; border-bottom: 1px solid transparent; transition: border-color var(--transition-speed-normal) var(--transition-timing), background-color var(--transition-speed-normal); user-select: none; } .collapsible-section.expanded > .section-header { border-bottom-color: var(--border-color); background-color: var(--section-header-bg-expanded); } .section-header-title { display: flex; align-items: center; gap: var(--space-3); flex-grow: 1; min-width: 0; } .section-icon { width: 1.25em; height: 1.25em; flex-shrink: 0; color: var(--primary-accent); transition: color var(--transition-speed-normal); } .section-header h2 { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .section-header:hover .toggle-icon { transform: scale(1.1); } .collapsible-section:not(.expanded) .section-header:hover .toggle-icon { transform: rotate(-45deg) scale(1.1); } .toggle-icon { width: 1rem; height: 1rem; display: inline-block; margin-left: var(--space-4); flex-shrink: 0; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform var(--transition-speed-normal) var(--transition-timing), border-color var(--transition-speed-normal); } .toggle-icon::before, .toggle-icon::after { content: none; } .collapsible-section:not(.expanded) .toggle-icon { transform: rotate(-45deg); } .section-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease-out; padding: 0 var(--space-5); } .collapsible-section.expanded .section-content { max-height: 5000px; padding: var(--space-6) var(--space-5); transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out; }

/* --- 8. Specific Section Content --- */
/* Main Loading Indicator */ #main-loading-indicator { padding: var(--space-8) var(--space-4); text-align: center; font-style: italic; color: var(--text-muted); }
/* Group Selector */ .group-selector-wrapper { margin-bottom: var(--space-6); padding: 0 var(--space-2); } .group-selector-wrapper label { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: var(--space-2); } #group-selector { width: 100%; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); font-size: 1rem; background-color: var(--input-bg); color: var(--text-primary); margin-top: var(--space-1); box-shadow: var(--shadow-xs); transition: var(--transition-colors), border-color var(--transition-speed-fast), box-shadow var(--transition-speed-fast); appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7280'%3e%3cpath fill-rule='evenodd' d='M4.22 6.22a.75.75 0 011.06 0L8 8.94l2.72-2.72a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0L4.22 7.28a.75.75 0 010-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right var(--space-3) center; background-size: 1em; padding-right: var(--space-8); } body.dark-mode #group-selector { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23d1d5db'%3e%3cpath fill-rule='evenodd' d='M4.22 6.22a.75.75 0 011.06 0L8 8.94l2.72-2.72a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0L4.22 7.28a.75.75 0 010-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e"); } #group-selector:focus-visible { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 0 3px var(--focus-ring-color); } #group-loading-message, #no-group-message { font-style: italic; color: var(--text-muted); margin-top: var(--space-1); font-size: 0.9em; } #group-dependent-content.hidden { display: none !important; }
/* Add/Edit Expense Form */ .add-expense-section { padding-top: 0; } .participants-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-3); margin-top: var(--space-2); border: 1px solid transparent; padding: var(--space-1); border-radius: var(--border-radius-sm); transition: border-color var(--transition-speed-fast); } .participant-item { display: flex; align-items: center; padding: var(--space-2) var(--space-3); background-color: var(--bg-color); border-radius: var(--border-radius-md); border: 1px solid var(--border-color); transition: var(--transition-colors), border-color var(--transition-speed-fast); gap: var(--space-3); } .participant-item:hover { border-color: var(--text-muted); background-color: var(--item-hover-bg); } .participant-item label:first-child { margin-bottom: 0; margin-right: 0; flex-grow: 1; cursor: default; font-size: 0.9375rem; color: var(--text-primary); font-weight: 400; min-width: 0; } .participant-item .switch { flex-shrink: 0; } .participants-list.invalid { border-color: var(--error-color) !important; } .no-participant-toggles { font-style: italic; color: var(--text-muted); padding: var(--space-2); } .select-all-participants { display: flex; align-items: center; margin-bottom: var(--space-3); padding: var(--space-1) 0; min-height: 28px; transition: opacity var(--transition-speed-fast); } .select-all-label { margin-left: var(--space-3); font-size: 0.9375rem; color: var(--text-secondary); transition: color var(--transition-speed-normal); } .select-all-participants.disabled { opacity: 0.5; pointer-events: none; } .select-all-participants.disabled .switch { cursor: not-allowed; } .custom-split-section { background-color: var(--bg-color); padding: var(--space-4); border-radius: var(--border-radius-md); margin-top: var(--space-4); border: 1px dashed var(--border-color); transition: var(--transition-colors), border-color var(--transition-speed-fast); } .custom-split-inputs .form-group { display: flex; align-items: center; margin-bottom: var(--space-3); } .custom-split-inputs label { width: auto; min-width: 60px; margin-bottom: 0; margin-right: var(--space-3); white-space: nowrap; flex-shrink: 0; font-size: 0.875rem; text-align: right; color: var(--text-secondary); } .custom-split-inputs input[type="number"] { flex-grow: 1; margin-bottom: 0; font-size: 0.9375rem; padding: var(--space-2) var(--space-3); } .custom-split-section.invalid-section { border-color: var(--error-color) !important; background-color: var(--error-bg-color) !important; border-style: solid; }
/* Manage Participants Section */ .manage-participants-section h3 { margin-top: var(--space-2); } .manage-participants-section form { margin-bottom: var(--space-8); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-color); transition: border-color var(--transition-speed-normal); } .settings-search-input { display: block; width: 100%; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-4); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); font-size: 0.9375rem; background-color: var(--input-bg); color: var(--text-primary); box-shadow: var(--shadow-xs); transition: var(--transition-colors), border-color var(--transition-speed-fast), box-shadow var(--transition-speed-fast); } .settings-search-input:focus-visible { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 0 3px var(--focus-ring-color); } #participants-settings-list { list-style: none; padding: 0; margin-top: var(--space-2); } .participant-setting-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-color); transition: var(--transition-colors), opacity var(--transition-speed-fast); gap: var(--space-3); } .participant-setting-item:last-child { border-bottom: none; } .participant-setting-item.filtered-out { opacity: 0.2; pointer-events: none; } .participant-setting-details { flex-grow: 1; margin-right: 0; font-size: 1rem; min-width: 0; } .participant-setting-details .name { font-weight: 500; color: var(--text-primary); font-size: 0.95rem; } .participant-setting-details .meta-info { display: block; font-size: 0.875rem; color: var(--text-secondary); margin-top: var(--space-1); } .participant-setting-details .phone { margin-right: var(--space-2); } .participant-setting-details .account .bank { color: var(--text-muted); margin-left: var(--space-1); } .participant-setting-details .participant-tags-container { margin-top: var(--space-1); line-height: 1.5; display: flex; flex-wrap: wrap; gap: var(--space-1); } .participant-setting-actions { flex-shrink: 0; padding-top: 0; } .no-participants { text-align: center; padding: var(--space-4); color: var(--text-muted); font-style: italic; }
/* Manage Groups Section */ .manage-groups-section h3 { margin-top: var(--space-2); } .manage-groups-section form { margin-bottom: var(--space-8); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-color); transition: border-color var(--transition-speed-normal); } .member-search-input { width: 100%; padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); font-size: 0.9375rem; background-color: var(--input-bg); color: var(--text-primary); box-shadow: var(--shadow-xs); transition: var(--transition-colors), border-color var(--transition-speed-fast), box-shadow var(--transition-speed-fast); } .member-search-input:focus-visible { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 0 3px var(--focus-ring-color); } .participant-checkbox-list { max-height: 250px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); padding: var(--space-2) var(--space-3); margin-top: var(--space-2); background-color: var(--bg-color); transition: var(--transition-colors); } .participant-checkbox-list .participant-check-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) 0; transition: opacity var(--transition-speed-fast); } .participant-checkbox-list .participant-check-item:not(:last-child) { border-bottom: 1px dotted var(--border-color); transition: border-color var(--transition-speed-normal); } .participant-checkbox-list .form-check-label { margin-left: 0; margin-right: var(--space-3); font-weight: 400; color: var(--text-primary); cursor: default; transition: color var(--transition-speed-normal); flex-grow: 1; pointer-events: none; user-select: none; min-width: 0; } .participant-checkbox-list .no-participant-options { color: var(--text-muted); font-style: italic; text-align: center; padding: var(--space-2); } .participant-checkbox-list .participant-check-item.filtered-out { display: none; } #groups-settings-list { list-style: none; padding: 0; margin-top: var(--space-4); } .group-setting-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-color); transition: var(--transition-colors); gap: var(--space-3); } .group-setting-item:last-child { border-bottom: none; } .group-setting-details { flex-grow: 1; margin-right: 0; min-width: 0; } .group-setting-details .name { font-weight: 500; color: var(--text-primary); font-size: 0.95rem; } .group-setting-details .members.participant-tags-container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-top: var(--space-1); line-height: 1.5; } .group-setting-details .members .members-label { font-weight: 500; color: var(--text-secondary); margin-right: var(--space-1); flex-shrink: 0; font-size: 0.8rem; padding-bottom: 1px; } .group-setting-actions { flex-shrink: 0; padding-top: 0; } .no-groups { text-align: center; padding: var(--space-4); color: var(--text-muted); font-style: italic; }
/* Manage Projects Section */ .manage-projects-section h3 { margin-top: var(--space-2); } .manage-projects-section form { margin-bottom: var(--space-8); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-color); transition: border-color var(--transition-speed-normal); } #projects-settings-list { list-style: none; padding: 0; margin-top: var(--space-4); } .project-setting-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-color); transition: var(--transition-colors); gap: var(--space-3); } .project-setting-item:last-child { border-bottom: none; } .project-setting-details { flex-grow: 1; margin-right: 0; min-width: 0; } .project-setting-details .name { font-weight: 500; color: var(--text-primary); font-size: 0.95rem; } .project-setting-details .description { display: block; font-size: 0.875rem; color: var(--text-secondary); margin-top: var(--space-1); white-space: normal; } .project-setting-details .project-group-link { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: var(--space-1); } .project-setting-details .project-group-link strong { font-weight: 500; color: var(--text-secondary); } .project-setting-actions { flex-shrink: 0; padding-top: 0; } .no-projects { text-align: center; padding: var(--space-4); color: var(--text-muted); font-style: italic; }
.project-prepayments-details {
    font-size: 0.8em; /* Chữ nhỏ hơn một chút */
    color: var(--text-secondary);
    margin-top: var(--space-2);
    padding-left: var(--space-3); /* Thụt lề nhẹ */
    border-left: 2px solid var(--border-color); /* Đường kẻ trái để phân biệt */
}
body.dark-mode .project-prepayments-details {
    border-left-color: var(--text-muted);
}

.project-prepayments-details .prepayment-title {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}
body.dark-mode .project-prepayments-details .prepayment-title {
    color: var(--text-primary);
}


.project-prepayments-details ul {
    list-style: none;
    padding-left: var(--space-2); /* Thụt lề cho danh sách con */
    margin: 0;
}

.project-prepayments-details li {
    padding: 1px 0;
}

.total-prepayment-item {
    margin-top: var(--space-1);
    font-weight: 500;
}
.total-prepayment-item strong {
    color: var(--text-primary); /* Cho tổng tiền đậm hơn */
}
body.dark-mode .total-prepayment-item strong {
    color: var(--text-primary);
}


.treasurer-info-item {
    margin-top: var(--space-1);
    font-style: italic;
}

/* Responsive cho phần chi tiết ứng trước trong danh sách dự án */
@media (max-width: 600px) {
    .project-prepayments-details {
        font-size: 0.75em; /* Có thể giảm thêm nếu cần */
        padding-left: var(--space-2);
    }
    .project-prepayments-details ul {
        padding-left: var(--space-1);
    }
}
/* --- *** Style cho Trạng thái Dự án trong Danh sách *** --- */
.project-status-display {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    margin-left: var(--space-2);
    vertical-align: middle; /* Căn với tên dự án */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status-display.status-active {
    background-color: var(--primary-accent-light);
    color: var(--primary-accent-darker);
    border: 1px solid var(--primary-accent);
}
body.dark-mode .project-status-display.status-active {
    background-color: rgba(16, 185, 129, 0.2); /* Emerald 500 with 20% opacity */
    color: #6ee7b7; /* Lighter Emerald */
    border-color: #34d399; /* Emerald 400 */
}

.project-status-display.status-archived,
.project-status-display.status-completed {
    background-color: var(--border-color); /* Grayish background */
    color: var(--text-secondary);
    border: 1px solid var(--text-muted);
}
body.dark-mode .project-status-display.status-archived,
body.dark-mode .project-status-display.status-completed {
    background-color: var(--surface-color); /* Darker gray */
    color: var(--text-muted);
    border-color: var(--text-muted);
}


/* Responsive cho Trạng thái */
@media (max-width: 600px) {
    .project-setting-details .name {
        display: inline; /* Cho tên và trạng thái cùng hàng nếu đủ chỗ */
    }
    .project-status-display {
        /* margin-left: var(--space-1); */
        /* font-size: 0.7rem; */
    }
}
/* Prepayment Inputs */ .prepayment-inputs-container { margin-top: var(--space-4); padding: var(--space-4); background-color: var(--bg-color); border: 1px dashed var(--border-color); border-radius: var(--border-radius-md); max-height: 250px; overflow-y: auto; } body.dark-mode .prepayment-inputs-container { background-color: var(--surface-color); border-color: var(--text-muted); } .prepayment-input-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; } .prepayment-input-item:not(:last-child) { border-bottom: 1px dotted var(--border-color); } .prepayment-input-item .participant-info { display: flex; align-items: center; gap: var(--space-3); flex-grow: 1; min-width: 0; } .prepayment-input-item .participant-info label { margin-bottom: 0; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } body.dark-mode .prepayment-input-item .participant-info label { color: var(--text-primary); } .prepayment-input-item .prepayment-controls { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; } .prepayment-input-item .toggle-prepayment { transform: scale(0.85); margin-right: calc(-1 * var(--space-1)); cursor: pointer; } .prepayment-input-item input[type="number"] { width: 120px; flex-shrink: 0; padding: var(--space-2) var(--space-3); font-size: 0.9rem; text-align: right; border: 1px solid var(--border-color); border-radius: var(--border-radius-sm); background-color: var(--surface-color); box-shadow: var(--shadow-xs); } body.dark-mode .prepayment-input-item input[type="number"] { background-color: var(--input-bg); border-color: var(--border-color); } .prepayment-input-item input[type="number"].hidden { display: none; } .no-prepayment-options { font-style: italic; color: var(--text-muted); text-align: center; padding: var(--space-2); } .prepayment-summary { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-color); } .total-prepayment { font-size: 0.95rem; text-align: right; color: var(--text-secondary); margin-bottom: var(--space-3); } .total-prepayment strong { color: var(--text-primary); font-weight: 600; } body.dark-mode .total-prepayment strong { color: var(--text-primary); } #project-treasurer-select { margin-top: var(--space-1); /* Kế thừa style select chung */ }

/* Expense List Section */ .expense-list-section ul { margin-top: 0; padding: 0; } li.no-expenses { text-align: center; color: var(--text-muted); padding: var(--space-8) var(--space-4); font-style: italic; background-color: transparent; border-radius: 0; } #expense-list li { padding: 0; margin: 0; list-style: none; border-bottom: 1px solid var(--border-color); transition: border-color var(--transition-speed-normal); } #expense-list li:last-child { border-bottom: none; } .expense-item { background-color: transparent; padding: var(--space-5) 0; display: block; transition: none; } .expense-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-2); gap: var(--space-4); } .expense-name { flex-grow: 1; font-size: 1.125rem; font-weight: 500; color: var(--text-primary); word-break: break-word; line-height: 1.4; transition: color var(--transition-speed-normal); margin-right: var(--space-2); } .expense-actions { flex-shrink: 0; margin: 0; padding: 0; margin-top: 2px; } .expense-item-body { padding-left: 0px; } .expense-item-body .expense-amount { font-size: 1rem; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: var(--space-3); transition: color var(--transition-speed-normal); } .expense-item-body .expense-meta { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); transition: color var(--transition-speed-normal); } .expense-item-body .expense-meta .datetime, .expense-item-body .expense-meta .payer { white-space: nowrap; } .expense-item-body .expense-meta .payer strong { font-weight: 500; color: var(--text-secondary); font-size: 1em; display: inline; transition: color var(--transition-speed-normal); } .participant-tags-container { margin-top: var(--space-2); margin-bottom: var(--space-1); line-height: 1.6; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); } .tag-label { font-size: 0.875rem; color: var(--text-secondary); margin-right: var(--space-2); transition: color var(--transition-speed-normal); } .participant-tag { display: inline-block; background-color: var(--tag-bg-color); color: var(--tag-text-color); padding: var(--space-1) var(--space-2); border-radius: var(--border-radius-full); font-size: 0.8125rem; font-weight: 500; margin-right: var(--space-2); margin-bottom: var(--space-2); white-space: nowrap; transition: var(--transition-colors); line-height: 1.4;} .expense-split-info { margin-top: var(--space-2); margin-bottom: var(--space-3); font-size: 0.875rem; color: var(--text-muted); transition: color var(--transition-speed-normal); } .expense-split-type { margin-right: var(--space-2);} .expense-custom-details-wrapper { display: inline; } .expense-custom-details { color: var(--text-secondary); transition: color var(--transition-speed-normal); } .expense-notes-wrapper { margin-top: var(--space-3); } .expense-notes { font-size: 0.9375rem; color: var(--text-secondary); font-style: normal; padding-left: var(--space-3); border-left: 2px solid var(--border-color); display: block; white-space: pre-wrap; word-break: break-word; line-height: 1.5; transition: var(--transition-colors); } .expense-project-info { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: var(--space-1); font-style: italic; } .expense-project-info strong { font-style: normal; font-weight: 500; color: var(--text-secondary); } body.dark-mode .expense-project-info strong { color: var(--text-secondary); }
/* Filter Controls */ .filter-controls { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; padding: var(--space-4) 0 var(--space-5) 0; margin-bottom: var(--space-4); border-bottom: 1px solid var(--border-color); transition: border-color var(--transition-speed-normal); } .filter-group { display: flex; flex-direction: column; gap: var(--space-1); flex-grow: 1; min-width: 150px; } .filter-group label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0; font-weight: 400; } .filter-group input[type="date"], .filter-group select { padding: var(--space-2) var(--space-3); font-size: 0.9375rem; border-radius: var(--border-radius-sm); box-shadow: none; border-color: var(--border-color); background-color: var(--input-bg); color: var(--text-primary); transition: var(--transition-colors), border-color var(--transition-speed-fast); line-height: 1.4; min-height: calc(1em * 1.4 + var(--space-2) * 2 + 2px); box-sizing: border-box;} .filter-actions { display: flex; gap: var(--space-2); flex-shrink: 0; align-items: center; } .filter-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--space-4); font-size: 0.875rem; border-radius: var(--border-radius-sm); margin: 0; width: auto; height: 36px; cursor: pointer; transition: all var(--transition-speed-fast); border: 1px solid transparent; font-weight: 500; box-sizing: border-box; white-space: nowrap; align-self: center; } .filter-btn.apply { background-color: var(--primary-accent); color: var(--button-primary-text); box-shadow: var(--shadow-xs); border-color: var(--primary-accent); } .filter-btn.apply:hover { background-color: var(--primary-accent-darker); box-shadow: var(--shadow-sm); transform: translateY(-1px); } .filter-btn.apply:active { transform: translateY(0) scale(0.98); box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); } .filter-btn.clear { background-color: var(--surface-color); color: var(--text-secondary); border: 1px solid var(--border-color); box-shadow: var(--shadow-xs); } .filter-btn.clear:hover { background-color: var(--bg-color); border-color: var(--text-muted); box-shadow: var(--shadow-sm); transform: translateY(-1px); } .filter-btn.clear:active { transform: translateY(0) scale(0.98); box-shadow: inset 0 1px 1px rgba(0,0,0,0.05); }
/* Results Section */ .results-section { padding-top: 0; } .results-section ul { margin-top: var(--space-2); padding-left: 0; } .results-section li:last-child { border-bottom: none; }
#summary-list li { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border-color); font-size: 1rem; transition: var(--transition-colors); } #summary-list .positive { color: #16a34a; font-weight: 500; } #summary-list .negative { color: var(--error-color); font-weight: 500; } #summary-list .zero { color: var(--text-muted); } #results-transactions h3, #results-summary h3 { display: block !important; }
#summary-extra-info { font-size: 0.85em; margin-top: var(--space-3); color: var(--text-secondary); padding-left: var(--space-2); } #summary-extra-info ul { list-style: none; padding-left: var(--space-4); margin-top: var(--space-1); }
/* Transaction List Item Layout */ #transactions-list li.transaction-list-item { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border-color); line-height: 1.6; } #transactions-list .transaction-info { margin-bottom: var(--space-2); } #transactions-list .transaction-info span { font-weight: 500; } #transactions-list .transaction-info .debtor { color: var(--error-color); } #transactions-list .transaction-info .creditor { color: #16a34a; } #transactions-list .transaction-info .arrow { color: var(--text-muted); margin: 0 var(--space-1); display: inline-block; } #transactions-list .transaction-info .amount { font-weight: 600; color: var(--text-primary); margin-left: var(--space-1); transition: color var(--transition-speed-normal); }
.transaction-sub-actions { display: flex; justify-content: flex-start; align-items: center; gap: var(--space-4); margin-top: var(--space-1); }
.qr-section-inline { display: flex; flex-direction: column; align-items: flex-start; position: relative; } a.qr-trigger, span.no-qr-info { white-space: nowrap; display: inline-block; color: var(--link-color); font-size: 0.875rem; text-decoration: none; padding: var(--space-1) 0; } a.qr-trigger:hover { text-decoration: underline; } span.no-qr-info { color: var(--text-muted); font-style: italic; }
.qr-code-container { position: absolute; bottom: calc(100% + var(--space-1)); left: 0; z-index: 10; margin-top: 0; padding: var(--space-4); background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); text-align: center; animation: fadeIn 0.3s ease-in-out; transition: var(--transition-colors); width: max-content; max-width: 200px; }
.qr-code-image { display: block; max-width: 160px; height: auto; margin: 0 auto var(--space-3) auto; background-color: white; border-radius: var(--border-radius-sm); box-shadow: var(--shadow-sm); } .qr-description { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: var(--space-3); word-break: break-word; transition: color var(--transition-speed-normal); }
.mark-paid-btn { padding: var(--space-1) var(--space-3); font-size: 0.8rem; line-height: 1.4; border-radius: var(--border-radius-sm); border: 1px solid var(--border-color); background-color: var(--surface-color); color: var(--text-secondary); cursor: pointer; transition: all var(--transition-speed-fast); white-space: nowrap; flex-shrink: 0; vertical-align: middle; } .mark-paid-btn:hover { background-color: var(--item-hover-bg); border-color: var(--text-muted); color: var(--text-primary); box-shadow: var(--shadow-xs); } .mark-paid-btn:active { transform: scale(0.97); box-shadow: none; } .mark-paid-btn:disabled { opacity: 0.7; cursor: not-allowed; background-color: var(--bg-color); } body.dark-mode .mark-paid-btn { background-color: var(--surface-color); border-color: var(--border-color); color: var(--text-secondary); } body.dark-mode .mark-paid-btn:hover { background-color: var(--item-hover-bg); border-color: var(--text-muted); color: var(--text-primary); } body.dark-mode .mark-paid-btn:disabled { background-color: var(--input-bg); }
#no-transactions-message { text-align: center; margin-top: var(--space-4); color: var(--text-muted); font-style: italic; padding: var(--space-4); }
/* Statistics Section */ .stats-section .chart-container { margin-top: var(--space-4); padding: var(--space-4); background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius-md); transition: var(--transition-colors); box-shadow: var(--shadow-sm); } #statsChartCanvas { display: block; width: 100% !important; height: auto !important; } #no-stats-message { text-align: center; margin-top: 1rem; color: var(--text-muted); font-style: italic; padding: var(--space-4); }

/* Fade-in animation */ @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- 9. Footer --- */
footer { text-align: center; margin-top: var(--space-10); padding: var(--space-6) var(--space-4); font-size: 0.875rem; color: var(--text-muted); border-top: 1px solid var(--border-color); transition: var(--transition-colors); }

/* --- 10. Mobile Responsiveness --- */
@media (max-width: 600px) {
    /* Header */ .main-header { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); gap: var(--space-3); } h1 { font-size: 1.125rem; gap: var(--space-1); } .header-actions { gap: var(--space-2); } .user-menu-trigger .user-name { display: none; } .icon-button { padding: var(--space-1); } .icon-button svg { width: 18px; height: 18px; }
    /* Body & Container */ .container { margin: 0; padding: 0; max-width: 100%; } .collapsible-section { margin-bottom: 0; border-radius: 0; box-shadow: none; border-left: none; border-right: none; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); } .collapsible-section:first-of-type { border-top: none; } .collapsible-section:last-of-type { border-bottom: none; } .section-header { padding: var(--space-4) var(--space-4); } .section-content { padding: 0 var(--space-4); } .collapsible-section.expanded .section-content { padding: var(--space-5) var(--space-4); } body { padding-bottom: var(--space-10); font-size: 0.9375rem; }
    /* Typography & Forms */ h2 { font-size: 1.125rem; } h3 { font-size: 1rem; margin-top: var(--space-4); } label { font-size: 0.875rem; margin-bottom: var(--space-1); } input, select, textarea, button:not(.icon-button) { font-size: 1rem; } button:not(.icon-button) { width: 100%; margin-bottom: var(--space-3); margin-right: 0; padding: var(--space-3) var(--space-4); } button:not(.icon-button):last-of-type { margin-bottom: 0; }
    /* Tagify Mobile Fix */ .tagify { gap: var(--space-1) var(--space-2); } .tagify__input { min-width: 80px; font-size: 0.95rem; }
    /* Participant/Group List Icon Fix */ .participant-setting-item, .group-setting-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) 0; gap: var(--space-3); } .participant-setting-details, .group-setting-details { margin-right: 0; margin-bottom: 0; flex-grow: 1; min-width: 0; } .participant-setting-details .name, .group-setting-details .name { font-size: 0.95rem; } .participant-setting-details .meta-info, .participant-setting-details .account, .participant-setting-details .participant-tags-container, .group-setting-details .members.participant-tags-container { font-size: 0.8rem; margin-top: var(--space-1); } .participant-setting-actions, .group-setting-actions { width: auto; text-align: right; flex-shrink: 0; padding-top: 0; }
    /* Expense Add Form Toggle Fix */ .participant-item { gap: var(--space-2); }
    /* Other Layouts */ .participants-list { grid-template-columns: 1fr; gap: var(--space-2); } .custom-split-inputs .form-group { flex-direction: column; align-items: flex-start; } .custom-split-inputs label { width: auto; margin-bottom: var(--space-1); text-align: left; } .participant-checkbox-list { max-height: 150px; }
    /* Prepayments Mobile */ .prepayment-inputs-container { padding: var(--space-3); max-height: 200px; } .prepayment-input-item { gap: var(--space-3); } .prepayment-input-item input[type="number"] { width: 100px; } .total-prepayment { font-size: 0.9rem; text-align: left; } #project-treasurer-select { font-size: 0.9rem; }
    /* Expense List Items */ .expense-item { padding: var(--space-4) 0; } .expense-item-header { margin-bottom: var(--space-3); gap: var(--space-3); align-items: center; } .expense-name { font-size: 1.0625rem; } .expense-actions button { font-size: 1.25rem; margin: 0 0 0 var(--space-2); } .expense-item-body .expense-amount { font-size: 1rem; margin-bottom: var(--space-2); } .expense-item-body .expense-meta { font-size: 0.8125rem; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-2);} .participant-tags-container { margin-top: var(--space-2); margin-bottom: var(--space-2); } .participant-tag { font-size: 0.75rem; padding: var(--space-1) var(--space-2); margin-right: var(--space-1); margin-bottom: var(--space-1); } .expense-split-info, .expense-notes-wrapper { margin-top: var(--space-2); margin-bottom: var(--space-2); } .expense-split-type, .expense-custom-details { font-size: 0.8125rem; } .expense-notes { font-size: 0.875rem; padding-left: var(--space-2); } .expense-project-info { font-size: 0.75rem; }
    /* Transactions Mobile Layout */ #transactions-list li.transaction-list-item { flex-direction: column; align-items: flex-start; gap: var(--space-2); } #transactions-list .transaction-info { margin-right: 0; width: 100%; margin-bottom: 0; } .transaction-sub-actions { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-2); } .qr-section-inline { width: 100%; } .qr-code-container { position: fixed; bottom: var(--space-4); left: 50%; transform: translateX(-50%); top: auto; right: auto; width: 90%; max-width: 300px; } .mark-paid-btn { padding: var(--space-2) var(--space-4); font-size: 0.9rem; width: auto; align-self: flex-start; }
    /* Stats */ .stats-section .chart-container { height: 50vh; max-height: 350px; padding: var(--space-1); background-color: var(--surface-color); }
    /* Footer */ footer { font-size: 0.8125rem; padding: var(--space-5) var(--space-4); }
    /* Filter Buttons on Mobile */ .filter-actions { width: 100%; justify-content: flex-end; padding-bottom: 0; margin-top: var(--space-2); gap: var(--space-3); align-items: center; } .filter-btn { flex-grow: 1; padding: 0 var(--space-3); font-size: 0.8125rem; height: 34px; align-self: center; }
    /* Dropdown on Mobile */ .user-menu-trigger .user-name { display: none; } .dropdown-menu { min-width: 200px; }
}
/* Further responsiveness */
@media (max-width: 768px) { .container { margin: var(--space-6) auto; padding: 0 var(--space-3); } .collapsible-section { margin-bottom: var(--space-5); } }
@media (max-width: 680px) { /* Breakpoint for filter group wrapping */ .filter-controls { gap: var(--space-3); } .filter-group { min-width: calc(50% - var(--space-3) / 2); } }
@media (max-width: 400px) { .filter-group { min-width: 100%; } }