:root {
    --font-family: 'Ariel', sans-serif;
    --bg-primary: #f7f8fc;
    --bg-secondary: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-primary: #4f46e5;
    --accent-primary-light: #e0e7ff;
    --border-color: #e5e7eb;
    --danger-color: #ef4444; /* Added danger color */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --new-ngoflow-header-height: 65px; /* Define the height for the new top bar */
    --transition-fast: 0.2s ease-out;
    --transition-slow: 0.3s ease-in-out;
    --z-index-dropdown: 1000;
    --z-index-notifications: 1050;
    --z-index-tooltip: 1150; /* Ensure tooltips are above most things */
    --z-index-modal: 1100;
    --z-index-navbar: 900;

    /* --- Accounting Specific Variables --- */
    --debit-color: #e74c3c;
    --credit-color: #2ecc71;
    /* ... other accounting vars ... */

    /* Added Button Color Variables */
    --success-color-bg: #d1fae5;
    --success-color: #065f46;
    --success-color-hover: #0f9971;
    --text-on-success: #ffffff;

    /* --danger-color: #ef4444; already exists */
    --danger-color-hover: #d93737;
    --text-on-danger: #ffffff;

    --warning-color: #92400e;
    --warning-color-bg: #fef3c7;
    --warning-color-hover: #d38609;
    --text-on-warning: #1f2937;

    --info-color: #1e40af;
    --info-color-bg: #bfdbfe;
    --info-color-hover: #286fdd;
    --text-on-info: #ffffff;

    --light-color-bg: #f9fafb;
    --light-color-border: #e5e7eb;
    --light-color-text: #374151;
    --light-color-bg-hover: #f3f4f6;
    --light-color-border-hover: #d1d5db;
    --light-color-text-hover: #1f2937;

    --dark-color-bg: #374151;
    --dark-color-border: #4b5563;
    --dark-color-text: #ffffff;
    --dark-color-bg-hover: #1f2937;
    --dark-color-border-hover: #374151;
    --dark-color-text-hover: #ffffff;

    --accent-primary-hover: #4338ca;
    --text-on-primary: #ffffff;

    --bg-primary-hover: #e5e7eb;
    --border-color-hover: #d1d5db;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    /* background-color: var(--bg-primary); */
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    padding: var(--new-ngoflow-header-height) 0;
}
a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { text-decoration: none; color: #3b30cc; }
button { font-family: inherit; cursor: pointer; }

/* --- Main Layout --- */
.app-layout { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-height)); }

/* --- Top Navbar --- */
.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-index-navbar);
    box-shadow: var(--shadow-sm);
    gap: 20px;
}

.navbar-left, .navbar-right { display: flex; align-items: center; gap: 15px; }
.navbar-left { flex-shrink: 0; }
.navbar-right { flex-grow: 1; justify-content: flex-end; }

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: 15px; }
.logo-icon { height: 30px; width: 30px; border-radius: 4px; }
.logo-text { font-size: 1.1rem; font-weight: 600; white-space: nowrap; color: var(--text-primary); }
.logo-highlight { font-weight: 700; color: var(--accent-primary); }

/* Navbar Links / Navigation Items */
.navbar-links { display: flex; align-items: center; gap: 18px; /* INCREASED gap AGAIN */ }
.nav-item { list-style: none; position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 6px;
    position: relative;
}
.nav-link:hover { background-color: var(--bg-primary); color: var(--text-primary); text-decoration: none; }
.nav-item.active > .nav-link { background-color: var(--accent-primary-light); color: var(--accent-primary); font-weight: 600; }
.nav-icon { font-size: 0.95rem; width: 16px; text-align: center; flex-shrink: 0; }
.nav-text { display: inline; }

/* Navigation Dropdowns */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 6px;
    position: relative;
}
.nav-dropdown-toggle:hover, .nav-dropdown.open > .nav-dropdown-toggle { background-color: var(--bg-primary); color: var(--text-primary); }
.nav-dropdown.active > .nav-dropdown-toggle { background-color: var(--accent-primary-light); color: var(--accent-primary); font-weight: 600; }

.dropdown-icon-nav { font-size: 0.7rem; margin-left: 4px; transition: transform var(--transition-fast); }
.nav-dropdown.open > .nav-dropdown-toggle .dropdown-icon-nav { transform: rotate(180deg); }

.nav-dropdown-content {
    /* ... positioning styles unchanged ... */
    display: none; position: absolute; left: 0; top: calc(100% + 5px);
    background-color: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 8px; box-shadow: var(--shadow-md); min-width: 220px;
    z-index: var(--z-index-dropdown); padding: 6px; opacity: 0;
    transform: translateY(-5px); transition: opacity var(--transition-fast), transform var(--transition-fast);
    pointer-events: none; max-height: calc(100vh - var(--header-height) - 20px); overflow-y: auto;
}
.nav-dropdown.open > .nav-dropdown-content { display: block; opacity: 1; transform: translateY(0); pointer-events: auto; }
.nav-dropdown-content .nav-item { margin-bottom: 0; }
.nav-dropdown-content .nav-link { padding: 8px 10px; margin: 2px 0; width: 100%; }
.nav-dropdown-content .nav-link .nav-text { display: inline !important; }
.nav-dropdown-content .nav-item.active > .nav-link { background-color: var(--accent-primary-light); color: var(--accent-primary); font-weight: 600; }

/* Header Actions (Search, Buttons, User Menu) */
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-container { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 10px; color: var(--text-secondary); font-size: 0.85rem; pointer-events: none; }
.search-input { background-color: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 20px; padding: 5px 10px 5px 28px; font-size: 0.85rem; width: 180px; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast), width var(--transition-fast); position: relative; }
.search-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-primary-light); width: 240px; }
.action-btn { background: none; border: none; font-size: 1.05rem; color: var(--text-secondary); padding: 6px; border-radius: 50%; position: relative; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; transition: background-color var(--transition-fast), color var(--transition-fast); flex-shrink: 0; position: relative; }
.action-btn:hover { background-color: var(--bg-primary); color: var(--text-primary); }
#new-top-bar .badge { position: absolute; top: 2px; right: 2px; background-color: #ef4444; color: white; font-size: 0.6rem; font-weight: 600; min-width: 14px; height: 14px; border-radius: 7px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Notification Center, Search Suggestions, User Menu Dropdown */
/* ... styles largely unchanged ... */
.notification-center { position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-height: 500px; background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: var(--z-index-notifications); display: none; opacity: 0; transform: translateY(-10px); transition: opacity var(--transition-fast), transform var(--transition-fast); pointer-events: none; display: flex; flex-direction: column; }
.notification-center.show { display: flex; opacity: 1; transform: translateY(0); pointer-events: auto; }
.notification-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.notification-title { font-weight: 600; font-size: 1rem; }
.notification-clear { color: var(--accent-primary); cursor: pointer; font-size: 0.85rem; font-weight: 500; }
.notification-list { padding: 5px 15px 15px; max-height: 400px; overflow-y: auto; flex-grow: 1; }
.notification-item { padding: 12px 0; border-bottom: 1px solid var(--border-color); display: flex; gap: 10px; }
.notification-item:last-child { border-bottom: none; }
.notification-icon { color: var(--accent-primary); font-size: 1.1rem; margin-top: 2px; width: 20px; text-align: center; flex-shrink: 0; }
.notification-content { flex: 1; font-size: 0.9rem; line-height: 1.4; }
.notification-time { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }
.notification-unread { background-color: var(--accent-primary-light); margin: 0 -15px; padding: 12px 15px; }

