/* --- CSS VARIABLES & GLOBAL STYLES --- */
:root {
    --color-primary: #0066CC;
    --color-primary-light: #F0F8FF;
    --color-primary-dark: #1B365D;
    --color-secondary: #64748B;
    --color-medical-blue: #0066CC;
    --color-medical-teal: #00A3B5;
    --color-medical-mint: #4ECDC4;
    --color-medical-navy: #1B365D;
    --color-medical-light: #F0F8FF;
    --color-medical-accent: #FF6B6B;
    --color-light-bg: #F9FAFB;
    --color-border: #E5E7EB;
    --color-white: #FFFFFF;
    --color-danger: #DC2626;
    --color-danger-light: #FEE2E2;
    --color-text-primary: #111827;
    --color-text-secondary: #6B7280;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    --font-family-sans: 'Inter', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-sans);
}

/* Ensure all text inputs, textareas, and selects have visible borders */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
    border: 1px solid var(--color-border) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1) !important;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--color-light-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* Ensure all elements inherit the Inter font */
html, body, input, textarea, select, button, label, a, p, h1, h2, h3, h4, h5, h6, span, div, table, th, td, li, ul, ol {
    font-family: var(--font-family-sans);
}

/* --- MAIN PORTAL LAYOUT --- */
.portal-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

.portal-container { 
    display: flex; 
    flex: 1;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}
.sidebar { width: 256px; background-color: var(--color-white); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: auto; 
    padding: 2rem 1.5rem; 
    border-bottom: 1px solid var(--color-border); 
    flex-direction: column; 
    background: transparent;
}
.sidebar-header .logo { 
    width: 500px; 
    height: auto; 
    max-width: 100%; 
    object-fit: contain; 
    display: block; 
    margin-bottom: 1rem;
    border: none;
    outline: none;
    background: none;
}
.sidebar-header h2 { font-size: 1.125rem; margin: 0; font-weight: 700; color: var(--color-gray-900); }
.sidebar-nav { flex-grow: 1; padding: 1.5rem 1rem; overflow-y: auto; }
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-nav a { display: flex; align-items: center; padding: 0.625rem 1rem; color: var(--color-secondary); text-decoration: none; font-weight: 500; font-size: 0.875rem; border-radius: 0.5rem; transition: all 0.2s; position: relative; cursor: pointer; }
.sidebar-nav a:hover { background-color: var(--color-primary-light); color: var(--color-primary); }
.sidebar-nav a.active { background-color: var(--color-primary-light); color: var(--color-primary); }
.sidebar-nav a.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background-color: var(--color-primary); border-radius: 0 2px 2px 0; }
.sidebar-nav a i { width: 20px; margin-right: 0.75rem; text-align: center; }
/* Navigation Section Headers */
.sidebar-nav .nav-section-header { 
    margin-top: 1rem; 
    margin-bottom: 0; 
    padding: 0; 
    cursor: pointer;
    user-select: none;
    position: relative;
}
.sidebar-nav .nav-section-header:first-of-type { margin-top: 0.5rem; }
.sidebar-nav .nav-section-header .section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
    position: relative;
}
.sidebar-nav .nav-section-header .section-toggle:hover {
    background-color: var(--color-gray-50);
    color: var(--color-gray-700);
}
.sidebar-nav .nav-section-header .section-toggle:active {
    transform: scale(0.98);
}
.sidebar-nav .nav-section-header .section-title {
    flex: 1;
    font-weight: 600;
}
.sidebar-nav .nav-section-header .section-icon {
    font-size: 0.625rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-gray-400);
    margin-left: 0.5rem;
    flex-shrink: 0;
}
.sidebar-nav .nav-section-header.collapsed .section-icon {
    transform: rotate(-90deg);
}
.sidebar-nav .nav-section-header.expanded .section-icon {
    transform: rotate(0deg);
}

/* Navigation Section Content (Collapsible) */
.sidebar-nav .nav-section-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.25s ease 0.05s,
                padding 0.25s ease;
    margin: 0;
    padding: 0;
    transform: translateY(-4px);
}
.sidebar-nav .nav-section-content.expanded {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
    padding: 0;
}
.sidebar-nav .nav-section-content:not(.expanded) {
    display: none;
}
.sidebar-nav .nav-section-content a {
    padding-left: 2.5rem;
    font-size: 0.875rem;
}

/* Ensure member dashboard is completely hidden when officer dashboard is visible */
.content-body:has(#officer-dashboard[style*="display: block"]) #member-dashboard {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Officer Dashboard Alignment - Apply same logic as Member Dashboard */
section.content-body:has(#officer-dashboard) {
    padding: 2rem !important;
    margin: 0 !important;
}

#officer-dashboard {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* Ensure ALL child elements of officer-dashboard start at the same horizontal position */
#officer-dashboard > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Alerts banner and KPI cards container */
#officer-alerts-kpi-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 0 2rem 0 !important;
}

/* Force perfect alignment of alerts banner and KPI cards */
#alerts-banner,
#officer-kpi-grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Remove any default card margins that might cause misalignment */
#alerts-banner {
    margin: 0 0 0.75rem 0 !important;
    padding: 0 !important;
}

#officer-kpi-grid .kpi-card {
    margin: 0 !important;
    padding: 0 !important;
}
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--color-border); }
.user-profile { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: #DBEAFE; color: #2563EB; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem; }
.user-info .user-name { font-weight: 600; font-size: 0.875rem; color: var(--color-gray-900); }
.user-info a { color: var(--color-secondary); text-decoration: none; font-size: 0.75rem; transition: color 0.2s; }
.user-info a:hover { color: var(--color-primary); }

/* --- HEADER USER PROFILE --- */
.header-right { display: flex; align-items: center; gap: 1.5rem; }
.user-profile-header { display: flex; align-items: center; gap: 0.5rem; position: relative; }
.user-profile-link { display: flex; align-items: center; text-decoration: none; padding: 0.25rem; border-radius: 0.5rem; transition: background-color 0.2s; }
.user-profile-link:hover { background-color: var(--color-gray-50); }
.user-avatar-header { width: 36px; height: 36px; border-radius: 50%; background-color: #DBEAFE; color: #2563EB; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem; cursor: pointer; }
.user-menu { position: relative; }
.user-menu-toggle { background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--color-gray-700); font-size: 0.875rem; transition: color 0.2s; display: flex; align-items: center; justify-content: center; }
.user-menu-toggle:hover { color: var(--color-gray-900); }
.user-menu-dropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 0.5rem; background: white; border: 1px solid var(--color-border); border-radius: 0.5rem; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); min-width: 200px; z-index: 1000; }
.user-menu-dropdown.show { display: block; }
.user-menu-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); }
.user-menu-name { font-weight: 600; font-size: 0.875rem; color: var(--color-gray-900); }
.user-menu-item { display: block; padding: 0.75rem 1rem; color: var(--color-gray-700); text-decoration: none; font-size: 0.875rem; transition: background-color 0.2s; }
.user-menu-item:hover { background-color: var(--color-gray-50); }
.user-menu-item.user-menu-logout { color: var(--color-danger); border-top: 1px solid var(--color-border); }
.user-menu-item.user-menu-logout:hover { background-color: var(--color-danger-light); }

