/* Flex centering for main layout */
.main-wrapper {
    display: flex;
    flex-direction: row;
}

.main-content {
    min-height: 100vh;
    box-sizing: border-box;
    padding: 2rem 0;
    background: #f1f5f9;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 1rem;
        padding-top: 4rem;
    }
    .main-wrapper {
        flex-direction: column;
    }
}
:root {
    /* Modern primary colors - vibrant but refined */
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --secondary: #06b6d4;
    --secondary-light: #22d3ee;
    
    /* Action colors - modern palette */
    --accent: #f97316;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    /* Accent colors */
    --purple: #8b5cf6;
    --pink: #ec4899;
    --indigo: #6366f1;
    
    /* Neutral background - fresh and clean */
    --bg: #f8fafc;
    --bg-light: #f1f5f9;
    --bg-lighter: #e2e8f0;
    --card: #ffffff;
    
    /* Text colors - better contrast */
    --text: #0f172a;
    --text-light: #475569;
    --text-lighter: #64748b;
    
    /* Border - subtle and clean */
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    
    /* Shadows - soft and modern */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
    font-size: 90%;
}
body {
    font-family: 'Manrope', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}
button, input, select, textarea {
    font: inherit;
}

table {
    font-size: 0.95rem;
}

table th,
table td {
    padding-block: 0.7rem;
}

@media (max-width: 768px) {
    html { font-size: 14px; }
}

/* Login Screen */
.login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
    min-height: 100vh;
}
.login-container {
    background: var(--card); padding: 2rem; border-radius: 16px;
    box-shadow: var(--shadow-xl); width: 100%; max-width: 450px; text-align: center;
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}
@media (max-width: 480px) {
    .login-container { padding: 1.5rem; border-radius: 12px; }
}
.login-logo {
    width: 70px; height: 70px; background: var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem; color: white; font-size: 1.75rem;
}

/* Auth Loading Screen */
.auth-loading {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center; z-index: 1001;
    padding: 1rem;
}
.auth-loading-content {
    background: var(--card); padding: 2.5rem; border-radius: 16px;
    box-shadow: var(--shadow-xl); width: 100%; max-width: 400px; text-align: center;
}
.auth-loading-content h2 {
    font-size: 1.25rem; margin-bottom: 1.5rem; color: var(--text);
}
.auth-loading-content p {
    color: var(--text-light); font-size: 0.9rem; margin-top: 1rem;
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

body.dark .login-screen,
body.dark .auth-loading {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
}

body.dark .login-container,
body.dark .auth-loading-content {
    background: #ffffff;
    color: #1e293b;
}

body.dark .login-container h1,
body.dark .auth-loading-content h2,
body.dark .form-group label {
    color: #1e293b;
}

body.dark .login-container p,
body.dark .auth-loading-content p {
    color: #64748b;
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}

.login-container h1 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text); }
.login-container p { color: var(--text-light); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* Form Elements */
.form-group { margin-bottom: 1.25rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.875rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.75rem 1rem; border: 2px solid var(--border);
    border-radius: 8px; font-size: 1rem; font-family: 'Inter', sans-serif;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary-light);
}

/* Ensure explicit global form-control classes are not overridden by the broad
   .form-group input selector above. */
.form-group .form-input,
.form-group .form-select,
.form-group .form-textarea,
.form-group .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input.is-invalid,
.form-group input.is-invalid:focus {
    border-color: var(--danger);
    background-color: rgba(239, 68, 68, 0.04);
}

.form-group label.is-invalid {
    color: var(--danger);
}

.login-error-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
}

.login-error-alert i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    touch-action: manipulation;
    text-decoration: none;
}
.btn:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-secondary:hover { background: var(--border); }
.btn-secondary.active {
    background: rgba(59, 130, 246, 0.10);
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-purple { background: var(--purple); color: white; }
.btn-purple:hover { background: #6d28d9; }

/* Full-width button modifier */
.btn-block { width: 100%; }

/* ============================================================
   ACTION BUTTON STANDARDIZATION (MODULE-WIDE)
   ============================================================ */

.is-action-button {
    font-family: inherit;
}

.btn-standard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 36px;
    padding: 0.55rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

input[type="button"].btn-standard,
input[type="submit"].btn-standard {
    display: inline-block;
}

.btn-standard:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.btn-standard:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-standard-primary {
    background: var(--primary);
    color: #fff;
}

.btn-standard-primary:hover {
    background: var(--primary-dark);
}

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

.btn-standard-secondary:hover {
    background: var(--border);
}

.btn-standard-danger {
    background: var(--danger);
    color: #fff;
}

.btn-standard-danger:hover {
    background: #dc2626;
}

/* Global standardized button foundation for standalone pages and shared screens. */
[data-ui-button="true"],
[data-ui-button="true"]:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

[data-ui-button="true"]:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

[data-ui-button="true"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

[data-ui-button="true"][data-ui-button-variant="primary"] {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

[data-ui-button="true"][data-ui-button-variant="primary"]:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

[data-ui-button="true"][data-ui-button-variant="secondary"] {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

[data-ui-button="true"][data-ui-button-variant="secondary"]:hover,
[data-ui-button="true"].active[data-ui-button-variant="secondary"],
[data-ui-button="true"][aria-pressed="true"][data-ui-button-variant="secondary"] {
    background: var(--bg-light);
    color: var(--primary);
    border-color: var(--primary-light);
}

[data-ui-button="true"][data-ui-button-variant="danger"] {
    background: #fff5f5;
    color: var(--danger);
    border-color: #fecaca;
}

[data-ui-button="true"][data-ui-button-variant="danger"]:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

/* ============================================================
   GLOBAL ACTION ICON BUTTONS (View / Edit / Pause / Delete)
   ============================================================ */

/* Base action button — compact icon chip matching unified pastel theme */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    background: #f8fafc;
    color: var(--text-light);
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.btn-action:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.btn-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.btn-action:hover {
    background: #eef2f7;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

/* Semantic variants */
.btn-action-view {
    background: #eaf8ff;
    color: #0ea5e9;
    border-color: #bfe8fb;
}
.btn-action-view:hover {
    background: #dcf1fc;
    color: #0284c7;
    box-shadow: 0 6px 12px rgba(14, 165, 233, 0.18);
}

.btn-action-edit {
    background: #edf2ff;
    color: #2563eb;
    border-color: #c9d8ff;
}
.btn-action-edit:hover {
    background: #e2eaff;
    color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.18);
}

.btn-action-pause {
    background: #fff6e8;
    color: #f59e0b;
    border-color: #f7dfb3;
}
.btn-action-pause:hover {
    background: #ffefcf;
    color: #b45309;
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.18);
}

.btn-action-play {
    background: #eafaf2;
    color: #10b981;
    border-color: #c4ecd9;
}
.btn-action-play:hover {
    background: #d9f5e8;
    color: #047857;
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.18);
}

.btn-action-delete {
    background: #ffeff1;
    color: #ef4444;
    border-color: #f5c9cf;
}
.btn-action-delete:hover {
    background: #ffe1e5;
    color: #b91c1c;
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.16);
}

/* Action button group — tight cluster for table rows & cards */
.btn-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
}

/* Generic icon button (used in modals, forms, inline lists) */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.btn-icon:hover {
    background: var(--bg-lighter);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Outline button variants (used across modules but previously undefined) */
.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}
.btn-outline:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary-light);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.35);
}
.btn-outline-primary:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-dark);
    border-color: var(--primary);
}

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

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border-color: var(--danger);
}

