* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Light Theme - Grey/Neutral Colors */
:root {
    --primary: #3B4A54;
    --primary-dark: #2C3A44;
    --primary-light: #5A6E7A;
    --secondary: #6C757D;
    --accent: #17A2B8;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;
    --bg-gradient-start: #E9ECEF;
    --bg-gradient-end: #CED4DA;
    --card-bg: #FFFFFF;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --border: #DEE2E6;
    --table-header: #F8F9FA;
    --hover-bg: #F1F3F5;
    --shadow: rgba(0, 0, 0, 0.1);
    /* Service Colors */
    --fast-color: #3B82F6;
    --fast-bg: #EFF6FF;
    --second-color: #F59E0B;
    --second-bg: #FFFBEB;
    /* Filter Colors */
    --filter-active-bg: #3B4A54;
    --filter-active-text: #FFFFFF;
}

/* Dark Theme */
body.dark-theme {
    --primary: #6C757D;
    --primary-dark: #5A6268;
    --primary-light: #8A9CAD;
    --secondary: #ADB5BD;
    --accent: #20C997;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;
    --bg-gradient-start: #1A1A2E;
    --bg-gradient-end: #16213E;
    --card-bg: #1F1F2E;
    --text-primary: #F8F9FA;
    --text-secondary: #CED4DA;
    --border: #2D3E5F;
    --table-header: #2D2D44;
    --hover-bg: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
    --fast-color: #60A5FA;
    --fast-bg: #1E3A5F;
    --second-color: #FBBF24;
    --second-bg: #4B3A0A;
    --filter-active-bg: #6C757D;
    --filter-active-text: #FFFFFF;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 10px;
    transition: background 0.3s ease, color 0.3s ease;
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    padding: 8px 16px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 10px;
    right: 10px;
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
    max-width: 350px;
    width: 100%;
}