/* --- MAIN CONTENT AREA --- */
.main-content { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; background-color: var(--color-light-bg); }
.content-header.with-selectors { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 64px; 
    padding: 0 2rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility; 
    background-color: #FFFFFF !important; 
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--color-border); 
    position: sticky; 
    top: 0; 
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}
.content-header h1 { font-size: 1.5rem; margin: 0; font-weight: 700; color: var(--color-gray-900); }
.content-header p { font-size: 0.875rem; color: var(--color-secondary); margin: 0.125rem 0 0 0; }
.context-selectors { 
    display: flex; 
    align-items: center; 
    gap: 1rem; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.selector-group { position: relative; }
.selector-group label { 
    font-size: 0.75rem; 
    color: var(--color-secondary); 
    position: absolute; 
    top: -8px; 
    left: 8px; 
    background-color: var(--color-white); 
    padding: 0 4px; 
    font-weight: 500; 
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    z-index: 1;
}
.context-select { 
    min-width: 160px; 
    padding: 0.5rem 2.5rem 0.5rem 0.75rem; 
    border: 1px solid var(--color-border); 
    border-radius: 0.375rem; 
    background-color: var(--color-white); 
    font-family: var(--font-family-sans); 
    font-size: 0.875rem; 
    line-height: 1.5;
    transition: all 0.2s; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    color: var(--color-gray-900);
    font-weight: 400;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.context-select:focus { 
    outline: none; 
    border-color: var(--color-primary); 
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1); 
}

/* --- CONTENT HEADER STYLES (for pages like About) --- */
.content-header {
    padding: 2rem 2rem 1.5rem 2rem;
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--color-border);
}

.content-header .header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin: 0 0 0.5rem 0;
}

.content-header .header-text .text-muted {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* --- SETTINGS PAGE LAYOUT --- */
.settings-container { display: flex; gap: 2rem; align-items: flex-start; }
.settings-nav { flex-shrink: 0; width: 220px; }
.settings-nav ul { list-style: none; }
.settings-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: var(--color-text-secondary); text-decoration: none; font-weight: 500; border-radius: 8px; transition: background-color 0.2s, color 0.2s; }
.settings-nav a svg { stroke: var(--color-text-secondary); transition: stroke 0.2s; }
.settings-nav a:hover { color: var(--color-text-primary); }
.settings-nav a:hover svg { stroke: var(--color-text-primary); }
.settings-nav a.active { background-color: var(--color-medical-light); color: var(--color-text-primary); font-weight: 600; }
.settings-nav a.active svg { stroke: var(--color-medical-blue); }
.settings-content { flex-grow: 1; }
.settings-pane h2 { font-size: 1.5rem; margin-bottom: 0.25rem; font-weight: 600; }
.settings-pane > p { color: var(--color-text-secondary); margin-bottom: 1.5rem; max-width: 600px; }
.settings-pane .card { border: 1px solid var(--color-border); box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.settings-pane .card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.settings-form .form-group { margin-bottom: 1.5rem; }
.settings-form .form-input-inline {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font-family-sans);
    font-weight: 400;
    transition: all 0.2s;
    background-color: var(--color-white);
    color: var(--color-gray-900);
    line-height: 1.5;
}
.settings-form .form-input-inline:focus { 
    outline: none; 
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
.settings-form .form-input-inline::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}
.settings-form .form-actions { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* --- SHARED ROSTER TABLE STYLES --- */
.table-responsive { overflow-x: auto; border: 1px solid var(--color-border); border-radius: 8px; background-color: var(--color-white); }
.roster-table { width: 100%; border-collapse: collapse; }
.roster-table th, .roster-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
/* Top Spending Categories Table - Darker borders */
#top-spending-categories-table { 
    border: 1px solid #9CA3AF !important; 
    border-collapse: collapse !important;
}
#top-spending-categories-table th, 
#top-spending-categories-table td { 
    border: 1px solid #9CA3AF !important; 
    border-bottom: 1px solid #9CA3AF !important; 
}
#top-spending-categories-table thead th {
    border-bottom: 2px solid #6B7280 !important;
}
#top-spending-categories-table tbody tr:last-child td { 
    border-bottom: 1px solid #9CA3AF !important; 
}
.roster-table thead th { font-size: 0.875rem; text-transform: uppercase; color: var(--color-text-secondary); font-weight: 600; background-color: #F9FAFB; border-bottom: 1px solid var(--color-border); letter-spacing: 0.05em; }
.roster-table tbody tr:last-child td { border-bottom: none; }
.roster-table tbody tr:hover { background-color: #F9FAFB; }
.roster-table td .btn { margin-right: 0.5rem; }
.roster-table .btn-danger { background-color: transparent; color: var(--color-dark-red); padding: 0; font-weight: 500; border: none; cursor: pointer;}
.roster-table .btn-danger:hover { text-decoration: underline; }

/* Task Status Badges */
.task-status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-width: 100px;
}

.task-status-badge.status-not-started {
    background-color: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.task-status-badge.status-in-progress {
    background-color: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

.task-status-badge.status-completed {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

/* --- MEETINGS PAGE LAYOUT --- */
.content-body { 
    flex: 1; 
    padding: 2rem; 
    overflow-y: auto; 
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

/* Override content-body padding for member dashboard - keep padding for edge spacing */
section.content-body:has(#member-dashboard) {
    padding: 2rem !important;
    margin: 0 !important;
}

/* Member dashboard container - no padding/margin */
#member-dashboard {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
}

/* Ensure ALL child elements of member-dashboard start at the same horizontal position */
#member-dashboard > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Welcome banner and status cards container */
#member-dashboard > div:first-child {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 0 2.5rem 0 !important;
}

/* Force perfect alignment of welcome banner and status cards */
#member-welcome-banner,
#member-status-grid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Remove any default card margins that might cause misalignment */
#member-welcome-banner.card {
    margin: 0 0 0.75rem 0 !important;
    padding: 0 !important;
}

#member-status-grid .kpi-card {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure Get Involved section also aligns */
#member-get-involved,
#member-dashboard > div:nth-child(2) {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 2.5rem !important;
}
.meetings-container { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; max-width: 100%; }
.meeting-list-sidebar { grid-column: span 3; }
.meeting-list-sidebar-inner { background-color: var(--color-white); border: 1px solid var(--color-border); border-radius: 0.5rem; overflow: hidden; }
.meeting-list-sidebar .sidebar-header { display: flex; justify-content: flex-start; align-items: center; padding: 1rem; margin-bottom: 0; }
.meeting-list-sidebar .sidebar-header h3 { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--color-gray-900); text-align: left; }
.meeting-list { list-style: none; }
.meeting-list li { border-bottom: 1px solid var(--color-border); }
.meeting-list li:last-child { border-bottom: none; }
.meeting-list li a { display: block; padding: 1rem; text-decoration: none; cursor: pointer; transition: background-color 0.2s; }
.meeting-list li a:hover { background-color: var(--color-gray-50); }
.meeting-list li a.active { background-color: var(--color-primary-light); border-left: 4px solid var(--color-primary); padding-left: calc(1rem - 4px); }
.meeting-list li a.active p:first-child { font-weight: 600; color: var(--color-primary); }
.meeting-list li a p { margin: 0; font-size: 0.875rem; }
.meeting-list li a p:first-child { font-weight: 600; color: var(--color-gray-800); font-size: 0.875rem; }
.meeting-list li a p:last-child { font-size: 0.75rem; color: var(--color-primary-dark); margin-top: 0.25rem; }
.add-to-calendar-btn { background: none; border: none; padding: 0.25rem 0.5rem; cursor: pointer; color: var(--color-primary); transition: color 0.2s, background-color 0.2s; display: flex; align-items: center; justify-content: center; border-radius: 0.25rem; }
.add-to-calendar-btn:hover { color: var(--color-primary-dark); background-color: var(--color-primary-light); }
.meeting-details-content { grid-column: span 9; display: flex; flex-direction: column; gap: 2rem; }
/* --- MEETING DETAILS HEADER (Supports both Member and Officer Meetings) --- */
.meeting-details-header { 
    display: flex; 
    gap: 1rem; 
    align-items: center; 
    justify-content: space-between;
    flex-wrap: wrap; 
}
.meeting-details-header h3 { 
    margin: 0; 
    font-size: 1.125rem; 
    font-weight: 600; 
    color: var(--color-gray-900); 
}
.meeting-details-header .form-actions-header { 
    display: flex; 
    gap: 0.75rem; 
    align-items: center; 
}