/* Role Selector */
.role-selector {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.5rem;
}
@media (max-width: 480px) {
    .role-selector { grid-template-columns: 1fr; }
}
.role-option {
    padding: 1rem; border: 2px solid var(--border); border-radius: 8px;
    cursor: pointer; text-align: center;
}
.role-option:hover, .role-option.active { border-color: var(--primary); background: #eff6ff; }
.role-option i { font-size: 1.25rem; margin-bottom: 0.5rem; display: block; color: var(--primary); }
.role-option span { font-size: 0.8rem; font-weight: 500; }

/* Layout */
.app-container { display: none; min-height: 100vh; }

/* Sidebar */
.sidebar {
    position: fixed; left: 0; top: 0; width: 280px; height: 100vh;
    background: var(--card); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 100; overflow-y: auto;
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.active { transform: translateX(0); }
}
.sidebar-header { 
    padding: 1.25rem; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
}
.sidebar-logo {
    width: 40px; height: 40px; background: var(--primary); border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: white; font-size: 1.25rem;
}
.sidebar-brand h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.sidebar-brand span { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }

.nav-menu { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem;
    color: var(--text-light); text-decoration: none;
    border-left: 3px solid transparent; cursor: pointer; font-size: 0.9rem;
}
.nav-item:hover, .nav-item.active { background: #eff6ff; color: var(--primary); border-left-color: var(--primary); }
.nav-item i { width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto; background: var(--danger); color: white;
    font-size: 0.7rem; padding: 0.125rem 0.5rem; border-radius: 9999px;
}

.sidebar-footer { padding: 1.25rem; border-top: 1px solid var(--border); }
.user-profile { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.user-avatar {
    width: 36px; height: 36px; background: var(--primary-light); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 0.875rem;
}
.user-info h4 { font-size: 0.8rem; font-weight: 600; }
.user-info span { font-size: 0.7rem; color: var(--text-light); }

.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 99;
}
@media (max-width: 1024px) {
    .sidebar-overlay.active { display: block; }
}

/* Main Content */

.main-content {
    padding: 2rem 3rem;
    min-height: 100vh;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1400px) {
    .main-content {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}



@media (max-width: 1024px) {
    .main-content {
        padding: 1rem;
        padding-top: 4rem;
        max-width: 100vw;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.25rem 1.25rem 2.5rem 1.25rem !important;
        min-width: 0;
        box-sizing: border-box;
    }
    .content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        overflow-x: auto;
        padding-bottom: 2.5rem;
    }
        /* Show and style horizontal scrollbar for content-grid */
        .content-grid::-webkit-scrollbar {
            height: 10px;
            background: #f1f1f1;
        }
        .content-grid::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 5px;
        }
        .content-grid {
            scrollbar-width: thin;
            scrollbar-color: #c1c1c1 #f1f1f1;
        }
    .card, .card-body, .card-header {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
    .additional-details, .sub-tasks {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
}

/* Top Bar */
.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
    gap: 1rem;
    position: relative;
    z-index: 100;
}
@media (max-width: 768px) {
    .top-bar { flex-wrap: wrap; }
    .page-title { width: 100%; order: 2; }
}
.page-title h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.page-title p { color: var(--text-light); font-size: 0.875rem; }
.section-title { font-size: 1.25rem; font-weight: 700; }
.info-box {
    margin: 0;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 4px;
}
.info-box-block {
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    min-height: 100px;
    white-space: pre-wrap;
}
.top-actions { display: flex; gap: 0.75rem; align-items: center; position: relative; }

.menu-toggle {
    display: none; width: 40px; height: 40px; border: none; background: var(--card);
    border-radius: 8px; cursor: pointer; align-items: center; justify-content: center;
    font-size: 1.25rem; box-shadow: var(--shadow); position: fixed;
    top: 1rem; left: 1rem; z-index: 98;
}
@media (max-width: 1024px) {
    .menu-toggle { display: flex; }
}

.search-box { position: relative; }
.search-box input {
    padding: 0.625rem 1rem 0.625rem 2.5rem; border: 2px solid var(--border);
    border-radius: 8px; width: 250px; font-size: 0.875rem;
}
@media (max-width: 768px) {
    .search-box { display: none; }
    .search-box.mobile-visible {
        display: block; position: fixed; top: 4rem; left: 1rem; right: 1rem; z-index: 97; width: auto;
    }
    .search-box.mobile-visible input { width: 100%; }
}
.search-box i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.notification-btn {
    position: relative; width: 40px; height: 40px; border: 2px solid var(--border);
    border-radius: 8px; background: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.notification-btn::after {
    content: ''; position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
}
.notification-panel {
    position: absolute; top: 50px; right: 0; width: 320px; max-height: 400px;
    background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
    z-index: 9999; display: none; overflow-y: auto;
}
@media (max-width: 480px) {
    .notification-panel {
        width: calc(100vw - 2rem);
        right: -1rem;
        max-height: 60vh;
    }
}
.notification-panel.active { display: block; }
.notification-item {
    padding: 1rem; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.notification-item:hover { background: var(--bg); }
.notification-item.unread { border-left: 3px solid var(--primary); }
.notification-item:last-child { border-bottom: none; }

/* User Dropdown */
.user-dropdown-container { position: relative; }
.user-dropdown-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    background: var(--card); border: 2px solid var(--border);
    border-radius: 50px; cursor: pointer;
    font-size: 0.875rem; font-weight: 500;
}
.user-dropdown-btn:hover { border-color: var(--primary); }
.user-dropdown-btn .user-avatar-img,
.user-dropdown-btn .user-avatar-placeholder {
    width: 32px; height: 32px; border-radius: 50%;
    object-fit: cover;
}
.user-dropdown-btn .user-avatar-placeholder {
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600;
}
.user-dropdown-btn .user-name {
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown-btn .fa-chevron-down {
    font-size: 0.75rem; color: var(--text-light); margin-left: 0.25rem;
}
.user-dropdown-menu {
    position: absolute; top: 50px; right: 0; width: 260px;
    background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
    z-index: 10000; display: none; overflow: hidden;
}
.user-dropdown-menu.active { display: block; }
.user-dropdown-menu .dropdown-header {
    padding: 1rem; background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}
.user-dropdown-menu .dropdown-header strong {
    display: block; font-size: 0.95rem; margin-bottom: 0.25rem;
}
.user-dropdown-menu .dropdown-header span {
    display: block; font-size: 0.75rem; opacity: 0.9;
}
.user-dropdown-menu .dropdown-divider {
    height: 1px; background: var(--border); margin: 0.5rem 0;
}
.user-dropdown-menu .dropdown-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; color: var(--text); text-decoration: none;
    font-size: 0.875rem;
}
.user-dropdown-menu .dropdown-item:hover { background: var(--bg); }
.user-dropdown-menu .dropdown-item i { width: 20px; color: var(--text-light); }
.user-dropdown-menu .dropdown-item.logout { color: var(--danger); }
.user-dropdown-menu .dropdown-item.logout i { color: var(--danger); }
@media (max-width: 480px) {
    .user-dropdown-btn .user-name { display: none; }
    .user-dropdown-menu { width: calc(100vw - 2rem); right: -0.5rem; }
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 1440px) { .dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .dashboard-grid { grid-template-columns: 1fr; } }

.stat-card {
    --stat-accent: var(--primary-light);
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 94px;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 60%, rgba(59, 130, 246, 0.10) 100%);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--stat-accent);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
}
.stat-card.primary { --stat-accent: var(--primary-light); background: linear-gradient(135deg, #ffffff 0%, rgba(59, 130, 246, 0.10) 100%); }
.stat-card.success { --stat-accent: var(--success); background: linear-gradient(135deg, #ffffff 0%, rgba(16, 185, 129, 0.10) 100%); }
.stat-card.warning { --stat-accent: var(--warning); background: linear-gradient(135deg, #ffffff 0%, rgba(245, 158, 11, 0.10) 100%); }
.stat-card.danger { --stat-accent: var(--danger); background: linear-gradient(135deg, #ffffff 0%, rgba(239, 68, 68, 0.10) 100%); }
.stat-card.info { --stat-accent: var(--info); background: linear-gradient(135deg, #ffffff 0%, rgba(14, 165, 233, 0.10) 100%); }
.stat-card.purple { --stat-accent: var(--purple); background: linear-gradient(135deg, #ffffff 0%, rgba(124, 58, 237, 0.10) 100%); }
.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
}
.stat-header > div:first-child {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.18rem;
}
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    background: rgba(59, 130, 246, 0.16);
    color: var(--primary);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.16);
    flex-shrink: 0;
}
.stat-card.primary .stat-icon { background: rgba(59, 130, 246, 0.14); color: var(--primary); }
.stat-card.success .stat-icon { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.stat-card.warning .stat-icon { background: rgba(245, 158, 11, 0.16); color: var(--warning); }
.stat-card.danger .stat-icon { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.stat-card.info .stat-icon { background: rgba(14, 165, 233, 0.14); color: var(--info); }
.stat-card.purple .stat-icon { background: rgba(124, 58, 237, 0.14); color: var(--purple); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.14); color: var(--primary); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.16); color: var(--warning); }
.stat-icon.green { background: rgba(16, 185, 129, 0.14); color: var(--success); }
.stat-icon.red { background: rgba(239, 68, 68, 0.14); color: var(--danger); }
.stat-icon.purple { background: rgba(124, 58, 237, 0.14); color: var(--purple); }
.stat-value {
    font-size: clamp(1.2rem, 1.5vw, 1.45rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
}
.stat-label {
    color: var(--text-light);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
}

.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 1024px) { .content-grid { grid-template-columns: 1fr; } }

/* Cards */
.card {
    background: var(--card); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
    margin-bottom: 1rem;
}
.card-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* Module Sections */
.module-section { 
    display: none;
    position: relative;
}
.module-section.active { 
    display: block; 
    overflow: visible;
}
#messaging.module-section.active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Ensure proper box-sizing for all module elements */
.module-section * {
    box-sizing: border-box;
}

/* Committees */
.committee-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 1rem; 
    margin-bottom: 1.5rem; 
}
@media (max-width: 640px) { .committee-grid { grid-template-columns: 1fr; } }

.committee-card {
    background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
    overflow: hidden; border: 2px solid transparent;
}
.committee-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); }
.committee-header {
    padding: 1.25rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white;
}
.committee-header.property { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.committee-header.fig { background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%); }
.committee-header.people { background: linear-gradient(135deg, #db2777 0%, #ec4899 100%); }
.committee-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.committee-subtitle { font-size: 0.8rem; opacity: 0.9; }
.committee-body { padding: 1.25rem; }
.committee-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1rem; text-align: center; }
.committee-stat { padding: 0.5rem; background: var(--bg); border-radius: 8px; }
.committee-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.committee-stat-label { font-size: 0.7rem; color: var(--text-light); }
.member-list { display: flex; margin-bottom: 1rem; }
.member-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light);
    display: flex; align-items: center; justify-content: center; color: white;
    font-size: 0.7rem; font-weight: 600; border: 2px solid white; margin-left: -0.5rem;
}
.member-avatar:first-child { margin-left: 0; }

.workflow-status {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-radius: 9999px; font-size: 0.8rem; font-weight: 600; margin-top: 1rem;
}
.workflow-pending { background: #fef3c7; color: var(--warning); }
.workflow-approved { background: #d1fae5; color: var(--success); }
.workflow-board { background: #dbeafe; color: var(--primary); }

/* Meetings */
.meeting-tabs {
    display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
    background: var(--bg); padding: 0.5rem; border-radius: 12px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.meeting-tabs::-webkit-scrollbar { display: none; }
.meeting-tab {
    padding: 0.625rem 1rem; border-radius: 8px; cursor: pointer;
    font-weight: 500; border: none; background: transparent;
    white-space: nowrap; font-size: 0.875rem;
}
.meeting-tab.active { background: white; box-shadow: var(--shadow); color: var(--primary); }
.meeting-tab:hover:not(.active) { background: rgba(255,255,255,0.5); }
.meeting-detail-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 600;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.meeting-detail-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.meeting-detail-tab:hover { color: var(--text); }
.meeting-type-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600;
}
.type-board { background: #dbeafe; color: var(--primary); }
.type-committee { background: #d1fae5; color: var(--success); }
.type-extraordinary { background: #fee2e2; color: var(--danger); }

.meeting-board-layout,
.meeting-table-view {
    padding: 1.25rem;
}

.meeting-board-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
}

.meeting-board-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.meeting-board-copy {
    margin-top: 0.3rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-light);
    max-width: 760px;
}

.meeting-board-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.meeting-category-section {
    margin-top: 1rem;
}

.meeting-category-panel {
    border: 1px solid #dbe3ee;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
    overflow: visible;
}

.meeting-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(219, 227, 238, 0.9);
}

.meeting-category-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.meeting-category-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #dbeafe;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.meeting-category-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.meeting-category-subtitle {
    margin-top: 0.18rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.meeting-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 300px));
    gap: 1rem;
    padding: 1rem;
    justify-content: flex-start;
}

.meeting-card {
    display: flex;
    flex-direction: column;
    min-height: 170px;
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(219, 227, 238, 0.95);
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.meeting-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    border-color: rgba(59, 130, 246, 0.26);
}

/* Meeting urgency states */
.meeting-card-urgent {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.03) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.meeting-card-urgent:hover {
    box-shadow: 0 14px 30px rgba(220, 38, 38, 0.12);
}

.meeting-card-soon {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.03) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.meeting-card-soon:hover {
    box-shadow: 0 14px 30px rgba(217, 119, 6, 0.12);
}

.meeting-card-upcoming {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.03) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.meeting-card-upcoming:hover {
    box-shadow: 0 14px 30px rgba(5, 150, 105, 0.12);
}

.meeting-card-past {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.03) 0%, rgba(255, 255, 255, 0.95) 100%);
    opacity: 0.75;
}

.meeting-card-past:hover {
    box-shadow: 0 14px 30px rgba(148, 163, 184, 0.08);
}

.meeting-card-top,
.meeting-card-actions,
.meeting-action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meeting-card-top {
    justify-content: space-between;
}

.meeting-card-type,
.meeting-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.meeting-card-type {
    background: #eff6ff;
    color: var(--primary);
}

.meeting-card-title {
    margin: 0.62rem 0 0.28rem;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.28;
    color: var(--text);
}

.meeting-card-datetime {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.48rem;
    padding: 0.42rem 0.55rem;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.06) 100%);
}

.meeting-card-date-strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: 0.01em;
}

.meeting-card-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #1e3a8a;
    font-size: 0.76rem;
    font-weight: 700;
}