.search-suggestions { position: absolute; top: calc(100% + 4px); left: 0; width: 100%; min-width: 250px; background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow-md); z-index: var(--z-index-dropdown); display: none; max-height: 300px; overflow-y: auto; opacity: 0; transform: translateY(-5px); transition: opacity var(--transition-fast), transform var(--transition-fast); pointer-events: none; }
.search-suggestions.show { display: block; opacity: 1; transform: translateY(0); pointer-events: auto; }
.suggestion-item { padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.suggestion-item:hover { background-color: var(--bg-primary); }
.suggestion-icon { color: var(--text-secondary); width: 16px; text-align: center; }
.search-input:focus + .search-suggestions { width: 240px; }

.user-menu-dropdown { position: relative; margin-left: 5px; }
.user-menu-btn { background: none; border: none; display: flex; align-items: center; padding: 4px; border-radius: 6px; transition: background-color var(--transition-fast); gap: 8px; position: relative; }
.user-menu-btn:hover { background-color: var(--bg-primary); }
.user-avatar-large { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-color); background-color: #ccc; display: inline-block; flex-shrink: 0; }
.user-name-display { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); display: none; white-space: nowrap; }
.dropdown-icon { color: var(--text-secondary); font-size: 0.75rem; transition: transform var(--transition-fast); }
.dropdown-content { /* ... positioning unchanged ... */ display: none; position: absolute; right: 0; top: calc(100% + 10px); background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow-md); min-width: 200px; z-index: var(--z-index-dropdown); padding: 0; opacity: 0; transform: translateY(-10px); transition: opacity var(--transition-fast), transform var(--transition-fast); pointer-events: none; }
.user-menu-dropdown.open .dropdown-content { display: block; opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-user-info { padding: 10px 15px; border-bottom: 1px solid var(--border-color); }
.dropdown-user-info strong { display: block; font-size: 0.95rem; font-weight: 600; }
.dropdown-user-info small { font-size: 0.8rem; color: var(--text-secondary); }
.dropdown-content a { display: flex; align-items: center; gap: 10px; padding: 10px 15px; color: var(--text-primary); font-size: 0.9rem; position: relative; }
.dropdown-content a i { width: 16px; text-align: center; color: var(--text-secondary); }
.dropdown-content a:hover { background-color: var(--bg-primary); text-decoration: none; }
.dropdown-content a:hover i { color: var(--accent-primary); }
.dropdown-content hr { border: none; border-top: 1px solid var(--border-color); margin: 6px 0; }
.user-menu-dropdown.open .dropdown-icon { transform: rotate(180deg); }

/* Main Content Area */
/* ... unchanged ... */
.main-content { flex-grow: 1; display: flex; flex-direction: column; min-height: calc(100vh - var(--header-height)); }
.module-content-area { flex-grow: 1; }

/* Footer */
/* ... unchanged ... */
.main-footer { flex-shrink: 0; padding: 15px 25px; border-top: 1px solid var(--border-color); background-color: var(--bg-primary); font-size: 0.8rem; color: var(--text-secondary); text-align: center; margin-top: auto; }
.main-footer a { color: var(--text-secondary); margin: 0 8px; }
.main-footer a:hover { color: var(--accent-primary); }

/* --- Reusable Component Styles --- */
/* ... Card, Button, Table, Form styles largely unchanged ... */
.card { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.card h4 { font-size: 1.05rem; margin-bottom: 15px; font-weight: 600; }
.card p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.card p strong { color: var(--text-primary); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; text-align: center; vertical-align: middle; cursor: pointer; user-select: none; background-color: transparent; border: 1px solid transparent; padding: 0.4rem 0.9rem; font-size: 0.9rem; line-height: 1.4; border-radius: 6px; transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast); position: relative; }
.btn i { font-size: 0.9em; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

/* --- Consolidated Button Styles --- */
.btn-primary {
    color: var(--text-on-primary);
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}
.btn-primary:hover {
    color: var(--text-on-primary);
    background-color: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    color: var(--text-primary);
    background-color: var(--bg-primary-hover);
    border-color: var(--border-color-hover);
}

.btn-success {
    color: var(--text-on-success);
    background-color: var(--success-color);
    border-color: var(--success-color);
}
.btn-success:hover {
    color: var(--text-on-success);
    background-color: var(--success-color-hover);
    border-color: var(--success-color-hover);
}

.btn-danger {
    color: var(--text-on-danger);
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}
.btn-danger:hover {
    color: var(--text-on-danger);
    background-color: var(--danger-color-hover);
    border-color: var(--danger-color-hover);
}

.btn-warning {
    color: var(--text-on-warning);
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}
.btn-warning:hover {
    color: var(--text-on-warning);
    background-color: var(--warning-color-hover);
    border-color: var(--warning-color-hover);
}

.btn-info {
    color: var(--text-on-info);
    background-color: var(--info-color);
    border-color: var(--info-color);
}
.btn-info:hover {
    color: var(--text-on-info);
    background-color: var(--info-color-hover);
    border-color: var(--info-color-hover);
}

.btn-light {
    color: var(--light-color-text);
    background-color: var(--light-color-bg);
    border-color: var(--light-color-border);
}
.btn-light:hover {
    color: var(--light-color-text-hover);
    background-color: var(--light-color-bg-hover);
    border-color: var(--light-color-border-hover);
}

.btn-dark {
    color: var(--dark-color-text);
    background-color: var(--dark-color-bg);
    border-color: var(--dark-color-border);
}
.btn-dark:hover {
    color: var(--dark-color-text-hover);
    background-color: var(--dark-color-bg-hover);
    border-color: var(--dark-color-border-hover);
}

/* Outline Buttons */
.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background-color: transparent;
    width: fit-content;
    margin: auto;
}
.btn-outline-primary:hover {
    color: var(--text-on-primary);
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background-color: transparent;
}
.btn-outline-secondary:hover {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

.btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
    background-color: transparent;
}
.btn-outline-success:hover {
    color: var(--text-on-success);
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background-color: transparent;
}
.btn-outline-danger:hover {
    color: var(--text-on-danger);
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
    background-color: transparent;
}
.btn-outline-warning:hover {
    color: var(--text-on-warning);
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-outline-info {
    color: var(--info-color);
    border-color: var(--info-color);
    background-color: transparent;
}
.btn-outline-info:hover {
    color: var(--text-on-info);
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-outline-light {
    color: var(--light-color-text);
    border-color: var(--light-color-border);
    background-color: transparent;
}
.btn-outline-light:hover {
    color: var(--light-color-text-hover);
    background-color: var(--light-color-bg);
    border-color: var(--light-color-border-hover);
}

.btn-outline-dark {
    color: var(--dark-color-text);
    border-color: var(--dark-color-border);
    background-color: transparent;
}
.btn-outline-dark:hover {
    color: var(--dark-color-text-hover);
    background-color: var(--dark-color-bg);
    border-color: var(--dark-color-border-hover);
}

/* Ensure dark mode overrides are correctly applied */
body.dark-mode .btn-primary {
    color: var(--text-on-primary);
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}
body.dark-mode .btn-primary:hover {
    background-color: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
}

body.dark-mode .btn-secondary {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}
body.dark-mode .btn-secondary:hover {
    background-color: var(--bg-primary-hover);
    border-color: var(--border-color-hover);
}

body.dark-mode .btn-success {
    color: var(--text-on-success);
    background-color: var(--success-color);
    border-color: var(--success-color);
}
body.dark-mode .btn-success:hover {
    color: var(--text-on-success);
    background-color: var(--success-color-hover);
    border-color: var(--success-color-hover);
}

body.dark-mode .btn-danger {
    /* Uses existing --danger-color from dark mode which is #f87171 */
    /* Text on danger might need to be dark if danger color becomes too light */
    color: var(--text-on-danger); /* Assuming white is still good */
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}
body.dark-mode .btn-danger:hover {
    background-color: var(--danger-color-hover);
    border-color: var(--danger-color-hover);
}

body.dark-mode .btn-warning {
    color: var(--text-on-warning);
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}
body.dark-mode .btn-warning:hover {
    background-color: var(--warning-color-hover);
    border-color: var(--warning-color-hover);
}

body.dark-mode .btn-info {
    color: var(--text-on-info);
    background-color: var(--info-color);
    border-color: var(--info-color);
}
body.dark-mode .btn-info:hover {
    background-color: var(--info-color-hover);
    border-color: var(--info-color-hover);
}

body.dark-mode .btn-light { /* Acts as a "darker" light button in dark mode */
    color: var(--light-color-text);
    background-color: var(--light-color-bg);
    border-color: var(--light-color-border);
}
body.dark-mode .btn-light:hover {
    color: var(--light-color-text-hover);
    background-color: var(--light-color-bg-hover);
    border-color: var(--light-color-border-hover);
}

body.dark-mode .btn-dark { /* Acts as a "lighter" dark button in dark mode */
    color: var(--dark-color-text);
    background-color: var(--dark-color-bg);
    border-color: var(--dark-color-border);
}
body.dark-mode .btn-dark:hover {
    color: var(--dark-color-text-hover);
    background-color: var(--dark-color-bg-hover);
    border-color: var(--dark-color-border-hover);
}

/* Dark Mode Outline Buttons */
body.dark-mode .btn-outline-primary {
    color: var(--accent-primary);
}
body.dark-mode .btn-outline-primary:hover {
    color: var(--text-on-primary);
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

body.dark-mode .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}
body.dark-mode .btn-outline-secondary:hover {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

body.dark-mode .btn-outline-success {
    color: var(--success-color);
    border-color: var(--success-color);
}
body.dark-mode .btn-outline-success:hover {
    color: var(--text-on-success);
    background-color: var(--success-color);
    border-color: var(--success-color);
}

body.dark-mode .btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}
body.dark-mode .btn-outline-danger:hover {
    color: var(--text-on-danger);
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

body.dark-mode .btn-outline-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
}
body.dark-mode .btn-outline-warning:hover {
    color: var(--text-on-warning);
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

body.dark-mode .btn-outline-info {
    color: var(--info-color);
    border-color: var(--info-color);
}
body.dark-mode .btn-outline-info:hover {
    color: var(--text-on-info);
    background-color: var(--info-color);
    border-color: var(--info-color);
}

body.dark-mode .btn-outline-light {
    color: var(--light-color-text);
    border-color: var(--light-color-border);
}
body.dark-mode .btn-outline-light:hover {
    color: var(--light-color-text-hover);
    background-color: var(--light-color-bg);
    border-color: var(--light-color-border-hover);
}

body.dark-mode .btn-outline-dark {
    color: var(--dark-color-text);
    border-color: var(--dark-color-border);
}
body.dark-mode .btn-outline-dark:hover {
    color: var(--dark-color-text-hover);
    background-color: var(--dark-color-bg);
    border-color: var(--dark-color-border-hover);
}

/* End of Consolidated Button Styles */

.module-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 10px; }
.module-header h3 { font-size: 1.4rem; font-weight: 600; color: var(--text-primary); margin: 0; flex-grow: 1; }
.module-actions { display: flex; gap: 8px; flex-shrink: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { background-color: var(--bg-secondary); border-radius: 8px; padding: 15px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--accent-primary); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card h4 { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.stat-card .trend { display: flex; align-items: center; font-size: 0.8rem; }
.trend.up { color: #10b981; } .trend.down { color: #ef4444; } .trend i { margin-right: 4px; }
.recent-activity { margin-top: 15px; }
.activity-item { display: flex; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 36px; height: 36px; border-radius: 50%; background-color: var(--accent-primary-light); color: var(--accent-primary); display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0; }
.activity-content { flex-grow: 1; }
.activity-title { font-weight: 500; margin-bottom: 3px; font-size: 0.9rem; }
.activity-meta { font-size: 0.8rem; color: var(--text-secondary); }
.table-container { overflow-x: auto; margin-top: 15px; border: 1px solid var(--border-color); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; vertical-align: middle; }
th { background-color: var(--bg-primary); font-weight: 600; color: var(--text-primary); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: var(--bg-primary); }
.status-badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: 500; line-height: 1.2; }
.status-active { background-color: #d1fae5; color: #065f46; } .status-pending { background-color: #fef3c7; color: #92400e; } .status-inactive { background-color: #fee2e2; color: #991b1b; }
td .btn { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-primary); font-size: 0.9rem; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; background-color: var(--bg-primary); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); font-size: 0.9rem; }
.form-control:focus { border-color: var(--accent-primary); outline: none; box-shadow: 0 0 0 2px var(--accent-primary-light); }
textarea.form-control { min-height: 80px; }
.form-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 18px; }
.form-row .form-group { flex: 1 1 calc(50% - 8px); min-width: 150px; margin-bottom: 0; }
.form-row .form-group.full-width { flex-basis: 100%; }
.chart-container { height: 300px; margin-top: 15px; background-color: var(--bg-secondary); border-radius: 8px; padding: 15px; border: 1px solid var(--border-color); }
.chart-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary); font-size: 1rem; text-align: center; }

/* --- Accounting Specific Styles (Unchanged) --- */
/* ... Accounting styles ... */
.form-toggle { display: flex; margin-bottom: 18px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border-color); }
.form-toggle-btn { flex: 1; padding: 8px 12px; text-align: center; cursor: pointer; background: var(--bg-secondary); color: var(--text-secondary); font-weight: 500; transition: background-color 0.3s, color 0.3s; border-right: 1px solid var(--border-color); font-size: 0.9rem; }
.form-toggle-btn:last-child { border-right: none; }
.form-toggle-btn.active { background: var(--accent-primary); color: white; }
.form-toggle-btn.active#income-toggle { background: var(--income); }
.form-toggle-btn.active#expense-toggle { background: var(--expense); }
.card#transaction-form .card-header { font-size: 1.05rem; font-weight: 600; color: white; padding: 12px 20px; margin: -20px -20px 18px -20px; border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--border-color); }
.card#transaction-form .card-body { padding-top: 0; }
.card#transaction-form button#submit-btn { width: 100%; padding: 10px; font-size: 0.95rem; border: none; border-radius: 6px; color: white; transition: background-color 0.3s; }
.card#transaction-form button#submit-btn.income-btn { background: var(--income); }
.card#transaction-form button#submit-btn.expense-btn { background: var(--expense); }
.card#transaction-form button#submit-btn:hover { opacity: 0.9; }
.payment-method-group { font-size: 0.9rem; }
.payment-method-group .form-label { margin-bottom: 8px; }
.payment-method-group label { margin-right: 15px; cursor: pointer; display: inline-flex; align-items: center; }
.payment-method-group input[type="radio"] { margin-right: 5px; accent-color: var(--accent-primary); }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.3em 1.3em; padding-right: 2.5rem; }
#new-top-bar .badge-income { background: rgba(46, 204, 113, 0.1); color: var(--income); }
#new-top-bar .badge-expense { background: rgba(230, 126, 34, 0.1); color: var(--expense); }
#transaction-form .form-group { display: block; }
#journal-table th.debit-col, #journal-table td.debit-col { text-align: right; color: var(--debit-color); font-weight: 500; }
#journal-table th.credit-col, #journal-table td.credit-col { text-align: right; color: var(--credit-color); font-weight: 500; }
#journal-table td { vertical-align: top; }
#journal-table .account-name { font-weight: 500; }
#journal-table .description-text { font-size: 0.85em; color: var(--text-secondary); }