/* Member Meetings structure - form-field-group as individual field containers (direct children of header) */
.card-header.meeting-details-header > .form-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.card-header.meeting-details-header > .form-field-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-header.meeting-details-header > .form-field-group .form-input-inline {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    max-width: 150px;
}

/* Officer Meetings structure - form-field-group as grid container (inside card-body) */
.card-body .form-field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Officer Meetings - 3 fields in a row (Date, Time, Location) */
#meeting-details-card .card-body .form-field-group {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
    gap: 1.5rem !important;
}

/* Responsive: if screen is too narrow, allow wrapping */
/* Responsive styles for Dues and Next Meeting cards */
.dues-meeting-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .dues-meeting-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Make dashboard KPI grid responsive */
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Officer KPI grid responsive */
    #officer-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* My History page - 3 cards become 2 on tablet */
    #history-content .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Make Get Involved section responsive */
    #blood-drives-list,
    #competitions-list {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        align-items: stretch !important;
    }
    
    #blood-drives-list > .card,
    #competitions-list > .card {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }
    
    /* Responsive search and filter inputs */
    #blood-drive-search,
    #competition-search,
    #blood-drive-filter,
    #competition-filter {
        min-width: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .dashboard-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    
    .dues-meeting-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Elegant card hover effects */
    #dues-card:hover,
    #meeting-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    }
    
    #btn-pay-dues:hover,
    #btn-view-meeting:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3) !important;
    }
    
    /* Stack search and filter on very small screens */
    #blood-drive-search,
    #competition-search {
        margin-bottom: 0.5rem;
    }
}

/* Modern, thin status cards for member dashboard - ensure perfect alignment */
#member-dashboard {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Override content-body padding when it contains member dashboard */
.content-body:has(#member-dashboard),
section:has(#member-dashboard) .content-body {
    padding: 0 !important;
    margin: 0 !important;
}

#member-dashboard > div:first-child {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 2.5rem !important;
    margin-top: 0 !important;
}

#member-dashboard .dashboard-kpi-grid {
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

#member-dashboard .dashboard-kpi-grid .kpi-card {
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

#member-dashboard .dashboard-kpi-grid .kpi-card:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Thin welcome banner - ensure perfect alignment */
#member-dashboard .card:has(#member-welcome),
#member-dashboard > div:first-child > .card:first-child {
    border-radius: 0.5rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 0.75rem 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Override default card-body padding for welcome banner */
#member-dashboard .card:has(#member-welcome) .card-body {
    padding: 0.75rem 1.25rem !important;
    margin: 0 !important;
}

/* Ensure Get Involved section has proper spacing */
#member-dashboard > div:nth-child(2) {
    margin-top: 2.5rem !important;
    margin-bottom: 2rem !important;
    padding: 0 !important;
}

/* Responsive styles for status cards */
@media (max-width: 1024px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .dashboard-kpi-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Officer KPI grid mobile */
    #officer-kpi-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1200px) {
    #meeting-details-card .card-body .form-field-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #meeting-details-card .card-body .form-field-group {
        grid-template-columns: 1fr;
    }
}
.card-body .form-field-group > div.relative { 
    position: relative; 
    min-width: 0; /* Prevents grid items from overflowing */
}
.card-body .form-field-group > div.relative label { 
    display: block; 
    font-size: 0.875rem; 
    font-weight: 500; 
    color: var(--color-gray-700); 
    margin-bottom: 0.25rem; 
}
.card-body .form-field-group > div.relative .form-input-inline { 
    width: 100% !important; 
    min-width: 150px;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem !important; 
    border: 1px solid var(--color-border); 
    border-radius: 0.375rem; 
    font-size: 0.875rem; 
    font-family: var(--font-family-sans);
    font-weight: 400;
    transition: all 0.2s;
    background-color: var(--color-white);
    color: var(--color-gray-900);
    line-height: 1.5;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}
.card-body .form-field-group > div.relative .form-input-inline:focus { 
    outline: none; 
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
.card-body .form-field-group > div.relative .form-input-inline::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}

/* Override global form-input-inline padding for officer meetings inputs with icons */
#meeting-details-card .card-body .form-field-group > div.relative .form-input-inline {
    padding: 0.5rem 0.75rem 0.5rem 2.5rem !important;
    min-width: 180px !important;
}

.card-body .form-field-group .input-icon { 
    position: absolute; 
    left: 0.75rem; 
    top: 2.25rem;
    color: var(--color-secondary); 
    font-size: 0.875rem; 
    pointer-events: none;
    z-index: 1;
}

/* --- GLOBAL FORM INPUT STYLES (Applied across all modules) --- */
.form-input-inline,
.form-group .form-input-inline,
.add-member-form .form-input-inline,
.add-officer-form .form-input-inline,
.add-event-form .form-input-inline,
.settings-form .form-input-inline,
.modal .form-input-inline {
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    font-family: var(--font-family-sans) !important;
    font-weight: 400 !important;
    transition: all 0.2s !important;
    background-color: var(--color-white) !important;
    color: var(--color-gray-900) !important;
    line-height: 1.5 !important;
}

.form-input-inline:focus,
.form-group .form-input-inline:focus,
.add-member-form .form-input-inline:focus,
.add-officer-form .form-input-inline:focus,
.add-event-form .form-input-inline:focus,
.settings-form .form-input-inline:focus,
.modal .form-input-inline:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

.form-input-inline::placeholder,
.form-group .form-input-inline::placeholder,
.add-member-form .form-input-inline::placeholder,
.add-officer-form .form-input-inline::placeholder,
.add-event-form .form-input-inline::placeholder,
.settings-form .form-input-inline::placeholder,
.modal .form-input-inline::placeholder {
    color: var(--color-secondary) !important;
    opacity: 0.6 !important;
}