.meeting-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 0.35rem;
    color: var(--text-light);
    font-size: 0.78rem;
}

.meeting-card-location {
    min-height: 1.05rem;
    margin-bottom: 0.45rem;
}

.meeting-card-actions {
    margin-top: auto;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.1rem;
}

.meeting-card-actions .btn,
.meeting-action-group .btn {
    height: 34px;
    min-width: 34px;
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.meeting-action-view {
    width: 36px;
    padding: 0;
}

.meeting-table-title {
    font-weight: 700;
    color: var(--text);
}

.meeting-table-subtitle {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--text-light);
}

.meeting-action-group {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.meeting-actions-column {
    text-align: right;
    width: 128px;
}

.meeting-actions-column .meeting-action-group {
    justify-content: flex-end;
}

.meeting-action-group .btn-primary {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.meeting-action-group .btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.meeting-action-group .btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.meeting-action-group .btn-secondary:hover {
    background: var(--border);
    border-color: var(--primary-light);
}

.meeting-action-group .btn-success {
    background: var(--success);
    color: white;
    font-weight: 600;
}

.meeting-action-group .btn-success:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.meeting-action-menu-wrap {
    position: relative;
}

.meeting-menu-toggle {
    width: 36px;
    padding: 0;
}

.meeting-action-menu {
    position: absolute;
    inset: calc(100% + 0.4rem) 0 auto auto;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    padding: 0.35rem;
    z-index: 220;
    display: none;
}

#meetings .meeting-action-menu,
#meetingsModalHost .meeting-action-menu {
    z-index: 14020;
}

.meeting-table-card,
.meeting-table-responsive {
    overflow: visible;
}

.meeting-action-menu.open {
    display: block;
}

.meeting-action-menu.open-up {
    top: auto;
    bottom: calc(100% + 0.4rem);
}

.meeting-action-menu.open-down {
    top: calc(100% + 0.4rem);
    bottom: auto;
}

.meeting-action-menu.open-left {
    right: 0;
    left: auto;
}

.meeting-action-menu.open-right {
    left: 0;
    right: auto;
}

.meeting-action-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 500;
    text-align: left;
    border-radius: 8px;
    padding: 0.52rem 0.62rem;
    cursor: pointer;
}

.meeting-action-menu-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.meeting-action-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ========== GENERIC ACTION MENU (Reusable across all modules) ========== */

.action-menu-wrap {
    position: relative;
}

.action-menu-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.action-menu {
    position: absolute;
    inset: calc(100% + 0.4rem) 0 auto auto;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    padding: 0.35rem;
    z-index: 220;
    display: none;
}

.table-card .action-menu {
    z-index: 250;
}

.action-menu.open {
    display: block;
    animation: slideIn 0.15s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-menu.open-up {
    top: auto;
    bottom: calc(100% + 0.4rem);
}

.action-menu.open-down {
    top: calc(100% + 0.4rem);
    bottom: auto;
}

.action-menu.open-left {
    right: 0;
    left: auto;
}

.action-menu.open-right {
    left: 0;
    right: auto;
}

.action-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 500;
    text-align: left;
    border-radius: 8px;
    padding: 0.52rem 0.62rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--text-light);
}

.action-menu-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.action-menu-item:hover i {
    color: var(--primary);
}

.action-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-menu-item.danger {
    color: var(--danger);
}

.action-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.action-menu-item.success {
    color: var(--success);
}

.action-menu-item.success:hover {
    background: rgba(5, 150, 105, 0.1);
}

/* Meetings overlay modals must override global .modal content styles */
#meetingsModalHost .modal,
#meetings .modal,
#polls .modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12000 !important;
    padding: 1rem;
    overflow-y: auto;
}

#meetingsModalHost .modal-content,
#meetings .modal-content,
#polls .modal-content {
    width: min(900px, calc(100vw - 2rem));
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

#meetingDetailsModal .modal-content,
#meetingsModalHost #meetingDetailsModal .modal-content {
    width: min(1120px, calc(100vw - 2rem));
    height: min(90vh, 860px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#meetingDetailsModal .modal-body,
#meetingsModalHost #meetingDetailsModal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

#meetingDetailsFooter,
#meetingsModalHost #meetingDetailsFooter {
    margin-top: 0;
    position: sticky;
    bottom: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 22px rgba(15, 23, 42, 0.08);
    z-index: 2;
}

@media (max-width: 768px) {
    #meetingDetailsModal .modal-content,
    #meetingsModalHost #meetingDetailsModal .modal-content {
        width: calc(100vw - 1rem);
        height: calc(100vh - 1rem);
        border-radius: 12px;
    }
}

.meeting-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-light);
}

.meeting-empty-state i {
    display: block;
    margin-bottom: 0.9rem;
    font-size: 2.35rem;
    opacity: 0.35;
}

.agenda-item {
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.agenda-item:hover {
    background: #f8fbff !important;
}

@media (max-width: 768px) {
    .meeting-detail-tab {
        padding: 0.6rem 0.75rem;
        font-size: 0.82rem;
    }

    .meeting-board-summary {
        flex-direction: column;
    }

    .meeting-category-grid {
        grid-template-columns: 1fr;
    }

    #meetingsAllTable th:nth-child(4),
    #meetingsAllTable td:nth-child(4) {
        display: none;
    }

    .meeting-action-group {
        flex-wrap: wrap;
    }

    .meeting-action-menu {
        right: auto;
        left: 0;
        min-width: 160px;
    }
}

/* Checklist Items */
.checklist-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem;
    border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item.completed { background: #f0fdf4; }
.checklist-checkbox {
    width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.checklist-item.completed .checklist-checkbox { background: var(--success); border-color: var(--success); color: white; }
.checklist-content { flex: 1; min-width: 0; }
.checklist-content h4 { font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; }
.checklist-content p { font-size: 0.8rem; color: var(--text-light); }
.checklist-due { font-size: 0.75rem; color: var(--danger); font-weight: 500; }

/* Training */
.training-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
@media (max-width: 640px) { .training-grid { grid-template-columns: 1fr; } }

.training-card {
    background: var(--card); border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow);
}
.training-card:hover { box-shadow: var(--shadow-lg); }
.training-thumbnail {
    height: 140px; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex; align-items: center; justify-content: center; color: white; font-size: 2.5rem;
}
.training-info { padding: 1.25rem; }
.training-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.training-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.training-duration { font-size: 0.8rem; color: var(--text-light); }

/* Calendar */
.calendar-container { background: var(--card); border-radius: 12px; padding: 1.25rem; box-shadow: var(--shadow); }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.calendar-header h3 { font-size: 1.1rem; }
.calendar-nav { display: flex; gap: 0.5rem; }
.calendar-nav button {
    width: 32px; height: 32px; border: 1px solid var(--border); background: white;
    border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.calendar-day-header {
    text-align: center; font-weight: 600; font-size: 0.75rem;
    color: var(--text-light); padding: 0.5rem;
}
.calendar-day {
    min-height: 80px; border: 1px solid var(--border); border-radius: 6px;
    padding: 0.35rem; cursor: pointer; position: relative;
    font-size: 0.8rem; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    overflow: hidden;
}
.calendar-day:hover { background: #eff6ff; border-color: var(--primary); }
.calendar-day.today { background: var(--primary); color: white; border-color: var(--primary); }
.calendar-day.today .day-number { color: white; }
.calendar-day.today .day-event-pill { background: rgba(255,255,255,0.2); color: white; border-left-color: rgba(255,255,255,0.9); }
.calendar-day.today .day-event-more { color: rgba(255,255,255,0.85); }
.calendar-day.other-month { opacity: 0.3; }

.calendar-day .day-number {
    font-weight: 600; font-size: 0.75rem; color: var(--text);
    margin-bottom: 0.25rem; display: block;
}

.calendar-day .day-events {
    width: 100%; display: flex; flex-direction: column; gap: 2px;
}

.calendar-day .day-event-pill {
    font-size: 0.65rem; line-height: 1.2;
    padding: 1px 4px; border-radius: 3px;
    background: var(--event-color); color: white;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border-left: 2px solid rgba(255,255,255,0.5);
}

.calendar-day .day-event-more {
    font-size: 0.65rem; color: var(--text-light); padding: 1px 4px;
}

/* Upcoming events list */
.upcoming-event-item:hover { background: var(--bg-light); }
.upcoming-event-item:last-child { border-bottom: none; }


/* Tasks */
.task-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem;
    border-bottom: 1px solid var(--border);
}
.task-item:hover { background: var(--bg); }
.task-priority { width: 4px; height: 40px; border-radius: 2px; flex-shrink: 0; }
.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }
.task-content { flex: 1; min-width: 0; }
.task-title { font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; }
.task-meta { font-size: 0.8rem; color: var(--text-light); }
.task-assignee { display: flex; align-items: center; gap: 0.5rem; }
.assignee-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.7rem; font-weight: 600;
}