/* --- Modals, Quick Actions, Help, Shortcuts (Unchanged) --- */
/* ... Modal, QA, Help, Shortcuts styles ... */
.modal { display: none; position: fixed; z-index: var(--z-index-modal); left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(3px); align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-content { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow-lg); position: relative; overflow-y: auto; }
.modal-header { border-bottom: 2px solid var(--border-color); }
.modal-body { padding: 20px 40px; }
.close-modal { position: absolute; top: 10px; right: 15px; color: var(--text-secondary); background: none; border: none; font-size: 24px; font-weight: bold; cursor: pointer; line-height: 1; padding: 5px; }
.close-modal:hover { color: var(--text-primary); }
.quick-actions-menu { position: fixed; bottom: 25px; right: 25px; z-index: var(--z-index-navbar); }
.quick-action-btn { width: 50px; height: 50px; border-radius: 50%; background-color: var(--accent-primary); color: white; border: none; box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; cursor: pointer; transition: all 0.3s ease; position: relative; }
.quick-action-btn:hover { transform: scale(1.08) rotate(15deg); background-color: #4338ca; }
.quick-actions-list { position: absolute; bottom: 65px; right: 0; background-color: var(--bg-secondary); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px; width: 220px; display: none; z-index: var(--z-index-navbar) + 5; opacity: 0; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease; }
.quick-actions-list.show { display: block; opacity: 1; transform: translateY(0); }
.quick-action-item { padding: 9px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; position: relative; }
.quick-action-item i { width: 16px; text-align: center; color: var(--text-secondary); }
.quick-action-item:hover { background-color: var(--bg-primary); }
.quick-action-item:hover i { color: var(--accent-primary); }
.help-center { position: fixed; bottom: 25px; left: 25px; z-index: var(--z-index-navbar); }
.help-btn { width: 45px; height: 45px; border-radius: 50%; background-color: var(--accent-primary); color: white; border: none; box-shadow: var(--shadow-md); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: pointer; transition: all 0.3s ease; position: relative; }
.help-btn:hover { transform: scale(1.1); background-color: #4338ca; }
.shortcuts-modal { display: none; position: fixed; z-index: var(--z-index-modal); left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; pointer-events: none; }
.shortcuts-modal.show { display: flex; opacity: 1; pointer-events: auto; }
.shortcuts-content { background-color: var(--bg-secondary); border-radius: 10px; padding: 20px; width: 90%; max-width: 800px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: scale(0.95); transition: transform 0.2s ease; }
.shortcuts-modal.show .shortcuts-content { transform: scale(1); }
.shortcuts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.shortcuts-title { font-size: 1.3rem; font-weight: 600; }
.shortcuts-close { font-size: 1.5rem; cursor: pointer; background: none; border: none; padding: 0; color: var(--text-secondary); line-height: 1; }
.shortcuts-close:hover { color: var(--text-primary); }
.shortcuts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.shortcuts-group { margin-bottom: 15px; }
.shortcuts-group-title { font-weight: 600; margin-bottom: 10px; font-size: 1rem; }
.shortcut-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border-color); font-size: 0.9rem; }
.shortcut-item:last-child { border-bottom: none; }
.shortcut-key { background-color: var(--bg-primary); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.85rem; border: 1px solid var(--border-color); }

/* --- Custom Tooltip Styles --- */
[data-tooltip] { position: relative; }
[data-tooltip]::after { /* Tooltip Content */
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  /* POSITION BELOW ELEMENT */
  top: 100%;
  transform: translateX(-50%) translateY(5px); /* Start slightly below */
  background-color: rgba(31, 41, 55, 0.9);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: var(--z-index-tooltip);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-out 0.3s, transform 0.2s ease-out 0.3s;
}
[data-tooltip]::before { /* Tooltip Arrow */
  content: '';
  position: absolute;
  left: 50%;
   /* POSITION ABOVE TOOLTIP BOX */
  top: 100%;
  transform: translateX(-50%) translateY(0px); /* Start just below element */
  border: 5px solid transparent;
  /* POINT UPWARDS (towards element) */
  border-bottom-color: rgba(31, 41, 55, 0.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-out 0.3s, transform 0.2s ease-out 0.3s;
  z-index: var(--z-index-tooltip);
}
/* Show on Hover */
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(8px); /* Move further down */
  transition-delay: 0.5s;
}
[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(3px); /* Arrow just above tooltip box */
   transition-delay: 0.5s;
}

/* Adjust tooltip position for Quick Actions/Help buttons (Now appears ABOVE these) */
.quick-action-btn[data-tooltip]::after, .help-btn[data-tooltip]::after {
    top: auto; /* Reset top */
    bottom: 100%; /* Position ABOVE */
    transform: translateX(-50%) translateY(-8px); /* Adjust position */
}
.quick-action-btn[data-tooltip]::before, .help-btn[data-tooltip]::before {
    top: auto; /* Reset top */
    bottom: 100%;
    border-bottom-color: transparent; /* Reset bottom border */
    border-top-color: rgba(31, 41, 55, 0.9); /* Point down */
    transform: translateX(-50%) translateY(-3px); /* Adjust position */
}
.quick-action-btn[data-tooltip]:hover::after, .help-btn[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(-10px); /* Adjust hover position */
}
.quick-action-btn[data-tooltip]:hover::before, .help-btn[data-tooltip]:hover::before {
    transform: translateX(-50%) translateY(-5px); /* Adjust hover position */
}