/* Select dropdowns with custom arrow */
select.form-input-inline {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Textareas */
textarea.form-input-inline {
    resize: vertical;
    min-height: 80px;
}

/* --- MEMBERS PAGE FORM STYLES --- */
.add-member-form .form-group {
    margin-bottom: 1.5rem;
}

/* CRITICAL: Override ALL input styles in members form - highest specificity */
.card-body .add-member-form .form-group input,
.card-body .add-member-form input[type="text"],
.card-body .add-member-form input[type="email"],
.card-body .add-member-form input[type="password"],
.card-body .add-member-form input[type="number"],
.content-body .add-member-form .form-group input,
.content-body .add-member-form input[type="text"],
.content-body .add-member-form input[type="email"],
.content-body .add-member-form input[type="password"],
.content-body .add-member-form input[type="number"],
.add-member-form .form-group input,
.add-member-form input[type="text"],
.add-member-form input[type="email"],
.add-member-form input[type="password"],
.add-member-form input[type="number"] {
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    font-family: var(--font-family-sans) !important;
    font-weight: 400 !important;
    transition: all 0.2s !important;
    background-color: var(--color-white) !important;
    color: var(--color-gray-900) !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

.card-body .add-member-form .form-group input:focus,
.card-body .add-member-form input[type="text"]:focus,
.card-body .add-member-form input[type="email"]:focus,
.card-body .add-member-form input[type="password"]:focus,
.card-body .add-member-form input[type="number"]:focus,
.content-body .add-member-form .form-group input:focus,
.content-body .add-member-form input[type="text"]:focus,
.content-body .add-member-form input[type="email"]:focus,
.content-body .add-member-form input[type="password"]:focus,
.content-body .add-member-form input[type="number"]:focus,
.add-member-form .form-group input:focus,
.add-member-form input[type="text"]:focus,
.add-member-form input[type="email"]:focus,
.add-member-form input[type="password"]:focus,
.add-member-form input[type="number"]:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

.card-body .add-member-form .form-group input::placeholder,
.card-body .add-member-form input[type="text"]::placeholder,
.card-body .add-member-form input[type="email"]::placeholder,
.card-body .add-member-form input[type="password"]::placeholder,
.card-body .add-member-form input[type="number"]::placeholder,
.content-body .add-member-form .form-group input::placeholder,
.content-body .add-member-form input[type="text"]::placeholder,
.content-body .add-member-form input[type="email"]::placeholder,
.content-body .add-member-form input[type="password"]::placeholder,
.content-body .add-member-form input[type="number"]::placeholder,
.add-member-form .form-group input::placeholder,
.add-member-form input[type="text"]::placeholder,
.add-member-form input[type="email"]::placeholder,
.add-member-form input[type="password"]::placeholder,
.add-member-form input[type="number"]::placeholder {
    color: var(--color-secondary) !important;
    opacity: 0.6 !important;
}

/* Ensure members form inputs with form-input-inline class also work */
.card-body .add-member-form .form-group input.form-input-inline,
.card-body .add-member-form input.form-input-inline,
.content-body .add-member-form .form-group input.form-input-inline,
.content-body .add-member-form input.form-input-inline,
.add-member-form .form-group input.form-input-inline,
.add-member-form input.form-input-inline {
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    font-family: var(--font-family-sans) !important;
    font-weight: 400 !important;
    transition: all 0.2s !important;
    background-color: var(--color-white) !important;
    color: var(--color-gray-900) !important;
    line-height: 1.5 !important;
}

.card-body .add-member-form .form-group input.form-input-inline:focus,
.card-body .add-member-form input.form-input-inline:focus,
.content-body .add-member-form .form-group input.form-input-inline:focus,
.content-body .add-member-form input.form-input-inline:focus,
.add-member-form .form-group input.form-input-inline:focus,
.add-member-form input.form-input-inline:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

.card-body .add-member-form .form-group input.form-input-inline::placeholder,
.card-body .add-member-form input.form-input-inline::placeholder,
.content-body .add-member-form .form-group input.form-input-inline::placeholder,
.content-body .add-member-form input.form-input-inline::placeholder,
.add-member-form .form-group input.form-input-inline::placeholder,
.add-member-form input.form-input-inline::placeholder {
    color: var(--color-secondary) !important;
    opacity: 0.6 !important;
}

/* --- OFFICERS PAGE FORM STYLES --- */
.add-officer-form .form-group {
    margin-bottom: 1.5rem;
}

/* --- MEETING SECTIONS --- */
.meeting-sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.meeting-section { 
    background: var(--color-white); 
    border: 1px solid var(--color-border); 
    border-radius: 0.5rem; 
    padding: 1.5rem; 
}
.meeting-section h4 { 
    margin: 0 0 0.25rem 0; 
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    padding-bottom: 0.5rem; 
    display: block;
}
.meeting-section h4::after {
    content: '';
    display: block;
    width: 48px;
    height: 2px;
    background-color: var(--color-primary);
    margin-top: 0.5rem;
}

/* --- BLOOD DRIVE SECTIONS (Donors & Volunteers) --- */
.drive-sections { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 2rem; 
    margin-top: 1rem;
}
.drive-section { 
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent grid overflow */
    overflow: hidden; /* Contain content */
}
.drive-section .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex overflow */
    overflow: hidden; /* Contain content */
}
.drive-section .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex overflow */
    overflow: hidden; /* Contain content */
}
.donor-card,
.volunteer-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    min-width: 0; /* Prevent overflow */
}

/* Form styling within drive sections */
.drive-section .add-donor-form,
.drive-section .add-volunteer-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.drive-section .add-donor-form .form-group,
.drive-section .add-volunteer-form .form-group {
    margin-bottom: 0;
}
.drive-section .add-donor-form .form-group:last-child,
.drive-section .add-volunteer-form .form-group:last-child {
    display: flex;
    align-items: flex-end;
}

/* Table styling within drive sections */
.drive-section .roster-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    table-layout: auto; /* Allow columns to size based on content */
}
.drive-section .roster-table th,
.drive-section .roster-table td {
    padding: 0.75rem; /* Slightly reduced padding for better fit */
    white-space: nowrap; /* Prevent text wrapping in cells */
}
.drive-section .roster-table th:last-child,
.drive-section .roster-table td:last-child {
    white-space: normal; /* Allow wrapping in actions column */
}
.drive-section .table-responsive {
    margin-top: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0; /* Critical: Prevent flex overflow */
    overflow-x: auto; /* Enable horizontal scrolling if table is too wide */
    overflow-y: visible; /* Allow vertical overflow */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}
.drive-section .table-responsive .roster-table {
    margin-bottom: 0;
    min-width: 600px; /* Minimum table width to ensure readability */
}

/* Responsive: Stack drive sections on smaller screens */
@media (max-width: 1024px) {
    .drive-sections {
        grid-template-columns: 1fr;
    }
}

/* --- AGENDA & DEBRIEF LIST STYLING --- */
.editable-list { 
    list-style: none; 
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.editable-list li { 
    padding: 0.75rem;
    background-color: var(--color-gray-50);
    border: 1px solid transparent;
    border-radius: 0.375rem;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.2s ease;
}
.editable-list li:hover {
    background-color: var(--color-gray-100);
}
.item-text-input { 
    flex-grow: 1; 
    padding: 0; 
    border: none; 
    border-radius: 0; 
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-800);
    background: transparent;
    transition: all 0.2s ease;
}
.item-text-input:read-only { 
    background: transparent;
    border: none; 
    cursor: default;
}
.item-text-input:not(:read-only) { 
    border: 1px solid var(--color-primary);
    background: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}