/* Documents */
.document-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
@media (max-width: 480px) { .document-grid { grid-template-columns: 1fr; } }

.document-card {
    background: var(--card); border: 2px solid var(--border); border-radius: 12px;
    padding: 1.25rem; cursor: pointer;
}
.document-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.doc-icon {
    width: 40px; height: 40px; background: #fee2e2; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--danger); font-size: 1.25rem; margin-bottom: 0.75rem;
}
.doc-icon.pdf { background: #fee2e2; color: var(--danger); }
.doc-icon.doc { background: #dbeafe; color: var(--primary); }
.doc-icon.sheet { background: #d1fae5; color: var(--success); }
.doc-title { font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 0.75rem; color: var(--text-light); line-height: 1.4; }

/* Policies */
.policy-table { width: 100%; border-collapse: collapse; }
.policy-table th, .policy-table td {
    padding: 1rem; text-align: left; border-bottom: 1px solid var(--border);
}
.policy-table th {
    font-weight: 600; color: var(--text-light); font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em;
}
@media (max-width: 768px) {
    .policy-table { display: block; overflow-x: auto; white-space: nowrap; }
}
.policy-status {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600;
}
.status-active { background: #d1fae5; color: var(--success); }
.status-review { background: #fef3c7; color: var(--warning); }
.status-expired { background: #fee2e2; color: var(--danger); }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); display: none;
    align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px);
    padding: 1rem;
    overflow-y: auto;
}
@media (max-width: 640px) {
    .modal-overlay {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card); border-radius: 16px; width: 100%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 700px; }

/* Keep the shared app modal card visible even when module CSS defines generic .modal overlays. */
#modalOverlay > .modal {
    position: relative;
    display: block;
    inset: auto;
    background: var(--card);
}

.modal-header {
    padding: 1.25rem; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 600; }
.modal-header:has(h2:empty) { display: none; }
.modal-close {
    width: 32px; height: 32px; border: none; background: var(--bg);
    border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

.auth-modal-simple {
    max-width: 420px;
    padding: 2.5rem 2rem;
    margin: auto;
}

.auth-modal-simple-content {
    text-align: center;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-modal-simple-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.auth-modal-simple-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 0 0;
    line-height: 1.6;
    padding: 0;
}

.auth-modal-shell {
    max-width: 500px;
}

.auth-modal-shell-recovery {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, #ffffff 75%);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    padding: 0.25rem;
}

.auth-modal-header {
    display: flex;
    gap: 0.95rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.auth-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: var(--shadow);
    flex-shrink: 0;
    font-size: 0.95rem;
}

.auth-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text);
}

.auth-modal-subtitle {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-modal-hero {
    display: flex;
    gap: 0.95rem;
    align-items: flex-start;
    margin-bottom: 0.95rem;
    padding: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(8, 145, 178, 0.08));
}

.auth-modal-hero-copy {
    flex: 1;
}

.auth-modal-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.auth-modal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1e3a8a;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.auth-modal-chip i {
    font-size: 0.74rem;
}

.auth-modal-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.auth-modal-field {
    margin-top: 0;
    margin-bottom: 0;
}

.auth-modal-field label {
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #334155;
}

.auth-modal-field input {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 10px;
    font-size: 0.95rem;
}

.auth-modal-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-modal-hint {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.78rem;
}

.auth-modal-note {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    font-size: 0.8rem;
    color: #334155;
    background: #eef4ff;
    border: 1px solid #c5d5ff;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    margin: 0.9rem 0 0;
}

.auth-modal-note i {
    margin-top: 2px;
    color: #4f46e5;
}

.auth-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

.auth-modal-cancel,
.auth-modal-submit {
    min-width: 160px;
    min-height: 44px;
}

.auth-modal-submit {
    box-shadow: var(--shadow);
}

.auth-modal-cancel {
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

.auth-modal-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

@media (max-width: 640px) {
    .auth-modal-hero {
        padding: 0.8rem;
    }

    .auth-modal-actions {
        flex-direction: column-reverse;
    }

    .auth-modal-cancel,
    .auth-modal-submit {
        width: 100%;
    }
}

/* Poll wizard step indicators */
.poll-step-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: #e2e8f0; color: #64748b;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.8rem; transition: all 0.2s;
}
.poll-step-dot.active {
    background: var(--primary); color: #fff;
}
.poll-step-dot.completed {
    background: var(--success); color: #fff;
}

/* Toast */
.toast-container {
    position: fixed; top: 1rem; right: 1rem; z-index: 1001;
    display: flex; flex-direction: column; gap: 0.75rem;
    max-width: calc(100% - 2rem);
}
@media (max-width: 480px) {
    .toast-container { left: 1rem; right: 1rem; }
}
.toast {
    background: var(--card); padding: 1rem 1.25rem; border-radius: 12px;
    box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 0.75rem;
    border-left: 4px solid var(--success);
}
@media (max-width: 480px) { .toast { width: 100%; } }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }


/* Role-based visibility */
.admin-only { display: none !important; }
.user-admin .admin-only { display: block !important; }
.user-admin .admin-only-flex { display: flex !important; }
.chair-only { display: none !important; }
.user-chair .chair-only, .user-admin .chair-only { display: block !important; }
.user-chair .chair-only-flex, .user-admin .chair-only-flex { display: flex !important; }

/* Utilities */
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

/* Job Cards */
.job-card {
    background: var(--bg);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.job-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.job-title { font-weight: 700; color: var(--primary); font-size: 1rem; }
.job-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    flex-wrap: wrap;
}
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-open { background: #d1fae5; color: var(--success); }
.status-review { background: #fef3c7; color: var(--warning); }
.status-active { background: #dbeafe; color: var(--primary); }
.status-completed { background: #e2e8f0; color: var(--text-light); }
.status-info { background: #dbeafe; color: var(--primary); }
.status-success { background: #d1fae5; color: var(--success); }
.status-warning { background: #fef3c7; color: var(--warning); }
.status-danger { background: #fee2e2; color: var(--danger); }
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;

}
.progress-fill.warning { background: var(--warning); }
.progress-fill.success { background: var(--success); }

.hidden-mobile { display: inline; }
@media (max-width: 640px) { .hidden-mobile { display: none; } }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #f8fafc;
}
.upload-zone.uploaded {
    border-color: var(--success);
    background: #f0fdf4;
}

/* ==========================================
   RECRUITMENT MODULE STYLES
   ========================================== */

/* Recruitment Tabs */
.recruitment-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg);
    padding: 0.5rem;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.recruitment-tabs::-webkit-scrollbar { display: none; }

.recruitment-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: transparent;
    white-space: nowrap;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    color: var(--text);
}

.recruitment-tab.active {
    background: white;
    box-shadow: var(--shadow);
    color: var(--primary);
}

.recruitment-tab:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

.tab-badge {
    margin-left: 0.5rem;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* Recruitment Content */
.recruitment-content {
    display: none;
}
.recruitment-content.active {
    display: block;
}

/* Job Listings */
.job-listings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.job-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.job-card.closed {
    opacity: 0.7;
    background: var(--bg);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.job-info {
    flex: 1;
    min-width: 250px;
}

.job-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.job-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.job-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.job-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.job-description {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.job-requirements {
    background: var(--bg);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.job-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    flex-wrap: wrap;
}

.job-stats .stat {
    text-align: center;
}

.job-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.job-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.progress-section {
    flex: 1;
    min-width: 150px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    display: block;
}

.job-footer {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.job-footer .btn {
    flex: 1;
    min-width: 140px;
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
}

/* Applications List */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.application-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    align-items: center;
    flex-wrap: wrap;
}

.applicant-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}
.applicant-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.applicant-info {
    flex: 1;
    min-width: 250px;
}

.applicant-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.applicant-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.applicant-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.applicant-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.application-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.status-actions {
    display: flex;
    gap: 0.5rem;
}

/* Shortlist Table */
.shortlist-table {
    width: 100%;
    border-collapse: collapse;
}

.shortlist-table th,
.shortlist-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.shortlist-table th {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.candidate-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.candidate-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Biometric Section */
.biometric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.biometric-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.biometric-card.completed {
    border-color: var(--success);
    background: #f0fdf4;
}

.biometric-card.pending {
    border-color: var(--warning);
}

.biometric-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.biometric-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.biometric-info {
    flex: 1;
}

.biometric-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.biometric-info p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.biometric-details {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
}

.biometric-details p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.biometric-details p:last-child {
    margin-bottom: 0;
}

.biometric-actions {
    display: flex;
    gap: 0.75rem;
}

/* Process Steps */
.process-steps {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 200px;
    opacity: 0.5;
}

.step.completed,
.step.active {
    opacity: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step-content h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Selected Candidates */
.selected-candidates {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.selected-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--success);
}

.selected-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.selected-avatar {
    width: 60px;
    height: 60px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.selected-info {
    flex: 1;
}

.selected-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.selected-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-details {
    background: var(--bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 140px;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
}

.detail-value {
    flex: 1;
    font-size: 0.9rem;
}

.selected-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.selected-actions .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

/* Mobile Responsive for Recruitment */
@media (max-width: 768px) {
    .recruitment-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .recruitment-tab {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .tab-badge {
        display: none;
    }
    
    .job-stats {
        gap: 1rem;
    }
    
    .job-footer .btn {
        flex: 1 1 100%;
    }
    
    .application-status {
        width: 100%;
        align-items: flex-start;
    }
    
    .shortlist-table {
        display: block;
        overflow-x: auto;
    }
    
    .process-steps {
        flex-direction: column;
    }
    
    .selected-actions .btn {
        flex: 1 1 100%;
    }
}

/* Create Job Modal Specific Styles */
#createJobModal {
    z-index: 1001;
}

#createJobModal .modal {
    max-height: 85vh;
    overflow-y: auto;
}

#createJobModal .form-group {
    margin-bottom: 1rem;
}

#createJobModal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

#createJobModal input[type="text"],
#createJobModal input[type="date"],
#createJobModal select,
#createJobModal textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

#createJobModal input:focus,
#createJobModal select:focus,
#createJobModal textarea:focus {
    outline: none;
    border-color: var(--primary-light);
}

#createJobModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

#createJobModal .modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

/* ==========================================
   PLATFORM ADMIN STYLES
   ========================================== */

/* Tab Navigation */
.platform-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-light);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--bg-light);
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Client List Table */
.client-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.client-list-table th,
.client-list-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.client-list-table th {
    background: var(--bg-light);
    font-weight: 600;
    white-space: nowrap;
}

.client-list-table tr:hover {
    background: var(--bg-light);
}

/* Compact Badges for Table */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-trial { background: #fef3c7; color: #92400e; }
.status-active { background: #d1fae5; color: #065f46; }
.status-past_due { background: #fee2e2; color: #991b1b; }
.status-suspended { background: #e5e7eb; color: #374151; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Extra small buttons for compact action column */
.btn-xs {
    padding: 2px 5px !important;
    font-size: 0.7rem !important;
    line-height: 1 !important;
    min-height: unset !important;
}

/* Client info */
.client-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.client-slug {
    font-size: 0.8rem;
    color: var(--text-light);
}

.client-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Client Actions */
.client-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Loading & Empty States */
.loading-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
}

.loading-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Activity List */
.activity-list {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon i {
    color: var(--primary);
}

/* Platform Admin Header */
.platform-admin-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    color: white;
}

.platform-logo {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.badge-super {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.plan-card-platform {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
}

.plan-card-platform.popular {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
}

.plan-popular-badge {
    position: absolute;
    top: -10px;
    right: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-price-platform {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.plan-price-platform span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-light);
}

/* ==========================================
   ROLE-BASED VISIBILITY FIXES
   ========================================== */

/* Owners should see admin-only elements */
.user-owner .admin-only { display: block !important; }
.user-owner .admin-only-flex { display: flex !important; }

/* Owners should see chair-only elements */
.user-owner .chair-only { display: block !important; }
.user-owner .chair-only-flex { display: flex !important; }

/* ==========================================
   ACCOUNT PAGE STYLES
   ========================================== */

/* Account Page Header */
.account-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
    border-radius: 0 0 32px 32px;
    padding: 2.5rem 2rem 3rem;
    margin: -1.5rem -1.5rem 0;
    color: white;
}

.account-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.account-header p {
    opacity: 0.9;
    font-size: 1rem;
}

/* Settings Cards */
.settings-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.settings-card-header i {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.settings-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.settings-card-body {
    padding: 0;
}

/* Settings Items */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.settings-item:hover {
    background: #fafafa;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info h4 {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.settings-item-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.settings-item-info .hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.875rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-info {
    background: #e0f2fe;
    color: #075985;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Session Item */
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-radius: 12px;
    margin: 1rem 1.5rem;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.session-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.session-details h4 {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.session-details p {
    color: var(--text-light);
    font-size: 0.8rem;
}

.session-status {
    color: var(--success);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.session-status i {
    font-size: 0.5rem;
}

/* Danger Zone */
.danger-zone {
    border: 1px solid var(--danger);
    border-radius: 16px;
    overflow: hidden;
}

.danger-zone-header {
    background: #fef2f2;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.danger-zone-header i {
    color: var(--danger);
    font-size: 1.25rem;
}

.danger-zone-header h3 {
    color: var(--danger);
    font-weight: 600;
}

.danger-zone-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.danger-zone-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.danger-zone-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .account-header {
        padding: 2rem 1.5rem;
        border-radius: 0 0 24px 24px;
    }
    
    .account-header h1 {
        font-size: 1.5rem;
    }
    
    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .settings-item button {
        width: 100%;
    }
    
    .session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .danger-zone-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .danger-zone-body button {
        width: 100%;
    }
}

/* ==========================================
   PAGE HEADER (Generic for all modules)
   ========================================== */

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.page-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}


/* ==========================================
   MODERN SIDEBAR DESIGN - 2026
   ========================================== */

/* Glassmorphism Sidebar - OVERRIDE */
.sidebar {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%) !important;
    backdrop-filter: blur(30px);
    border-right: 1px solid rgba(226, 232, 240, 0.6) !important;
    box-shadow: 
        4px 0 24px rgba(0, 0, 0, 0.04),
        20px 0 60px -20px rgba(0, 0, 0, 0.08) !important;
    width: 300px !important;
}

/* Animated Gradient Header - OVERRIDE */
.sidebar-header {
    padding: 1.75rem 1.5rem !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
    position: relative;
    overflow: hidden;
}



/* Modern Logo - OVERRIDE */
.sidebar-logo {
    width: 48px !important;
    height: 48px !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%) !important;
    border-radius: 14px !important;
    box-shadow: 
        0 8px 20px rgba(59, 130, 246, 0.35),
        0 0 0 4px rgba(59, 130, 246, 0.1) !important;
    font-size: 1.35rem !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.2) 100%);
}

.sidebar-logo i {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Brand Typography */
.sidebar-brand h2 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.sidebar-brand span {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Modern Navigation Menu */
.nav-menu {
    padding: 1.25rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* Nav Items with Modern Styling - OVERRIDE */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.9375rem 1.125rem !important;
    margin: 0 0.375rem !important;
    color: #64748b !important;
    text-decoration: none;
    font-size: 0.925rem !important;
    font-weight: 500 !important;
    border-radius: 12px !important;
    border-left: none !important;

    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
}

.nav-item i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #3b82f6 !important;
}



.nav-item:hover i {
    color: #3b82f6 !important;
}

/* Active State with Gradient Background - OVERRIDE */
.nav-item.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 
        0 4px 15px rgba(59, 130, 246, 0.35),
        0 0 0 1px rgba(59, 130, 246, 0.2) !important;
}

.nav-item.active::before {
    transform: scaleY(1);
    background: rgba(255,255,255,0.5);
}

.nav-item.active i {
    color: white;
}

/* Badge Styling */
.nav-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* Modern Sidebar Footer */
.sidebar-footer {
    padding: 1.25rem;
    background: linear-gradient(180deg, transparent 0%, rgba(248,250,252,0.8) 100%);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(203, 213, 225, 0.5), transparent);
}

.sidebar-footer div {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* User Profile in Sidebar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    margin: 0 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.user-info h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
}

.user-info span {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

/* Section Dividers in Menu */
.nav-menu > div {
    padding: 0.5rem 1.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-top: 0.75rem;
}

/* Mobile Overlay Enhancement */
.sidebar-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.2);
    }
}

/* Scrollbar Styling for Nav Menu */
.nav-menu::-webkit-scrollbar {
    width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}



/* ==========================================
   Role Management Styles
   ========================================== */

/* Small button variant */
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Locked role styling */
.role-locked {
    background-color: rgba(0, 0, 0, 0.02);
}

.role-locked td {
    color: var(--text-light);
}

.role-locked strong {
    color: var(--text);
}

/* Text muted helper */
.text-muted {
    color: var(--text-light);
}

/* Table action column alignment */
.data-table th:last-child,
.data-table td:last-child {
    text-align: right;
}

/* Role actions container */
.role-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Disabled button styling */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form actions alignment */
.form-actions {
    display: flex;
    gap: 0.75rem;
}

.form-actions .btn {
    width: auto;
    flex-shrink: 0;
}

.form-actions .btn-sm {
    width: auto;
    min-width: 80px;
}

/* ==========================================
   USER DETAILS MODAL STYLES
   ========================================== */

.user-details-modal {
    max-width: 600px;
}

.user-details-modal .user-avatar-large {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.user-details-modal .user-avatar-large:hover {
    transform: scale(1.05);
}

.user-details-modal .info-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.user-details-modal .info-item label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.user-details-modal .info-item p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* Role badge colors */
.badge-owner {
    background: var(--purple);
    color: white;
}

.badge-admin {
    background: var(--danger);
    color: white;
}

.badge-chair {
    background: var(--primary);
    color: white;
}

.badge-vice_chair {
    background: var(--primary-light);
    color: white;
}

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

.badge-secretary {
    background: var(--secondary);
    color: white;
}

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

.badge-compliance_officer {
    background: var(--accent);
    color: white;
}

.badge-health_officer {
    background: #10b981;
    color: white;
}

.badge-trustee {
    background: #6366f1;
    color: white;
}

.badge-volunteer {
    background: #8b5cf6;
    color: white;
}

.badge-viewer {
    background: var(--text-light);
    color: white;
}

/* Danger button styles */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Modal footer button spacing */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* Confirmation modal styles */
.confirmation-modal {
    text-align: center;
    padding: 1rem 0;
}

.confirmation-modal .icon-warning {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.confirmation-modal h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.confirmation-modal p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Alert/info boxes in modals */
.alert-info {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 0.75rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.alert-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    border-left: 3px solid #ef4444;
    padding: 0.75rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.alert-danger p {
    margin: 0;
    font-size: 0.875rem;
    color: #991b1b;
}

/* ==========================================
   EDIT USER MODAL STYLES
   ========================================== */

.edit-user-modal {
    max-width: 500px;
}

.edit-user-modal .form-field {
    margin-bottom: 1rem;
}

.edit-user-modal .form-field label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-user-modal .committees-checkbox-list {
    background: var(--bg);
}

.edit-user-modal .committee-item {
    border-bottom: 1px solid var(--border);
}

.edit-user-modal .committee-item:last-child {
    border-bottom: none;
}

.edit-user-modal .committee-item:hover {
    background: var(--bg-light);
}

.edit-user-modal .committee-item input[type="checkbox"] {
    accent-color: var(--primary);
}

.edit-user-modal .committee-item .badge {
    text-transform: capitalize;
}

/* ==========================================
   FINANCE MODULE STYLES
   ========================================== */

/* Finance Tabs */
.finance-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.finance-tabs::-webkit-scrollbar {
    display: none;
}

.finance-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: transparent;
    white-space: nowrap;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.finance-tab:hover {
    background: rgba(255,255,255,0.5);
}

.finance-tab.active {
    background: white;
    box-shadow: var(--shadow);
    color: var(--primary);
}

.finance-tab i {
    font-size: 0.9rem;
}

/* Finance Tab Content */
.finance-tab-content {
    display: none;
}

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

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary);
}

.quick-action-btn span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

/* Finance Summary Items */
.finance-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.finance-summary-item .label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.finance-summary-item .value {
    font-weight: 600;
    font-size: 1rem;
}

.finance-summary-item .value.positive {
    color: var(--success);
}

.finance-summary-item .value.negative {
    color: var(--danger);
}

.finance-summary-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.finance-summary-item.total {
    padding-top: 0.5rem;
    font-size: 1.1rem;
}

.finance-summary-item.total .label {
    font-weight: 600;
    color: var(--text);
}

.finance-summary-item.total .value {
    font-size: 1.25rem;
}

/* Transaction List */
.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.transaction-item:hover {
    background: var(--bg);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.transaction-icon.income {
    background: #d1fae5;
    color: var(--success);
}

.transaction-icon.expense {
    background: #fee2e2;
    color: var(--danger);
}

.transaction-icon.transfer {
    background: #dbeafe;
    color: var(--primary);
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.transaction-amount {
    font-weight: 600;
    font-size: 1rem;
    text-align: right;
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-amount.expense {
    color: var(--danger);
}

/* Invoice Tabs */
.invoice-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.invoice-tabs::-webkit-scrollbar {
    display: none;
}

.invoice-tab {
    padding: 0.625rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: transparent;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--text-light);
    transition: all 0.2s ease;
}

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

.invoice-tab.active {
    background: white;
    box-shadow: var(--shadow);
    color: var(--primary);
}

/* Transaction Type Selector */
.transaction-type-selector {
    display: flex;
    gap: 1rem;
}

.type-option {
    flex: 1;
    cursor: pointer;
}

.type-option input {
    display: none;
}

.type-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.type-option input:checked + .type-label.income {
    border-color: var(--success);
    background: #f0fdf4;
    color: var(--success);
}

.type-option input:checked + .type-label.expense {
    border-color: var(--danger);
    background: #fef2f2;
    color: var(--danger);
}

.type-option input:checked + .type-label.transfer {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
}

/* Global Table Standard */
.table-card,
.table-card .card-body,
.table-responsive,
.activity-table-container,
.card:has(table),
.card:has(table) .card-body {
    border-radius: 0 !important;
}

.data-table,
.policy-table,
.shortlist-table,
.client-list-table,
#peopleTable,
.activity-table-container table,
.table-standard {
    width: 100%;
    display: table !important;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--card);
    font-size: 0.92rem;
    border-radius: 0 !important;
}

.data-table th,
.data-table td,
.policy-table th,
.policy-table td,
.shortlist-table th,
.shortlist-table td,
.client-list-table th,
.client-list-table td,
#peopleTable th,
#peopleTable td,
.activity-table-container th,
.activity-table-container td,
.table-standard th,
.table-standard td {
    padding: 0.95rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th,
.policy-table th,
.shortlist-table th,
.client-list-table th,
#peopleTable th,
.activity-table-container th,
.table-standard th {
    background: #f8fafc;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    border-radius: 0 !important;
    border-bottom: 1px solid #dbe3ee;
}

.data-table tbody tr,
.policy-table tbody tr,
.shortlist-table tbody tr,
.client-list-table tbody tr,
#peopleTable tbody tr,
.activity-table-container tbody tr,
.table-standard tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover,
.policy-table tbody tr:hover,
.shortlist-table tbody tr:hover,
.client-list-table tbody tr:hover,
#peopleTable tbody tr:hover,
.activity-table-container tbody tr:hover,
.table-standard tbody tr:hover {
    background: #f8fbff;
}

.data-table .text-right,
.table-standard .text-right {
    text-align: right;
}

@media (max-width: 768px) {
    .data-table,
    .policy-table,
    .shortlist-table,
    .client-list-table,
    #peopleTable,
    .activity-table-container table,
    .table-standard {
        font-size: 0.86rem;
    }

    .data-table th,
    .data-table td,
    .policy-table th,
    .policy-table td,
    .shortlist-table th,
    .shortlist-table td,
    .client-list-table th,
    .client-list-table td,
    #peopleTable th,
    #peopleTable td,
    .activity-table-container th,
    .activity-table-container td,
    .table-standard th,
    .table-standard td {
        padding: 0.8rem 0.75rem;
    }
}

/* Status Badges for Finance */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.status-badge.draft {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.sent {
    background: #dbeafe;
    color: #1e40af;
}

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

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

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

/* Grid Layout Utilities */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-12 {
    grid-template-columns: repeat(12, 1fr);
}

.gap-4 {
    gap: 1rem;
}

/* Form Enhancements */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea,
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--card);
    color: var(--text);
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-textarea,
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-control-sm,
select.form-control-sm,
input.form-control-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.form-checkbox,
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-checkbox input[type="checkbox"],
.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* People - Add Donor modal layout (dense laptop-first) */
#addDonorModal .donor-modal-card {
    max-width: min(96vw, 980px);
    border-radius: 14px;
}

#addDonorModal .modal-header {
    padding: 0.8rem 1rem;
}

#addDonorModal .modal-header h2 {
    font-size: 1.05rem;
}

#addDonorModal .donor-modal-body {
    padding: 0.85rem 1rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

#addDonorModal .modal-footer {
    padding: 0.75rem 1rem;
}

#addDonorModal .donor-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.85rem;
}

#addDonorModal .donor-form-col {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

#addDonorModal .form-group {
    margin-bottom: 0;
}

#addDonorModal .form-group > label {
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-light);
    text-transform: uppercase;
}