/* --- Dark Mode Styles --- */
/* ... Dark mode styles unchanged ... */
body.dark-mode { --bg-primary: #1f2937; --bg-secondary: #374151; --text-primary: #f3f4f6; --text-secondary: #9ca3af; --border-color: #4b5563; --accent-primary-light: rgba(79, 70, 229, 0.2); --debit-color: #f87171; --credit-color: #34d399; --danger-color: #f87171; /* Added danger color for dark mode */ }
body.dark-mode .top-navbar { background-color: var(--bg-secondary); border-bottom-color: var(--border-color); }
body.dark-mode .nav-link, body.dark-mode .nav-dropdown-toggle { color: var(--text-secondary); }
body.dark-mode .nav-link:hover, body.dark-mode .nav-dropdown-toggle:hover { background-color: var(--bg-primary); color: var(--text-primary); }
body.dark-mode .nav-item.active > .nav-link, body.dark-mode .nav-dropdown.active > .nav-dropdown-toggle { background-color: var(--accent-primary-light); color: #a5b4fc; font-weight: 600; }
body.dark-mode .nav-dropdown-content { background-color: #4b5563; border-color: var(--border-color); }
body.dark-mode .dropdown-content { background-color: #4b5563; border-color: var(--border-color); }
body.dark-mode .dropdown-content a { color: var(--text-primary); }
body.dark-mode .dropdown-content a:hover { background-color: var(--bg-primary); }
body.dark-mode .search-input { background-color: var(--bg-primary); border-color: var(--border-color); color: var(--text-primary); }
body.dark-mode .search-input::placeholder { color: var(--text-secondary); }
body.dark-mode .action-btn { color: var(--text-secondary); }
body.dark-mode .action-btn:hover { background-color: var(--bg-primary); color: var(--text-primary); }
body.dark-mode .card { background-color: var(--bg-secondary); border-color: var(--border-color); }
body.dark-mode th { background-color: #4b5563; color: var(--text-primary); }
body.dark-mode tbody tr:hover { background-color: rgba(75, 85, 99, 0.5); }
body.dark-mode .form-control { background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border-color); }
body.dark-mode .form-control::placeholder { color: var(--text-secondary); }
body.dark-mode .form-control:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-primary-light); }
body.dark-mode .status-active { background-color: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
body.dark-mode .status-pending { background-color: rgba(245, 158, 11, 0.2); color: #fcd34d; }
body.dark-mode .status-inactive { background-color: rgba(239, 68, 68, 0.2); color: #fca5a5; }
body.dark-mode .form-toggle { border-color: var(--border-color); }
body.dark-mode .form-toggle-btn { background: var(--bg-primary); color: var(--text-secondary); border-color: var(--border-color); }
body.dark-mode .form-toggle-btn.active#income-toggle { background: var(--income); color: #1a1a1a; }
body.dark-mode .form-toggle-btn.active#expense-toggle { background: var(--expense); color: #1a1a1a; }
body.dark-mode #new-top-bar .badge-income { background: rgba(46, 204, 113, 0.2); color: #6ee7b7; }
body.dark-mode #new-top-bar .badge-expense { background: rgba(230, 126, 34, 0.2); color: #fcd34d; }
body.dark-mode #journal-table .description-text { color: var(--text-secondary); }
body.dark-mode .shortcuts-content { background-color: var(--bg-secondary); }
body.dark-mode .shortcuts-group-title { border-bottom-color: var(--border-color); }
body.dark-mode .shortcut-item { border-bottom-color: var(--border-color); }
body.dark-mode .shortcut-key { background-color: var(--bg-primary); border-color: var(--border-color); color: var(--text-primary); }
body.dark-mode .quick-actions-list { background-color: #4b5563; }
body.dark-mode .quick-action-item:hover { background-color: var(--bg-primary); }
body.dark-mode .notification-center { background-color: #4b5563; border-color: var(--border-color); }
body.dark-mode .notification-item { border-bottom-color: var(--border-color); }
body.dark-mode .notification-header { border-bottom-color: var(--border-color); }
body.dark-mode .search-suggestions { background-color: #4b5563; border-color: var(--border-color); }
body.dark-mode .suggestion-item:hover { background-color: var(--bg-primary); }
body.dark-mode .modal-content { background-color: var(--bg-secondary); }
body.dark-mode .close-modal { color: var(--text-secondary); }
body.dark-mode .close-modal:hover { color: var(--text-primary); }
body.dark-mode .dropdown-user-info { border-bottom-color: var(--border-color); }
body.dark-mode .dropdown-content hr { border-top-color: var(--border-color); }
body.dark-mode .table-container { border-color: var(--border-color); }
body.dark-mode ::-webkit-scrollbar { width: 8px; height: 8px; }
body.dark-mode ::-webkit-scrollbar-track { background: var(--bg-primary); }
body.dark-mode ::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 4px; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background-color: #6b7280; }
body.dark-mode select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E"); }
/* Dark mode custom tooltips */
body.dark-mode [data-tooltip]::after { background-color: rgba(229, 231, 235, 0.95); color: #1f2937; }
body.dark-mode [data-tooltip]::before { border-bottom-color: rgba(229, 231, 235, 0.95); border-top-color: transparent;} /* Correct arrow color */
body.dark-mode .quick-action-btn[data-tooltip]::before,
body.dark-mode .help-btn[data-tooltip]::before { border-top-color: rgba(229, 231, 235, 0.95); border-bottom-color: transparent; } /* Correct arrow color */

/* --- Responsiveness --- */
/* ... responsive styles largely unchanged ... */
@media (max-width: 1200px) { .navbar-links > .nav-item > .nav-link > .nav-text, .navbar-links > .nav-dropdown > .nav-dropdown-toggle > .nav-text { display: none; } .navbar-links > .nav-item > .nav-link > .nav-icon, .navbar-links > .nav-dropdown > .nav-dropdown-toggle > .nav-icon { margin-right: 0; } .nav-dropdown-content .nav-text { display: inline !important; } .navbar-links > .nav-item > .nav-link, .navbar-links > .nav-dropdown > .nav-dropdown-toggle { padding: 6px 10px; } .user-name-display { display: none; } .logo-text { display: none; } .search-input { width: 150px; } .search-input:focus { width: 200px; } }
@media (max-width: 992px) { .top-navbar { padding: 0 15px; } .navbar-left { margin-right: 10px; } .navbar-links { gap: 12px; /* Adjusted gap */ } .header-actions { gap: 12px; /* Adjusted gap */ } .action-btn { width: 30px; height: 30px; font-size: 1rem; } .user-avatar-large { width: 30px; height: 30px; } .module-content-area { padding: 20px; } .main-footer { padding: 12px 20px; } .stats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
@media (max-width: 768px) { body { font-size: 14px; padding-top: 60px; --header-height: 60px; } .top-navbar { padding: 0 10px; } .navbar-right .search-container { display: none; } .navbar-left { display: none; } .top-navbar { justify-content: flex-end; } .header-actions { gap: 8px; /* Adjusted gap */ } .module-content-area { padding: 15px; } .main-footer { padding: 10px 15px; } .form-row { flex-direction: column; gap: 0; } .form-row .form-group { flex-basis: 100%; } .module-header { flex-direction: column; align-items: flex-start; gap: 10px; } .module-actions { width: 100%; justify-content: flex-start; } .quick-actions-menu { bottom: 15px; right: 15px; } .help-center { bottom: 15px; left: 15px; } .notification-center { width: calc(100% - 20px); max-width: 320px; right: 10px; } .shortcuts-content { max-width: 90%; } .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 480px) { .action-btn[aria-label="Messages"], .action-btn[aria-label="Reminders"], .action-btn[aria-label="Updates"], .action-btn[aria-label="Deadlines"] { display: none; } .header-actions { gap: 10px; /* Adjusted gap */ } .module-actions .btn { font-size: 0.85rem; padding: 0.3rem 0.7rem; } .form-toggle { flex-direction: column; } .form-toggle-btn { border-right: none; border-bottom: 1px solid var(--border-color); } .form-toggle-btn:last-child { border-bottom: none; } .stat-card .value { font-size: 1.4rem; } .card { padding: 15px; } .module-content-area { padding: 10px; } .modal-content { padding: 20px; } .shortcuts-grid { grid-template-columns: 1fr; } }

/* Print styles */
@media print { /* ... unchanged ... */ .top-navbar, .quick-actions-menu, .help-center, .main-footer, .module-actions, .btn, [data-tooltip]::after, [data-tooltip]::before { display: none !important; } body { padding-top: 0; } .main-content { margin: 0; } .module-content-area { padding: 0; } .card, .table-container { border: none; box-shadow: none; padding: 0; margin-bottom: 15px; } table, th, td { border: 1px solid #ccc; } th { background-color: #eee; } }

/* Main Content Styles */

.main-content {
    flex-grow: 1;
}

.page-content-wrapper {
    max-width: 1600px;
}

.card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.card-body {
    padding: 20px;
}

.detail-item {
    margin-bottom: 15px;
}

.detail-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.detail-label i {
    margin-right: 8px;
    color: #9ca3af;
}

.detail-value {
    font-size: 1rem;
    color: #1f2937;
}

.detail-value-list {
    margin-top: 5px;
    padding-left: 20px;
    list-style: disc;
}

.detail-value-list li {
    margin-bottom: 4px;
    font-size: 1rem;
    color: #1f2937;
}

.btn-primary { color: #fff; background-color: var(--accent-primary); border-color: var(--accent-primary); }
.btn-primary:hover { background-color: #4338ca; border-color: #4338ca; color: #fff; text-decoration: none; box-shadow: var(--shadow-sm); }
.btn-secondary { color: var(--text-primary); background-color: var(--bg-primary); border-color: var(--border-color); }
.btn-secondary:hover { background-color: #e5e7eb; border-color: #d1d5db; }

/* Outline Buttons */
.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background-color: transparent;
}
.btn-outline-secondary:hover {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background-color: transparent;
}
.btn-outline-danger:hover {
    color: var(--bg-secondary); /* White text on hover */
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    text-transform: capitalize;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-closed {
    background-color: #bfdbfe;
    color: #1e40af;
}

.table-header {
    background-color: #f7f8fc;
    color: #1f2937;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.table-row:nth-child(even) {
    background-color: #f9fafb;
}

.table-row:hover {
    background-color: #f0f4f8;
}

.table-cell {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
    color: #374151;
}

.table-cell:last-child {
    border-bottom: none;
}

/* Tab Styles */
.tabs-container {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.tab-link {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tab-link:hover {
    color: #1f2937;
}
.tab-link.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}
#new-tab-content .tab-content {
    display: none;
}
#new-tab-content .tab-content.active {
    display: block;
}

/* Utility classes */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.text-muted { color: #6b7280 !important; }
.font-size-15 { font-size: 0.9375rem !important; } /* 15px */
.font-size-16 { font-size: 1rem !important; } /* 16px */
.text-center { text-align: center !important; }
.float-end { float: right !important; }
.clearfix::after { display: block; clear: both; content: ""; }
.rounded-circle { border-radius: 50% !important; }
.img-thumbnail { padding: 0.25rem; background-color: #fff; border: 1px solid #dee2e6; border-radius: 0.25rem; max-width: 100%; height: auto; }
.avatar-lg { width: 120px; height: 120px; } /* Adjusted from design to match existing more closely */

.dropdown { position: relative; }
.dropdown-toggle::after { display: none !important; } /* Assuming we are using FontAwesome icons instead of Bootstrap's default caret */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .25rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
}
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem; /* Increased padding */
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    text-decoration: none; /* Added */
}
.dropdown-item:hover, .dropdown-item:focus {
    color: #1e2125;
    background-color: #f8f9fa;
}
.dropdown-item i {
    margin-right: 0.5rem;
    width: 16px; /* ensure icon alignment */
    text-align: center;
}

/* Accordion basic styles */
.accordion-item {
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.accordion-header {
    padding: 12px 16px;
    background-color: #f9fafb;
    cursor: pointer;
    font-weight: 500;
}
.accordion-button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
    color: #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.accordion-button::after { /* Basic arrow, can be improved with FontAwesome */
    content: '\25BC'; /* Down arrow */
    font-size: 0.8rem;
    transition: transform 0.2s ease-in-out;
}
.accordion-button.collapsed::after {
     content: '\25B6'; /* Right arrow */
}
.accordion-collapse {
    display: none; /* Hidden by default */
}
.accordion-collapse.show {
    display: block; /* Shown when active */
}
.accordion-body {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Adjustments for existing layout structure */
.container-fluid {
    padding-left: 15px; /* Maintain some padding */
    padding-right: 15px;
}

/* New Client Header Styles */
.client-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.client-header-info {
    display: flex;
    align-items: center;
}

.profile-avatar-wrapper {
    position: relative;
    margin-right: 20px;
}

.profile-avatar {
    width: 60px; /* Increased size */
    height: 60px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    object-fit: cover;
}

.profile-avatar-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.status-active-dot {
    background-color: #10b981; /* Green for active */
}

.status-inactive-dot {
    background-color: #ef4444; /* Red for inactive/other */
}

.client-details-main h1 {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 5px 0;
}

.client-meta {
    font-size: 0.875rem; /* 14px */
    color: #6b7280;
}

.client-meta span {
    margin-right: 10px;
}

.status-text-active { color: #065f46; font-weight: 500; }
.status-text-inactive { color: #991b1b; font-weight: 500; } /* Add more as needed */

.client-header-actions {
    display: flex;
    gap: 10px;
}

.client-header-actions .btn-secondary,
.client-header-actions .btn-primary {
    padding: 0.6rem 1.2rem; /* Slightly larger buttons */
}
.client-header-actions .btn-secondary i,
.client-header-actions .btn-primary i {
    font-size: 0.8em; /* Adjust icon size if needed */
}


/* New Tab Navigation Styles */
.new-tabs-navigation {
    display: flex;
    gap: 5px; /* Small gap between tabs */
    border-bottom: 1px solid #e5e7eb; /* Bottom border for the container */
    padding-bottom: -1px; /* To make active tab border overlap container border */
    margin-top: 25px;
}

.new-tab-link {
    padding: 10px 20px;
    font-size: 0.95rem; /* 15px */
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border: 1px solid transparent; /* For border alignment */
    border-bottom: 2px solid transparent; /* Bottom border for active state */
    margin-bottom: -1px; /* Overlap with container border */
    transition: color 0.2s ease, border-color 0.2s ease;
    border-radius: 6px 6px 0 0; /* Rounded top corners */
    cursor: pointer; /* Add cursor pointer as they are interactive spans */
}

.new-tab-link:hover {
    color: #374151;
    background-color: #f9fafb; /* Slight hover background */
}

.new-tab-link.active {
    color: #4f46e5; /* Primary color for active tab */
    border-color: #e5e7eb #e5e7eb #fff; /* Border to make it look connected to content */
    border-bottom-color: #4f46e5; /* Active tab indicator */
    font-weight: 600;
    background-color: #fff; /* Match content area background */
}

/* Tab Content Styles */
.new-tab-content {
    display: none; /* Hidden by default */
    padding: 25px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-top: none; /* Remove top border as tabs handle it */
    border-radius: 0 0 10px 10px; /* Rounded bottom corners */
    margin-bottom: 20px;
    /* Ensure no layout shifts */
    position: relative;
    width: 100%;
}

.new-tab-content.active {
    display: block;
}

#new-tab-content .tab-content-title {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

/* --- NGOFlow New Top Bar Styles --- */
#new-ngoflow-top-bar {
    --new-font-family: 'Inter', sans-serif;
    --new-bg-primary: #f7f8fc;
    --new-bg-secondary: #ffffff;
    --new-text-primary: #1f2937;
    --new-text-secondary: #6b7280;
    --new-accent-primary: #4f46e5;
    --new-accent-primary-light: #e0e7ff;
    --new-border-color: #e5e7eb;
    --new-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --new-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --new-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --new-header-height: var(--new-ngoflow-header-height); /* Use the globally defined height */
    --new-transition-fast: 0.2s ease-out;
    --new-transition-slow: 0.3s ease-in-out;
    --new-z-index-dropdown: 1000;
    --new-z-index-notifications: 1050;
    --new-z-index-tooltip: 1150;
    --new-z-index-modal: 1100;
    --new-z-index-navbar: 950; /* Ensure this is high enough */
    --new-debit-color: #e74c3c;
    --new-credit-color: #2ecc71;
    font-family: var(--new-font-family);
    font-size: 15px;
    line-height: 1.5;
    color: var(--new-text-primary);
    position: fixed; /* Make the entire top bar fixed */
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--new-z-index-navbar);
    background-color: var(--new-bg-secondary); 
    box-shadow: var(--new-shadow-sm); 
}

#new-ngoflow-top-bar .new-top-navbar {
    /* ... other styles ... */
    /* Remove position, top, left, width, z-index, box-shadow as they are now on #new-ngoflow-top-bar */
    /* The height, bg-color, border-bottom, padding, gap should remain */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--new-header-height);
    background-color: var(--new-bg-secondary);
    border-bottom: 1px solid var(--new-border-color);
    padding: 0 20px;
    gap: 20px;
}

#new-ngoflow-top-bar * { box-sizing: border-box; margin: 0; padding: 0; }
#new-ngoflow-top-bar a { color: var(--new-accent-primary); text-decoration: none; transition: color var(--new-transition-fast); }
#new-ngoflow-top-bar a:hover { text-decoration: none; color: #3b30cc; }
#new-ngoflow-top-bar button { font-family: inherit; cursor: pointer; }

#new-ngoflow-top-bar .new-app-layout { display: flex; flex-direction: column; min-height: calc(100vh - var(--new-header-height)); }

#new-ngoflow-top-bar .new-navbar-left, #new-ngoflow-top-bar .new-navbar-right { display: flex; align-items: center; gap: 15px; }
#new-ngoflow-top-bar .new-navbar-left { flex-shrink: 0; }
#new-ngoflow-top-bar .new-navbar-right { flex-grow: 1; justify-content: flex-end; }

#new-ngoflow-top-bar .new-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: 15px; }
#new-ngoflow-top-bar .new-logo-icon { height: 30px; border-radius: 4px; }
#new-ngoflow-top-bar .new-logo-text { font-size: 1.1rem; font-weight: 600; white-space: nowrap; color: var(--new-text-primary); }
#new-ngoflow-top-bar .new-logo-highlight { font-weight: 700; color: var(--new-accent-primary); }

#new-ngoflow-top-bar .new-navbar-links { display: flex; align-items: center; gap: 18px; }
#new-ngoflow-top-bar .new-nav-item { list-style: none; position: relative; }

#new-ngoflow-top-bar .new-nav-link {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 6px;
    color: var(--new-text-secondary);
    transition: background-color var(--new-transition-fast), color var(--new-transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 6px;
    position: relative;
}
#new-ngoflow-top-bar .new-nav-link:hover { background-color: var(--new-bg-primary); color: var(--new-text-primary); text-decoration: none; }
#new-ngoflow-top-bar .new-nav-item.new-active > .new-nav-link { background-color: var(--new-accent-primary-light); color: var(--new-accent-primary); font-weight: 600; }
#new-ngoflow-top-bar .new-nav-icon { font-size: 0.95rem; width: 16px; text-align: center; flex-shrink: 0; }
#new-ngoflow-top-bar .new-nav-text { display: inline; }

#new-ngoflow-top-bar .new-nav-dropdown { position: relative; }
#new-ngoflow-top-bar .new-nav-dropdown-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 6px;
    color: var(--new-text-secondary);
    transition: background-color var(--new-transition-fast), color var(--new-transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 6px;
    position: relative;
}
#new-ngoflow-top-bar .new-nav-dropdown-toggle:hover, #new-ngoflow-top-bar .new-nav-dropdown.new-open > .new-nav-dropdown-toggle { background-color: var(--new-bg-primary); color: var(--new-text-primary); }
#new-ngoflow-top-bar .new-nav-dropdown.new-active > .new-nav-dropdown-toggle { background-color: var(--new-accent-primary-light); color: var(--new-accent-primary); font-weight: 600; }

#new-ngoflow-top-bar .new-dropdown-icon-nav { font-size: 0.7rem; margin-left: 4px; transition: transform var(--new-transition-fast); }
#new-ngoflow-top-bar .new-nav-dropdown.new-open > .new-nav-dropdown-toggle .new-dropdown-icon-nav { transform: rotate(180deg); }

#new-ngoflow-top-bar .new-nav-dropdown-content {
    display: none; /* Initially hidden */
    position: fixed; /* Changed from absolute to fixed */
    /* left: 0; top: calc(100% + 5px); Removed fixed top/left for JS calculation */
    background-color: var(--new-bg-secondary);
    border: 1px solid var(--new-border-color);
    border-radius: 8px;
    box-shadow: var(--new-shadow-md);
    min-width: 220px;
    z-index: var(--new-z-index-dropdown); /* Ensure it's above other content */
    padding: 6px;
    opacity: 0;
    /* transform: translateY(-5px); Removed transform as it can interfere with fixed positioning calculations */
    transition: opacity var(--new-transition-fast); /* Only transition opacity now */
    pointer-events: none;
    /* max-height: calc(100vh - var(--new-header-height) - 20px); */ /* Removed max-height */
    /* overflow-y: auto; */ /* Removed overflow-y */
}
#new-ngoflow-top-bar .new-nav-dropdown.new-open > .new-nav-dropdown-content {
    display: block; /* Or flex, depending on content needs */
    opacity: 1;
    /* transform: translateY(0); Removed transform */
    pointer-events: auto;
}
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item { margin-bottom: 0; }
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-link { padding: 8px 10px; margin: 2px 0; width: 100%; }
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-link .new-nav-text { display: inline !important; }
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item.new-active > .new-nav-link { background-color: var(--new-accent-primary-light); color: var(--new-accent-primary); font-weight: 600; }

#new-ngoflow-top-bar .new-header-actions { display: flex; align-items: center; gap: 10px; }
#new-ngoflow-top-bar .new-search-container { position: relative; display: flex; align-items: center; }
#new-ngoflow-top-bar .new-search-icon { position: absolute; left: 10px; color: var(--new-text-secondary); font-size: 0.85rem; pointer-events: none; }
#new-ngoflow-top-bar .new-search-input { background-color: var(--new-bg-primary); border: 1px solid var(--new-border-color); border-radius: 20px; padding: 5px 10px 5px 28px; font-size: 0.85rem; width: 180px; outline: none; transition: border-color var(--new-transition-fast), box-shadow var(--new-transition-fast), width var(--new-transition-fast); position: relative; }
#new-ngoflow-top-bar .new-search-input:focus { border-color: var(--new-accent-primary); box-shadow: 0 0 0 2px var(--new-accent-primary-light); width: 240px; }
#new-ngoflow-top-bar .new-action-btn { background: none; border: none; font-size: 1.05rem; color: var(--new-text-secondary); padding: 6px; border-radius: 50%; position: relative; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; transition: background-color var(--new-transition-fast), color var(--new-transition-fast); flex-shrink: 0; }
#new-ngoflow-top-bar .new-action-btn:hover { background-color: var(--new-bg-primary); color: var(--new-text-primary); }
#new-ngoflow-top-bar .new-badge { position: absolute; top: 2px; right: 2px; background-color: #ef4444; color: white; font-size: 0.6rem; font-weight: 600; min-width: 14px; height: 14px; border-radius: 7px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

#new-ngoflow-top-bar .new-notification-center { position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-height: 500px; background-color: var(--new-bg-secondary); border: 1px solid var(--new-border-color); border-radius: 8px; box-shadow: var(--new-shadow-lg); z-index: var(--new-z-index-notifications); display: none; opacity: 0; transform: translateY(-10px); transition: opacity var(--new-transition-fast), transform var(--new-transition-fast); pointer-events: none; display: flex; flex-direction: column; }
#new-ngoflow-top-bar .new-notification-center.new-show { display: flex; opacity: 1; transform: translateY(0); pointer-events: auto; }
#new-ngoflow-top-bar .new-notification-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid var(--new-border-color); flex-shrink: 0; }
#new-ngoflow-top-bar .new-notification-title { font-weight: 600; font-size: 1rem; }
#new-ngoflow-top-bar .new-notification-clear { color: var(--new-accent-primary); cursor: pointer; font-size: 0.85rem; font-weight: 500; }
#new-ngoflow-top-bar .new-notification-list { padding: 5px 15px 15px; max-height: 400px; overflow-y: auto; flex-grow: 1; }
#new-ngoflow-top-bar .new-notification-item { padding: 12px 0; border-bottom: 1px solid var(--new-border-color); display: flex; gap: 10px; }
#new-ngoflow-top-bar .new-notification-item:last-child { border-bottom: none; }
#new-ngoflow-top-bar .new-notification-icon { color: var(--new-accent-primary); font-size: 1.1rem; margin-top: 2px; width: 20px; text-align: center; flex-shrink: 0; }
#new-ngoflow-top-bar .new-notification-content { flex: 1; font-size: 0.9rem; line-height: 1.4; }
#new-ngoflow-top-bar .new-notification-time { font-size: 0.75rem; color: var(--new-text-secondary); margin-top: 4px; }
#new-ngoflow-top-bar .new-notification-unread { background-color: var(--new-accent-primary-light); margin: 0 -15px; padding: 12px 15px; }

#new-ngoflow-top-bar .new-search-suggestions { position: absolute; top: calc(100% + 4px); left: 0; width: 100%; min-width: 250px; background-color: var(--new-bg-secondary); border: 1px solid var(--new-border-color); border-radius: 8px; box-shadow: var(--new-shadow-md); z-index: var(--new-z-index-dropdown); display: none; max-height: 300px; overflow-y: auto; opacity: 0; transform: translateY(-5px); transition: opacity var(--new-transition-fast), transform var(--new-transition-fast); pointer-events: none; }
#new-ngoflow-top-bar .new-search-suggestions.new-show { display: block; opacity: 1; transform: translateY(0); pointer-events: auto; }
#new-ngoflow-top-bar .new-suggestion-item { padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
#new-ngoflow-top-bar .new-suggestion-item:hover { background-color: var(--new-bg-primary); }
#new-ngoflow-top-bar .new-suggestion-icon { color: var(--new-text-secondary); width: 16px; text-align: center; }
#new-ngoflow-top-bar .new-search-input:focus + .new-search-suggestions { width: 240px; }

#new-ngoflow-top-bar .new-user-menu-dropdown { position: relative; margin-left: 5px; }
#new-ngoflow-top-bar .new-user-menu-btn { background: none; border: none; display: flex; align-items: center; padding: 4px; border-radius: 6px; transition: background-color var(--new-transition-fast); gap: 8px; position: relative; }
#new-ngoflow-top-bar .new-user-menu-btn:hover { background-color: var(--new-bg-primary); }
#new-ngoflow-top-bar .new-user-avatar-large { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--new-border-color); background-color: #ccc; display: inline-block; flex-shrink: 0; }
#new-ngoflow-top-bar .new-user-name-display { font-size: 0.9rem; font-weight: 500; color: var(--new-text-primary); display: none; white-space: nowrap; }
#new-ngoflow-top-bar .new-dropdown-icon { color: var(--new-text-secondary); font-size: 0.75rem; transition: transform var(--new-transition-fast); }
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content { display: none; position: absolute; right: 0; top: calc(100% + 10px); background-color: var(--new-bg-secondary); border: 1px solid var(--new-border-color); border-radius: 8px; box-shadow: var(--new-shadow-md); min-width: 200px; z-index: var(--new-z-index-dropdown); padding: 0; opacity: 0; transform: translateY(-10px); transition: opacity var(--new-transition-fast), transform var(--new-transition-fast); pointer-events: none; }
#new-ngoflow-top-bar .new-user-menu-dropdown.new-open .new-dropdown-content { display: block; opacity: 1; transform: translateY(0); pointer-events: auto; }
#new-ngoflow-top-bar .new-dropdown-user-info { padding: 10px 15px; border-bottom: 1px solid var(--new-border-color); }
#new-ngoflow-top-bar .new-dropdown-user-info strong { display: block; font-size: 0.95rem; font-weight: 600; }
#new-ngoflow-top-bar .new-dropdown-user-info small { font-size: 0.8rem; color: var(--new-text-secondary); }
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content a { display: flex; align-items: center; gap: 10px; padding: 10px 15px; color: var(--new-text-primary); font-size: 0.9rem; position: relative; }
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content a i { width: 16px; text-align: center; color: var(--new-text-secondary); }
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content a:hover { background-color: var(--new-bg-primary); text-decoration: none; }
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content a:hover i { color: var(--new-accent-primary); }
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content hr { border: none; border-top: 1px solid var(--new-border-color); margin: 6px 0; }
#new-ngoflow-top-bar .new-user-menu-dropdown.new-open .new-dropdown-icon { transform: rotate(180deg); }

/* Tooltip Styles - these are general but scoped under #new-ngoflow-top-bar to avoid conflict */
#new-ngoflow-top-bar [data-new-tooltip] { position: relative; }
#new-ngoflow-top-bar [data-new-tooltip]::after {
  content: attr(data-new-tooltip);
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(5px);
  background-color: rgba(31, 41, 55, 0.9);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: var(--new-z-index-tooltip);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-out 0.3s, transform 0.2s ease-out 0.3s;
}
#new-ngoflow-top-bar [data-new-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%) translateY(0px);
  border: 5px solid transparent;
  border-bottom-color: rgba(31, 41, 55, 0.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-out 0.3s, transform 0.2s ease-out 0.3s;
  z-index: var(--new-z-index-tooltip);
}
#new-ngoflow-top-bar [data-new-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(8px);
  transition-delay: 0.5s;
}
#new-ngoflow-top-bar [data-new-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(3px);
  transition-delay: 0.5s;
}

/* Dark Mode Styles for the New Top Bar */
#new-ngoflow-top-bar.new-dark-mode {
    --new-bg-primary: #1f2937;
    --new-bg-secondary: #374151;
    --new-text-primary: #f3f4f6;
    --new-text-secondary: #9ca3af;
    --new-border-color: #4b5563;
    --new-accent-primary-light: rgba(79, 70, 229, 0.2);
    --new-debit-color: #f87171;
    --new-credit-color: #34d399;
    color: var(--new-text-primary); /* Ensure main text color for the bar itself changes */
}
#new-ngoflow-top-bar.new-dark-mode .new-top-navbar { background-color: var(--new-bg-secondary); border-bottom-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-nav-link, #new-ngoflow-top-bar.new-dark-mode .new-nav-dropdown-toggle { color: var(--new-text-secondary); }
#new-ngoflow-top-bar.new-dark-mode .new-nav-link:hover, #new-ngoflow-top-bar.new-dark-mode .new-nav-dropdown-toggle:hover { background-color: var(--new-bg-primary); color: var(--new-text-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-nav-item.new-active > .new-nav-link, #new-ngoflow-top-bar.new-dark-mode .new-nav-dropdown.new-active > .new-nav-dropdown-toggle { background-color: var(--new-accent-primary-light); color: #a5b4fc; font-weight: 600; }
#new-ngoflow-top-bar.new-dark-mode .new-nav-dropdown-content { background-color: #4b5563; border-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-user-menu-dropdown .new-dropdown-content { background-color: #4b5563; border-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-user-menu-dropdown .new-dropdown-content a { color: var(--new-text-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-user-menu-dropdown .new-dropdown-content a:hover { background-color: var(--new-bg-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-search-input { background-color: var(--new-bg-primary); border-color: var(--new-border-color); color: var(--new-text-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-search-input::placeholder { color: var(--new-text-secondary); }
#new-ngoflow-top-bar.new-dark-mode .new-action-btn { color: var(--new-text-secondary); }
#new-ngoflow-top-bar.new-dark-mode .new-action-btn:hover { background-color: var(--new-bg-primary); color: var(--new-text-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-notification-center { background-color: #4b5563; border-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-notification-item { border-bottom-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-notification-header { border-bottom-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-search-suggestions { background-color: #4b5563; border-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-suggestion-item:hover { background-color: var(--new-bg-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-modal-content { background-color: var(--new-bg-secondary); }
#new-ngoflow-top-bar.new-dark-mode .new-close-modal { color: var(--new-text-secondary); }
#new-ngoflow-top-bar.new-dark-mode .new-close-modal:hover { color: var(--new-text-primary); }
#new-ngoflow-top-bar.new-dark-mode .new-dropdown-user-info { border-bottom-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-dropdown-content hr { border-top-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode .new-table-container { border-color: var(--new-border-color); }
#new-ngoflow-top-bar.new-dark-mode ::-webkit-scrollbar { width: 8px; height: 8px; }
#new-ngoflow-top-bar.new-dark-mode ::-webkit-scrollbar-track { background: var(--new-bg-primary); }
#new-ngoflow-top-bar.new-dark-mode ::-webkit-scrollbar-thumb { background-color: var(--new-border-color); border-radius: 4px; }
#new-ngoflow-top-bar.new-dark-mode ::-webkit-scrollbar-thumb:hover { background-color: #6b7280; }
#new-ngoflow-top-bar.new-dark-mode select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E"); }
/* Dark mode custom tooltips */
#new-ngoflow-top-bar.new-dark-mode [data-new-tooltip]::after { background-color: rgba(229, 231, 235, 0.95); color: #1f2937; }
#new-ngoflow-top-bar.new-dark-mode [data-new-tooltip]::before { border-bottom-color: rgba(229, 231, 235, 0.95); border-top-color: transparent;} /* Correct arrow color */
#new-ngoflow-top-bar.new-dark-mode .new-quick-action-btn[data-tooltip]::before,
#new-ngoflow-top-bar.new-dark-mode .new-help-btn[data-tooltip]::before { border-top-color: rgba(229, 231, 235, 0.95); border-bottom-color: transparent; } /* Correct arrow color */

/* Responsive adjustments for the new top bar */
@media (max-width: 1200px) {
    #new-ngoflow-top-bar .new-navbar-links > .new-nav-item > .new-nav-link > .new-nav-text,
    #new-ngoflow-top-bar .new-navbar-links > .new-nav-dropdown > .new-nav-dropdown-toggle > .new-nav-text { display: none; }
    #new-ngoflow-top-bar .new-navbar-links > .new-nav-item > .new-nav-link > .new-nav-icon,
    #new-ngoflow-top-bar .new-navbar-links > .new-nav-dropdown > .new-nav-dropdown-toggle > .new-nav-icon { margin-right: 0; }
    #new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-text { display: inline !important; }
    #new-ngoflow-top-bar .new-navbar-links > .new-nav-item > .new-nav-link,
    #new-ngoflow-top-bar .new-navbar-links > .new-nav-dropdown > .new-nav-dropdown-toggle { padding: 6px 10px; }
    #new-ngoflow-top-bar .new-user-name-display { display: none; }
    #new-ngoflow-top-bar .new-logo-text { display: none; }
    #new-ngoflow-top-bar .new-search-input { width: 150px; }
    #new-ngoflow-top-bar .new-search-input:focus { width: 200px; }
}
@media (max-width: 992px) {
    #new-ngoflow-top-bar .new-top-navbar { padding: 0 15px; }
    #new-ngoflow-top-bar .new-navbar-left { margin-right: 10px; }
    #new-ngoflow-top-bar .new-navbar-links { gap: 12px; }
    #new-ngoflow-top-bar .new-header-actions { gap: 12px; }
    #new-ngoflow-top-bar .new-action-btn { width: 30px; height: 30px; font-size: 1rem; }
    #new-ngoflow-top-bar .new-user-avatar-large { width: 30px; height: 30px; }
}
@media (max-width: 768px) {
    #new-ngoflow-top-bar { --new-header-height: 60px; } /* Adjust variable for embedded context if body padding changes */
    #new-ngoflow-top-bar .new-top-navbar { padding: 0 10px; height: var(--new-header-height); }
    #new-ngoflow-top-bar .new-navbar-right .new-search-container { display: none; }
    #new-ngoflow-top-bar .new-navbar-left { display: none; } /* Consider if logo should always be visible */
    #new-ngoflow-top-bar .new-top-navbar { justify-content: flex-end; }
    #new-ngoflow-top-bar .new-header-actions { gap: 8px; }
    #new-ngoflow-top-bar .new-notification-center { width: calc(100% - 20px); max-width: 320px; right: 10px; }
}
@media (max-width: 480px) {
    #new-ngoflow-top-bar .new-action-btn[aria-label="Messages"],
    #new-ngoflow-top-bar .new-action-btn[aria-label="Reminders"],
    #new-ngoflow-top-bar .new-action-btn[aria-label="Updates"],
    #new-ngoflow-top-bar .new-action-btn[aria-label="Deadlines"] { display: none; }
    #new-ngoflow-top-bar .new-header-actions { gap: 10px; }
}

/* Font Awesome classes used in the new design - ensure they are available or replace */
/* Assuming Font Awesome is globally available. If not, include:
   @import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css");
   or ensure the link is in the main HTML head.
*/
#new-ngoflow-top-bar .fas { /* Basic styling if needed */ }

/* --- NGOFlow Top Bar Enhancements --- */

#new-ngoflow-top-bar .new-navbar-left {
    flex-shrink: 1; /* Allow shrinking to make space for expanded search */
    min-width: 0; /* Allow shrinking below content size */
    overflow: hidden; /* Hide the logo text if it overflows, though it should be handled by media queries */
}

#new-ngoflow-top-bar .new-navbar-links {
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden; /* Hide vertical scrolling */
    white-space: nowrap; /* Keep nav items in a single line */
    flex-grow: 1; /* Allow it to take available space */
    flex-shrink: 1; /* Allow it to shrink when search expands */
    min-width: 100px; /* Minimum width before it starts scrolling */
    padding-bottom: 10px; /* Space for scrollbar without overlapping content */
    margin-bottom: -10px; /* Counteract padding-bottom for layout */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Custom Scrollbar for Nav Links */
#new-ngoflow-top-bar .new-navbar-links::-webkit-scrollbar {
    height: 6px;
}

#new-ngoflow-top-bar .new-navbar-links::-webkit-scrollbar-track {
    background: transparent; /* Or var(--new-bg-primary) for a subtle track */
}

#new-ngoflow-top-bar .new-navbar-links::-webkit-scrollbar-thumb {
    background-color: var(--new-border-color);
    border-radius: 3px;
}

#new-ngoflow-top-bar .new-navbar-links::-webkit-scrollbar-thumb:hover {
    background-color: var(--new-text-secondary);
}

#new-ngoflow-top-bar .new-nav-item {
    flex-shrink: 0; /* Prevent nav items from shrinking */
}

/* Responsive Link Widths */
@media (min-width: 992px) { /* md and above */
    #new-ngoflow-top-bar .new-nav-link .new-nav-text,
    #new-ngoflow-top-bar .new-nav-dropdown-toggle .new-nav-text {
        display: inline-block; /* Ensure text is visible */
    }
    #new-ngoflow-top-bar .new-nav-link,
    #new-ngoflow-top-bar .new-nav-dropdown-toggle {
        padding-left: 12px;
        padding-right: 12px;
        min-width: auto; /* Reset min-width if previously set for icons only */
    }
}