.item-text-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
}
.editable-list .item-actions { 
    display: flex; 
    gap: 0.75rem;
    flex-shrink: 0;
    align-items: center;
}
.editable-list .item-actions button {
    padding: 0.25rem 0.5rem;
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    transition: color 0.2s;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.editable-list .item-actions button:hover {
    color: var(--color-primary);
}
.editable-list .item-actions .btn-danger {
    color: var(--color-secondary);
}
.editable-list .item-actions .btn-danger:hover {
    color: var(--color-danger);
}
.editable-list .item-actions .item-edit-btn,
.editable-list .item-actions .item-delete-btn {
    padding: 0;
    font-size: 0.875rem;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- AGENDA/DEBRIEF ADD FORM --- */
.meeting-section .form-input-inline {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 400;
    font-family: var(--font-family-sans);
    transition: all 0.2s ease;
    background: var(--color-white);
    color: var(--color-gray-900);
    line-height: 1.5;
}
.meeting-section .form-input-inline:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.meeting-section .form-input-inline::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}

/* --- TASKS TABLE STYLING --- */
.meeting-section .roster-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.meeting-section .roster-table thead th {
    background-color: var(--color-gray-50);
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-secondary);
    text-align: left;
}
.meeting-section .roster-table thead th:first-child {
    border-radius: 0.5rem 0 0 0;
}
.meeting-section .roster-table thead th:last-child {
    border-radius: 0 0.5rem 0 0;
}
.meeting-section .roster-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}
.meeting-section .roster-table tbody tr {
    transition: background-color 0.2s ease;
}
.meeting-section .roster-table tbody tr:hover {
    background-color: var(--color-gray-50);
}
.task-description-textarea { 
    width: 100%; 
    padding: 0; 
    border: none; 
    border-radius: 0; 
    font-size: 0.875rem;
    font-family: var(--font-family-sans);
    font-weight: 500;
    color: var(--color-gray-900);
    resize: none;
    background: transparent;
    transition: all 0.2s ease;
}
.task-description-textarea:focus { 
    outline: none;
}
.task-assign-select { 
    padding: 0.5rem 0.75rem; 
    border: 1px solid var(--color-border); 
    border-radius: 0.375rem; 
    font-size: 0.875rem;
    font-weight: 400;
    font-family: var(--font-family-sans);
    background: var(--color-white);
    color: var(--color-gray-900);
    transition: all 0.2s ease;
    min-width: 120px;
}
.task-assign-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.task-actions-cell { 
    white-space: nowrap;
}
.task-actions-cell button {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.task-actions-cell button:hover {
    text-decoration: underline;
}
.task-actions-cell .btn-danger {
    color: var(--color-danger);
    margin-left: 1rem;
}
.task-actions-cell .btn-danger:hover {
    color: #B91C1C;
    text-decoration: underline;
}

/* --- ADD TASK FORM --- */
.add-task-form { 
    display: grid; 
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem; 
    margin-top: 1rem; 
    padding: 1rem;
    background-color: var(--color-gray-50);
    border-radius: 0.5rem;
}
.add-task-form textarea {
    grid-column: span 6;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-family: var(--font-family-sans);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-gray-900);
    resize: none;
    min-height: 38px;
    transition: all 0.2s ease;
    background: var(--color-white);
}
.add-task-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.add-task-form textarea::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}
.add-task-form select {
    grid-column: span 4;
}
.add-task-form button {
    grid-column: span 2;
}

/* --- MEMBER MEETINGS SPECIFIC --- */
.add-link-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.add-link-form .form-input-inline {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font-family-sans);
    font-weight: 400;
    color: var(--color-gray-900);
    background: var(--color-white);
    transition: all 0.2s ease;
}

.add-link-form .form-input-inline:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.add-link-form .form-input-inline::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--color-secondary);
    margin-bottom: 0.75rem;
    font-style: italic;
}

/* --- NOTES TEXTAREA --- */
/* Textareas in meeting sections */
.meeting-section textarea,
textarea#meetingNotes,
textarea#meetingSendOuts { 
    width: 100%; 
    min-height: 120px;
    padding: 0.75rem; 
    border: 1px solid var(--color-border); 
    border-radius: 0.375rem; 
    font-size: 0.875rem; 
    font-family: var(--font-family-sans); 
    font-weight: 400;
    color: var(--color-gray-900);
    resize: vertical; 
    line-height: 1.5;
    transition: all 0.2s ease;
    background: var(--color-white);
}
.meeting-section textarea:focus,
textarea#meetingNotes:focus,
textarea#meetingSendOuts:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.meeting-section textarea::placeholder,
textarea#meetingNotes::placeholder,
textarea#meetingSendOuts::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}

/* Additional textarea for debrief */
textarea.debrief-textarea {
    width: 100%;
    height: 128px;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font-family-sans);
    font-weight: 400;
    color: var(--color-gray-900);
    resize: none;
    line-height: 1.5;
    transition: all 0.2s ease;
    background: var(--color-white);
}
textarea.debrief-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
textarea.debrief-textarea::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}



/* --- OTHER STYLES --- */
.hidden { display: none !important; }

/* Profile Page - 2 Column Grid Layout */
#profile-content .card-body form > div[style*="grid-template-columns"] {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Responsive: Stack columns on mobile */
@media (max-width: 768px) {
    #profile-content .card-body form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr;
    }
    
    #profile-content .card-body form > div[style*="grid-template-columns"] > div[style*="flex-direction: column"] {
        gap: 1rem;
    }
    
    /* Password section also stacks on mobile */
    #profile-content .card-body form > div[style*="border-top"] > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* --- MODAL STYLES --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none !important;
}