#addDonorModal .form-group input,
#addDonorModal .form-group select {
    padding: 0.5rem 0.7rem;
    min-height: 38px;
    font-size: 0.9rem;
}

#addDonorModal .donor-email-group small {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.25;
}

#addDonorModal .donor-col-1 {
    grid-column: span 1;
}

#addDonorModal .donor-col-2 {
    grid-column: span 2;
}

#addDonorModal .donor-col-4 {
    grid-column: 1 / -1;
}

#addDonorModal .donor-col-1-fixed {
    grid-column: 1 / span 1;
}

#addDonorModal .donor-col-2-fixed {
    grid-column: 2 / span 1;
}

#addDonorModal .donor-col-3-fixed {
    grid-column: 2 / span 1;
}

#addDonorModal .donor-col-start-1 {
    grid-column: 1 / span 1;
}

#addDonorModal .donor-full-row {
    grid-column: 1 / -1;
}

/* Legacy fixed-column helpers retained but neutralized after layout refactor. */
#addDonorModal .donor-col-1-fixed,
#addDonorModal .donor-col-2-fixed,
#addDonorModal .donor-col-3-fixed {
    grid-column: auto;
}

#addDonorModal .donor-consent-card,
#addDonorModal .donor-kit-card {
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
}

#addDonorModal .donor-consent-card label {
    margin-bottom: 0;
    text-transform: none;
    font-size: 0.86rem;
    letter-spacing: 0;
    color: var(--text);
    font-weight: 500;
}

