        :root {
            --primary: #2563eb;
            --primary-dark: #1d4ed8;
            --bg-slate: #f8fafc;
            --card-bg: #ffffff;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --border-color: #e2e8f0;
            --dark-header: #1e293b;
            --success: #16a34a;
            --accent-blue: #38bdf8;
            --warning: #d97706;
            --danger: #dc2626;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
        body { background-color: var(--bg-slate); color: var(--text-main); display: flex; flex-direction: column; min-height: 100vh; }
        
        header { background-color: var(--dark-header); color: #fff; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; border-bottom: 3px solid var(--primary); }
        .brand-container { display: flex; align-items: center; gap: 1rem; }
        .logo-group { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
        .school-logo { 
            width: 48px; 
            height: 48px; 
            object-fit: contain; 
            background: #ffffff; 
            border-radius: 50%; 
            padding: 2px; 
            border: 2px solid var(--accent-blue);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            flex-shrink: 0;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .brand-details { display: flex; flex-direction: column; }
        .brand-details h1 { font-size: 1.1rem; font-weight: 700; color: #ffffff; letter-spacing: 0.02em; line-height: 1.2; }
        .brand-details h2 { font-size: 0.85rem; font-weight: 600; color: var(--accent-blue); line-height: 1.2; }
        .brand-details p { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

        .portal-switcher { display: flex; gap: 0.5rem; width: 100%; max-width: 650px; }
        .portal-switcher button { flex: 1; background: transparent; border: 1px solid #475569; color: #cbd5e1; padding: 0.6rem 0.5rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: all 0.2s; text-align: center; }
        .portal-switcher button.active, .portal-switcher button:hover { background: var(--primary); color: white; border-color: var(--primary); }
        .app-container { display: flex; flex: 1; flex-direction: column; }
        .sidebar { width: 100%; background: white; border-bottom: 1px solid var(--border-color); padding: 0.75rem 1rem; }
        .sidebar h3 { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 0.5rem; }
        .nav-links-wrapper { display: flex; overflow-x: auto; gap: 0.5rem; padding-bottom: 0.25rem; scrollbar-width: thin; }
        .nav-link { white-space: nowrap; padding: 0.6rem 0.85rem; color: var(--text-main); text-decoration: none; border-radius: 6px; font-size: 0.85rem; cursor: pointer; font-weight: 500; background-color: #f1f5f9; }
        .nav-link:hover, .nav-link.active { background-color: #eff6ff; color: var(--primary); font-weight: 600; }
        .main-content { flex: 1; padding: 1rem; overflow-y: auto; }
        .portal-section, .sub-tab-content { display: none; }
        .portal-section.active, .sub-tab-content.active { display: block; }
        .card { background: var(--card-bg); border-radius: 8px; border: 1px solid var(--border-color); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
        .card-header { margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
        .card-title { font-size: 1.05rem; font-weight: 600; }
        .form-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
        .form-group { margin-bottom: 0.75rem; }
        .form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; font-weight: 500; }
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.65rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9rem; }
        
        .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; background: #f8fafc; padding: 1rem; border-radius: 6px; border: 1px solid var(--border-color); margin-bottom: 1rem; }
        .checkbox-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; font-weight: 500; cursor: pointer; user-select: none; }
        .checkbox-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

        button.btn-primary { width: 100%; background: var(--primary); color: white; border: none; padding: 0.75rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9rem; }
        button.btn-secondary { background: #e2e8f0; color: var(--text-main); border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.85rem; }
        .btn-action { padding: 0.35rem 0.65rem; font-size: 0.75rem; border-radius: 4px; border: none; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; margin-right: 0.25rem; }
        .btn-download { background-color: #dcfce7; color: #15803d; }
        .btn-pay { background-color: #2563eb; color: white; }
        .filter-bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; background: #f8fafc; padding: 0.75rem; border-radius: 6px; border: 1px solid var(--border-color); }
        .filter-bar label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
        .filter-bar select, .filter-bar input { padding: 0.4rem 0.6rem; font-size: 0.85rem; border-radius: 4px; border: 1px solid var(--border-color); }
        .teacher-selector-bar { background: #ffffff; border: 1px solid var(--border-color); padding: 1rem; border-radius: 8px; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
        .teacher-selector-bar select { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9rem; min-width: 250px; }
        
        .pagination-container { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: 0.5rem; border-top: 1px solid var(--border-color); }
        .pagination-info { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
        .pagination-controls { display: flex; gap: 0.5rem; }
        .pagination-controls button { padding: 0.35rem 0.75rem; font-size: 0.8rem; font-weight: 600; border-radius: 4px; border: 1px solid var(--border-color); background: white; cursor: pointer; }
        .pagination-controls button:disabled { opacity: 0.5; cursor: not-allowed; }

        .table-container { width: 100%; overflow-x: auto; }
        table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.85rem; min-width: 600px; }
        th, td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border-color); }
        th { background-color: #f1f5f9; color: var(--text-muted); font-weight: 600; }
        .auth-container { max-width: 480px; margin: 2rem auto; }
        .auth-toggle { display: flex; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
        .auth-toggle button { flex: 1; padding: 0.6rem; background: none; border: none; cursor: pointer; font-weight: 600; color: var(--text-muted); }
        .auth-toggle button.active { color: var(--primary); border-bottom: 2px solid var(--primary); }
        .user-badge { background: #eff6ff; border: 1px solid #bfdbfe; padding: 0.75rem; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
        .cta-banner { text-align: center; padding: 1rem; background: #f1f5f9; border-radius: 8px; margin-bottom: 1.5rem; }
        .cta-banner h3 { color: var(--primary); margin-bottom: 0.5rem; }
        
        .badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-block; }
        .badge-pending { background-color: #fef3c7; color: #92400e; }
        .badge-approved { background-color: #d1fae5; color: #065f46; }
        .badge-recorded { background-color: #e0f2fe; color: #075985; }
        .badge-transmitted { background-color: #e0e7ff; color: #3730a3; }
        .badge-disapproved { background-color: #fee2e2; color: #991b1b; }

        .action-select {
            padding: 6px 10px;
            border-radius: 6px;
            border: 1px solid #cbd5e1;
            background-color: #ffffff;
            font-size: 13px;
            cursor: pointer;
            outline: none;
        }
        .action-select:focus { border-color: #2563eb; }

        .announcement-card { 
            background: #ffffff; 
            border-radius: 12px; 
            border: 1px solid var(--border-color); 
            border-top: 4px solid var(--primary);
            padding: 1.75rem; 
            margin-bottom: 1.75rem; 
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); 
            scroll-margin-top: 1rem; 
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .announcement-card:hover {
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
        }

        .announcement-category-tag {
            display: inline-block;
            background-color: #eff6ff;
            color: var(--primary);
            font-size: 0.725rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 0.25rem 0.6rem;
            border-radius: 4px;
            margin-bottom: 0.75rem;
        }

        .announcement-title { 
            font-size: 1.35rem; 
            font-weight: 700; 
            color: var(--dark-header); 
            line-height: 1.3;
            margin-bottom: 0.5rem;
        }

        .announcement-meta { 
            font-size: 0.8rem; 
            color: var(--text-muted); 
            margin-bottom: 1.25rem; 
            padding-bottom: 0.75rem;
            border-bottom: 1px solid #f1f5f9;
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem 1rem;
            align-items: center;
        }

        .announcement-body { 
            font-size: 0.95rem; 
            line-height: 1.7; 
            color: #334155; 
            margin-bottom: 1.25rem; 
            white-space: pre-wrap; 
        }

        .announcement-hashtags { 
            font-size: 0.825rem; 
            font-weight: 600; 
            color: var(--primary); 
            margin-top: 1rem; 
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

     /* Base gallery container */
.announcement-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centers images automatically */
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
}

/* Default style for MULTIPLE images */
.announcement-img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* Style automatically applied when ONLY ONE image is present */
.announcement-img:only-child {
    width: 100%;
    max-width: 720px;          /* Prevents over-stretching on large displays */
    height: auto;
    aspect-ratio: 16 / 9;      /* Maintains proper landscape proportion */
    object-fit: cover;
    border-radius: 12px;
}

        @media (max-width: 640px) {
            .announcement-img {
                max-height: 45vh;
                aspect-ratio: 4 / 3;
            }
        }

        footer { background-color: var(--dark-header); color: #94a3b8; padding: 1.25rem 1.5rem; font-size: 0.85rem; border-top: 1px solid #334155; margin-top: auto; width: 100%; }
        .footer-container { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; max-width: 1200px; margin: 0 auto; text-align: center; }
        .footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
        .footer-links a { color: #cbd5e1; text-decoration: none; cursor: pointer; }
        .footer-links a:hover { color: var(--accent-blue); text-decoration: underline; }

        .modal-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); z-index: 999; justify-content: center; align-items: center; padding: 1rem; }
        .modal-backdrop.active { display: flex; }
        .modal-card { background: white; border-radius: 10px; max-width: 650px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 1.5rem; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2); position: relative; }
        .modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 0.75rem; margin-bottom: 1rem; }
        .modal-header h3 { font-size: 1.15rem; color: var(--dark-header); }
        .modal-close { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
        .modal-body { font-size: 0.9rem; line-height: 1.6; color: var(--text-main); }

        @media (max-width: 640px) {
            header { padding: 1rem; justify-content: center; }
            .brand-container { flex-direction: column; text-align: center; width: 100%; gap: 0.75rem; }
            .logo-group { justify-content: center; gap: 0.85rem; }
            .school-logo { width: 54px; height: 54px; padding: 3px; border-width: 2px; }
            .brand-details h1 { font-size: 1.15rem; }
            .brand-details h2 { font-size: 0.9rem; }
            .brand-details p { font-size: 0.72rem; }
        }

        @media (min-width: 768px) {
            header { flex-wrap: nowrap; padding: 1rem 2rem; }
            .portal-switcher { width: auto; }
            .app-container { flex-direction: row; }
            .sidebar { width: 260px; border-bottom: none; border-right: 1px solid var(--border-color); padding: 1.5rem 1rem; }
            .nav-links-wrapper { flex-direction: column; overflow-x: visible; gap: 0.25rem; }
            .nav-link { background-color: transparent; white-space: normal; }
            .main-content { padding: 2rem; }
            .form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
            button.btn-primary { width: auto; }
            table { min-width: 100%; }
            .footer-container { flex-direction: row; justify-content: space-between; text-align: left; }
        }

/* Sidebar Monthly Categorization Styles */
.sidebar-category-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 1.25rem 0 0.5rem 0;
    padding-left: 0.25rem;
    letter-spacing: 0.05em;
}

.sidebar-month-link {
    display: block;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: pointer;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.sidebar-month-link:hover, .sidebar-month-link.active {
    background-color: #eff6ff;
    color: var(--primary);
    font-weight: 600;
    border-color: #bfdbfe;
}

/* Announcement Comments Section Styles */
.comments-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.comments-header {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--dark-header);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    max-height: 250px;
    overflow-y: auto;
}

.comment-item {
    background: #f8fafc;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 700;
    color: var(--primary-dark);
}

.comment-date {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.comment-text {
    color: #334155;
    white-space: pre-wrap;
    line-height: 1.4;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #fafafa;
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comment-form input, .comment-form textarea {
    padding: 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 100%;
    background-color: #ffffff;
}

.btn-comment-submit {
    align-self: flex-start;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.825rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.portal-dropdown {
    position: relative;
    flex: 1;
}

.dropdown-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--dark-header);
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-radius: 6px;
    margin-top: 4px;
    border: 1px solid #475569;
    overflow: hidden;
}

.dropdown-content a {
    color: #cbd5e1;
    padding: 0.65rem 0.85rem;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--primary);
    color: #ffffff;
}

.dropdown-content.show {
    display: block;
}
.btn-donate-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-donate-floating:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-donate-floating {
    position: fixed;
    bottom: 24px;       /* Matches standard Voiceflow bottom alignment */
    right: 175px;       /* Positions the button directly to the left of the AI widget */
    z-index: 9999;
}

/* Adjust layout for mobile viewports to prevent screen overflow */
@media (max-width: 600px) {
    .btn-donate-floating {
        bottom: 20px;
        right: 145px;
        padding: 0.6rem 0.85rem;
        font-size: 0.8rem;
    }
}