.modal:not(.hidden) {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--color-white);
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.modal-content .form-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-content .form-group {
    margin-bottom: 1.5rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--color-gray-900);
}
.btn { 
    padding: 0.75rem 1.25rem; 
    border-radius: 8px; 
    border: none; 
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-primary { 
    background-color: var(--color-primary); 
    color: var(--color-white);
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-primary:hover { 
    background-color: var(--color-primary-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.btn-secondary { 
    background-color: var(--color-white); 
    color: var(--color-text-primary); 
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-secondary:hover {
    background-color: var(--color-gray-50);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.btn-small { 
    font-size: 0.875rem; 
    padding: 0.5rem 1rem;
    font-weight: 600;
}
.btn-small.btn-primary {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-small.btn-secondary {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-danger { 
    background-color: transparent;
    color: var(--color-danger);
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0;
    margin: 0;
    box-shadow: none;
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.btn-danger:hover {
    color: #B91C1C;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}
.btn-danger i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
}

/* Standardized Icon-Only Action Buttons */
.btn-small[class*="edit-"] {
    padding: 0.5rem !important;
    width: 2rem !important;
    height: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
    border-radius: 0.375rem !important;
    background-color: var(--color-secondary) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.btn-small[class*="edit-"]:hover {
    background-color: var(--color-primary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2) !important;
}

.btn-small[class*="edit-"] i {
    color: white !important;
    margin: 0 !important;
    font-size: 0.875rem !important;
}

.btn-small[class*="delete-"] {
    padding: 0.5rem !important;
    width: 2rem !important;
    height: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
    border-radius: 0.375rem !important;
    background-color: var(--color-danger) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.1) !important;
}

.btn-small[class*="delete-"]:hover {
    background-color: #B91C1C !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2) !important;
}

.btn-small[class*="delete-"] i {
    color: white !important;
    margin: 0 !important;
    font-size: 0.875rem !important;
}

/* Delete button override for meeting details - must be plain text */
#delete-meeting-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-size: 0.875rem !important;
    color: var(--color-danger) !important;
    font-weight: 500 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s;
    text-decoration: none !important;
}

#delete-meeting-btn:hover {
    color: #B91C1C !important;
    text-decoration: none !important;
    transform: none !important;
    box-shadow: none !important;
    background: none !important;
}

/* --- GLASS PANEL EFFECT (Modern Card Style) --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card { background-color: var(--color-white); border-radius: 0.5rem; border: 1px solid var(--color-border); overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); }
.card-header { padding: 1.5rem; border-bottom: 1px solid var(--color-border); background-color: var(--color-white); }
.card-header h3 { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--color-gray-900); }
.card-body { padding: 1.5rem; }

/* Override card margins for member dashboard to ensure perfect alignment */
#member-dashboard .card,
#member-welcome-banner,
#member-status-grid .kpi-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* NUCLEAR OPTION: Force all member dashboard direct children to align perfectly */
#member-dashboard > * {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* --- MODERN FORM CARD STYLE (For Add/Edit Sections) --- */
.form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--color-primary);
}

.form-card .form-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

.form-card .form-card-title[style*="cursor: pointer"] {
    transition: color 0.2s ease;
}

.form-card .form-card-title[style*="cursor: pointer"]:hover {
    color: var(--color-primary);
}

.form-card .form-card-title i {
    color: var(--color-primary);
}

/* Form card form group styling */
.form-card .form-group {
    margin-bottom: 0;
}

.form-card .form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
}

/* --- MODERN TABLE CARD STYLE (For Existing/List Sections) --- */
.table-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table-card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
}
.danger-zone { border-color: var(--color-coral); }
.danger-zone .card-body p { color: var(--color-dark-red); }
.status-badge { padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }

/* Dashboard KPI Cards */
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Dashboard Quick Action Buttons */
.quick-action-btn:hover {
    background-color: var(--color-primary-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2) !important;
}
.status-no { background-color: #fde8e8; color: var(--color-dark-red); }
.status-yes { background-color: #eaf6f0; color: #348e5b; }
.error-message { color: var(--color-danger); text-align: center; font-weight: 500; }

/* Action Card Buttons (for select-meeting-prompt) */
.action-card-btn {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.action-card-btn:hover {
    background-color: var(--color-gray-50);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* CRITICAL OVERRIDE: Ensure Members form inputs match design - placed at end for highest priority */
.content-body .card .card-body .add-member-form .form-group input,
.content-body .card .card-body .add-member-form input,
.content-body .add-member-form .form-group input,
.content-body .add-member-form input,
#memberName,
#editMemberName {
    padding: 0.5rem 0.75rem !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    font-family: var(--font-family-sans) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    width: 100% !important;
    background-color: var(--color-white) !important;
    color: var(--color-gray-900) !important;
    box-sizing: border-box !important;
}

.content-body .card .card-body .add-member-form .form-group input:focus,
.content-body .card .card-body .add-member-form input:focus,
.content-body .add-member-form .form-group input:focus,
.content-body .add-member-form input:focus,
#memberName:focus,
#editMemberName:focus {
    outline: none !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1) !important;
}

.content-body .card .card-body .add-member-form .form-group input::placeholder,
.content-body .card .card-body .add-member-form input::placeholder,
.content-body .add-member-form .form-group input::placeholder,
.content-body .add-member-form input::placeholder,
#memberName::placeholder,
#editMemberName::placeholder {
    color: var(--color-secondary) !important;
    opacity: 0.6 !important;
}

/* --- CALENDAR PAGE --- */
.calendar-container {
    max-width: 100%;
}

.add-event-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.add-event-form .form-group {
    display: flex;
    flex-direction: column;
}

.add-event-form .form-input-inline {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font-family-sans);
    font-weight: 400;
    color: var(--color-gray-900);
    background-color: var(--color-white);
    transition: all 0.2s ease;
    line-height: 1.5;
}

.add-event-form .form-input-inline:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.add-event-form .form-input-inline::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}

.add-event-form textarea.form-input-inline {
    resize: vertical;
    min-height: 80px;
}

.add-event-form select.form-input-inline {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.add-event-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* --- BUDGET MODULE STYLES --- */
.budget-container,
.competition-container {
    max-width: 100%;
}

.budget-nav {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.budget-nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    flex: 1;
}

.budget-year-filter {
    position: relative;
    margin-left: auto;
}

.budget-nav li {
    margin: 0;
}

.budget-nav a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.budget-nav a:hover {
    color: var(--color-primary);
    background-color: var(--color-gray-50);
}

.budget-nav a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.budget-pane {
    display: none !important;
}

.budget-pane.active {
    display: block !important;
}

.budget-pane.hidden {
    display: none !important;
}

.settings-pane {
    display: none !important;
}

.settings-pane.active {
    display: block !important;
}

.settings-pane.hidden {
    display: none !important;
}

.competition-content {
    margin-top: 2rem;
}

.transaction-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.transaction-form .form-group {
    display: flex;
    flex-direction: column;
}

.transaction-form .form-input-inline {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font-family-sans);
    font-weight: 400;
    color: var(--color-gray-900);
    background-color: var(--color-white);
    transition: all 0.2s ease;
    line-height: 1.5;
}

.transaction-form .form-input-inline:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.transaction-form .form-input-inline::placeholder {
    color: var(--color-secondary);
    opacity: 0.6;
}

.transaction-form select.form-input-inline {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.transaction-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.current-balance {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.current-balance h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-secondary);
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.balance-amount.loading {
    color: var(--color-secondary);
    font-weight: 400;
}

/* --- ASSIGNED MEMBERS PILLS STYLES --- */
/* Different color variations for member pills */
.member-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.member-pill.teal {
    background: #CCFBF1;
    color: #134E4A;
}

.member-pill.indigo {
    background: #E0E7FF;
    color: #3730A3;
}

.member-pill.green {
    background: #D1FAE5;
    color: #065F46;
}

.member-pill.purple {
    background: #F3E8FF;
    color: #6B21A8;
}

.member-pill.yellow {
    background: #FEF3C7;
    color: #92400E;
}

.member-pill.blue {
    background: #DBEAFE;
    color: #1E40AF;
}

.member-pill.pink {
    background: #FCE7F3;
    color: #9F1239;
}

.member-pill.orange {
    background: #FFEDD5;
    color: #9A3412;
}

.member-pill .member-name {
    flex-shrink: 0;
}

.member-pill .remove-btn {
    margin-left: 0.5rem;
    margin-right: -0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.member-pill:hover .remove-btn {
    opacity: 1;
}

.member-pill .remove-btn i {
    font-size: 0.875rem;
}

.member-pill.teal .remove-btn {
    color: #0D9488;
}

.member-pill.teal .remove-btn:hover {
    color: #134E4A;
}

.member-pill.indigo .remove-btn {
    color: #6366F1;
}

.member-pill.indigo .remove-btn:hover {
    color: #3730A3;
}

.member-pill.green .remove-btn {
    color: #10B981;
}

.member-pill.green .remove-btn:hover {
    color: #065F46;
}

.member-pill.purple .remove-btn {
    color: #A855F7;
}

.member-pill.purple .remove-btn:hover {
    color: #6B21A8;
}

.member-pill.yellow .remove-btn {
    color: #F59E0B;
}

.member-pill.yellow .remove-btn:hover {
    color: #92400E;
}

.member-pill.blue .remove-btn {
    color: #3B82F6;
}

.member-pill.blue .remove-btn:hover {
    color: #1E40AF;
}

.member-pill.pink .remove-btn {
    color: #EC4899;
}

.member-pill.pink .remove-btn:hover {
    color: #9F1239;
}

.member-pill.orange .remove-btn {
    color: #F97316;
}

.member-pill.orange .remove-btn:hover {
    color: #9A3412;
}

.assigned-members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

/* Capacity badge for full events */
.capacity-badge-full {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #FEE2E2;
    color: #991B1B;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* Ensure table cells with member pills have proper padding */
#assignments-table-body td {
    vertical-align: middle;
}

/* CRITICAL: Ensure ALL text inputs, textareas, and selects have visible borders - highest priority */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="datetime-local"],
textarea,
select {
    border: 1px solid var(--color-border) !important;
    border-color: var(--color-border) !important;
}

input[type="text"]:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
input[type="email"]:not([type="hidden"]),
input[type="password"]:not([type="hidden"]),
input[type="number"]:not([type="hidden"]),
input[type="date"]:not([type="hidden"]),
input[type="time"]:not([type="hidden"]),
input[type="tel"]:not([type="hidden"]),
input[type="url"]:not([type="hidden"]),
input[type="search"]:not([type="hidden"]),
input[type="datetime-local"]:not([type="hidden"]),
textarea:not([type="hidden"]),
select:not([type="hidden"]) {
    border: 1px solid var(--color-border) !important;
    border-color: var(--color-border) !important;
}

/* ==================== BLOOD DRIVES UPGRADE STYLES ==================== */

/* Tab Switcher */
.drive-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-border);
}