#addDonorModal .donor-kit-card > label {
    margin-bottom: 0.45rem;
}

#addDonorModal .donor-kit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem 0.6rem;
}

#addDonorModal .form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    text-transform: none;
}

#addDonorModal .form-checkbox span {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
    text-transform: none;
}

#addDonorModal .donor-kit-grid .form-checkbox {
    font-size: 0.83rem;
    justify-content: flex-start;
}

#addDonorModal .donor-postcode-country-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 0.6rem;
    align-items: end;
}

#addDonorModal .donor-sub-field {
    display: flex;
    flex-direction: column;
}

#addDonorModal .donor-sub-field label {
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-light);
    text-transform: uppercase;
}

#addDonorModal .form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

@media (max-width: 1200px) {
    #addDonorModal .donor-form-grid {
        grid-template-columns: 1fr;
    }

    #addDonorModal .donor-postcode-country-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    #addDonorModal .donor-form-grid,
    #addDonorModal .donor-kit-grid {
        grid-template-columns: 1fr;
    }

    #addDonorModal .donor-modal-body {
        max-height: calc(100vh - 150px);
    }
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .finance-tabs,
    .invoice-tabs {
        flex-wrap: nowrap;
    }
    
    .finance-tab,
    .invoice-tab {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .transaction-type-selector {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Empty State */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ==========================================
   Modern Calendar System - 2026 Design
   ========================================== */

/* Bento Stats Row */
.calendar-bento-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bento-stat-card {
    background: linear-gradient(145deg, #ffffff 0%, #f6f9ff 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.bento-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(59, 130, 246, 0.16), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.bento-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
}

.bento-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bento-stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bento-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.bento-stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* Calendar Layout */
.calendar-layout {
    gap: 1.5rem;
}

.calendar-main {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 620px;
}

/* Modern Header */
.calendar-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.calendar-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-header-modern h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.02em;
}

.btn-today {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* View Switcher */
.view-switcher {
    display: inline-flex;
    background: var(--bg-light);
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
}

.view-switcher button {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-switcher button:hover {
    color: var(--text);
    background: rgba(255,255,255,0.5);
}

.view-switcher button.active {
    background: var(--card);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Modern Nav Buttons */
.calendar-nav-modern {
    display: flex;
    gap: 0.4rem;
}

.calendar-nav-modern button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.2s ease;
}

.calendar-nav-modern button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Calendar View Container */
.calendar-view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Enhanced Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    flex: 1;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 0.6rem 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calendar-day {
    min-height: 90px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.45rem;
    cursor: pointer;
    position: relative;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    background: var(--card);
    transition: all 0.15s ease;
}

.calendar-day:hover {
    background: #eff6ff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    z-index: 1;
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.calendar-day.today .day-number {
    color: white;
    background: rgba(255,255,255,0.2);
}

.calendar-day.today .day-event-pill {
    background: rgba(255,255,255,0.25);
    color: white;
    border-left-color: rgba(255,255,255,0.8);
}

.calendar-day.today .day-event-more {
    color: rgba(255,255,255,0.9);
}

.calendar-day.other-month {
    opacity: 0.35;
    background: var(--bg-light);
}

.calendar-day.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.calendar-day.today.selected {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(191, 219, 254, 0.95), 0 6px 18px rgba(37, 99, 235, 0.35);
}

.calendar-day.today.selected .day-number {
    background: #ffffff;
    color: var(--primary-dark);
}

.calendar-day.has-event {
    border-left: 3px solid var(--event-accent, var(--primary));
}

.calendar-day .day-number {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.calendar-day .day-events {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.calendar-day .day-event-pill {
    font-size: 0.68rem;
    line-height: 1.3;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--event-color);
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid rgba(255,255,255,0.5);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: transform 0.15s ease;
}

.calendar-day .day-event-pill::before {
    content: '';
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-day .day-event-more {
    font-size: 0.7rem;
    color: var(--text-light);
    padding: 1px 4px;
    font-weight: 500;
}

/* Calendar Legend */
.calendar-legend {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-light);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-item i {
    font-size: 0.55rem;
}

/* Calendar Sidebar */
.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Mini Calendar */
.mini-calendar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.mini-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.mini-nav-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.mini-nav-btn:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.mini-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.4rem;
}

.mini-calendar-weekdays span {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.mini-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    transition: all 0.15s ease;
    position: relative;
}

.mini-calendar-day:hover {
    background: var(--bg-light);
}

.mini-calendar-day.other-month {
    color: var(--text-light);
    opacity: 0.5;
}

.mini-calendar-day.today {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.mini-calendar-day.selected {
    box-shadow: inset 0 0 0 1.5px var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.mini-calendar-day.today.selected {
    background: var(--primary);
    color: #ffffff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 1px var(--primary);
    font-weight: 700;
}

.mini-calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--event-dot, var(--primary));
}

/* Upcoming Events Card */
.upcoming-events-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.upcoming-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

.upcoming-events-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upcoming-events-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.upcoming-event-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
}

.upcoming-event-item:hover {
    background: var(--bg-light);
    padding-left: 1.4rem;
}

.upcoming-event-item:last-child {
    border-bottom: none;
}

/* Quick Actions */
.calendar-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.quick-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.quick-action-btn i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.quick-action-btn:hover i {
    background: var(--primary);
    color: white;
}

/* Week View */
.calendar-week-view {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.calendar-week-header-cell {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    border-right: 1px solid var(--border);
}

.calendar-week-header-cell:last-child {
    border-right: none;
}

.calendar-week-header-cell .day-number {
    font-size: 1.1rem;
    color: var(--text);
    display: block;
    margin-bottom: 0.2rem;
}

.calendar-week-header-cell.today .day-number {
    color: var(--primary);
}

.calendar-week-header-cell.today {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.calendar-week-body {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    flex: 1;
    overflow-y: auto;
    max-height: 520px;
}

.calendar-week-time-label {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--bg-light);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.calendar-week-cell {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 60px;
    padding: 0.35rem;
    position: relative;
    background: var(--card);
}

.calendar-week-cell:nth-child(8n) {
    border-right: none;
}

.calendar-week-cell.today {
    background: rgba(37, 99, 235, 0.03);
}

.calendar-week-event {
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--event-color);
    color: white;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.calendar-week-event:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Day View */
.calendar-day-view {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
}

.calendar-day-view-header {
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.calendar-day-view-header .day-name {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.calendar-day-view-header .day-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.25rem;
}

.calendar-day-view-body {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    padding: 1rem;
}

.calendar-day-time-slot {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border);
    min-height: 70px;
}

.calendar-day-time-slot .time-label {
    width: 55px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
    padding-top: 0.2rem;
}

.calendar-day-time-slot .slot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.calendar-day-event-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.875rem;
    background: var(--bg-light);
    border-radius: 10px;
    border-left: 3px solid var(--event-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-day-event-card:hover {
    background: var(--border);
    transform: translateX(4px);
}

.calendar-day-event-card .event-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--event-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.calendar-day-event-card .event-info {
    flex: 1;
    min-width: 0;
}

.calendar-day-event-card .event-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day-event-card .event-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Agenda View */
.calendar-agenda-view {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    overflow-y: auto;
    max-height: 560px;
    padding-right: 0.5rem;
}

.calendar-agenda-date-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-agenda-date-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 2;
}

.calendar-agenda-date-header .day-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.calendar-agenda-date-header .day-name {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.calendar-agenda-date-header.today .day-number {
    color: var(--primary);
}

.calendar-agenda-event {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid var(--event-color);
}

.calendar-agenda-event:hover {
    background: var(--border);
    transform: translateX(4px);
}

.calendar-agenda-event .event-time {
    width: 55px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    flex-shrink: 0;
    text-align: right;
    padding-top: 0.2rem;
}

.calendar-agenda-event .event-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--event-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.calendar-agenda-event .event-details {
    flex: 1;
    min-width: 0;
}

.calendar-agenda-event .event-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.15rem;
}

.calendar-agenda-event .event-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.calendar-agenda-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.calendar-agenda-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Calendar */
@media (max-width: 1100px) {
    .calendar-layout {
        grid-template-columns: 1fr !important;
    }
    
    .calendar-sidebar {
        flex-flow: row wrap;
    }
    
    .mini-calendar-card {
        flex: 0 0 260px;
    }
    
    .upcoming-events-card {
        flex: 1;
        min-height: 300px;
    }
    
    .calendar-quick-actions {
        flex: 1 0 100%;
        flex-flow: row wrap;
    }
    
    .quick-action-btn {
        flex: 1;
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .calendar-bento-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .bento-stat-card {
        padding: 0.875rem;
    }
    
    .bento-stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .bento-stat-value {
        font-size: 1.25rem;
    }
    
    .calendar-main {
        padding: 1rem;
        min-height: auto;
    }
    
    .calendar-header-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .calendar-title-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .calendar-toolbar {
        width: 100%;
        justify-content: space-between;
    }
    
    .view-switcher button {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 0.3rem;
    }
    
    .calendar-day .day-event-pill {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    
    .calendar-sidebar {
        flex-direction: column;
    }
    
    .mini-calendar-card {
        flex: auto;
    }
    
    .upcoming-events-card {
        flex: auto;
        min-height: 200px;
    }
    
    .calendar-quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        flex: auto;
    }
    
    .calendar-week-header {
        grid-template-columns: 40px repeat(7, 1fr);
    }
    
    .calendar-week-header-cell {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .calendar-week-body {
        grid-template-columns: 40px repeat(7, 1fr);
    }
    
    .calendar-week-time-label {
        font-size: 0.6rem;
        padding: 0.35rem 0.2rem;
    }
}

@media (max-width: 480px) {
    .calendar-bento-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .calendar-grid {
        gap: 0.2rem;
    }
    
    .calendar-day {
        min-height: 48px;
        border-radius: 6px;
    }
    
    .calendar-day .day-number {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .calendar-day .day-events {
        display: none;
    }
    
    .calendar-day.has-event .day-number::after {
        content: '';
        position: absolute;
        top: 4px;
        right: 4px;
        width: 5px;
        height: 5px;
        background: var(--primary);
        border-radius: 50%;
    }
}

/* ==========================================
   Messaging App - Modern Global Styles
   ========================================== */
.messaging-app {
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-rows: 1fr;
    flex: 1;
    min-height: 400px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid var(--border);
}

#messaging.module-section.active .messaging-app {
    height: auto;
}

@media (max-width: 900px) {
    .messaging-app {
        grid-template-columns: 1fr;
        border-radius: 12px;
    }
    #messaging.module-section.active .messaging-app {
        min-height: 320px;
    }
    .messaging-sidebar {
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 10;
        transition: transform 0.28s ease;
    }
    .messaging-sidebar.hidden {
        transform: translateX(-110%);
    }
    .messaging-back-btn {
        display: flex !important;
    }
}

.messaging-sidebar {
    display: flex;
    flex-direction: column;
    background: rgba(248,250,252,0.6);
    border-right: 1px solid var(--border);
}

body.dark .messaging-sidebar {
    background: rgba(30,34,45,0.6);
}

.messaging-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
}

.messaging-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.btn-messaging-new {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}

.btn-messaging-new:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59,130,246,0.35);
}

.messaging-search {
    position: relative;
    padding: 0 1.25rem 0.75rem;
}

.messaging-search-icon {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.85rem;
}

.messaging-search-input {
    width: 100%;
    padding: 0.6rem 0.875rem 0.6rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.messaging-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.messaging-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 0.75rem;
}

.messaging-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.messaging-tab:hover {
    background: rgba(0,0,0,0.03);
    color: var(--text);
}

.messaging-tab.active {
    background: var(--primary);
    color: #fff;
}

.messaging-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.75rem 0.75rem;
}

.messaging-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    gap: 0.75rem;
}

.messaging-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0,0,0,0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: msg-spin 0.8s linear infinite;
}

@keyframes msg-spin {
    to { transform: rotate(360deg); }
}

.messaging-empty-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

.messaging-empty-list i {
    font-size: 2rem;
    opacity: 0.35;
    margin-bottom: 0.75rem;
}

.messaging-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-bottom: 0.25rem;
}

.messaging-item:hover,
.messaging-item.active {
    background: rgba(59,130,246,0.08);
}

.messaging-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    overflow: hidden;
}