@media (min-width: 1200px) { /* lg and above */
    #new-ngoflow-top-bar .new-nav-link,
    #new-ngoflow-top-bar .new-nav-dropdown-toggle {
        /* min-width: 120px; /* Example fixed width if all items should be same size */
        /* padding: 7px 15px; /* Slightly more padding for larger screens */
    }
}

/* Collapsible Search Bar */
#new-ngoflow-top-bar .new-search-container {
    position: relative;
    display: flex;
    align-items: center;
    transition: width var(--new-transition-slow); /* Transition for container width */
}

#new-ngoflow-top-bar .new-search-icon-btn { /* New class for the button behavior */
    background: none;
    border: none;
    color: var(--new-text-secondary);
    font-size: 1.05rem; /* Match other action buttons */
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--new-transition-fast), color var(--new-transition-fast);
    margin-left: auto; /* Push to the right initially if needed */
    z-index: 2; /* Above the input when collapsed */
}

#new-ngoflow-top-bar .new-search-icon-btn:hover {
    background-color: var(--new-bg-primary);
    color: var(--new-text-primary);
}

#new-ngoflow-top-bar .new-search-input {
    width: 0;
    padding-left: 10px; /* No icon padding initially */
    padding-right: 10px;
    opacity: 0;
    visibility: hidden;
    border: 1px solid transparent;
    transition: width var(--new-transition-slow), opacity var(--new-transition-fast) 0.1s, visibility 0s 0.3s, border-color var(--new-transition-fast);
    position: absolute; /* Take out of flow until expanded */
    right: 0; /* Align to the right of the container */
}