.drive-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-secondary);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

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

.tab-content {
    display: block;
    min-height: 400px;
}

.tab-content.hidden {
    display: none !important;
}

/* Force Live Dashboard to always have dimensions when visible */
#tab-content-live-dashboard:not(.hidden) {
    display: block !important;
    min-height: 600px !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Dashboard KPI Cards */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Funnel Visualization */
.funnel-container {
    margin-bottom: 2rem;
}

.funnel-visual {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-gray-50);
    border-radius: 0.5rem;
    flex-wrap: wrap;
}

.funnel-segment {
    flex: 1;
    min-width: 80px;
    background: var(--color-primary);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

/* Efficiency Metric */
.efficiency-metric {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}

/* Volunteer Mode Overlay */
.volunteer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F7F9FC;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.volunteer-overlay.hidden {
    display: none;
}

.volunteer-overlay-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 1.5rem;
    border-bottom: 2px solid var(--color-border);
    z-index: 10000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.volunteer-cards-container {
    padding: 1.5rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Volunteer Donor Cards */
.volunteer-donor-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid #9CA3AF;
    transition: all 0.2s;
}

.volunteer-donor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.volunteer-action-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    font-size: 1rem;
    transition: all 0.2s;
}

.volunteer-action-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.volunteer-action-btn:active {
    transform: scale(0.98);
}

.volunteer-bus-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    min-height: 44px;
    transition: border-color 0.2s;
}

.volunteer-bus-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .funnel-visual {
        flex-direction: column;
    }
    
    .funnel-segment {
        width: 100%;
    }
    
    .volunteer-overlay-header {
        padding: 1rem;
    }
    
    .volunteer-cards-container {
        padding: 1rem;
    }
    
    .volunteer-donor-card {
        padding: 1rem;
    }
}

/* --- PORTAL FOOTER --- */
/* Force dark navy footer on all pages */
footer.portal-footer,
.portal-footer,
body > footer.portal-footer,
body footer.portal-footer,
.public-page-wrapper footer.portal-footer,
.portal-wrapper footer.portal-footer {
    background-color: #1B365D !important;
    background: #1B365D !important;
    color: #FFFFFF !important;
    padding: 1.5rem 2rem !important;
    text-align: center !important;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    clear: both;
}

.portal-footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.portal-footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.portal-footer .footer-disclaimer {
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.5;
    margin-top: 0.75rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* --- PUBLIC PAGE LAYOUT (About/FAQ without authentication) --- */
.public-page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-light-bg);
}

/* Force white header on public pages */
header.public-page-header,
.public-page-header,
body > header.public-page-header,
body header.public-page-header,
.public-page-wrapper header.public-page-header {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid var(--color-border) !important;
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.public-logo-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 1.125rem;
    transition: opacity 0.2s;
}

.public-logo-link:hover {
    opacity: 0.8;
}

.public-logo {
    height: 50px;
    width: auto;
    max-width: 200px;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.public-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
}

.public-nav a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.public-nav a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.public-nav .btn-signin {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.public-nav .btn-signin:hover {
    background-color: var(--color-primary-dark);
    border-bottom-color: transparent;
}

.public-page-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--color-text-secondary);
}

.breadcrumb-item a {
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-text-secondary);
}

.breadcrumb-item.active a {
    color: var(--color-text-secondary);
    cursor: default;
    pointer-events: none;
}

.breadcrumb-item.active a:hover {
    text-decoration: none;
}

/* Public page content adjustments */
.public-page-content .content-body {
    background-color: transparent;
    padding: 0;
}

.public-page-content .content-header {
    margin-bottom: 2rem;
}

/* Responsive adjustments for public pages */
@media (max-width: 768px) {
    .public-header-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .public-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .public-page-content {
        padding: 1.5rem 1rem;
    }
}

/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   ============================================ */

/* --- FORMS PAGE RESPONSIVE STYLES --- */
.forms-container {
    width: 100%;
    max-width: 100%;
}

/* Forms page headers */
.forms-container h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    word-wrap: break-word;
}

.forms-container .card {
    margin-bottom: 1rem;
}

/* Forms library cards - responsive layout */
#forms-library-list .card,
#forms-list .card {
    margin-bottom: 1rem;
}

#forms-library-list .card-body > div,
#forms-list .card-body > div {
    flex-direction: column;
    gap: 1rem;
}

#forms-library-list .card-body > div > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Budget nav tabs - responsive */
.budget-nav ul {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.budget-nav a {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

/* Tables - convert to cards on mobile */
@media (max-width: 768px) {
    /* Hide table headers on mobile */
    .roster-table thead {
        display: none;
    }
    
    /* Convert table rows to cards */
    .roster-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 1rem;
        background-color: var(--color-white);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .roster-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border: none;
        text-align: left;
        border-bottom: 1px solid var(--color-gray-100);
    }
    
    .roster-table tbody td:last-child {
        border-bottom: none;
        padding-top: 0.75rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .roster-table tbody td:first-child {
        border-bottom: none;
        padding-bottom: 0.5rem;
    }
    
    .roster-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-text-secondary);
        display: inline-block;
        min-width: 140px;
        font-size: 0.875rem;
    }
    
    .roster-table tbody td:first-child:before {
        content: "";
        min-width: 0;
    }
    
    /* Stack action buttons */
    .roster-table tbody td:last-child .btn {
        width: 100%;
        margin: 0;
    }
    
    .roster-table tbody td:last-child > div {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    /* Checkbox styling on mobile */
    .roster-table tbody td:first-child {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 0.5rem 0 0.75rem 0;
    }
    
    .roster-table tbody td:first-child input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Forms modals - responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1.5rem 1rem;
    }
    
    .modal-content h2 {
        font-size: 1.25rem;
    }
    
    .modal-content .form-group {
        margin-bottom: 1rem;
    }
    
    .modal-content .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-content .form-actions .btn {
        width: 100%;
    }
    
    /* Multi-select dropdowns */
    select[multiple] {
        min-height: 150px;
        font-size: 0.875rem;
    }
}

/* Forms card actions - responsive */
@media (max-width: 768px) {
    #forms-library-list .card-body > div {
        flex-direction: column;
    }
    
    #forms-library-list .card-body > div > div:last-child {
        flex-direction: column;
        width: 100%;
    }
    
    #forms-library-list .card-body .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* Members page - mobile responsive */