@media (max-width: 480px) {
    .toast {
        max-width: 100%;
    }
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
.toast.warning { background: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Login Page */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
}

.login-box {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px 25px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px var(--shadow);
    transition: background 0.3s ease;
}

@media (max-width: 480px) {
    .login-box {
        padding: 25px 20px;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-header h1 {
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 8px;
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 22px;
    }
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .role-selector {
        flex-direction: column;
        gap: 10px;
    }
}

.role-btn {
    flex: 1;
    padding: 12px;
    background: var(--table-header);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.role-btn i {
    margin-right: 8px;
}

.role-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.role-btn[data-role="volunteer"] i {
    color: #8B5CF6;
}

.role-btn[data-role="volunteer"].active {
    background: #8B5CF6;
    border-color: #8B5CF6;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[readonly] {
    background: var(--table-header);
    cursor: not-allowed;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-btn:not(:disabled):hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Dashboard */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 35px var(--shadow);
    transition: background 0.3s ease;
}

@media (max-width: 768px) {
    .dashboard {
        padding: 12px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .dashboard {
        padding: 10px;
        border-radius: 12px;
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 480px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
}

.header-title h1 {
    color: var(--primary);
    font-size: 22px;
}

@media (max-width: 480px) {
    .header-title h1 {
        font-size: 18px;
    }
}

.header-title p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.logout-btn {
    padding: 8px 16px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 14px;
}

@media (max-width: 480px) {
    .logout-btn {
        width: 100%;
        padding: 10px;
    }
}

.logout-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============================================
   SERVICE SELECTOR STYLES (UPDATED)
   ============================================ */

.service-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--table-header);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.service-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 5px;
}

.service-label i {
    margin-right: 6px;
    color: var(--primary);
}

.service-btn {
    padding: 8px 18px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.service-btn i {
    font-size: 14px;
}

.service-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* All Services Button */
.service-btn[data-service="all"] {
    border-color: var(--primary);
    color: var(--primary);
}

.service-btn[data-service="all"]:hover {
    background: var(--primary);
    color: white;
}

.service-btn[data-service="all"].active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 74, 84, 0.3);
}

/* Fast Service Button */
.service-btn.fast {
    border-color: var(--fast-color);
    color: var(--fast-color);
    background: var(--fast-bg);
}

.service-btn.fast:hover {
    background: var(--fast-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.service-btn.fast.active {
    background: var(--fast-color);
    color: white;
    border-color: var(--fast-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Second Service Button */
.service-btn.second {
    border-color: var(--second-color);
    color: var(--second-color);
    background: var(--second-bg);
}

.service-btn.second:hover {
    background: var(--second-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.service-btn.second.active {
    background: var(--second-color);
    color: white;
    border-color: var(--second-color);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.service-current {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 4px 12px;
    background: var(--card-bg);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.service-current strong {
    color: var(--primary);
}

/* Service Info Box */
.service-info {
    background: var(--table-header);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--info);
}

.service-info i {
    color: var(--info);
    margin-right: 8px;
}

.service-info strong {
    color: var(--primary);
}

/* Service Badge */
.service-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.service-badge.fast {
    background: var(--fast-bg);
    color: var(--fast-color);
    border: 1px solid var(--fast-color);
}

.service-badge.second {
    background: var(--second-bg);
    color: var(--second-color);
    border: 1px solid var(--second-color);
}

.service-badge.both {
    background: #E5E7EB;
    color: #4B5563;
    border: 1px solid #9CA3AF;
}

body.dark-theme .service-badge.both {
    background: #374151;
    color: #9CA3AF;
    border: 1px solid #6B7280;
}

/* Responsive Service Selector */
@media (max-width: 640px) {
    .service-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 15px;
    }
    
    .service-label {
        text-align: center;
    }
    
    .service-btn {
        justify-content: center;
        padding: 10px;
        width: 100%;
    }
    
    .service-current {
        margin-left: 0;
        text-align: center;
    }
}

/* ============================================
   STATS ROW
   ============================================ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

.stat-box {
    background: var(--table-header);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: background 0.3s ease;
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: rgba(59, 74, 84, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 20px;
    color: var(--primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 20px;
    }
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Comparison Section */
.comparison-section {
    background: var(--table-header);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.comparison-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
}

.comparison-section h3 i {
    margin-right: 8px;
    color: var(--primary);
}

.comparison-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.comparison-box {
    text-align: center;
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 12px;
    min-width: 120px;
    box-shadow: 0 2px 8px var(--shadow);
}

.comparison-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.comparison-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.comparison-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.comparison-arrow i {
    font-size: 24px;
    color: var(--text-secondary);
}

.comparison-difference {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
}

.comparison-difference #diffValue {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.comparison-difference #diffText {
    font-size: 12px;
    color: var(--text-secondary);
}

.diff-positive {
    color: var(--success);
}

.diff-negative {
    color: var(--danger);
}

.diff-neutral {
    color: var(--warning);
}

.weekly-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.weekly-box {
    text-align: center;
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 12px;
    flex: 1;
    min-width: 100px;
}

.weekly-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.weekly-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

@media (max-width: 768px) {
    .comparison-row {
        flex-direction: column;
    }
    
    .comparison-arrow i {
        transform: rotate(90deg);
    }
    
    .weekly-stats {
        flex-direction: column;
    }
    
    .weekly-box {
        width: 100%;
    }
}

/* Tabs */
.tabs-container {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: var(--table-header);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    gap: 2px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .tab-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 8px;
    }
}

.tab-btn {
    padding: 12px 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    white-space: nowrap;
}

.tab-btn i {
    margin-right: 6px;
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 10px 12px;
        font-size: 11px;
    }
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn[data-tab="sa-volunteers"] i {
    color: #8B5CF6;
}

.tab-btn[data-tab="sa-volunteers"].active {
    color: #8B5CF6;
    border-bottom-color: #8B5CF6;
}

.tab-panels {
    padding: 20px;
}

@media (max-width: 768px) {
    .tab-panels {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .tab-panels {
        padding: 12px;
    }
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Panel Card */
.panel-card {
    background: var(--card-bg);
}

.panel-card h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 18px;
    font-weight: 600;
}

.panel-card h3 i {
    margin-right: 8px;
    color: var(--primary);
}

@media (max-width: 480px) {
    .panel-card h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
}

.search-filter, .search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .search-filter, .search-box {
        flex-direction: column;
    }
}

.search-filter input, 
.search-box input,
.search-filter select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    width: 250px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .search-filter input, 
    .search-box input,
    .search-filter select {
        width: 100%;
    }
}

/* ============================================
   FILTER BUTTON STYLES (NEW)
   ============================================ */

.filter-btn {
    padding: 10px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.filter-btn:active {
    transform: scale(0.96);
}

.filter-btn.active {
    background: var(--filter-active-bg);
    color: var(--filter-active-text);
    border-color: var(--filter-active-bg);
}

.filter-btn i {
    font-size: 14px;
}

/* Dark theme filter button */
body.dark-theme .filter-btn {
    background: #4B5563;
}

body.dark-theme .filter-btn:hover {
    background: #6B7280;
}

body.dark-theme .filter-btn.active {
    background: #6C757D;
}

/* ============================================
   ATTENDANCE TABLE STYLES (UPDATED)
   ============================================ */

.attendance-table .status-present {
    color: var(--success);
    font-weight: 600;
}

.attendance-table .status-absent {
    color: var(--danger);
    font-weight: 600;
}

.attendance-table .status-present i,
.attendance-table .status-absent i {
    margin-right: 4px;
}

.attendance-table tr.present-row {
    border-left: 3px solid var(--success);
}

.attendance-table tr.absent-row {
    border-left: 3px solid var(--danger);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.form-group {
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 480px) {
    .form-buttons {
        justify-content: stretch;
    }
    .form-buttons button {
        flex: 1;
    }
}

.btn-primary {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary i {
    margin-right: 6px;
}

@media (max-width: 480px) {
    .btn-primary {
        padding: 12px 16px;
        width: 100%;
    }
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-secondary i {
    margin-right: 6px;
}

@media (max-width: 480px) {
    .btn-secondary {
        padding: 10px 16px;
        width: 100%;
    }
}

.btn-export {
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 8px;
    font-size: 13px;
}

.btn-export i {
    margin-right: 6px;
}

@media (max-width: 480px) {
    .btn-export {
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
    }
    .export-buttons {
        display: flex;
        flex-direction: column;
    }
}

.btn-checkin {
    padding: 8px 16px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-checkin:hover {
    background: #1e7e34;
    transform: scale(1.02);
}

.btn-assign {
    padding: 6px 12px;
    background: var(--info);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.submit-btn {
    width: 100%;
    margin-top: 20px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

@media (max-width: 768px) {
    .data-table {
        font-size: 12px;
        min-width: 500px;
    }
}

.data-table th {
    text-align: left;
    padding: 10px 8px;
    background: var(--table-header);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    font-size: 13px;
}

@media (max-width: 480px) {
    .data-table th {
        padding: 8px 6px;
        font-size: 11px;
    }
}

.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 13px;
}

@media (max-width: 480px) {
    .data-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
}

.data-table tr:hover {
    background: var(--hover-bg);
}

/* Member Name Clickable */
.member-name-clickable {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.member-name-clickable:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Check-in List */
.checkin-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
}

.checkin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 640px) {
    .checkin-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.checkin-item:last-child {
    border-bottom: none;
}

.checkin-info {
    flex: 1;
}

.checkin-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.checkin-details {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.badge-id {
    background: var(--table-header);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-family: monospace;
    color: var(--text-primary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-checked-in {
    background: #d4edda;
    color: #155724;
}

.status-checked-out {
    background: #fff3cd;
    color: #856404;
}

/* Agenda & Video Styles */
.agenda-upload-section,
.video-upload-section {
    background: var(--table-header);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.agenda-upload-section h4,
.video-upload-section h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.agenda-upload-section h4 i,
.video-upload-section h4 i {
    margin-right: 8px;
    color: var(--primary);
}

.agenda-upload-form,
.video-upload-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.agenda-upload-form input[type="file"],
.video-upload-form input[type="file"] {
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    flex: 1;
    min-width: 150px;
}

.agenda-upload-form input[type="text"],
.video-upload-form input[type="text"] {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    flex: 2;
    min-width: 200px;
}

.video-upload-form textarea {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    flex: 2;
    min-width: 200px;
    font-family: inherit;
}

@media (max-width: 640px) {
    .agenda-upload-form,
    .video-upload-form {
        flex-direction: column;
    }
    .agenda-upload-form input,
    .video-upload-form input,
    .video-upload-form textarea {
        width: 100%;
    }
}

.agenda-list-section h4,
.video-list-section h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.agenda-list-section h4 i,
.video-list-section h4 i {
    margin-right: 8px;
    color: var(--primary);
}

.btn-download {
    padding: 6px 12px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-download i {
    margin-right: 4px;
}

.btn-download:hover {
    opacity: 0.9;
}

/* Date Filter & Attendance Filters */
.date-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.attendance-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.attendance-filters > div {
    display: flex;
    flex-direction: column;
}

.attendance-filters label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.attendance-filters select,
.attendance-filters input {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    min-width: 150px;
}

.attendance-date-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.attendance-date-selector label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.attendance-date-selector input {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .date-filter,
    .attendance-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .attendance-filters > div {
        width: 100%;
    }
    
    .attendance-filters select,
    .attendance-filters input {
        width: 100%;
    }
}

.export-buttons {
    margin-top: 20px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.attendance-export-buttons {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .export-buttons,
    .attendance-export-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Sunday Date Input Styling */
.sunday-only {
    border-color: var(--success);
}

.sunday-only:invalid {
    border-color: var(--danger);
}

/* Responsive Fixes */
@media (max-width: 360px) {
    .stat-box {
        padding: 12px;
    }
    
    .stat-icon {
        width: 35px;
        height: 35px;
    }
    
    .stat-icon i {
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .tab-btn {
        padding: 8px 10px;
        font-size: 10px;
    }
    
    .btn-checkin {
        width: 100%;
        text-align: center;
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 1024px) {
    .dashboard {
        padding: 20px;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--table-header);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Badges */
.unassigned-badge {
    background: var(--warning);
    color: #212529;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Action Buttons */
.btn-edit {
    background: #F59E0B;
    color: #1F2937;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
}

.btn-delete {
    background: #DC3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-edit:hover, .btn-delete:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* ============================================
   MESSAGING SYSTEM STYLES
   ============================================ */

.message-compose {
    background: var(--table-header);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.message-compose h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 16px;
}

.message-compose h4 i {
    margin-right: 8px;
    color: var(--primary);
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-form .form-group {
    margin-bottom: 0;
}

.message-form input,
.message-form select,
.message-form textarea {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.3s ease;
}

.message-form input:focus,
.message-form select:focus,
.message-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.message-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.message-form button[type="submit"] {
    align-self: flex-start;
}

@media (max-width: 480px) {
    .message-form button[type="submit"] {
        align-self: stretch;
        width: 100%;
    }
}

.message-inbox {
    margin-top: 20px;
}

.message-inbox h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 16px;
}

.message-inbox h4 i {
    margin-right: 8px;
    color: var(--primary);
}

.message-inbox .data-table tr.unread {
    background: rgba(59, 130, 246, 0.08);
    font-weight: 500;
}

.message-inbox .data-table tr.unread td:first-child {
    font-weight: 600;
}

.message-inbox .data-table tr.unread:hover {
    background: rgba(59, 130, 246, 0.15);
}

.status-badge.unread {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.read {
    background: #d1fae5;
    color: #065f46;
}

body.dark-theme .status-badge.unread {
    background: #78350f;
    color: #fde68a;
}

body.dark-theme .status-badge.read {
    background: #064e3b;
    color: #6ee7b7;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: var(--danger);
    color: white;
    margin-left: 4px;
    vertical-align: middle;
    min-width: 20px;
    text-align: center;
}

.badge.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Message Thread Modal */
#messageThreadModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

#messageThreadModal.show {
    display: flex;
}

#messageThreadModal > div {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#threadBody {
    background: var(--table-header);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

#repliesContainer {
    margin-bottom: 15px;
}

.reply-item {
    background: var(--table-header);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.reply-item .reply-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.reply-item .reply-meta strong {
    color: var(--text-primary);
}

.reply-item .reply-text {
    font-size: 14px;
    line-height: 1.5;
}

#messageThreadModal #replyForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

#messageThreadModal #replyForm textarea {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    width: 100%;
    transition: border-color 0.3s ease;
}

#messageThreadModal #replyForm textarea:focus {
    outline: none;
    border-color: var(--primary);
}

#messageThreadModal #replyForm button {
    align-self: flex-start;
}

@media (max-width: 480px) {
    #messageThreadModal > div {
        padding: 18px;
        width: 95%;
    }
    
    #messageThreadModal #replyForm button {
        align-self: stretch;
        width: 100%;
    }
}

/* ============================================
   GRADUATION SYSTEM STYLES
   ============================================ */

#sa-graduation .stats-row {
    margin-bottom: 20px;
}

#sa-graduation .stat-box:nth-child(1) .stat-icon i { color: #3B82F6; }
#sa-graduation .stat-box:nth-child(2) .stat-icon i { color: #F59E0B; }
#sa-graduation .stat-box:nth-child(3) .stat-icon i { color: #10B981; }
#sa-graduation .stat-box:nth-child(4) .stat-icon i { color: #EF4444; }

#saGraduationTable tr.graduated {
    background: rgba(16, 185, 129, 0.08);
}

#saGraduationTable tr.notified {
    background: rgba(245, 158, 11, 0.08);
}

#saGraduationTable tr.pending {
    background: rgba(239, 68, 68, 0.05);
}

.btn-graduate {
    background: #10B981;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-graduate:hover {
    background: #059669;
    transform: scale(1.02);
}

.btn-notify {
    background: #F59E0B;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    margin-right: 5px;
}

.btn-notify:hover {
    background: #D97706;
    transform: scale(1.02);
}

.btn-notify-all {
    background: #F59E0B;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-notify-all:hover {
    background: #D97706;
    transform: scale(1.02);
}

.btn-graduate-all {
    background: #10B981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-graduate-all:hover {
    background: #059669;
    transform: scale(1.02);
}

.btn-refresh {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-refresh:hover {
    background: var(--primary);
    transform: scale(1.02);
}

.grad-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.grad-status.graduated {
    background: #d1fae5;
    color: #065f46;
}

.grad-status.notified {
    background: #fef3c7;
    color: #92400e;
}

.grad-status.pending {
    background: #fee2e2;
    color: #991b1b;
}

body.dark-theme .grad-status.graduated {
    background: #064e3b;
    color: #6ee7b7;
}

body.dark-theme .grad-status.notified {
    background: #78350f;
    color: #fde68a;
}

body.dark-theme .grad-status.pending {
    background: #7f1d1d;
    color: #fca5a5;
}

#saGraduationBadge,
#adminGraduationBadge {
    animation: none;
}

#saGraduationBadge.show,
#adminGraduationBadge.show {
    display: inline-block;
    animation: pulse 2s infinite;
}

.tab-btn[data-tab="sa-graduation"] .badge,
.tab-btn[data-tab="admin-graduation"] .badge {
    background: #EF4444;
}

#sa-graduated .data-table tr {
    background: rgba(16, 185, 129, 0.05);
}

#sa-graduated .data-table tr:hover {
    background: rgba(16, 185, 129, 0.12);
}

#admin-graduation .data-table tr {
    background: rgba(59, 130, 246, 0.05);
}

#admin-graduation .data-table tr:hover {
    background: rgba(59, 130, 246, 0.12);
}

@media (max-width: 640px) {
    #sa-graduation .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-graduate,
    .btn-notify {
        width: 100%;
        margin-bottom: 5px;
        text-align: center;
    }
    
    .btn-notify {
        margin-right: 0;
    }
    
    #sa-graduation .btn-primary,
    #sa-graduation .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   VOLUNTEER SYSTEM STYLES
   ============================================ */

#volunteerDashboard .dashboard-header h1 {
    color: #8B5CF6;
}

#volunteerDashboard .dashboard-header h1 i {
    color: #8B5CF6;
}

#volunteerDashboard .stat-box .stat-icon i {
    color: #8B5CF6;
}

#volunteerDashboard .stat-box {
    border-left: 3px solid #8B5CF6;
}

.tab-btn[data-tab="volunteer-attendance"] i {
    color: #8B5CF6;
}

.tab-btn[data-tab="volunteer-attendance"].active {
    color: #8B5CF6;
    border-bottom-color: #8B5CF6;
}

/* Volunteer Service Selector */
#volunteerServiceSelector .service-btn.fast.active {
    background: #8B5CF6;
    border-color: #8B5CF6;
    color: white;
}

#volunteerServiceSelector .service-btn.second.active {
    background: #8B5CF6;
    border-color: #8B5CF6;
    color: white;
}

#volunteerServiceSelector .service-btn.fast {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

#volunteerServiceSelector .service-btn.second {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

#volunteerServiceSelector .service-btn.fast:hover {
    background: #8B5CF6;
    color: white;
}

#volunteerServiceSelector .service-btn.second:hover {
    background: #8B5CF6;
    color: white;
}

#sa-volunteers .volunteer-add-section {
    background: var(--table-header);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

#sa-volunteers .volunteer-add-section h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

#sa-volunteers .volunteer-add-section h4 i {
    color: #8B5CF6;
    margin-right: 8px;
}

.volunteer-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.volunteer-form .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.volunteer-form button {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .volunteer-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .volunteer-form .form-group {
        min-width: 100%;
    }
    
    .volunteer-form button {
        width: 100%;
    }
}

#saVolunteersTable tr td:first-child {
    font-weight: 500;
    color: #8B5CF6;
}

