/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    --bg-primary: #f0f4f8; /* Light green */
    --bg-secondary: #ffffff; /* Slightly darker light green */
    --bg-card: #ffffff; /* White cards */
    --bg-card-hover: #f8fafc;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-hover: rgba(59, 130, 246, 0.4);
    
    /* Brand Palette */
    --color-primary: #10b981; /* Emerald Green */
    --color-primary-rgb: 16, 185, 129;
    --color-primary-hover: #059669;
    --color-accent: #f59e0b; /* Gold/Amber */
    --color-accent-rgb: 245, 158, 11;
    --color-accent-hover: #d97706;
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-blue: #3b82f6;
    --color-purple: #8b5cf6;
    
    /* Text Colors */
    --text-main: #0f172a; /* Dark slate text for readability */
    --text-muted: #64748b; /* Muted dark slate */
    
    /* Fonts & Radii */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-title: 'Outfit', sans-serif;
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 20px -3px rgba(0, 0, 0, 0.3), 0 4px 12px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --backdrop-blur: blur(12px);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BASE STYLES & LAYOUT
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    padding: 2px;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background-color: white;
}

.brand-text h1 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.03);
}

.nav-item.active {
    color: var(--color-primary);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), transparent);
    border-left: 3px solid var(--color-primary);
    padding-left: calc(1rem - 3px);
}

.nav-item.active i {
    color: var(--color-primary);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.time-widget {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.clock-time {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.clock-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    height: 100vh;
}

/* Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
}

.btn-mobile-logout {
    display: none;
}

.header-title h2 {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.text-muted {
    color: var(--text-muted);
}

.prayer-indicator-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px -5px rgba(245, 158, 11, 0.1);
}

.prayer-icon {
    width: 38px;
    height: 38px;
    background: var(--color-accent);
    color: #090d16;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prayer-icon i {
    width: 20px;
    height: 20px;
}

.prayer-info {
    display: flex;
    flex-direction: column;
}

.prayer-info .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.prayer-info .value {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.prayer-time-badge {
    background: rgba(0, 0, 0, 0.08);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS & COMMON COMPONENTS
   ========================================================================== */
.content-card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.content-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-muted);
}

.badge.emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-primary);
}

.badge.gold {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent), #d97706);
    color: #090d16;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger);
    color: white;
}

.btn-text {
    background: transparent;
    color: var(--color-primary);
    padding: 0;
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Forms */
.form-input, .form-select, .form-textarea {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: black;
    padding: 0.65rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
    width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-group-vertical label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.required {
    color: var(--color-danger);
}

/* ==========================================================================
   TAB 1: DASHBOARD SPECIFIC
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper i {
    width: 26px;
    height: 26px;
}

.stat-icon-wrapper.emerald {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-primary);
}

.stat-icon-wrapper.gold {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-accent);
}

.stat-icon-wrapper.blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-blue);
}

.stat-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-purple);
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-value {
    font-family: var(--font-title);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0.15rem 0;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend i {
    width: 12px;
    height: 12px;
}

.stat-trend.green { color: var(--color-primary); }
.stat-trend.gold { color: var(--color-accent); }
.stat-trend.blue { color: var(--color-blue); }
.stat-trend.purple { color: var(--color-purple); }

/* Dashboard Grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-grid.full-width {
    grid-template-columns: 1fr;
}

.chart-card .card-body {
    position: relative;
    height: 320px;
    width: 100%;
}

.distribution-card .card-body {
    position: relative;
    height: 320px;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Recent Activity Timelines */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.activity-avatar {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.activity-details {
    flex: 1;
}

.activity-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

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

.activity-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-primary);
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: rgba(0, 0, 0, 0.15);
}

.empty-state h3 {
    color: var(--text-main);
    font-family: var(--font-title);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   TAB 2: ATTENDANCE SYSTEM SPECIFIC
   ========================================================================== */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-w: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-group label i {
    width: 14px;
    height: 14px;
}

.search-box-wrapper {
    position: relative;
    flex: 2;
    min-width: 250px;
}

.search-box-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-input {
    padding-left: 2.75rem !important;
}

.attendance-grid-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.attendance-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    gap: 2rem;
}

.progressbar-container {
    flex: 1;
    max-width: 300px;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progressbar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #059669);
    border-radius: 3px;
    transition: var(--transition-normal);
}

.jamaah-attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.attendance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.attendance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: var(--transition-fast);
}