#new-ngoflow-top-bar .new-search-container.search-expanded {
    /* Container doesn\'t need to change width explicitly, input will push it */
}

#new-ngoflow-top-bar .new-search-container.search-expanded .new-search-input {
    width: 220px; /* Expanded width */
    opacity: 1;
    visibility: visible;
    border: 1px solid var(--new-border-color);
    padding-left: 30px; /* Make space for icon inside */
    position: relative; /* Back in flow */
    transition: width var(--new-transition-slow), opacity var(--new-transition-fast), visibility 0s, border-color var(--new-transition-fast);
}
#new-ngoflow-top-bar .new-search-container.search-expanded .new-search-input:focus {
     width: 260px; /* Slightly larger on focus */
     border-color: var(--new-accent-primary);
     box-shadow: 0 0 0 2px var(--new-accent-primary-light);
}


#new-ngoflow-top-bar .new-search-container.search-expanded .new-search-icon-btn {
    position: absolute; /* Position inside the input field */
    left: 6px; /* Adjust as needed for alignment */
    top: 50%;
    transform: translateY(-50%);
    color: var(--new-text-secondary);
    pointer-events: none; /* Icon inside input should not be clickable */
    z-index: 3; /* Above the input */
}

/* Adjustments for dark mode for new styles if necessary */
#new-ngoflow-top-bar.new-dark-mode .new-navbar-links::-webkit-scrollbar-thumb {
    background-color: var(--new-border-color);
}
#new-ngoflow-top-bar.new-dark-mode .new-navbar-links::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280; /* From original dark scrollbar */
}