@media (max-width: 768px) {
    /* Add Member Form - stack on mobile */
    .add-member-form {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .form-card {
        margin-bottom: 1.5rem;
    }
    
    .form-card-title {
        font-size: 1rem;
        padding: 1rem;
    }
    
    /* Table card header - stack filters */
    .table-card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }
    
    .table-card-header h3 {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
    }
    
    .table-card-header .context-selectors {
        flex-direction: column !important;
        width: 100% !important;
        gap: 1rem !important;
    }
    
    .table-card-header .selector-group {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .table-card-header .selector-group select,
    .table-card-header .selector-group label {
        width: 100% !important;
    }
    
    /* Table card body padding */
    .table-card > div[style*="padding"] {
        padding: 1rem !important;
    }
    
    /* Search bar - full width */
    .table-card > div[style*="padding"] .context-selectors {
        flex-direction: column !important;
        width: 100% !important;
        gap: 1rem !important;
    }
    
    .table-card > div[style*="padding"] .selector-group {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .table-card > div[style*="padding"] .selector-group input {
        width: 100% !important;
    }
    
    /* Bulk actions bar - stack on mobile */
    #bulk-actions-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
    
    #bulk-actions-bar > div {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    #bulk-actions-bar .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    #clear-selection-btn {
        width: 100% !important;
    }
    
    /* Pagination - stack on mobile */
    #members-pagination {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        padding: 1rem 0 !important;
    }
    
    #members-pagination > div:first-child {
        text-align: center;
        width: 100%;
    }
    
    #members-pagination > div:last-child {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.75rem !important;
    }
    
    #members-pagination-pages {
        justify-content: center !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }
    
    #members-pagination > div:last-child > div:last-child {
        width: 100% !important;
        display: flex !important;
        gap: 0.5rem !important;
    }
    
    #members-pagination-prev,
    #members-pagination-next {
        flex: 1 !important;
        width: auto !important;
    }
}

/* --- GENERAL RESPONSIVE STYLES --- */

/* Mobile menu toggle - hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

/* Sidebar - collapse on mobile */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .sidebar-nav a {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    
    .sidebar-nav a i {
        width: 18px;
        margin-right: 0.5rem;
    }
}

@media (max-width: 768px) {
    .portal-container {
        flex-direction: column;
        position: relative;
    }
    
    .sidebar {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        background: var(--color-white);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .sidebar.mobile-open {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-header .logo {
        width: 100%;
        max-width: 300px;
    }
    
    .main-content {
        width: 100%;
        margin-top: 0;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--color-white);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 0.75rem;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        font-size: 1.25rem;
        color: var(--color-gray-700);
        transition: all 0.2s;
    }
    
    .mobile-menu-toggle:hover {
        background: var(--color-gray-50);
        color: var(--color-primary);
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    /* Adjust header position when sidebar is open */
    header.portal-header {
        position: relative;
        z-index: 998;
    }
}

/* Content area - responsive padding */
@media (max-width: 768px) {
    .content-body {
        padding: 1rem;
    }
    
    .content-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .content-header p {
        font-size: 0.875rem;
    }
}

/* Cards - responsive */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .card-header h3 {
        font-size: 1.125rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header > .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Buttons - responsive */
@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    /* Stack buttons in form actions */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* Form inputs - responsive */
@media (max-width: 768px) {
    .form-input-inline {
        width: 100% !important;
        font-size: 1rem; /* Prevents zoom on iOS */
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    /* Grid forms stack on mobile */
    .form-field-group {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Tables - general responsive */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        border-radius: 0;
    }
    
    .table-responsive table {
        border: none;
    }
}

/* Header - responsive */
@media (max-width: 768px) {
    header.portal-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .user-profile-header {
        width: 100%;
        margin-top: 1rem;
        justify-content: space-between;
    }
    
    .content-header.with-selectors {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        height: auto !important;
        padding: 1rem !important;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
    }
    
    .content-header p {
        font-size: 0.8125rem;
    }
    
    .content-header .selectors {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .content-header .selectors select {
        width: 100%;
    }
    
    .context-selectors {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .selector-group {
        width: 100%;
    }
    
    .context-select {
        width: 100%;
        min-width: 100%;
    }
}

/* Dashboard KPI cards - responsive */
.dashboard-kpi-grid {
    max-width: 100%;
    box-sizing: border-box;
}

.dashboard-split-view {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .dashboard-split-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    .dashboard-split-view {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Member dashboard cards - responsive */
@media (max-width: 768px) {
    .member-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .member-dashboard-card {
        padding: 1rem;
    }
    
    .member-dashboard-card .card-icon {
        font-size: 2rem;
    }
    
    .member-dashboard-card h3 {
        font-size: 1.125rem;
    }
}

/* Budget nav tabs - responsive */
@media (max-width: 768px) {
    .budget-nav {
        margin-bottom: 1rem;
    }
    
    .budget-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .budget-nav a {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
}

/* Modal improvements for mobile */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }
    
    .close-btn {
        font-size: 1.5rem;
        top: 0.5rem;
        right: 0.5rem;
        width: 32px;
        height: 32px;
        line-height: 32px;
    }
}

/* Footer - responsive */
@media (max-width: 768px) {
    .portal-footer {
        padding: 1rem !important;
        font-size: 0.875rem;
    }
    
    .portal-footer-content {
        padding: 0;
    }
}

/* Tablet specific styles (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-field-group {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .modal-content {
        width: 85%;
        max-width: 600px;
    }
}

/* Large desktop (1024px+) */
@media (min-width: 1025px) {
    .content-body {
        padding: 2rem;
    }
    
    /* Dashboard container - full width for alignment */
    #officer-dashboard {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Member dashboard - ensure full width at all screen sizes */
    #member-dashboard {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Officer alerts and KPI container - full width */
    #officer-alerts-kpi-container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Alerts banner and KPI grid - full width */
    #alerts-banner,
    #officer-kpi-grid {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Member dashboard children - full width */
    #member-dashboard > div:first-of-type {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Split view - Next Up and Quick Actions - limit width */
    #officer-dashboard > div[style*="grid-template-columns: 1fr 1fr"] {
        max-width: 100%;
    }
}

/* Extra large desktop (1400px+) */
@media (min-width: 1400px) {
    .content-body {
        padding: 2.5rem;
    }
    
    /* Dashboard - keep full width for alignment */
    #officer-dashboard {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Member dashboard - keep full width even on large screens */
    #member-dashboard {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Officer alerts and KPI container - full width */
    #officer-alerts-kpi-container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Alerts banner and KPI grid - full width */
    #alerts-banner,
    #officer-kpi-grid {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Split view - maintain reasonable width */
    #officer-dashboard > div[style*="grid-template-columns: 1fr 1fr"] {
        max-width: 100%;
    }
}

/* Ultra wide screens (1920px+) */
@media (min-width: 1920px) {
    .content-body {
        padding: 3rem;
    }
    
    /* Dashboard - keep full width for alignment */
    #officer-dashboard {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    /* Member dashboard - keep full width even on ultra-wide screens */
    #member-dashboard {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Officer alerts and KPI container - full width */
    #officer-alerts-kpi-container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* Alerts banner and KPI grid - full width */
    #alerts-banner,
    #officer-kpi-grid {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Extra small devices (phones, < 480px) */
/* Calendar grid responsive styles */
#calendar-view {
    overflow-x: auto;
}

/* Dashboard card grid - ensure equal heights */
#blood-drives-list,
#competitions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

#blood-drives-list > .card,
#competitions-list > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Dropdown menu styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-gray-900);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--color-gray-50);
}

.dropdown-item:first-child {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

#calendar-view > div {
    min-width: 600px;
}

@media (max-width: 768px) {
    #calendar-view > div {
        min-width: 100%;
        font-size: 0.875rem;
    }
    
    #calendar-view .calendar-event {
        font-size: 0.625rem !important;
        padding: 0.125rem 0.25rem !important;
    }
    
    .calendar-event-card {
        margin-bottom: 0.75rem !important;
    }
    
    .calendar-event-card .card-body {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .forms-container h1 {
        font-size: 1.25rem;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .modal-content {
        padding: 1rem 0.75rem;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.25rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
    }
    
    .sidebar.mobile-open {
        max-height: 70vh;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .portal-header,
    .portal-footer,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .card {
        page-break-inside: avoid;
    }
}