.attendance-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.attendance-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.attendance-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attendance-card-name {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.attendance-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    width: fit-content;
}

.attendance-card-category.anak { background: rgba(59, 130, 246, 0.15); color: var(--color-blue); }
.attendance-card-category.remaja { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.attendance-card-category.dewasa { background: rgba(16, 185, 129, 0.15); color: var(--color-primary); }
.attendance-card-category.lansia { background: rgba(245, 158, 11, 0.15); color: var(--color-accent); }

.attendance-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attendance-card-meta i {
    width: 14px;
    height: 14px;
}

/* Checked/Status Card States */
.attendance-card.status-hadir {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.03);
}
.attendance-card.status-hadir::before {
    background: var(--color-primary);
}

.attendance-card.status-sakit {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.03);
}
.attendance-card.status-sakit::before {
    background: var(--color-blue);
}

.attendance-card.status-ijin {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.03);
}
.attendance-card.status-ijin::before {
    background: var(--color-accent);
}

/* Checked Button Design */
.attendance-actions-group {
    display: flex;
    gap: 0.4rem;
    width: 100%;
}

.btn-status {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.25rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-status i {
    width: 14px;
    height: 14px;
}

.btn-status:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

/* Active states */
.btn-status-hadir.active {
    background: linear-gradient(135deg, var(--color-primary), #059669);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-status-sakit.active {
    background: linear-gradient(135deg, var(--color-blue), #2563eb);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn-status-ijin.active {
    background: linear-gradient(135deg, var(--color-accent), #d97706);
    border-color: transparent;
    color: #090d16;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   TAB 3: MEMBER LIST / TABLE SPECIFIC
   ========================================================================== */
.members-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    padding: 0.75rem 1.25rem !important;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.member-avatar-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.member-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.member-name-text {
    font-weight: 600;
    color: var(--text-main);
}

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

.btn-icon.edit {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-accent);
}

.btn-icon.edit:hover {
    background: var(--color-accent);
    color: #090d16;
}

.btn-icon.delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.btn-icon.delete:hover {
    background: var(--color-danger);
    color: white;
}

/* ==========================================================================
   TAB 4: LEADERBOARD SPECIFIC
   ========================================================================== */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    padding-top: 3rem;
    height: 280px;
    margin-bottom: 2rem;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 180px;
    position: relative;
}

.podium-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    box-shadow: var(--shadow-md);
}

.avatar-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

.podium-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.podium-name {
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.podium-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.75rem;
}

.streak-value {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.podium-meta .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.podium-bar {
    width: 100%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-bottom: none;
}

/* Special Podium Spot Designs */
.podium-spot.first {
    z-index: 2;
}

.podium-spot.first .podium-avatar {
    width: 86px;
    height: 86px;
    border-color: var(--color-accent);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.podium-spot.first .avatar-icon {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
}

.crown-icon {
    position: absolute;
    top: -38px;
    color: var(--color-accent);
    animation: float 3s ease-in-out infinite;
}

.crown-icon i {
    width: 28px;
    height: 28px;
    fill: var(--color-accent);
}

.podium-spot.first .podium-badge {
    background: var(--color-accent);
    color: #090d16;
}

.podium-spot.first .streak-value {
    color: var(--color-accent);
}

.podium-spot.first .podium-bar {
    height: 120px;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.01));
    border-color: rgba(245, 158, 11, 0.25);
}

.podium-spot.second .podium-avatar {
    border-color: #cbd5e1; /* Silver color symbol */
}

.podium-spot.second .avatar-icon {
    color: #cbd5e1;
}

.podium-spot.second .podium-badge {
    background: #cbd5e1;
    color: #090d16;
}

.podium-spot.second .streak-value {
    color: #cbd5e1;
}

.podium-spot.second .podium-bar {
    height: 80px;
    background: linear-gradient(180deg, rgba(203, 213, 225, 0.15), rgba(203, 213, 225, 0.01));
    border-color: rgba(203, 213, 225, 0.2);
}

.podium-spot.third .podium-avatar {
    border-color: #b45309; /* Bronze/Amber dark */
}

.podium-spot.third .avatar-icon {
    color: #b45309;
}

.podium-spot.third .podium-badge {
    background: #b45309;
    color: white;
}

.podium-spot.third .streak-value {
    color: #b45309;
}

.podium-spot.third .podium-bar {
    height: 50px;
    background: linear-gradient(180deg, rgba(180, 83, 9, 0.15), rgba(180, 83, 9, 0.01));
    border-color: rgba(180, 83, 9, 0.2);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.rank-badge {
    font-weight: 700;
    font-size: 0.9rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-badge.top1 { background: rgba(245, 158, 11, 0.15); color: var(--color-accent); }
.rank-badge.top2 { background: rgba(203, 213, 225, 0.15); color: #cbd5e1; }
.rank-badge.top3 { background: rgba(180, 83, 9, 0.15); color: #b45309; }
.rank-badge.regular { color: var(--text-muted); }

/* ==========================================================================
   TAB 5: SETTINGS SPECIFIC
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.settings-grid .full-width {
    grid-column: 1 / -1;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-db-actions {
    display: flex;
    gap: 1rem;
}

.flex-1 { flex: 1; }
.cursor-pointer { cursor: pointer; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.text-center { text-align: center; }
.flex-row { display: flex; flex-direction: row; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-6 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }

/* ==========================================================================
   MODAL DIALOG STYLING
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 550px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition-normal);
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    color: white;
    background: rgba(0, 0, 0, 0.05);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-textarea {
    resize: vertical;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ==========================================================================
   TOAST NOTIFICATION STYLING
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    background: #1e293b;
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 400px;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               toastOut 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) var(--toast-delay, 3s) forwards;
}

.toast.success { border-left-color: var(--color-primary); }
.toast.info { border-left-color: var(--color-blue); }
.toast.warning { border-left-color: var(--color-accent); }
.toast.danger { border-left-color: var(--color-danger); }

.toast i {
    width: 20px;
    height: 20px;
}

.toast.success i { color: var(--color-primary); }
.toast.info i { color: var(--color-blue); }
.toast.warning i { color: var(--color-accent); }
.toast.danger i { color: var(--color-danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(20px) scale(0.9); }
}

/* ==========================================================================
   LOGIN SCREEN STYLING
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e0f2fe; /* Light Blue */
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.login-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-card {
    background: #ffffff; /* White background for the card */
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid rgba(0, 0, 0, 0.1);
}

.login-header h2 {
    font-family: var(--font-title);
    color: red !important;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: black;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-group-vertical label {
    font-size: 0.85rem;
    font-weight: 600;
    color: black;
}

.login-card .form-input, .login-card .form-select {
    background-color: white;
    color: black;
    border: 1px solid #ccc;
}

.login-footer {
    color: black !important;
}

.w-full {
    width: 100%;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */



@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-secondary);
        z-index: 100;
    }
    
    .sidebar-brand {
        display: flex;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .nav-item {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        border: none !important;
        background: transparent;
        flex-direction: row;
    }

    .nav-item.active {
        color: var(--color-primary);
        font-weight: bold;
        background: rgba(59, 130, 246, 0.1) !important;
        border-radius: var(--radius-sm);
    }
    
    .sidebar-divider {
        width: 100%;
        height: 1px;
        background: var(--border-color);
        margin: 0.5rem 0;
        display: block !important;
    }

    #btn-logout {
        display: flex !important;
        width: 100%;
        justify-content: center;
        background: #fee2e2;
        color: #ef4444 !important;
        border-radius: var(--radius-md);
        padding: 0.75rem;
        margin-top: 0.25rem;
        font-weight: bold;
    }

    .sidebar-footer {
        display: none !important;
    }
    
    .btn-mobile-logout {
        display: none !important;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }

    .jamaah-attendance-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group, .search-box-wrapper, .filter-actions {
        width: 100%;
    }

    .data-table th, .data-table td {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .podium-container {
        gap: 0.5rem;
        height: 240px;
        padding-top: 2rem;
    }
    
    .podium-spot {
        width: 90px;
    }
    
    .podium-avatar {
        width: 45px;
        height: 45px;
    }

    .login-card {
        padding: 1.5rem;
        width: 90%;
    }
}