#new-ngoflow-top-bar.new-dark-mode .new-search-icon-btn:hover {
    background-color: var(--new-bg-primary);
    color: var(--new-text-primary);
}

#new-ngoflow-top-bar.new-dark-mode .new-search-container.search-expanded .new-search-input {
    border-color: var(--new-border-color);
    background-color: var(--new-bg-primary); /* Match existing dark input */
    color: var(--new-text-primary); /* Match existing dark input */
}
#new-ngoflow-top-bar.new-dark-mode .new-search-container.search-expanded .new-search-input:focus {
    border-color: var(--new-accent-primary);
    box-shadow: 0 0 0 2px var(--new-accent-primary-light);
}

/* --- Styles for span.new-dropdown-item in User Menu to match a.new-dropdown-item --- */
#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--new-text-primary);
    font-size: 0.9rem;
    position: relative;
    cursor: pointer; /* Already set inline, but good to have in CSS */
}

#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--new-text-secondary);
}

#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item:hover {
    background-color: var(--new-bg-primary);
    text-decoration: none;
}

#new-ngoflow-top-bar .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item:hover i {
    color: var(--new-accent-primary);
}

/* Dark mode for span.new-dropdown-item in User Menu */
#new-ngoflow-top-bar.new-dark-mode .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item {
    color: var(--new-text-primary);
}

#new-ngoflow-top-bar.new-dark-mode .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item:hover {
    background-color: var(--new-bg-primary);
}

#new-ngoflow-top-bar.new-dark-mode .new-user-menu-dropdown .new-dropdown-content span.new-dropdown-item:hover i {
    color: var(--new-accent-primary); /* Ensure icon hover color is consistent in dark mode */
}

/* Logo visibility based on theme */
#new-ngoflow-top-bar .new-logo-dark-theme {
    display: none; /* Hidden by default */
}
#new-ngoflow-top-bar .new-logo-default {
    display: inline-block; /* Visible by default */
}

#new-ngoflow-top-bar.new-dark-mode .new-logo-default {
    display: none; /* Hide default logo in dark mode */
}
#new-ngoflow-top-bar.new-dark-mode .new-logo-dark-theme {
    display: inline-block; /* Show dark theme logo in dark mode */
}

/* --- Submenu specific styles for Programs --- */
#new-ngoflow-top-bar .new-nav-item.new-nav-submenu-container {
    position: relative; /* Establishes positioning context for the submenu */
}

#new-ngoflow-top-bar .new-nav-submenu-toggle { /* The button that triggers the submenu */
    display: flex;
    justify-content: space-between; /* Pushes text and icon apart */
    align-items: center;
    width: 100%; /* Takes full width of the parent li */
    /* Inherits .new-nav-link styles already from HTML, so padding, font, etc. are consistent */
}

#new-ngoflow-top-bar .new-nav-submenu { /* The UL for Program Types */
    display: none;
    position: absolute;
    left: 100%; /* Position to the right of the parent li.new-nav-submenu-container */
    top: 0; /* Align with the top of the parent "Programs" li item */
    background-color: var(--new-bg-secondary);
    border: 1px solid var(--new-border-color);
    border-radius: 8px;
    box-shadow: var(--new-shadow-md);
    min-width: 200px; /* Adjust as needed */
    max-height: 500px; /* Limit height for long program lists */
    overflow-y: auto; /* Enable scrolling when content exceeds max-height */
    z-index: calc(var(--new-z-index-dropdown) + 5); /* Ensure it's above the parent dropdown */
    padding: 6px;
    list-style: none; /* Remove default list styling */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--new-transition-fast), visibility 0s var(--new-transition-fast); /* Quick hide, fade in */
    pointer-events: none;
}

/* Show submenu on hover of its container li */
#new-ngoflow-top-bar .new-nav-submenu-container:hover > .new-nav-submenu {
    display: block;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s; /* Show immediately on hover */
    pointer-events: auto;
}

/* Keep submenu open if mouse moves onto the submenu itself */
#new-ngoflow-top-bar .new-nav-submenu:hover {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#new-ngoflow-top-bar .new-dropdown-icon-submenu {
    font-size: 0.7rem;
    margin-left: auto; /* Pushes icon to the far right */
    padding-left: 8px; /* Space between text and icon */
    transition: transform var(--new-transition-fast);
}

/* Optional: Rotate submenu icon on hover */
/*
#new-ngoflow-top-bar .new-nav-submenu-container:hover .new-dropdown-icon-submenu {
    transform: rotate(90deg);
}
*/

/* Dark mode for submenu */
#new-ngoflow-top-bar.new-dark-mode .new-nav-submenu {
    background-color: #4b5563; /* Match dark mode dropdown backgrounds */
    border-color: var(--new-border-color);
}
/* Ensure submenu links also get dark mode styling if not inheriting correctly */
#new-ngoflow-top-bar.new-dark-mode .new-nav-submenu .new-nav-link {
    color: var(--new-text-secondary);
}
#new-ngoflow-top-bar.new-dark-mode .new-nav-submenu .new-nav-link:hover {
    background-color: var(--new-bg-primary);
    color: var(--new-text-primary);
}
#new-ngoflow-top-bar.new-dark-mode .new-nav-submenu .new-nav-item.new-active > .new-nav-link {
    background-color: var(--new-accent-primary-light);
    color: #a5b4fc; /* Specific active color from main dark mode nav */
}

/* Style for button.new-nav-link (like Programs submenu trigger) to match a.new-nav-link in dropdowns */
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item > button.new-nav-link {
    background-color: transparent; /* Ensure no different background */
    border: none; /* Ensure no different border */
    color: var(--new-text-secondary); /* Default text color for nav links */
    padding: 8px 10px; /* Match padding of a.new-nav-link in dropdown */
    margin: 2px 0; /* Match margin */
    width: 100%;
    text-align: left; /* Align text to the left like other links */
    font-weight: 500; /* Match font-weight */
}

#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item > button.new-nav-link:hover {
    background-color: var(--new-bg-primary);
    color: var(--new-text-primary);
}

#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item.new-active > button.new-nav-link {
    background-color: var(--new-accent-primary-light);
    color: var(--new-accent-primary);
    font-weight: 600;
}

#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item > button.new-nav-link .new-nav-icon {
    color: var(--new-text-secondary); /* Default icon color */
    /* Potentially adjust icon color on hover/active if needed, though inherited from parent hover might be enough */
}

#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item > button.new-nav-link:hover .new-nav-icon,
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-item.new-active > button.new-nav-link .new-nav-icon {
    color: var(--new-accent-primary); /* Icon color on hover/active */
}

/* Keep Programs link highlighted when its submenu is open (on hover of container) */
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-submenu-container:hover > .new-nav-submenu-toggle {
    background-color: var(--new-bg-primary); /* Same as .new-nav-link:hover */
    color: var(--new-text-primary); /* Same as .new-nav-link:hover */
}
#new-ngoflow-top-bar .new-nav-dropdown-content .new-nav-submenu-container:hover > .new-nav-submenu-toggle .new-nav-icon {
    color: var(--new-accent-primary); /* Match icon color on hover */
}

/* Dark mode for Programs link highlighting when submenu is open */
#new-ngoflow-top-bar.new-dark-mode .new-nav-dropdown-content .new-nav-submenu-container:hover > .new-nav-submenu-toggle {
    background-color: var(--new-bg-primary); /* Dark mode hover background */
    color: var(--new-text-primary); /* Dark mode hover text color */
}
#new-ngoflow-top-bar.new-dark-mode .new-nav-dropdown-content .new-nav-submenu-container:hover > .new-nav-submenu-toggle .new-nav-icon {
    color: var(--new-accent-primary); /* Dark mode hover icon color */
}

/* Base Badge Style (already somewhat defined by .status-badge) */
.badge {
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    padding: 0.3em 0.6em; /* Base padding */
    font-size: 0.75rem;   /* Base font size */
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 2.5rem; /* Bootstrap-like rounded corners */
}

.badge i,
.badge .fas,
.badge .far,
.badge .fal,
.badge .fad {
    margin-right: 0.25em; /* Space between icon and text */
}

/* Colored Badges */
.badge-primary {
    color: var(--text-on-primary);
    background-color: var(--accent-primary);
}

.badge-secondary {
    color: var(--text-primary);
    background-color: var(--bg-primary); /* Using bg-primary for secondary badge */
    border: 1px solid var(--border-color);
}

.badge-success {
    color: var(--success-color);
    background-color: var(--success-color-bg);
}

.badge-danger {
    color: var(--text-on-danger);
    background-color: var(--danger-color);
}

.badge-warning {
    color: var(--warning-color);
    background-color: var(--warning-color-bg);
}

.badge-info {
    color: var(--info-color);
    background-color: var(--info-color-bg);
}

.badge-light {
    color: var(--light-color-text);
    background-color: var(--light-color-bg);
    border: 1px solid var(--light-color-border);
}

.badge-dark {
    color: var(--dark-color-text);
    background-color: var(--dark-color-bg);
}

/* Badge Sizes */
.badge-sm {
    padding: 0.2em 0.5em;
    font-size: 0.65rem;
}

.badge-lg {
    padding: 0.4em 0.8em;
    font-size: 0.9rem;
}

/* Dark Mode Adjustments for New Badges */
body.dark-mode .badge-primary {
    color: var(--text-on-primary); /* Assuming accent-primary is dark enough for light text */
    background-color: var(--accent-primary);
}

body.dark-mode .badge-secondary {
    color: var(--text-primary);
    background-color: var(--bg-primary); /* Dark mode bg-primary */
    border: 1px solid var(--border-color);
}

body.dark-mode .badge-success {
    /* Success color might need specific dark mode version if too light/dark */
    color: var(--text-on-success); /* Re-evaluate if --success-color changes significantly in dark mode */
    background-color: var(--success-color);
}

body.dark-mode .badge-danger {
    /* Uses dark mode --danger-color variable which is #f87171 */
    color: var(--text-on-danger); /* Usually white */
    background-color: var(--danger-color);
}

body.dark-mode .badge-warning {
    /* Warning color might need specific dark mode version */
    color: var(--text-on-warning); /* Re-evaluate if --warning-color changes significantly */
    background-color: var(--warning-color);
}

body.dark-mode .badge-info {
    /* Info color might need specific dark mode version */
    color: var(--text-on-info);
    background-color: var(--info-color);
}

body.dark-mode .badge-light {
    color: var(--dark-color-text); /* Text should be light on a dark "light" badge */
    background-color: var(--dark-color-bg); /* Using dark mode bg for light badge */
    border: 1px solid var(--dark-color-border);
}

body.dark-mode .badge-dark {
    color: var(--light-color-text); /* Text should be dark on a light "dark" badge (ironic) */
    background-color: var(--light-color-bg); /* Using light mode bg for dark badge */
}

/* --- Global Tab Styles --- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}
.tabs::-webkit-scrollbar { /* Chrome, Safari, Opera */
    display: none;
}

.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease-out, border-bottom-color 0.2s ease-out;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex-grow: 1; /* Allow buttons to grow and fill available space */
    text-align: center; /* Center text within each button */
}

.tab-button:not(:last-child) {
    margin-right: 5px; /* Add a small margin between tab buttons, but not after the last one */
}