.messaging-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.messaging-item-body {
    flex: 1;
    min-width: 0;
}

.messaging-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.messaging-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.messaging-item-time {
    font-size: 0.7rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.messaging-item-preview {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.messaging-item-badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.messaging-chat {
    display: flex;
    flex-direction: column;
    background: var(--card);
}

.messaging-chat-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 0.875rem;
}

.messaging-back-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(0,0,0,0.04);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.messaging-chat-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.messaging-chat-avatars {
    display: flex;
    flex-shrink: 0;
}

.messaging-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid var(--card);
    margin-left: -10px;
    overflow: hidden;
}

.messaging-chat-avatar:first-child {
    margin-left: 0;
}

.messaging-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.messaging-chat-title-wrap {
    min-width: 0;
}

.messaging-chat-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.messaging-chat-status {
    font-size: 0.75rem;
    color: var(--text-light);
}

.messaging-chat-actions {
    position: relative;
}

.messaging-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(0,0,0,0.04);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messaging-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 50;
    overflow: hidden;
}

.messaging-actions-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}

.messaging-actions-menu a:last-child {
    border-bottom: none;
}

.messaging-actions-menu a:hover {
    background: rgba(0,0,0,0.03);
}

.messaging-action-danger {
    color: #ef4444 !important;
}

.messaging-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(248,250,252,0.35);
}