.volunteer-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #EDE9FE;
    color: #7C3AED;
}

body.dark-theme .volunteer-badge {
    background: #2D1B4E;
    color: #A78BFA;
}

.volunteer-info-box {
    background: var(--table-header);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #8B5CF6;
}

.volunteer-info-box p {
    color: var(--text-secondary);
    font-size: 13px;
}

.volunteer-info-box i {
    color: #8B5CF6;
    margin-right: 8px;
}

#volunteerCheckinList .checkin-item {
    border-left: 3px solid #8B5CF6;
}

#submitVolunteerAttendanceBtn {
    background: #8B5CF6;
}

#submitVolunteerAttendanceBtn:hover {
    background: #7C3AED;
}

/* ============================================
   MEMBER DETAILS MODAL
   ============================================ */

#memberDetailsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

#memberDetailsModal.show {
    display: flex;
}

#memberDetailsModal > div {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#memberDetailsModal h2 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 4px;
}

#memberDetailsModal h4 {
    color: var(--primary);
    font-size: 16px;
    margin-bottom: 10px;
}

#memberDetailsModal h4 i {
    margin-right: 8px;
    color: var(--primary);
}

#memberDetailsModal .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--table-header);
    padding: 15px;
    border-radius: 10px;
}

#memberDetailsModal .detail-grid strong {
    color: var(--text-secondary);
    font-weight: 600;
}

#memberDetailsModal .detail-grid span {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    #memberDetailsModal > div {
        padding: 18px;
        width: 95%;
    }
    
    #memberDetailsModal .detail-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

#memberDetailsModal .modal-section {
    margin-bottom: 20px;
}

#memberDetailsModal .modal-section:last-child {
    margin-bottom: 0;
}

#memberDetailsModal .modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 0 5px;
}

#memberDetailsModal .modal-close-btn:hover {
    color: var(--danger);
}

#memberDetailsModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 15px;
}

/* Admin Notification Badges */
#adminGraduationBadge {
    display: none;
}

#adminGraduationBadge.show {
    display: inline-block;
}

#adminUnreadBadge {
    display: none;
}

#adminUnreadBadge.show {
    display: inline-block;
}