.tab-button:hover {
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    /* Ensure no layout shifts during transition */
    position: relative;
    width: 100%;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

/* Dark Mode for Tabs */
body.dark-mode .tabs {
    border-bottom-color: var(--border-color);
}

body.dark-mode .tab-button {
    color: var(--text-secondary);
}

body.dark-mode .tab-button:hover {
    color: var(--text-primary);
}

body.dark-mode .tab-button.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Responsive Tab Styles */
@media (max-width: 768px) {
    .tabs {
        /* justify-content: flex-start; /* Default behavior for overflow:auto is flex-start */
        padding-bottom: 5px; /* Add some space below tabs if they wrap or scroll */
    }
    .tab-button {
        flex-shrink: 0; /* Allow buttons to shrink to fit if many tabs */
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .tab-content.active {
        display: block;
    }
}

/* Case Item Card (Nested card style) */
.item-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    /* Adjust spacing between list and other elements */
}

.item-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0;
    /* Reset for grid */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    /* Consistent with main card */
    padding: 20px;
    /* Consistent with main card body padding */
    background-color: var(--bg-primary);
    /* Lighter background than main card */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.dark-mode .item-card {
    background-color: rgba(75, 85, 99, 0.2);
    /* Darker secondary background */
}

.item-card:hover {
    transform: translateY(-3px);
    /* Consistent with stat-card hover */
    box-shadow: var(--shadow-md);
    /* Consistent with stat-card hover */
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 5px;
    /* Spacing below header */
}

.item-header .detail-label,
.item-header .detail-value {
    /* Adjust if using these inside header */
    margin-bottom: 0;
    font-size: 0.9rem;
    /* Slightly smaller */
}

.item-header .detail-value {
    font-weight: 600;
}

.item-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Adjusted for more columns */
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.item-details .key-info {
    background: transparent;
    /* No extra background for nested key-info */
    border: none;
    /* No extra border */
    padding: 0;
    /* No extra padding */
    margin: 0;
    /* No extra margin */
    box-shadow: none;
    /* No shadow */
}

.item-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    /* More space above actions */
}

.item-actions div {
    margin-right: auto;
}

.item-actions .btn-sm {
    max-height: 30px;
}

/* Section Headers in Tabs */
.section-header {
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.section-header i {
    color: var(--accent-primary);
}

.section-header span i {
    color: var(--accent-primary-light);
}

/* Key Information Highlight */
.key-info {
    background: var(--bg-primary);
    /* Use primary background for slight contrast */
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--border-color);
    margin: 10px 0 0;
    /* Adjust top margin for spacing within grid */
}

/* Remove top margin for first item in grid */
.key-info.full-width {
    /* Utility class if an item should span full grid width in some contexts */
    grid-column: 1 / 1;
}

.key-info-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 600;
}

.key-info-value {
    font-size: 14px;
    /* Slightly smaller for dense info */
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.key-info-value .font-mono {
    font-family: var(--font-family-monospace, monospace);
}

/* Styled list for family/contacts for better readability */
.styled-list {
    list-style: none;
    padding: 0;
}

.styled-list li {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    /* Spacing for icon and text */
    flex-wrap: wrap;
    /* Allow content to wrap */
}

body.dark-mode .styled-list li {
    background-color: rgba(75, 85, 99, 0.2);
}

.styled-list li i {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 4px;
    /* Ensure space for icon */
}

.styled-list li:last-child {
    margin-bottom: 0;
}

.styled-list .list-item-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 5px;
}

.styled-list .list-item-value {
    font-weight: 400;
    color: var(--text-primary);
    word-break: break-word;
    /* Prevent long strings from breaking layout */
}

.styled-list .text-sm-secondary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 5px;
    /* Space before secondary text */
    white-space: nowrap;
}

.styled-list li>div {
    /* For multi-line address blocks */
    flex-grow: 1;
}

/* Specific styles for user Details page */
.user-header-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    flex-shrink: 0;
    background-color: var(--bg-primary);
    /* Use primary background for consistent look */
}

body.dark-mode .user-avatar {
    background-color: rgba(75, 85, 99, 0.5);
    /* Darker placeholder color */
    border-color: var(--accent-primary);
}

.user-info {
    flex-grow: 1;
}

.user-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.user-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-meta .font-mono {
    /* Ensure font-mono is applied if not globally defined for this context */
    font-family: var(--font-family-monospace, monospace);
}

.user-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

.table-card-list tr {
    background-color: #F7F8FC;
}

/* End Global Tab Styles */

/* --- Notes Timeline Component Styles --- */
.notes-timeline-component {
    margin-bottom: 20px;
}

.notes-timeline-component .card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.notes-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.notes-header-content .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notes-header-content .card-title i {
    color: var(--accent-primary);
}

.notes-count-badge {
    margin-left: 8px;
}

.notes-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.notes-stats {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notes-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Timeline Event Styles */
.notes-timeline {
    padding: 0;
}

.timeline-event {
    position: relative;
    padding: 20px;
    margin-bottom: 20px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.timeline-event:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.timeline-event:last-child {
    margin-bottom: 0;
}

.timeline-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-event-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-grow: 1;
}

.timeline-event-title > span:first-of-type {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.timeline-event-title i {
    color: var(--accent-primary);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.timeline-event-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.timeline-date {
    font-weight: 500;
}

.timeline-author {
    font-style: italic;
}

.timeline-edited {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.timeline-event-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.timeline-event-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Loading States */
.notes-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notes-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    margin-bottom: 15px;
}

/* Empty State */
.notes-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notes-empty-state i {
    color: var(--border-color);
    margin-bottom: 15px;
}

.notes-empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* Form Styles */
.notes-form .form-group {
    margin-bottom: 1rem;
}

.notes-form .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.notes-form .form-control,
.notes-form .form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notes-form .form-control:focus,
.notes-form .form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.2rem var(--accent-primary-light);
}

.notes-form .is-invalid {
    border-color: var(--danger-color);
}

.notes-form .invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* Dropdown Menu Styles */
.notes-timeline-component .dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    padding: 8px;
    min-width: 200px;
}

.notes-timeline-component .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.notes-timeline-component .dropdown-item:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.notes-timeline-component .dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.notes-timeline-component .dropdown-item:hover i {
    color: var(--accent-primary);
}

.notes-timeline-component .dropdown-divider {
    margin: 8px 0;
    border-top: 1px solid var(--border-color);
}

/* Badge Adjustments for Notes */
.timeline-event-title .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* Dark Mode Support for Notes Timeline */
body.dark-mode .timeline-event {
    background-color: rgba(75, 85, 99, 0.2);
    border-color: var(--border-color);
}

body.dark-mode .timeline-event:hover {
    background-color: rgba(75, 85, 99, 0.3);
}

body.dark-mode .timeline-event-actions {
    border-top-color: var(--border-color);
}

body.dark-mode .notes-timeline-component .dropdown-menu {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .notes-timeline-component .dropdown-item {
    color: var(--text-primary);
}

body.dark-mode .notes-timeline-component .dropdown-item:hover {
    background-color: var(--bg-primary);
}

body.dark-mode .notes-loading {
    color: var(--text-secondary);
}

body.dark-mode .notes-empty-state {
    color: var(--text-secondary);
}

body.dark-mode .notes-empty-state h5 {
    color: var(--text-primary);
}

body.dark-mode .notes-form .form-control,
body.dark-mode .notes-form .form-select {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .notes-form .form-control::placeholder {
    color: var(--text-secondary);
}

body.dark-mode .notes-form .form-control:focus,
body.dark-mode .notes-form .form-select:focus {
    background-color: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.2rem var(--accent-primary-light);
    color: var(--text-primary);
}

body.dark-mode .notes-form .is-invalid {
    border-color: var(--danger-color);
}

/* Responsive Notes Timeline */
@media (max-width: 768px) {
    .notes-header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .notes-header-actions {
        justify-content: space-between;
    }
    
    .notes-stats {
        order: -1;
        justify-content: center;
    }
    
    .timeline-event {
        padding: 15px;
    }
    
    .timeline-event-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .timeline-event-meta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .timeline-event-actions {
        justify-content: center;
        gap: 15px;
    }
    
    .notes-actions {
        justify-content: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .timeline-event-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .notes-timeline-component .dropdown-menu {
        min-width: 180px;
    }
    
    .notes-timeline-component .dropdown-item {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-event {
    animation: slideInUp 0.3s ease-out;
}

/* Utility Classes for Notes */
.notes-timeline-component .text-center {
    text-align: center !important;
}

.notes-timeline-component .mt-2 {
    margin-top: 0.5rem !important;
}

.notes-timeline-component .mt-3 {
    margin-top: 1rem !important;
}

.notes-timeline-component .mb-3 {
    margin-bottom: 1rem !important;
}

.notes-timeline-component .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Ensure proper spacing when used below tabs */
.tab-content-container + .notes-timeline-component {
    margin-top: 30px;
}

/* Updated Notes Timeline Component Styles */
.notes-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.header-left h5 {
    color: var(--text-primary, #1f2937);
    font-weight: 600;
    margin-bottom: 8px;
}

.stats-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-soft-primary {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-soft-info {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-soft-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

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

/* Timeline Container */
.notes-timeline-container {
    position: relative;
}

/* Timeline Events */
.timeline-events {
    position: relative;
}

.timeline-event {
    position: relative;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.timeline-event:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-primary, #3b82f6);
}

.timeline-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.timeline-event-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0;
    line-height: 1.4;
}

.timeline-event-meta {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    text-align: right;
}

.timeline-event-date {
    display: block;
    margin-bottom: 2px;
}

.timeline-event-author {
    display: block;
    font-weight: 500;
}

.timeline-event-content {
    color: var(--text-primary, #374151);
    line-height: 1.6;
    margin-bottom: 15px;
}

.timeline-event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #f3f4f6);
}

.timeline-event-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.timeline-event-category {
    background: var(--accent-primary, #3b82f6);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.timeline-event-visibility {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.visibility-internal {
    color: var(--warning-color, #f59e0b);
}

.visibility-shared {
    color: var(--success-color, #10b981);
}

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

.timeline-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.timeline-action-btn:hover {
    background: var(--bg-primary, #f3f4f6);
    color: var(--accent-primary, #3b82f6);
}

.timeline-action-btn.edit-btn:hover {
    color: var(--warning-color, #f59e0b);
}

.timeline-action-btn.delete-btn:hover {
    color: var(--danger-color, #ef4444);
}

/* Update Type Icons */
.update-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 14px;
    flex-shrink: 0;
}

.update-type-icon.call-attempted {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.update-type-icon.email-sent {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.update-type-icon.follow-up-scheduled {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.update-type-icon.document-received {
    background: rgba(139, 69, 19, 0.1);
    color: #8b4513;
}

.update-type-icon.meeting-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.update-type-icon.service-provided {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* Quick Update Modal */
.update-type-display {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.update-type-display .update-icon {
    font-size: 18px;
    margin-right: 8px;
}

/* Loading and Empty States */
.timeline-loading {
    text-align: center;
    color: var(--text-secondary, #6b7280);
}

.timeline-empty {
    text-align: center;
    color: var(--text-secondary, #6b7280);
}

.timeline-empty i {
    opacity: 0.6;
}

/* Form Styling */
.notes-form .form-label {
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    margin-bottom: 6px;
}

.notes-form .form-control:focus,
.notes-form .form-select:focus {
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Dropdown Styling */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
}

.dropdown-item i {
    width: 16px;
    margin-right: 8px;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--accent-primary, #3b82f6);
    color: white;
}

/* Responsive Design for New Timeline */
@media (max-width: 768px) {
    .notes-timeline-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-right {
        justify-content: flex-end;
    }
    
    .timeline-event-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .timeline-event-meta {
        text-align: left;
    }
    
    .timeline-event-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .timeline-event-actions {
        align-self: flex-end;
    }
}

/* Dark Mode Support for New Timeline */
body.dark-mode .timeline-event {
    background: var(--bg-secondary, #374151);
    border-color: var(--border-color, #4b5563);
    color: var(--text-primary, #f3f4f6);
}

body.dark-mode .timeline-event-title {
    color: var(--text-primary, #f9fafb);
}

body.dark-mode .timeline-event:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .timeline-action-btn:hover {
    background: var(--bg-primary, #4b5563);
}

body.dark-mode .badge-soft-primary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

body.dark-mode .badge-soft-info {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

body.dark-mode .badge-soft-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* End Notes Timeline Component Styles */