body.dark .messaging-chat-body {
    background: rgba(20,24,35,0.35);
}

.messaging-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    text-align: center;
}

.messaging-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.messaging-empty h5 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    color: var(--text);
}

.messaging-empty p {
    margin: 0;
    font-size: 0.85rem;
}

.messaging-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.messaging-date-divider::before,
.messaging-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: 0 0.75rem;
}

.messaging-message {
    display: flex;
    gap: 0.75rem;
    max-width: 78%;
    animation: msg-fade-in 0.25s ease;
}

@keyframes msg-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.messaging-message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.messaging-message.received {
    align-self: flex-start;
}

@media (min-width: 900px) {
    .messaging-message {
        max-width: 65%;
    }
}

.messaging-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    overflow: hidden;
}

.messaging-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.messaging-message-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.messaging-message.sent .messaging-message-content {
    align-items: flex-end;
}

.messaging-message-bubble {
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.45;
    overflow-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.messaging-message.sent .messaging-message-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messaging-message.received .messaging-message-bubble {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.messaging-message-sender {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.15rem;
    margin-left: 0.25rem;
}

.messaging-message-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    opacity: 0.75;
    margin-top: 0.2rem;
}

.messaging-message.sent .messaging-message-meta {
    color: rgba(255,255,255,0.85);
}

.messaging-message.received .messaging-message-meta {
    color: var(--text-light);
}

.messaging-mention {
    background: rgba(255,255,255,0.25);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    font-weight: 600;
}

.messaging-message.received .messaging-mention {
    background: rgba(59,130,246,0.12);
    color: var(--primary);
}

.messaging-chat-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--card);
}

.messaging-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.messaging-input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(248,250,252,0.6);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.messaging-input:focus {
    border-color: var(--primary);
    background: var(--card);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.messaging-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.messaging-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
    flex-shrink: 0;
}

.messaging-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59,130,246,0.35);
}

.messaging-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.messaging-mention-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 56px;
    bottom: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
}

.messaging-mention-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    transition: background 0.1s ease;
}

.messaging-mention-item:last-child {
    border-bottom: none;
}

.messaging-mention-item:hover,
.messaging-mention-item.active {
    background: rgba(59,130,246,0.08);
}

.messaging-mention-item i {
    color: var(--primary);
    font-size: 1.1rem;
}
.poll-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.poll-detail-header-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.poll-detail-header-right .btn {
    white-space: nowrap;
}
.poll-detail-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.poll-detail-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}
.poll-detail-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    position: relative;
}
.poll-detail-hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    opacity: 0.9;
    position: relative;
}
.poll-detail-hero-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    position: relative;
}
.poll-detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(4px);
}
.poll-detail-badge.draft { background: rgba(148, 163, 184, 0.35); }
.poll-detail-badge.active { background: rgba(34, 197, 94, 0.35); }
.poll-detail-badge.scheduled { background: rgba(56, 189, 248, 0.35); }
.poll-detail-badge.closed { background: rgba(100, 116, 139, 0.5); }
.poll-detail-badge.archived { background: rgba(245, 158, 11, 0.35); }

.poll-detail-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: #f1f5f9;
    padding: 0.375rem;
    border-radius: 12px;
    overflow-x: auto;
}
.poll-detail-tab {
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: transparent;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.poll-detail-tab:hover { color: #1e293b; }
.poll-detail-tab.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    color: #4f46e5;
}

.poll-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
}
@media (max-width: 900px) {
    .poll-detail-grid { grid-template-columns: 1fr; }
}

.poll-detail-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.poll-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.poll-detail-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.poll-detail-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e293b;
}
.poll-detail-card-body {
    padding: 1.25rem;
}

.poll-tab-panel { display: none; }
.poll-tab-panel.active { display: block; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.poll-info-grid {
    display: grid;
    gap: 0.875rem;
}
.poll-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}
.poll-info-row:last-child { border-bottom: none; }
.poll-info-label {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.poll-info-value {
    font-weight: 500;
    color: #1e293b;
}

.poll-creator-block {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}
.poll-creator-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}
.poll-creator-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}
.poll-creator-email {
    font-size: 0.8rem;
    color: #64748b;
}

.poll-question-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}
.poll-question-item:last-child { margin-bottom: 0; }
.poll-question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #4f46e5;
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.75rem;
}
.poll-question-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e0e7ff;
    color: #4338ca;
}

.poll-result-card {
    padding: 1.25rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}
.poll-result-card:last-child { margin-bottom: 0; }
.poll-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.poll-result-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
    margin: 0;
}
.poll-result-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.poll-bar-row {
    display: grid;
    grid-template-columns: 1fr 50px 60px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
}
.poll-bar-label {
    font-size: 0.875rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.poll-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}
.poll-bar-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.6s ease;
}
.poll-bar-pct {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4f46e5;
    text-align: right;
}
.poll-bar-count {
    font-size: 0.8rem;
    color: #64748b;
    text-align: right;
}

.poll-rating-summary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
}
.poll-rating-big {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4f46e5;
    line-height: 1;
}
.poll-rating-stars {
    color: #f59e0b;
    font-size: 1.25rem;
}
.poll-rating-label {
    font-size: 0.8rem;
    color: #64748b;
}

.poll-text-response {
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #334155;
    border-left: 3px solid #4f46e5;
}
.poll-text-response:last-child { margin-bottom: 0; }

.poll-participation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.poll-participation-stat {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
}
.poll-participation-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}
.poll-participation-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.375rem;
}

.poll-response-row {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}
.poll-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.poll-response-answers {
    display: grid;
    gap: 0.5rem;
}
.poll-response-answer {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
}
.poll-response-answer-q {
    font-weight: 500;
    color: #4f46e5;
    min-width: 120px;
}
.poll-response-answer-a {
    color: #334155;
}

.poll-linked-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #4f46e5;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}
.poll-linked-item:last-child { border-bottom: none; }


/* People Module Styles */
.people-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    place-items: stretch center;
}

.person-card {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.person-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.person-card-banner {
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
    border-radius: 12px 12px 0 0;
}

.person-card.term-ending .person-card-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.person-card.term-expired .person-card-banner {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.person-card-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-top: -40px;
    position: relative;
    z-index: 2;
}

.person-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    overflow: hidden;
    border: 4px solid var(--card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.person-card-avatar-wrap .person-avatar img {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.person-card-body {
    padding: 0.75rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.person-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.person-email {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.person-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    margin-top: 0.25rem;
}

.person-role.owner { background: #fef3c7; color: #92400e; }
.person-role.admin { background: #dbeafe; color: #1e40af; }
.person-role.chair { background: #d1fae5; color: #065f46; }
.person-role.secretary { background: #fce7f3; color: #9d174d; }
.person-role.trustee { background: #f3f4f6; color: #374151; }
.person-role.viewer { background: #e0e7ff; color: #3730a3; }

.person-card-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.person-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.person-card-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.person-card-stat-value.active { color: #065f46; }
.person-card-stat-value.ending { color: #92400e; }
.person-card-stat-value.expired { color: #991b1b; }
.person-card-stat-value.unknown { color: var(--text-light); }

.person-card-stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
}

.person-card-btn {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    background: #f0f7ff;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    padding-left: 2.5rem;
    width: 250px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* List View Styles - Modern Card List */
.people-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* List Header */
.list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--background);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-col-member { grid-column: 1; }
.list-col-role { grid-column: 2; }
.list-col-dept { grid-column: 3; }
.list-col-status { grid-column: 4; }
.list-col-ends { grid-column: 5; }
.list-col-actions { grid-column: 6; text-align: right; }

/* List Body */
.list-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* List Item */
.list-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    align-items: center;
    cursor: pointer;
}

.list-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.list-item.term-ending {
    border-left: 3px solid var(--warning);
    background: linear-gradient(to right, #fffbeb 0%, var(--card) 100%);
}

.list-item.term-expired {
    border-left: 3px solid var(--danger);
    background: linear-gradient(to right, #fef2f2 0%, var(--card) 100%);
}

/* List Member Cell */
.list-member {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.list-member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.list-member-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.list-member-info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* List Role Badge */
.list-role {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    width: fit-content;
}

.list-role.owner { background: #fef3c7; color: #92400e; }
.list-role.admin { background: #dbeafe; color: #1e40af; }
.list-role.chair { background: #d1fae5; color: #065f46; }
.list-role.secretary { background: #fce7f3; color: #9d174d; }
.list-role.trustee { background: #f3f4f6; color: #374151; }
.list-role.viewer { background: #e0e7ff; color: #3730a3; }

/* List Department */
.list-dept {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* List Status */
.list-status {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.list-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    width: fit-content;
}

.list-status-badge.active { background: #d1fae5; color: #065f46; }
.list-status-badge.ending { background: #fef3c7; color: #92400e; }
.list-status-badge.expired { background: #fee2e2; color: #991b1b; }

/* List Progress Bar */
.list-progress {
    width: 100%;
    max-width: 120px;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.list-progress-fill {
    height: 100%;
    background: var(--success);
}

.list-progress-fill.ending { background: var(--warning); }
.list-progress-fill.expired { background: var(--danger); }

/* List Date */
.list-date {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.list-date.ending { color: var(--warning); }
.list-date.expired { color: var(--danger); }

/* List Actions */
.list-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.list-actions button {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-actions button i {
    font-size: 0.9rem;
}

/* Responsive List View */
@media (max-width: 1024px) {
    .list-header {
        display: none;
    }
    
    .list-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .list-item > div {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .list-item > div::before {
        font-weight: 600;
        color: var(--text-light);
        font-size: 0.75rem;
        min-width: 80px;
    }
    
    .list-col-member::before { content: 'Member:'; }
    .list-col-role::before { content: 'Role:'; }
    .list-col-dept::before { content: 'Dept:'; }
    .list-col-status::before { content: 'Status:'; }
    .list-col-ends::before { content: 'Ends:'; }
    .list-col-actions::before { content: 'Actions:'; }
    
    .list-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1200px) {
    .people-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .people-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .people-grid {
        grid-template-columns: 1fr;
    }
    
    .person-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .search-box input {
        width: 100%;
    }
}

/* Disable all CSS transitions during initial module restore to prevent visible animations on refresh */
body.no-transitions,
body.no-transitions * {
    transition: none !important;
}
