/**
 * Barangay Pasong Buaya 2 Health Monitoring System
 * Main Stylesheet - Green and White Theme
 */

/* ===== Font Face (self-hosted) ===== */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS Variables ===== */
:root {
    /* Finance Dashboard Theme - Calming Greens and Neutrals */
    --primary-green: #10b981;
    /* Modern emerald green */
    --primary-green-dark: #059669;
    /* Darker green for hover */
    --primary-green-light: #34d399;
    /* Light green for highlights */
    --secondary-green: #6ee7b7;
    /* Soft mint green */
    --accent-lime: #a7f3d0;
    /* Very light green accent */
    --accent-mint: #f0fdf4;
    /* Very light green-tinted background */
    --white: #ffffff;
    --light-gray: #f9fafb;
    /* Clean light gray */
    --gray: #e5e7eb;
    /* Neutral gray */
    --dark-gray: #6b7280;
    /* Medium gray */
    --text-dark: #111827;
    /* Dark text */
    --text-secondary: #4b5563;
    /* Secondary text */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-strong: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-glass: 1px solid rgba(255, 255, 255, 0.3);
    --border-radius: 12px;
    /* Modern border radius */
    --border-radius-lg: 16px;
    /* Large border radius */
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.faded {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Scoped registration grid and file-input styles - only affect the Register tab */
.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    align-items: start;
}

.register-grid .full-width {
    grid-column: 1 / -1;
}

.register-grid .span-right {
    grid-column: 2 / 3;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 2px solid rgba(16, 185, 129, 0.08);
    border-radius: 10px;
    background: #fff;
}

.file-input-wrapper input[type="file"] {
    flex: 1 1 auto;
    min-width: 0;
    /* allow truncation instead of overflow */
    background: transparent;
    padding: 6px 0;
    border: none;
    color: var(--text-dark);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-input-wrapper input[type="file"]::file-selector-button,
.file-input-wrapper input[type="file"]::-webkit-file-upload-button {
    flex: 0 0 110px;
    width: 110px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.file-input-wrapper input[type="file"]::file-selector-button:hover,
.file-input-wrapper input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-green-dark);
}

/* Announcement-specific file input styling to blend with site while remaining subtle */
.announcement-file-input {
    border-color: rgba(16, 185, 129, 0.12);
    padding: 8px;
}

.announcement-file-input input[type="file"] {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    padding: 6px 0;
    border: none;
    font-size: 14px;
}

.announcement-file-input input[type="file"]::file-selector-button,
.announcement-file-input input[type="file"]::-webkit-file-upload-button {
    flex: 0 0 auto;
    width: auto;
    background: #fff;
    color: var(--text-dark);
    border: 1px solid var(--primary-green);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.announcement-file-input input[type="file"]::file-selector-button:hover,
.announcement-file-input input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--primary-green);
    color: #fff;
    border-color: var(--primary-green-dark);
}

/* Align checkbox label inline and tidy spacing specifically for announcement form */
.announcements-form .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
}

.announcements-form .checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

/* Scanner-specific file input: neat and professional appearance */
.scanner-file-input {
    border: 1px solid rgba(16, 185, 129, 0.12);
    padding: 12px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin: 12px auto;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-soft);
    border-radius: 10px;
    min-height: 44px;
}

.scanner-file-input input[type="file"] {
    flex: 0 0 auto;
    min-width: auto;
    background: transparent;
    padding: 0;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    height: auto;
    line-height: 1.4;
    white-space: nowrap;
}

.scanner-file-input input[type="file"]::file-selector-button,
.scanner-file-input input[type="file"]::-webkit-file-upload-button {
    flex: 0 0 auto;
    width: auto;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.scanner-file-input input[type="file"]::file-selector-button:hover,
.scanner-file-input input[type="file"]::-webkit-file-upload-button:hover {
    background: #f3f4f6;
    color: #059669;
    border-color: #10b981;
}

@media (max-width: 768px) {
    .register-grid {
        grid-template-columns: 1fr;
    }

    .register-grid .span-right {
        grid-column: 1 / -1;
    }

    .file-input-wrapper {
        padding: 6px;
    }
}

/* Small verification note styling */
.verify-note {
    display: inline-block;
    font-size: 12px;
    color: #064e3b;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
    vertical-align: middle;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f9fafb;
    /* Clean, minimalist background */
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    /* Prevents layout shift when modals open */
}

body.modal-open {
    overflow: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: #10b981;
    /* Removed gradients for speed */
    opacity: 0.08;
    filter: blur(80px);
    z-index: -2;
    animation: float 30s ease-in-out infinite;
    pointer-events: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

body::before {
    top: -150px;
    left: -120px;
    animation-delay: 0s;
}

body::after {
    bottom: -170px;
    right: -150px;
    background: radial-gradient(circle, rgba(47, 135, 90, 0.25) 0%, rgba(47, 135, 90, 0.15) 50%, transparent 100%);
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

a {
    text-decoration: none;
    color: inherit;
}

.required-asterisk {
    color: var(--danger);
    font-weight: 700;
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.35), transparent 55%) no-repeat,
        linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 30% 70% 40% 60%;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(0px);
    animation: float 12s ease-in-out infinite;
}

.login-page::before {
    top: 10%;
    left: 15%;
}

.login-page::after {
    bottom: 5%;
    right: 10%;
    animation-delay: 3s;
}

.login-container {
    width: 100%;
    max-width: 520px;
    /* slightly wider card */
    padding: 20px;
}

.login-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.login-header p {
    color: var(--dark-gray);
    font-size: 14px;
}

/* ===== Public Homepage ===== */

/* Top navigation bar inspired by DOH / government portals */
.site-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: linear-gradient(135deg, #059669 0%, #064e3b 100%) !important;
    background-color: #059669 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

.site-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-brand-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.site-brand-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.9) !important;
}

.site-brand-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff !important;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.site-nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 8px 16px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.site-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-1px);
}

.site-datetime {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #ffffff !important;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3) !important;
    padding: 8px 24px;
    border-radius: 999px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(4px);
}

.datetime-divider {
    opacity: 1;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    body.public-home {
        padding: 70px 0 0;
    }

    .site-topbar {
        padding: 8px 0;
    }

    .site-topbar-inner {
        flex-direction: column;
        gap: 10px;
        padding: 8px 12px;
    }

    .site-brand {
        width: 100%;
        justify-content: center;
    }

    .site-brand-logo img {
        width: 32px;
        height: 32px;
    }

    .site-brand-text {
        font-size: 12px;
    }

    .site-brand-title {
        font-size: 12px;
    }

    .site-datetime {
        width: 100%;
        justify-content: center;
        font-size: 11px;
        padding: 4px 12px;
        flex-wrap: wrap;
    }

    .site-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
    }

    .site-nav-link {
        padding: 6px 12px;
        font-size: 12px;
    }

    .homepage-main {
        padding: 0 8px;
        margin-top: 16px;
    }
}

body.public-home {
    min-height: 100vh;
    background: linear-gradient(rgba(223, 230, 218, 0.85), rgba(223, 230, 218, 0.9)), url('https://cdn.pixabay.com/animation/2022/10/11/03/41/03-41-15-56_512.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 80px 0 0;
    margin: 0;
    overflow-x: hidden;
}

.homepage-main {
    width: 100%;
    max-width: 1100px;
    margin: 24px auto 0;
    padding: 0 16px;
    box-sizing: border-box;
    overflow-x: visible;
}

.homepage-carousel {
    position: relative;
    margin-bottom: 40px;
}

.homepage-carousel .carousel {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 50px rgba(10, 38, 22, 0.35);
    background: #000;
    height: 430px;
}

.homepage-carousel .carousel-inner {
    position: relative;
}

.homepage-carousel .carousel-item {
    display: none;
}

.homepage-carousel .carousel-item.active {
    display: block;
}

.homepage-carousel img {
    width: 100%;
    height: 430px;
    object-fit: cover;
    display: block;
}

.hero-contact-info {
    position: absolute;

}

/* File input styling to match form controls (registration ID upload) */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: var(--text-dark);
    font-size: 14px;
}

input[type="file"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
    border-color: var(--primary-green);
}

/* Small helper text under file input */
input[type="file"]+small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}


.contact-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #155724;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.contact-label {
    font-size: 12px;
    color: #155724;
    font-weight: 500;
    opacity: 0.8;
}

.contact-value {
    font-size: 13px;
    color: #155724;
    font-weight: 600;
}

/* Dashboard Hotlines */
/* ===== Dashboard Announcements Panel ===== */
.dashboard-announcements {
    margin-top: 30px;
}

.dashboard-announcements-grid-wrapper {
    position: relative;
    max-height: 420px;
    overflow: hidden;
}

.dashboard-announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.dashboard-announcements-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0.7) 60%, rgba(255, 255, 255, 0.95) 85%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
    z-index: 5;
    will-change: opacity;
}

.dashboard-announcement-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-announcement-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    border-color: var(--primary-green);
}

.dashboard-announcement-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--light-gray) 100%);
    position: relative;
}

.dashboard-announcement-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-announcement-card:hover .dashboard-announcement-image img {
    transform: scale(1.08);
}

.dashboard-announcement-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--secondary-green) 100%);
    color: var(--primary-green);
}

.dashboard-announcement-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-announcement-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.dashboard-announcement-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex: 1;
}

.dashboard-announcement-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.dashboard-announcement-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.dashboard-announcement-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
}

.dashboard-announcements-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.dashboard-announcements-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--secondary-green) 100%);
    color: var(--primary-green);
    border-radius: 50%;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .dashboard-announcements-grid-wrapper {
        max-height: 400px;
    }

    .dashboard-announcements-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-announcement-image {
        height: 180px;
    }

    .dashboard-announcement-content {
        padding: 16px;
    }

    .dashboard-announcement-title {
        font-size: 16px;
    }

    .dashboard-announcements-fade-overlay {
        height: 120px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0.7) 60%, rgba(255, 255, 255, 0.95) 85%, rgba(255, 255, 255, 1) 100%);
    }

    .dashboard-announcements-empty {
        padding: 40px 16px;
    }

    .dashboard-announcements-empty-icon {
        width: 64px;
        height: 64px;
    }
}

.dashboard-hotlines {
    margin-top: 30px;
}

.dashboard-right .dashboard-hotlines {
    margin-top: 24px;
}

.hotlines-card {
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(16, 185, 129, 0.12);
    transition: all 0.3s ease;
    position: relative;
}

.hotlines-card::before {
    content: '!';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 80px;
    font-weight: 900;
    color: rgba(16, 185, 129, 0.05);
    font-family: serif;
    pointer-events: none;
}

.dashboard-right .hotlines-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.hotlines-card .contact-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hotlines-card .contact-section-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #155724;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hotlines-card .contact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.hotlines-card .contact-label {
    font-size: 12px;
    color: #155724;
    font-weight: 600;
    opacity: 0.9;
}

.hotlines-card .contact-value {
    font-size: 13px;
    color: #155724;
    font-weight: 700;
}

.homepage-carousel .carousel-control-prev,
.homepage-carousel .carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.homepage-carousel .carousel-control-prev {
    left: 20px;
}

.homepage-carousel .carousel-control-next {
    right: 20px;
}

.homepage-carousel .carousel-control-prev-icon,
.homepage-carousel .carousel-control-next-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

.homepage-carousel .carousel-control-prev-icon {
    transform: rotate(-135deg);
}

.homepage-carousel .carousel-control-next-icon {
    transform: rotate(45deg);
}

.homepage-carousel .carousel-indicators {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 999px;
    background: transparent;
}

.homepage-carousel .carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.homepage-carousel .carousel-indicator.active {
    background: #f4ffe2;
    transform: scale(1.3);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hero-slider {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-strong);
    background: linear-gradient(135deg, #11341c, #1e5b34);
}

.hero-slides {
    position: relative;
}

.hero-slide {
    display: none;
    min-height: 320px;
    color: #f6fff1;
}

.hero-slide.active {
    display: block;
    position: relative;
    padding: 50px;
}

.hero-slide-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.15), transparent 55%),
        linear-gradient(135deg, rgba(9, 42, 25, 0.88), rgba(18, 78, 44, 0.8));
    filter: blur(0px);
}

.hero-slide-content {
    position: relative;
    z-index: 1;
    max-width: 70%;
}

.hero-slide-tag {
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 12px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.hero-slide h2 {
    font-size: 32px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-slide p {
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
}

.hero-slide-cta {
    margin-top: 20px;
    background: #fff;
    color: var(--primary-green-dark);
    border: none;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.hero-slide-cta:hover {
    transform: translateY(-2px);
}

.hero-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-green-dark);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.hero-prev {
    left: 20px;
}

.hero-next {
    right: 20px;
}

.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.hero-indicator.active {
    width: 30px;
    border-radius: 999px;
    background: #fff;
}

@media (max-width: 768px) {
    .hero-slide.active {
        padding: 30px;
    }

    .hero-slide-content {
        max-width: 100%;
    }

    .hero-slide h2 {
        font-size: 24px;
    }

    .hero-control {
        width: 38px;
        height: 38px;
    }
}

/* ===== Disease Topics Section ===== */
.disease-topics-section {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 30px 16px 40px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.disease-topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.disease-topics-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.disease-topics-see-all {
    font-size: 14px;
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

.disease-topics-see-all:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

.disease-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.disease-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.disease-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
}

.disease-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.disease-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.disease-card:hover .disease-card-image img {
    transform: scale(1.05);
}

.disease-card-content {
    padding: 20px;
}

.disease-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 12px 0;
}

.disease-card-link {
    font-size: 14px;
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.disease-card-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* References Badge */
.references-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--dark-gray);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    font-weight: 500;
}

.references-badge svg {
    width: 12px;
    height: 12px;
    fill: var(--dark-gray);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .disease-topics-section {
        margin-top: 30px;
        padding: 24px 12px 30px;
        background: #ffffff;
        border-radius: 12px;
    }

    .disease-topics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .disease-topics-title {
        font-size: 20px;
    }

    .disease-topics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .disease-card-image {
        height: 180px;
    }
}

/* ===== Announcements Section (Homepage) ===== */
.announcements-section {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 30px 16px 40px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.announcements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.announcements-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.01em;
}

.announcements-see-all {
    font-size: 14px;
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: inherit;
}

.announcements-see-all:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

.announcements-grid-wrapper {
    position: relative;
    max-height: 850px;
    overflow: hidden;
}

.announcements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.announcements-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0.7) 60%, rgba(255, 255, 255, 0.95) 85%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
    z-index: 1;
}

.announcement-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.announcement-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    border-color: var(--primary-green);
}

.announcement-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--light-gray) 100%);
    position: relative;
}

.announcement-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-card:hover .announcement-card-image img {
    transform: scale(1.08);
}

.announcement-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--secondary-green) 100%);
    color: var(--primary-green);
    font-size: 14px;
}

.announcement-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.announcement-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.announcement-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 14px 0;
    flex: 1;
}

.announcement-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.announcement-card-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.announcement-card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
}

.announcements-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.announcement-detail-section {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px 30px 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.announcement-detail-header {
    margin-bottom: 24px;
    padding: 0;
}

.announcement-detail-header .btn {
    margin-bottom: 20px;
    display: inline-block;
}

.announcement-detail-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.3;
}

.announcement-detail-date {
    font-size: 14px;
    color: #666;
    margin: 0;
    padding: 0;
    display: block;
    line-height: 1.5;
}

.announcement-detail-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.announcement-detail-image-wrapper {
    margin-bottom: 24px;
}

.announcement-detail-image {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.announcement-detail-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-line;
}

@media (max-width: 768px) {
    .homepage-carousel {
        max-width: 100%;
        padding: 0;
        margin-bottom: 24px;
    }

    .homepage-carousel .carousel {
        border-radius: 16px;
        height: 300px;
    }

    .homepage-carousel img {
        height: 300px;
    }

    .homepage-carousel .carousel-control-prev,
    .homepage-carousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .homepage-carousel .carousel-control-prev {
        left: 10px;
    }

    .homepage-carousel .carousel-control-next {
        right: 10px;
    }

    .homepage-carousel .carousel-indicators {
        bottom: 12px;
        padding: 6px 12px;
    }

    .homepage-carousel .carousel-indicator {
        width: 8px;
        height: 8px;
    }

    .hero-contact-info {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 20px;
        padding: 20px 16px;
    }

    .contact-section-title {
        font-size: 14px;
    }

    .contact-label {
        font-size: 12px;
    }

    .contact-value {
        font-size: 13px;
    }

    .announcements-section {
        margin-top: 24px;
        padding: 20px 12px 24px;
        border-radius: 16px;
    }

    .announcements-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .announcements-header>div {
        width: 100%;
    }

    .announcements-header>div>div:first-child {
        width: 32px;
        height: 32px;
    }

    .announcements-header>div>div:first-child svg {
        width: 16px;
        height: 16px;
    }

    .announcements-title {
        font-size: 18px;
    }

    .announcements-header p {
        font-size: 12px;
    }

    .announcements-grid-wrapper {
        max-height: none;
    }

    .announcements-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .announcements-fade-overlay {
        display: none;
    }

    .announcement-card {
        border-radius: 12px;
    }

    .announcement-card-image {
        height: 160px;
    }

    .announcement-card-content {
        padding: 16px;
    }

    .announcement-card-title {
        font-size: 16px;
    }

    .announcement-card-description {
        font-size: 13px;
    }

    .announcement-card-date {
        font-size: 11px;
    }

    .announcement-detail-header h1 {
        font-size: 20px;
    }

    .announcement-detail-card {
        padding: 16px;
        margin: 16px;
        border-radius: 12px;
    }

    .disease-topics-section {
        margin-top: 24px;
        padding: 20px 12px 24px;
        border-radius: 16px;
    }

    .disease-topics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }

    .disease-topics-title {
        font-size: 18px;
    }

    .disease-topics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .disease-card {
        border-radius: 12px;
    }

    .disease-card-image {
        height: 160px;
    }

    .disease-card-content {
        padding: 16px;
    }

    .disease-card-title {
        font-size: 16px;
    }

    .homepage-wrapper {
        padding: 20px 16px;
        border-radius: 16px;
        margin: 16px 8px;
    }

    .homepage-logo {
        width: 180px;
    }

    .homepage-hero h1 {
        font-size: 20px;
    }

    .hero-subtitle {
        font-size: 13px;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .hero-btn-main,
    .hero-btn-secondary {
        width: 100%;
    }

    /* Modal Responsive */
    .modal-dialog {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        border-radius: 16px;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
        max-height: calc(90vh - 120px);
        overflow-y: auto;
    }

    .announcements-modal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .announcements-modal-card {
        border-radius: 12px;
    }

    .announcements-modal-card .announcement-card-image {
        height: 140px;
    }

    .announcement-detail-image {
        max-height: 250px;
        border-radius: 8px;
    }

    .announcement-detail-text {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* Extra Small Devices (320px - 480px) */
@media (max-width: 480px) {
    body.public-home {
        padding: 65px 4px 0;
    }

    .site-topbar-inner {
        padding: 6px 8px;
    }

    .site-brand-logo img {
        width: 28px;
        height: 28px;
    }

    .site-brand-label {
        font-size: 9px;
    }

    .site-brand-title {
        font-size: 11px;
    }

    .site-datetime {
        font-size: 10px;
        padding: 3px 8px;
    }

    .site-nav-link {
        font-size: 11px;
        padding: 5px 10px;
    }

    .homepage-main {
        padding: 0 4px;
    }

    .homepage-carousel img {
        height: 250px;
    }

    .homepage-carousel .carousel-control-prev,
    .homepage-carousel .carousel-control-next {
        width: 36px;
        height: 36px;
    }

    .announcements-section,
    .disease-topics-section {
        padding: 16px 8px 20px;
    }

    .announcement-card-content,
    .disease-card-content {
        padding: 12px;
    }

    .announcement-card-image,
    .disease-card-image {
        height: 140px;
    }

    .announcements-title,
    .disease-topics-title {
        font-size: 16px;
    }

    .modal-dialog {
        width: 98%;
        max-width: 98%;
        margin: 5px;
        max-height: 95vh;
    }

    .modal-body {
        padding: 12px;
    }

    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
        top: 10px;
        left: 10px;
        padding: 8px;
    }

    body.sidebar-open .mobile-menu-toggle {
        left: calc(var(--sidebar-width) + 10px);
        right: auto;
    }

    .mobile-menu-toggle svg {
        width: 21px;
        height: 21px;
    }

    .dashboard-content {
        padding: 12px;
    }

    .content-header {
        padding: 12px;
    }

    .content-header h1 {
        font-size: 18px;
    }

    .card {
        padding: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 40px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 32px;
    }
}

.homepage-wrapper {
    width: 100%;
    max-width: 1100px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 255, 249, 0.96) 100%);
    border-radius: 28px;
    box-shadow: var(--shadow-strong);
    padding: 40px 48px 32px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    margin: 0 auto;
}

.homepage-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

.homepage-logo {
    width: 260px;
    height: auto;
    object-fit: contain;
}

.homepage-hero h1 {
    font-size: 26px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--primary-green-dark);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 720px;
}

.hero-cta {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-btn-main,
.hero-btn-secondary {
    min-width: 140px;
    text-align: center;
}

.btn-outline {
    background: transparent;
    color: var(--primary-green);
    border: 1px solid rgba(45, 134, 89, 0.5);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 20px rgba(45, 134, 89, 0.22);
}

.homepage-section {
    margin-top: 32px;
}

.homepage-section h2 {
    font-size: 20px;
    color: var(--primary-green-dark);
    margin-bottom: 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(229, 255, 240, 0.9);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green-light), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    margin-bottom: 10px;
}

.feature-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--primary-green-dark);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
}

.problem-solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.problem-box,
.solution-box {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(229, 255, 240, 0.9);
}

.problem-box h3,
.solution-box h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--primary-green-dark);
}

.problem-box p,
.solution-box p {
    font-size: 14px;
    color: var(--text-muted);
}

.homepage-footer {
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid rgba(45, 134, 89, 0.12);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    width: 100%;
}

@media (max-width: 768px) {
    .homepage-wrapper {
        padding: 24px 18px 20px;
        border-radius: 20px;
    }

    .homepage-hero h1 {
        font-size: 20px;
    }

    .hero-subtitle {
        font-size: 14px;
    }
}

/* ===== Form Styles ===== */
/* Custom File Upload Styling - Professional Design */
.custom-file-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid rgba(16, 185, 129, 0.4);
    /* Subtle green border */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 52px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-file-upload:hover {
    border-color: var(--primary-green);
    background: var(--accent-mint);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
}

.custom-file-upload .upload-btn {
    background: var(--primary-green);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}



.custom-file-upload:hover .upload-btn {
    background: var(--primary-green-dark);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.custom-file-upload .file-name {
    color: var(--text-secondary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    flex: 1;
}

.custom-file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* ===== Form Elements & Tabs ===== */
.form-tabs {
    display: flex;
    background-color: #f1f5f9;
    padding: 6px;
    border-radius: 14px;
    margin: 0 auto 30px;
    width: fit-content;
    min-width: 280px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 10px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background-color: #ffffff;
    font-size: 15px;
    color: #1e293b;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Phone input with country code prefix */
.phone-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.phone-prefix {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-right: none;
    padding: 12px 14px;
    border-radius: 12px 0 0 12px;
    font-size: 14px;
    color: #475569;
    font-weight: 700;
    user-select: none;
    white-space: nowrap;
}

.phone-input-group input {
    border-radius: 0 12px 12px 0 !important;
    flex: 1;
}

.phone-input-group input:focus {
    z-index: 1;
}

.form-actions {
    margin-top: 30px;
    margin-bottom: 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.form-actions-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-actions-buttons {
        justify-content: stretch;
        flex-direction: column-reverse;
    }

    .form-actions-buttons .btn {
        width: 100%;
    }
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row-2 .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    /* Increased for better visibility */
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    /* Increased for value boldness */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--primary-green-light);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.1);
}

/* For read-only views like view_resident.php */
.form-group p {
    font-weight: 600;
    color: var(--text-dark);
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
}

/* Password toggle button */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 45px;
}

/* Hide Microsoft Edge / IE native password reveal button to prevent double-eye icon overlap */
input::-ms-reveal,
input::-ms-clear {
    display: none !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--primary-green);
}

.password-toggle:active {
    opacity: 0.8;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), 0 2px 8px rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
    background: var(--white);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Registration form grid for more landscape layout on larger screens */
.register-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 16px;
}

.register-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.classification-box {
    margin-bottom: 24px;
    background: #f8fafc;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.classification-box:focus-within {
    background: #ffffff;
    border-color: var(--primary-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.classification-label {
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
    display: block;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .register-grid {
        grid-template-columns: 1fr;
    }

    .register-grid .form-group.full-width {
        grid-column: auto;
    }
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
    }

    .form-row-2 .form-group {
        margin-bottom: 12px;
    }
}

/* ===== Professional Buttons ===== */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    line-height: 1.5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-green-light) 0%, var(--primary-green) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.23);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: #475569;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button with icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    line-height: 1;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
    flex-shrink: 0;
    stroke-opacity: 0.9;
}

.btn-sm .btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Icon-only circular/square button */
.btn-action-icon {
    width: 34px;
    height: 34px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.8;
}

.btn-action-icon:hover {
    transform: scale(1.1) translateY(-1px) !important;
}

.btn-action-icon:active {
    transform: scale(0.95) !important;
}

.btn-action-icon.btn-sm {
    width: 30px;
    height: 30px;
}

.btn-action-icon.btn-sm svg {
    width: 16px;
    height: 16px;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3), 0 4px 6px -2px rgba(16, 185, 129, 0.05);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.2), 0 10px 10px -5px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(107, 114, 128, 0.2), 0 4px 6px -2px rgba(107, 114, 128, 0.05);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(107, 114, 128, 0.2), 0 10px 10px -5px rgba(107, 114, 128, 0.1);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.3);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(239, 68, 68, 0.3);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

/* Info Button */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    transform: translateY(-2px);
}

/* Outline Buttons */
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-green);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}

.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    box-shadow: none;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
    transform: translateY(-2px);
}

/* Button Sizes */
.btn-block {
    width: 100%;
    display: flex;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
    border-radius: 12px;
}

.btn-sm .btn-icon svg {
    width: 14px;
    height: 14px;
}

.btn-lg .btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ===== Alerts ===== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
    box-shadow: var(--shadow-soft);
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ===== Layout ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    color: var(--text-dark);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-medium);
    border-right: 1px solid var(--gray);
    z-index: 1000;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

.sidebar-header {
    padding: 24px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--gray);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--white);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.7;
    white-space: nowrap;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-brand-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-green);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: linear-gradient(90deg, var(--accent-mint) 0%, rgba(240, 253, 244, 0.5) 100%);
    color: var(--primary-green);
    padding-left: 22px;
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--accent-mint) 0%, rgba(240, 253, 244, 0.7) 100%);
    color: var(--primary-green);
    border-left-color: var(--primary-green);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--primary-green);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: inherit;
    transition: transform 0.3s ease;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
    stroke-opacity: 0.8;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
    color: var(--primary-green);
}

.nav-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.nav-item.logout-link {
    margin-top: 8px;
    border-top: 1px solid var(--gray);
    padding-top: 16px;
}

.nav-item.logout-link:hover {
    background: linear-gradient(90deg, #fef2f2 0%, rgba(254, 242, 242, 0.5) 100%);
    color: #dc2626;
}

.nav-item.logout-link:hover .nav-icon {
    color: #dc2626;
}

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: calc(100vh - 200px);
    background: var(--light-gray);
    position: relative;
    overflow: visible;
    padding-bottom: 40px;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(77, 175, 124, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(45, 134, 89, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(111, 173, 72, 0.12) 0%, transparent 40%),
        linear-gradient(45deg, rgba(74, 115, 48, 0.08) 0%, transparent 35%),
        linear-gradient(225deg, rgba(61, 168, 112, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: mainGradientShift 20s ease-in-out infinite;
}

.main-content::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(111, 173, 72, 0.2) 0%, rgba(77, 175, 124, 0.1) 50%, transparent 80%);
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    animation: mainGradientOrb 35s ease-in-out infinite;
}

@keyframes mainGradientShift {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

@keyframes mainGradientOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }

    25% {
        transform: translate(80px, -60px) scale(1.3);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50px, 100px) scale(0.8);
        opacity: 0.5;
    }

    75% {
        transform: translate(60px, 40px) scale(1.1);
        opacity: 0.7;
    }
}

.content-header {
    background: var(--white);
    padding: 24px 32px;
    border-bottom: 1px solid var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-soft);
}

.content-header h1 {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Professional Badges ===== */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.badge svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.badge-admin {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.badge-health_worker {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.badge-resident {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* ===== Dashboard ===== */
.dashboard-content {
    padding: 32px;
    position: relative;
    background: linear-gradient(135deg, rgba(244, 249, 241, 0.85) 0%, rgba(229, 255, 240, 0.95) 30%, rgba(240, 253, 244, 0.9) 60%, rgba(247, 255, 249, 0.88) 100%);
    min-height: calc(100vh - var(--header-height) - 200px);
    overflow: hidden;
    padding-bottom: 60px;
}

.dashboard-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(111, 173, 72, 0.25) 0%, rgba(77, 175, 124, 0.15) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    animation: gradientFloat1 25s ease-in-out infinite;
}

.dashboard-content::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: -15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(74, 115, 48, 0.28) 0%, rgba(45, 134, 89, 0.18) 45%, transparent 75%);
    border-radius: 50%;
    filter: blur(110px);
    pointer-events: none;
    z-index: 0;
    animation: gradientFloat2 30s ease-in-out infinite;
}

@keyframes gradientFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }

    33% {
        transform: translate(50px, 80px) scale(1.2);
        opacity: 1;
    }

    66% {
        transform: translate(-30px, -50px) scale(0.9);
        opacity: 0.7;
    }
}

@keyframes gradientFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.75;
    }

    33% {
        transform: translate(-60px, -70px) scale(1.15);
        opacity: 0.95;
    }

    66% {
        transform: translate(40px, 60px) scale(0.85);
        opacity: 0.65;
    }
}

.dashboard-content>* {
    position: relative;
    z-index: 1;
}

.dashboard-two-column {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-right {
    position: sticky;
    top: 20px;
}

@media (max-width: 1024px) {
    .dashboard-two-column {
        grid-template-columns: 1fr;
    }

    .dashboard-right {
        position: static;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 185, 129, 0.08);
    padding: 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.03);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.stat-icon {
    font-size: 0;
    /* Hide emoji text */
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--secondary-green) 100%);
    border-radius: 14px;
    color: var(--primary-green);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18), 0 2px 4px rgba(16, 185, 129, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    border-radius: 14px;
}

.stat-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.stat-card:hover .stat-icon::after {
    width: 100px;
    height: 100px;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3), 0 4px 8px rgba(16, 185, 129, 0.15);
}

.stat-card:hover .stat-icon svg {
    transform: scale(1.1);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    margin: 0;
}

/* ===== Quick Actions ===== */
.quick-actions {
    margin-top: 30px;
}

.quick-actions h2 {
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {

    /* Content Header */
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .content-header h1 {
        font-size: 20px;
    }

    .content-header .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    /* Form Container */
    .form-container {
        padding: 20px 16px;
        border-radius: 16px;
        margin: 0 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .card-header h2 {
        font-size: 16px;
    }

    /* Tables */
    .table-container {
        padding: 12px;
        border-radius: 12px;
        margin: 0 -8px;
    }

    table {
        min-width: 600px;
        font-size: 13px;
    }

    table th,
    table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .inventory-name {
        max-width: 200px;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Action Cards */
    .action-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .action-card {
        padding: 20px;
    }

    .action-icon {
        width: 48px;
        height: 48px;
    }

    .action-icon svg {
        width: 20px;
        height: 20px;
    }

    /* Schedule Calendar */
    .schedule-calendar-container {
        padding: 12px;
        overflow-x: auto;
    }

    .schedule-calendar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 12px;
    }

    .schedule-calendar-title {
        font-size: 16px;
    }

    .schedule-month-nav {
        width: 100%;
        justify-content: space-between;
    }

    .schedule-calendar {
        font-size: 11px;
        min-width: 100%;
    }

    .schedule-calendar th {
        padding: 4px 2px;
        font-size: 10px;
    }

    .schedule-day-btn {
        height: 80px;
        padding: 2px;
        font-size: 11px;
    }

    .schedule-day-number {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .schedule-slot {
        font-size: 9px;
        padding: 2px 4px;
        margin: 2px 0;
    }

    .schedule-slot strong {
        font-size: 9px;
        display: block;
        margin-top: 2px;
    }

    /* Announcements List */
    .announcements-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .announcement-item-image {
        max-height: 200px;
    }

    .announcement-description {
        min-height: auto;
    }

    /* QR Code & Scanner */
    .qr-container,
    .scanner-container {
        padding: 16px;
        margin: 16px 0;
        border-radius: 12px;
    }

    .qr-code-img {
        max-width: 250px;
    }

    #video {
        max-width: 100%;
    }

    /* Dashboard Two Column */
    .dashboard-two-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* User Info Badge */
    .user-info {
        flex-wrap: wrap;
    }

    .badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Alert Messages */
    .alert {
        padding: 12px 16px;
        font-size: 13px;
        margin-bottom: 16px;
        border-radius: 8px;
    }

    /* Filter and Search Sections */
    .filter-section,
    .search-section {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        margin-bottom: 16px;
    }

    .filter-section .form-group,
    .search-section .form-group {
        width: 100%;
        margin-bottom: 0;
    }

    /* Button Groups */
    .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* Appointment Cards/Items */
    .appointment-item,
    .appointment-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    /* Sort and Filter Controls */
    .sort-controls,
    .filter-controls {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .sort-controls select,
    .filter-controls select {
        width: 100%;
    }

    /* Purpose Tabs/Buttons */
    .purpose-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .purpose-tab {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Inventory Transaction History */
    .transaction-history {
        overflow-x: auto;
    }

    .transaction-item {
        padding: 12px;
        margin-bottom: 12px;
    }

    /* Modal Content */
    .modal-content {
        padding: 16px;
    }

    /* Form Actions */
    .form-actions {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Stat Cards */
    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 56px;
        height: 56px;
        margin: 0 auto 12px;
    }

    .stat-icon svg {
        width: 24px;
        height: 24px;
    }

    .stat-info h3 {
        font-size: 24px;
    }

    .stat-info p {
        font-size: 13px;
    }
}

/* Extra Small Devices (320px - 480px) */
@media (max-width: 480px) {
    .content-header {
        padding: 12px;
    }

    .content-header h1 {
        font-size: 18px;
    }

    .form-container {
        padding: 16px 12px;
        margin: 0 4px;
    }

    .card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .card-header h2 {
        font-size: 14px;
    }

    .table-container {
        padding: 8px;
        margin: 0 -4px;
    }

    table {
        min-width: 500px;
        font-size: 11px;
    }

    table th,
    table td {
        padding: 6px 4px;
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 11px;
    }

    .schedule-calendar-container {
        padding: 8px;
    }

    .schedule-day-btn {
        height: 60px;
        padding: 1px;
        font-size: 9px;
    }

    .schedule-day-number {
        font-size: 10px;
    }

    .schedule-slot {
        font-size: 8px;
        padding: 1px 2px;
    }

    .schedule-slot strong {
        font-size: 8px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 32px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 16px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .action-card {
        padding: 16px;
    }

    .action-icon {
        width: 40px;
        height: 40px;
    }

    .purpose-tab {
        min-width: 100%;
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Available Slots (Extra Small) */
    .available-slot-card {
        padding: 12px;
    }

    .slot-date-label {
        font-size: 12px;
    }

    .slot-choice-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .selected-slot-summary {
        padding: 10px;
        font-size: 12px;
    }

    /* Profile Page (Extra Small) */
    .card-body .table-container {
        margin: 12px -8px 0;
        padding: 6px;
    }

    .card-body table {
        min-width: 450px;
        font-size: 11px;
    }

    .card-body table th,
    .card-body table td {
        padding: 6px 4px;
        font-size: 10px;
    }

    .card-body table td .btn {
        min-width: 70px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

.action-card {
    background: #ffffff;
    padding: 32px 24px;
    border-radius: 24px;
    border: 1px solid rgba(16, 185, 129, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.action-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px rgba(16, 185, 129, 0.12);
    border-color: var(--primary-green);
}

.action-icon {
    font-size: 32px;
    line-height: 1;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--secondary-green) 100%);
    border-radius: 14px;
    color: var(--primary-green);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18), 0 2px 4px rgba(16, 185, 129, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.action-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    border-radius: 14px;
}

.action-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-card:hover .action-icon::after {
    width: 90px;
    height: 90px;
}

.action-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.action-card:hover .action-icon {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.35), 0 4px 8px rgba(16, 185, 129, 0.2);
}

.action-card:hover .action-icon svg {
    transform: scale(1.15) rotate(5deg);
}

.action-card h3 {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.action-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* ===== Tables ===== */
.inventory-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: 280px;
}

.inventory-name .name-text {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-name .desc-text {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-container {
    background: var(--white);
    border-radius: 16px;
    padding: 0;
    /* Remove padding to let the header take full width */
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    /* Ensure rounded corners clip the content */
    border: 1px solid var(--gray);
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray);
    vertical-align: middle;
}

table th {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    border: none;
    padding: 16px 20px;
    white-space: nowrap;
}

table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-dark);
    font-size: 14px;
}

table tbody tr:nth-child(even) {
    background: var(--light-gray);
}

table tbody tr:hover {
    background: var(--accent-mint);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.data-table th {
    background: var(--light-gray);
    font-weight: 600;
    color: var(--text-dark);
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr.expired {
    background: rgba(220, 53, 69, 0.1);
}

.data-table tbody tr.warning {
    background: rgba(255, 193, 7, 0.1);
}

.data-table tbody tr:hover {
    background: var(--accent-mint);
}

.data-table tbody tr.expired:hover {
    background: rgba(220, 53, 69, 0.15);
}

.data-table tbody tr.warning:hover {
    background: rgba(255, 193, 7, 0.15);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Cards ===== */
.card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    border: 1px solid rgba(16, 185, 129, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray);
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray);
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
}

.sort-controls:hover {
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-green);
}

.sort-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}

.sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--gray);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23111827' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    min-width: 180px;
}

.sort-select:hover {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sort-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.sort-select option {
    padding: 8px;
    background: var(--white);
    color: var(--text-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
}

/* ===== Forms ===== */
.form-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
    max-width: 960px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ===== QR Code ===== */
.qr-container {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-soft);
}

.qr-code-img {
    max-width: 300px;
    margin: 20px auto;
    display: block;
}

.scanner-container {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-soft);
}

.scanner-container h3 {
    margin-bottom: 12px;
    color: var(--text-dark);
}

.scanner-container .text-muted {
    color: #64748b !important;
    font-size: 13px;
    margin-top: 15px !important;
}

.scanner-file-input {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 25px auto !important;
    padding: 35px 25px !important;
    border: 2px dashed #cbd5e1 !important;
    border-radius: 20px !important;
    background: #f8fafc !important;
    max-width: 480px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.scanner-file-input:hover {
    border-color: var(--primary-green) !important;
    background: var(--accent-mint) !important;
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.scanner-file-input .upload-icon {
    color: var(--primary-green);
    background: #fff;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.scanner-file-input:hover .upload-icon {
    transform: scale(1.1);
    background: var(--primary-green);
    color: #fff;
}

.scanner-file-input .upload-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.scanner-file-input .upload-btn-text {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-dark);
}

.scanner-file-input .file-name {
    font-size: 14px;
    color: #64748b;
}

.scanner-file-input input[type="file"] {
    display: none !important;
}

.scanner-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
}

.scanner-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.scanner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.scanner-btn.stop-btn {
    background: #475569;
    border-color: #475569;
}

.scanner-btn.stop-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.scanner-btn svg {
    stroke-width: 2.5;
}

#video {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    margin: 20px 0;
}

#scanner-canvas {
    display: none;
}

/* Emergency badge specifically requested to be red with a cross icon */
.badge-emergency {
    background: #ef4444 !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
    padding: 6px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
}

.badge-emergency::before {
    content: '\271A' !important;
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 900 !important;
}

.badge-medicine {
    background: var(--primary-green) !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
    padding: 6px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
}

/* ===== Status Badges ===== */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.status-badge svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.status-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.status-approved,
.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.status-declined,
.status-inactive {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.status-new {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.status-completed {
    background: linear-gradient(135deg, var(--info) 0%, #33b5e5 100%);
    color: var(--white);
}

.status-cancelled,
.status-rejected {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.25);
}

.required-asterisk {
    color: #ef4444;
    margin-left: 2px;
    font-weight: bold;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-content {
        padding: 16px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .content-header h1 {
        font-size: 20px;
    }

    .stats-grid,
    .action-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .card-header {
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .card-header h2 {
        font-size: 16px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px;
        /* Touch-friendly */
    }

    .btn-sm {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    .stats-grid,
    .action-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dashboard-two-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 10px;
        left: 10px;
        right: auto;
        z-index: 1002;
        background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
        color: var(--white);
        border: none;
        padding: 0;
        /* Padding handled by flex centering */
        border-radius: 10px;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 38px;
        height: 38px;
    }

    /* Burger Icon Style */
    .burger-icon {
        width: 22px;
        height: 16px;
        position: relative;
        transform: rotate(0deg);
        transition: .5s ease-in-out;
        cursor: pointer;
    }

    .burger-icon span {
        display: block;
        position: absolute;
        height: 2px;
        width: 100%;
        background: #ffffff;
        border-radius: 9px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: .25s ease-in-out;
    }

    .burger-icon span:nth-child(1) {
        top: 0px;
    }

    .burger-icon span:nth-child(2) {
        top: 7px;
    }

    .burger-icon span:nth-child(3) {
        top: 14px;
    }

    /* Burger to X Animation */
    body.sidebar-open .burger-icon span:nth-child(1) {
        top: 7px;
        transform: rotate(135deg);
    }

    body.sidebar-open .burger-icon span:nth-child(2) {
        opacity: 0;
        left: -40px;
    }

    body.sidebar-open .burger-icon span:nth-child(3) {
        top: 7px;
        transform: rotate(-135deg);
    }

    .mobile-menu-toggle:hover {
        background: linear-gradient(135deg, var(--primary-green-dark) 0%, #047857 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    }

    .mobile-menu-toggle:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.elevated {
    box-shadow: var(--shadow-strong);
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-30 {
    margin-bottom: 30px;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* ===== Modal Dialog ===== */
/* ===== Premium Modal Design ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    /* Darker, more solid */
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.2s ease;
    will-change: opacity;
    /* Removed backdrop-filter as it's the main cause of scroll lag */
}

.modal-overlay.show {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 20px;
    padding: 0;
    max-width: 680px;
    width: 100%;
    height: auto;
    max-height: 94vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    animation: modalSnap 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSnap {
    0% {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-dialog>form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

@keyframes modalSpring {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: #ffffff;
    color: #1e293b;
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.close-modal {
    background: none !important;
    border: none !important;
    font-size: 32px !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    border-radius: 50% !important;
}

.close-modal:hover {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
}

.modal-header button {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
}

.modal-header button:hover {
    color: var(--white);
}

.modal-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    /* Take up all available space but stay within dialog */
    min-height: 0;
    /* Critical for flexbox scrolling */
    overscroll-behavior: contain;
    transform: translate3d(0, 0, 0);
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

@media (max-width: 576px) {
    .modal-overlay {
        align-items: flex-start;
        padding-top: 20px;
    }

    .modal-dialog {
        width: 100%;
        max-width: 100%;
        margin: 0 8px;
        border-radius: 16px;
        max-height: calc(100vh - 40px);
    }
}

.modal-body p {
    color: var(--text-dark);
    font-size: 16px;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    background: #ffffff;
    flex-shrink: 0;
    /* Prevent footer from being pushed or squished */
}

/* Slot Editor Specific Responsiveness */
.schedule-slots-row {
    flex-direction: row !important;
    gap: 16px !important;
}

.schedule-slots-row .form-group {
    flex: 1;
}

.input-sublabel {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

@media (max-width: 480px) {
    .schedule-slots-row {
        gap: 10px !important;
    }
}

/* ===== Announcements Modal Styles ===== */
.announcements-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green) var(--light-gray);
}

.announcements-modal-grid::-webkit-scrollbar {
    width: 8px;
}

.announcements-modal-grid::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

.announcements-modal-grid::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

.announcements-modal-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green-dark);
}

.announcements-modal-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.announcements-modal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    border-color: var(--primary-green);
}

.announcements-modal-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-mint) 0%, var(--light-gray) 100%);
    position: relative;
}

.announcements-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcements-modal-card:hover .announcements-modal-image img {
    transform: scale(1.08);
}

.announcements-modal-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.announcements-modal-content {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.announcements-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.announcements-modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 14px 0;
    flex: 1;
}

.announcements-modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.announcements-modal-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.announcements-modal-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
}

@media (max-width: 768px) {
    .announcements-modal-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .announcements-modal-image {
        height: 160px;
    }

    .announcements-modal-content {
        padding: 16px;
    }

    .announcements-modal-title {
        font-size: 16px;
    }

    .modal-dialog {
        max-width: 95% !important;
    }
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modal-btn-cancel {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--gray);
    box-shadow: none;
}

.modal-btn-cancel:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.modal-btn-confirm,
.modal-btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.modal-btn-confirm:hover,
.modal-btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.2);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.modal-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(239, 68, 68, 0.2);
}

/* ===== Announcements (Resident view) ===== */
.announcements-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.announcement-item {
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.announcement-item-image {
    width: 100%;
    max-height: 260px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.announcement-description {
    min-height: 120px;
}

.announcement-see-more {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-green);
    text-decoration: none;
}

.announcement-see-more::after {
    content: '\203A';
    font-size: 16px;
    line-height: 1;
}

.announcement-see-more:hover {
    color: var(--primary-green-dark);
}

.announcement-detail-card {
    max-width: 960px;
    margin: 0 auto;
}

.announcement-detail-body {
    padding: 30px 34px;
}

.announcement-detail-image-wrapper {
    margin-bottom: 20px;
}

.announcement-detail-image {
    width: 100%;
    max-height: 380px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
}

.announcement-detail-text {
    white-space: pre-line;
    font-size: 16px;
    line-height: 1.6;
}

/* ===== Admin Available Schedule Calendar ===== */
.schedule-calendar-container {
    padding: 20px 24px;
}

.schedule-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.schedule-month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-calendar-title {
    font-weight: 600;
    font-size: 18px;
}

.schedule-month-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.schedule-calendar {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 10px;
}

.schedule-calendar th,
.schedule-calendar td {
    border: 1px solid #e4e4e4;
    padding: 0;
    vertical-align: top;
}

.schedule-calendar th {
    background: #f5f7f5;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 6px 0;
}

.schedule-calendar td.empty {
    background: #fafafa;
}

.schedule-day-btn {
    width: 100%;
    height: 120px;
    padding: 4px 4px 6px;
    border: none;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.schedule-day-btn:hover {
    background: #f5fbff;
    box-shadow: inset 0 0 0 1px #c8e5ff;
}

.schedule-day-btn.is-past {
    cursor: default;
    background: #fafafa;
    color: #bbb;
}

.schedule-day-btn.is-past:hover {
    background: #fafafa;
    box-shadow: none;
}

.schedule-day-number {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.schedule-slot {
    font-size: 11px;
    padding: 4px 4px;
    border-radius: 3px;
    background: #f2f2f2;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-slot span {
    font-weight: 600;
}

.schedule-slot.has-slots {
    background: #1990ff;
    color: #ffffff;
}

.schedule-slot.has-slots strong {
    font-weight: 600;
}

.schedule-slot.is-full {
    background: #dc3545;
    color: #ffffff;
}

.schedule-slot.is-full strong {
    font-weight: 600;
}

.schedule-note {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

.schedule-editor {
    border-top: 1px solid #e4e4e4;
    padding: 16px 24px 20px;
    background: #fafafa;
}

.available-slots-section {
    margin-top: 10px;
}

.selected-slot-summary {
    margin-bottom: 12px;
    font-size: 14px;
    padding: 10px 12px;
    background: var(--accent-mint);
    border-radius: 8px;
    border: 1px solid var(--primary-green-light);
}

.selected-slot-summary strong {
    color: var(--primary-green-dark);
}

/* Calendar Styles */
.calendar-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 992px) {
    .calendar-wrapper {
        flex-direction: column;
    }
}

.calendar-container {
    flex: 1.2;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--gray);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.calendar-nav-btn:hover:not(:disabled) {
    background: var(--accent-mint);
    border-color: var(--primary-green);
    color: var(--primary-green-dark);
}

.calendar-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-label {
    text-align: center;
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 12px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    border: 2px solid transparent;
}

.calendar-day:not(.disabled):hover {
    background: var(--accent-mint);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.calendar-day.active {
    background: var(--primary-green) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.calendar-day.disabled {
    color: #cbd5e1;
    cursor: default;
}

.calendar-day.has-slots:not(.disabled):not(.active) {
    background: #f0fdf4;
    color: var(--primary-green-dark);
    border-color: rgba(16, 185, 129, 0.1);
}

.calendar-day.has-slots::after {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--primary-green);
    border-radius: 50%;
    position: absolute;
    bottom: 8px;
}

.calendar-day.fully-booked {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
    cursor: not-allowed;
}

.calendar-day.fully-booked::after {
    content: '';
    width: 5px;
    height: 5px;
    background: #ef4444;
    border-radius: 50%;
    position: absolute;
    bottom: 8px;
}

.calendar-day.active::after {
    background: #fff;
}

.calendar-day.today:not(.active) {
    border-color: var(--primary-green);
}

.date-details-panel {
    flex: 1;
    background: #f8fafc;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.selected-date-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.selected-date-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.15rem;
    font-weight: 700;
}

.selected-date-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.period-chips {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.period-chip {
    flex: 1;
    padding: 16px 12px;
    border-radius: 16px;
    background: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.period-chip:hover:not(.disabled) {
    border-color: var(--primary-green-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.period-chip.active {
    background: var(--accent-mint);
    border-color: var(--primary-green);
    color: var(--primary-green-dark);
}

.period-chip.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

.period-chip-label {
    font-weight: 700;
    font-size: 1.1rem;
}

.period-chip-slots {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Time Chips Enhancement */
.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.time-chip {
    padding: 14px 10px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    border-color: #f1f5f9;
}

.time-chip:hover:not(.full) {
    border-color: var(--primary-green);
    background: var(--accent-mint);
    transform: scale(1.02);
}

.time-chip.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.time-chip.full {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
    cursor: not-allowed;
    opacity: 0.9;
}

.time-chip .time-range {
    font-weight: 700;
    font-size: 0.95rem;
}

.time-chip .time-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

.time-chip.active .time-label {
    color: #fff;
    opacity: 1;
}

.time-chip.full .time-label {
    color: #ef4444;
    font-weight: 500;
}

@keyframes slotFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {

    /* Available Slots Grid (Appointments Page) */
    .available-slots-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .available-slot-card {
        padding: 16px;
    }

    .slot-date-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .slot-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .slot-choice-btn {
        width: 100%;
        min-width: 100%;
        padding: 10px 12px;
        font-size: 13px;
    }

    .available-slots-section {
        margin-top: 16px;
    }

    .selected-slot-summary {
        padding: 12px;
        margin-bottom: 16px;
        background: var(--accent-mint);
        border-radius: 8px;
        font-size: 13px;
    }

    /* Card Body */
    .card-body {
        padding: 16px 0;
    }

    .card-body .btn {
        width: 100%;
        margin-bottom: 12px;
    }

    /* Form Row with 4 columns (Profile Name Fields) */
    .form-row {
        grid-template-columns: 1fr !important;
    }

    /* Household/Dependents Table */
    .card-body .table-container {
        margin: 16px -12px 0;
        padding: 8px;
    }

    .announcements-list {
        grid-template-columns: 1fr;
    }

    .announcement-item-image {
        max-height: 220px;
    }
}

/* ===== Site Footer ===== */
.site-footer {
    background: #1A2421;
    color: #e2e8f0;
    border-top: none;
    margin-top: 32px;
    padding: 0;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    position: relative;
    clear: both;
}


/* Full-width footer for public homepage */
body.public-home {
    --sidebar-width: 0px;
}

.site-footer .footer-republic,
.site-footer .footer-department-filipino,
.site-footer .footer-tagline,
.site-footer .footer-contact,
.site-footer .footer-link-list a,
.site-footer .footer-republic-seal,
.site-footer .footer-bottom-left p,
.site-footer .footer-bottom-center p,
.site-footer .footer-gov-row a {
    color: #cbd5e1 !important;
}

.site-footer .footer-heading,
.site-footer .footer-bottom-heading,
.site-footer .footer-contact strong {
    color: #f1f5f9 !important;
    font-weight: 700;
}

.site-footer .footer-link-list a:hover,
.site-footer .footer-contact a:hover,
.site-footer .footer-gov-row a:hover {
    color: var(--primary-green) !important;
    text-decoration: underline;
}

.site-footer .footer-department,
.site-footer .footer-tagline strong {
    color: #6ee7b7 !important;
}

.site-footer a {
    color: var(--primary-green);
    display: inline-block;
    transition: color 0.2s ease, transform 0.1s ease;
}

.site-footer a:active {
    transform: none !important;
}

/* Footer layout for public home */
body.public-home .site-footer {
    width: 100%;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
}

/* Footer layout for dashboard pages - positioned after sidebar */
body:not(.public-home) .site-footer {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    margin-right: 0;
    margin-top: 0;
}

/* Compact footer for admin & health worker dashboard pages */
body:not(.public-home) .footer-main {
    padding: 1px 20px;
    gap: 12px;
    grid-template-columns: 1fr 1.5fr 1fr;
}

body:not(.public-home) .footer-bottom {
    padding: 1px 20px;
    gap: 10px;
}

body:not(.public-home) .footer-branding {
    gap: 4px;
}

body:not(.public-home) .footer-logo {
    width: 40px;
    height: 40px;
}

body:not(.public-home) .footer-brand-text {
    gap: 1px;
}

body:not(.public-home) .footer-department {
    font-size: 12px;
    margin-top: 0;
}

body:not(.public-home) .footer-department-filipino {
    font-size: 11px;
    margin-bottom: 0;
}

body:not(.public-home) .footer-tagline {
    margin: 0;
    font-size: 11px;
}

body:not(.public-home) .footer-column {
    gap: 4px;
}

body:not(.public-home) .footer-bottom-center,
body:not(.public-home) .footer-bottom-right {
    gap: 4px;
}


.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 0.8fr 2.4fr 0.8fr;
    gap: 16px;
    width: 100%;
    align-items: center;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

/* Middle Branding Column Alignment */
.footer-branding {
    align-items: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.footer-branding-middle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    width: 100%;
    flex-wrap: wrap;
}

.footer-brand-side {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.footer-brand-side.text-right {
    text-align: right;
    align-items: flex-end;
}

.footer-brand-side.text-left {
    text-align: left;
    align-items: flex-start;
}

/* Right Section Alignment */
.footer-main>.footer-section:last-child {
    text-align: right;
    align-items: flex-end;
}

.footer-branding {
    gap: 1px;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo-large {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: center;
}

.footer-republic {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 500;
    margin: 0;
}

.footer-department {
    font-size: 14px;
    font-weight: 700;
    color: #6ee7b7;
    margin: 0;
    line-height: 1;

}

.footer-department-filipino {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    line-height: 1;
}

.footer-tagline {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.0;
    margin: 0;
    padding-bottom: 10px;
}

.footer-tagline strong {
    font-size: 14px;
    color: var(--primary-green-dark);
}

.footer-social-text {
    font-size: 12px;
    color: #666;
    margin-top: 12px;
}

.footer-social-icons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
    background: var(--primary-green-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (min-width: 1025px) {
    .footer-links>.footer-column:nth-child(2) {
        transform: translateX(-18px);
    }
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-heading {
    font-size: 14px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px 0;
}

.footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-link-list li {
    margin: 0;
}

.footer-link-list a {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link-list a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.footer-contact {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
    word-spacing: 1px;
}

.footer-contact p {
    margin: 0 0 8px 0;
}

.footer-contact strong {
    color: #f1f5f9;
    display: block;
    margin-bottom: 4px;
}

.footer-contact a {
    color: var(--primary-green);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-bottom {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Government links footer section */
.footer-bottom-govlinks {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 20px 40px 24px;
    box-sizing: border-box;
}

.footer-gov-heading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.8px;
    color: #f1f5f9;
    text-transform: uppercase;
}

.footer-gov-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-gov-row a {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
    padding: 2px 14px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.footer-gov-row a:hover {
    color: var(--primary-green);
    transform: translateY(-1px);
}

.footer-gov-sep {
    color: rgba(148, 163, 184, 0.2);
    font-size: 12px;
    line-height: 1;
    user-select: none;
    display: inline-block;
}

@media (max-width: 768px) {
    .footer-gov-row {
        flex-direction: column;
        gap: 10px;
    }
    .footer-gov-sep {
        display: none;
    }
    .footer-gov-row a {
        padding: 4px 0;
    }
}

body.public-home .footer-bottom {
    background: rgba(0, 0, 0, 0.04);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

@media (min-width: 1025px) {
    .footer-bottom {
        padding-left: 12px;
        padding-right: 12px;
        grid-template-columns: 1fr 1.3fr 1.2fr;
        gap: 14px;
    }
}

.footer-bottom::before {
    display: none;
}

.footer-bottom-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-republic-seal {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.5px;
}

.footer-bottom-left p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.footer-bottom-center,
.footer-bottom-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-bottom-heading {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.footer-bottom-center p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

.footer-gov-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-gov-links a {
    font-size: 12px;
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-gov-links a:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}



@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }

    .footer-main>.footer-section:last-child {
        text-align: center;
        align-items: center;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    body:not(.public-home) .site-footer {
        width: 100%;
        margin-left: 0;
    }

    .footer-main {
        padding: 20px 16px;
        gap: 20px;
    }

    .footer-branding-middle {
        flex-direction: column;
        gap: 8px;
    }

    .footer-brand-side.text-right,
    .footer-brand-side.text-left {
        text-align: center;
        align-items: center;
    }

    .footer-logo-large {
        width: 90px;
        height: 90px;
    }

    .footer-logo {
        width: 44px;
        height: 44px;
    }

    .footer-department {
        font-size: 11px;
    }

    .footer-department-filipino {
        font-size: 12px;
    }

    .footer-tagline {
        font-size: 12px;
        margin: 6px 0;
        text-align: center;
    }

    .footer-social-text {
        font-size: 11px;
    }

    .footer-social-icons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .social-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-column {
        gap: 12px;
    }

    .footer-heading {
        font-size: 13px;
    }

    .footer-link-list {
        gap: 6px;
    }

    .footer-link-list a {
        font-size: 12px;
    }

    .footer-contact {
        font-size: 12px;
        text-align: center;
    }

    .footer-contact p {
        margin: 0 0 8px 0;
    }

    .footer-bottom {
        padding: 16px 16px;
        gap: 16px;
    }

    .footer-bottom-govlinks {
        padding: 16px 16px 28px;
        gap: 12px;
    }

    .footer-gov-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        max-width: 100%;
        text-align: left;
    }

    .footer-bottom-left,
    .footer-bottom-center,
    .footer-bottom-right {
        gap: 10px;
    }

    .footer-republic-seal {
        font-size: 10px;
    }

    .footer-bottom-left p,
    .footer-bottom-center p {
        font-size: 11px;
    }

    .footer-bottom-heading {
        font-size: 12px;
    }

    .footer-gov-links {
        flex-direction: column;
        gap: 8px;
    }

    .footer-gov-links a {
        font-size: 11px;
    }

    .footer-gov-list {
        gap: 6px;
    }

    .footer-gov-list a {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .footer-gov-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 100%;
    }

    .footer-main {
        padding: 16px 12px;
    }

    .footer-logo-large {
        width: 70px;
        height: 70px;
    }

    .footer-branding-middle {
        gap: 6px;
    }

    .footer-bottom-govlinks {
        padding: 12px 12px 24px;
    }
}

/* ===== Print Styles ===== */
/* Print-only elements - hidden on screen */
.print-report-header,
.print-section-header,
.print-summary-section,
.print-report-meta,
.print-footer {
    display: none;
}

@media print {

    /* Hide UI elements / chrome */
    .sidebar,
    .site-topbar,
    .site-footer,
    .mobile-menu-toggle,
    .content-header,
    .btn,
    .action-cards,
    .modal-overlay {
        display: none !important;
    }

    /* Show print header with white background - ensure visibility */
    .print-report-header {
        display: block !important;
        visibility: visible !important;
        background: #ffffff !important;
        margin: 0 0 25px 0 !important;
        padding: 20px 0 15px 0 !important;
        border-bottom: 3px solid #000000 !important;
        width: 100% !important;
        position: relative !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ensure header is visible in print area */
    .reports-print-area>.print-report-header {
        display: block !important;
        visibility: visible !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
    }

    .print-report-header-inner {
        display: flex !important;
        visibility: visible !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 20px !important;
        width: 100% !important;
        padding: 10px 0 !important;
    }

    .print-report-logo {
        display: block !important;
        visibility: visible !important;
        flex-shrink: 0 !important;
        align-self: flex-start !important;
        margin-top: 5px !important;
    }

    .print-report-logo img {
        display: block !important;
        visibility: visible !important;
        width: 85px !important;
        height: 85px !important;
        object-fit: contain !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .print-report-text {
        display: flex !important;
        visibility: visible !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        flex: 1 !important;
        padding-top: 2px !important;
    }

    .print-report-line {
        display: block !important;
        visibility: visible !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        color: #000000 !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.5 !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase !important;
    }

    .print-report-title {
        display: block !important;
        visibility: visible !important;
        font-size: 20px !important;
        font-weight: bold !important;
        color: #000000 !important;
        margin: 8px 0 4px 0 !important;
        line-height: 1.3 !important;
        letter-spacing: 0.5px !important;
    }

    .print-report-subtitle {
        display: block !important;
        visibility: visible !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        color: #333333 !important;
        margin: 0 !important;
        font-style: italic !important;
        letter-spacing: 0.3px !important;
    }

    /* Excel-like clean background */
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
        font-family: Arial, sans-serif !important;
    }

    .wrapper,
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    .main-content .print-report-header {
        display: block !important;
        visibility: visible !important;
    }

    .dashboard-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }

    /* Hide all non-data elements */
    .reports-print-area .stats-grid,
    .reports-print-area .card-header,
    .reports-print-area h2,
    .reports-print-area .stat-card,
    .reports-print-area .stat-icon {
        display: none !important;
    }

    /* Excel-like table styling - pure data grid */
    .reports-print-area .card,
    .reports-print-area .table-container {
        box-shadow: none !important;
        border: none !important;
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .reports-print-area table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1px solid #000000 !important;
        margin: 10px 0 !important;
        page-break-inside: avoid;
    }

    /* Excel-like cells - all borders visible */
    .reports-print-area table th,
    .reports-print-area table td {
        border: 1px solid #000000 !important;
        padding: 4px 6px !important;
        color: #000000 !important;
        background: #ffffff !important;
        font-size: 11px !important;
        text-align: left !important;
        vertical-align: middle !important;
    }

    /* Excel-like header row */
    .reports-print-area table thead th {
        font-weight: bold !important;
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }

    /* Remove all styling from badges, icons, etc. */
    .reports-print-area .status-badge {
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
        padding: 0 !important;
        font-weight: normal !important;
    }

    /* Remove any text-center styling for data */
    .reports-print-area .text-center {
        text-align: left !important;
    }

    /* Ensure no page breaks inside tables */
    .reports-print-area table tr {
        page-break-inside: avoid;
    }

    /* Professional Print Header Enhancements */
    .print-report-meta {
        display: block !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px solid #000000 !important;
        font-size: 10px !important;
        color: #000000 !important;
    }

    .print-meta-row {
        display: flex !important;
        justify-content: space-between !important;
        margin-bottom: 4px !important;
    }

    .print-meta-label {
        font-weight: 600 !important;
        margin-right: 10px !important;
    }

    .print-meta-value {
        font-weight: normal !important;
    }

    .print-report-subtitle {
        display: block !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        color: #333333 !important;
        margin: 0 !important;
        font-style: italic !important;
        letter-spacing: 0.3px !important;
    }

    /* Print Summary Section */
    .print-summary-section {
        display: block !important;
        margin: 20px 0 !important;
        padding: 15px !important;
        border: 2px solid #000000 !important;
        background: #f9f9f9 !important;
        page-break-inside: avoid !important;
    }

    .print-summary-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        margin-top: 10px !important;
    }

    .print-summary-item {
        border: 1px solid #000000 !important;
        padding: 10px !important;
        background: #ffffff !important;
    }

    .print-summary-label {
        font-size: 10px !important;
        font-weight: 600 !important;
        color: #000000 !important;
        margin-bottom: 5px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .print-summary-value {
        font-size: 20px !important;
        font-weight: bold !important;
        color: #000000 !important;
    }

    /* Print Section Headers */
    .print-section {
        margin: 25px 0 !important;
        page-break-inside: avoid !important;
    }

    .print-section-header {
        display: block !important;
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
        border-bottom: 2px solid #000000 !important;
    }

    .print-section-title {
        display: block !important;
        font-size: 16px !important;
        font-weight: bold !important;
        color: #000000 !important;
        margin: 0 0 5px 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
    }

    .print-section-description {
        display: block !important;
        font-size: 11px !important;
        color: #333333 !important;
        margin: 0 !important;
        font-style: italic !important;
    }

    /* Enhanced Table Styling */
    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 2px solid #000000 !important;
        margin: 15px 0 !important;
        page-break-inside: avoid !important;
    }

    .print-table thead {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .print-table thead th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
        padding: 8px 10px !important;
        border: 1px solid #000000 !important;
        text-align: left !important;
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .print-table tbody td {
        padding: 6px 10px !important;
        border: 1px solid #000000 !important;
        font-size: 11px !important;
        vertical-align: top !important;
    }

    .print-table tbody tr:nth-child(even) {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .print-cell-number {
        text-align: right !important;
        font-family: 'Courier New', monospace !important;
    }

    .print-table-total {
        background: #e0e0e0 !important;
        font-weight: bold !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .print-table-total td {
        border-top: 2px solid #000000 !important;
        padding: 8px 10px !important;
    }

    /* Print Footer */
    .print-footer {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 10px 20px !important;
        border-top: 1px solid #000000 !important;
        background: #ffffff !important;
        font-size: 9px !important;
        color: #000000 !important;
        text-align: center !important;
    }

    .print-footer-content {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .print-page-number::after {
        content: "Page " counter(page) " of " counter(pages);
    }

    /* Page Breaks */
    @page {
        size: A4;
        margin: 2cm 1.5cm;

        @bottom-center {
            content: "Page " counter(page) " of " counter(pages);
            font-size: 9px;
            color: #666666;
        }
    }

    /* Hide screen-only elements in print */
    .reports-print-area .card-header,
    .reports-print-area .btn,
    .reports-print-area .action-cards {
        display: none !important;
    }

    /* Show print-only elements */
    .print-report-header,
    .print-section-header,
    .print-summary-section,
    .print-report-meta,
    .print-footer {
        display: block !important;
    }

    /* Better spacing for print */
    .reports-print-area>* {
        margin-bottom: 20px !important;
    }

    .reports-print-area>*:last-child {
        margin-bottom: 0 !important;
    }
}

/* ===== Notification Styles ===== */
.nav-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notifications-list {
    padding: 0;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
    gap: 15px;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.notification-header strong {
    color: #333;
    font-size: 14px;
    flex: 1;
}

.notification-badge {
    background: #2196f3;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.notification-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.notification-user {
    font-weight: 500;
}

.notification-time {
    color: #999;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-actions .btn-link {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
    transition: color 0.2s;
}

.notification-actions .btn-link:hover {
    color: #2196f3;
}

@media (max-width: 768px) {
    .notification-item {
        padding: 12px 15px;
        gap: 10px;
    }

    .notification-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .notification-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* Pagination controls for notifications */
.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    flex-wrap: wrap;
    border-top: 1px solid #eef2f7;
    background: #fff;
}

.pagination .btn {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 32px;
}

.pagination .btn-primary {
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
}

.pagination .btn-light {
    background: #f8fafc;
    color: #111827;
    border-radius: 6px;
    border: 1px solid #e6eef6;
}

.pagination .btn-disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-radius: 6px;
    padding: 6px 10px;
    pointer-events: none;
    opacity: 0.8;
}

.pagination .ellipsis {
    color: #6b7280;
    padding: 0 6px;
}

.pagination select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 13px;
    min-height: 32px;
}

.pagination label {
    color: #374151;
    font-size: 14px;
    margin-right: 6px;
}

/* ===== Toast Notification System (Pure CSS) ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow-strong);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-left: 4px solid;
    position: relative;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ===== Loading States (Pure CSS) ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--border-radius);
}

.loading-spinner {
    text-align: center;
}

.loading-spinner p {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Skeleton Loaders (Pure CSS) ===== */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray);
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, var(--gray) 25%, var(--light-gray) 50%, var(--gray) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}

.skeleton-title {
    width: 60%;
    height: 16px;
}

.skeleton-text {
    width: 100%;
}

.skeleton-text.short {
    width: 80%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== Enhanced Form Validation Styles ===== */
.form-group input.error,
.form-group textarea.error,
.form-group select.error,
.custom-file-upload.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-error::before {
    content: '\26A0';
    font-size: 14px;
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown),
.form-group select:valid {
    border-color: var(--success);
}

.form-group input:focus:valid,
.form-group textarea:focus:valid,
.form-group select:focus:valid {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ===== Pagination Styles ===== */
.pagination-container {
    margin-top: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
    text-align: center;
}

.pagination-info strong {
    color: #111827;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #111827;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #9ca3af;
    border-color: #d1d5db;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: white;
    color: #111827;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-number:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination-number.current {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #9ca3af;
    font-size: 14px;
}

/* =======================================================
   COMPREHENSIVE RESPONSIVE DESIGN OVERHAUL
   Covers: Admin | Health Worker | Resident
   Breakpoints: 1024px (tablet) | 768px (mobile) | 480px (small)
   ======================================================= */

/* â”€â”€ Tablet: 769px â€“ 1024px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    /* Sidebar narrower on tablet */
    .sidebar {
        width: var(--sidebar-width);
    }

    .sidebar-brand-label {
        font-size: 9px;
    }

    .sidebar-brand-title {
        font-size: 13px;
    }

    .nav-item {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* Main content adjusts */
    .main-content {
        margin-left: var(--sidebar-width);
    }

    /* Footer adjusts */
    body:not(.public-home) .site-footer {
        width: calc(100% - var(--sidebar-width));
        margin-left: var(--sidebar-width);
    }

    /* Dashboard layout */
    .dashboard-content {
        padding: 24px;
    }

    .content-header {
        padding: 18px 24px;
    }

    .content-header h1 {
        font-size: 22px;
    }

    /* Stats grid: 2 columns on tablet */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Action cards: 2 columns */
    .action-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Dashboard two-column: keep side panel below */
    .dashboard-two-column {
        grid-template-columns: 1fr;
    }

    .dashboard-right {
        position: static;
    }

    /* Form rows: 2 col â†’ 1 col */
    .form-row {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    /* Tables readable */
    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 10px 10px;
    }

    /* Card */
    .card {
        padding: 20px;
    }

    /* Search controls */
    .search-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-wrapper {
        min-width: 180px;
    }
}

/* â”€â”€ Mobile: â‰¤ 768px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 768px) {

    /* â”€â”€ Sidebar: slide-in drawer â”€â”€ */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }

    /* Overlay when sidebar is open */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* â”€â”€ Main content: no sidebar offset â”€â”€ */
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    /* â”€â”€ Footer: full width â”€â”€ */
    body:not(.public-home) .site-footer {
        width: 100%;
        margin-left: 0;
    }

    /* â”€â”€ Content header: space for hamburger â”€â”€ */
    .content-header {
        padding: 14px 16px 14px 72px;
        /* left gap for hamburger */
        flex-wrap: wrap;
        gap: 10px;
        min-height: 60px;
    }

    .content-header h1 {
        font-size: 18px;
        line-height: 1.3;
    }

    .content-header .user-info {
        margin-left: auto;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* â”€â”€ Dashboard content â”€â”€ */
    .dashboard-content {
        padding: 14px;
    }

    /* â”€â”€ Stats grid: 1 column â”€â”€ */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
    }

    .stat-info h3 {
        font-size: 24px;
    }

    .stat-info p {
        font-size: 13px;
    }

    /* â”€â”€ Action cards: 1 column â”€â”€ */
    .action-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* â”€â”€ Dashboard two-column â”€â”€ */
    .dashboard-two-column {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-right {
        position: static;
    }

    /* â”€â”€ Cards â”€â”€ */
    .card {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 12px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 14px;
    }

    .card-header h2 {
        font-size: 16px;
    }

    /* â”€â”€ Form â”€â”€ */
    .form-container {
        padding: 16px;
        border-radius: 16px;
        margin: 0;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        /* prevents iOS zoom */
        padding: 11px 12px;
    }

    /* â”€â”€ Form actions / buttons â”€â”€ */
    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 18px;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .form-buttons button,
    .form-buttons a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* â”€â”€ Buttons â”€â”€ */
    .btn {
        padding: 10px 18px;
        font-size: 14px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 7px 14px;
        font-size: 12px;
        min-height: 36px;
    }

    /* â”€â”€ Tables â”€â”€ */
    .table-container {
        padding: 0;
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 560px;
        font-size: 12px;
    }

    table th,
    table td {
        padding: 9px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .data-table th,
    .data-table td {
        padding: 9px 8px;
        font-size: 12px;
    }

    /* â”€â”€ Search controls â”€â”€ */
    .search-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .search-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .search-input {
        width: 100%;
        font-size: 16px;
        /* no iOS zoom */
    }

    .search-results-info {
        text-align: center;
        font-size: 12px;
    }

    /* â”€â”€ Sort controls â”€â”€ */
    .sort-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
    }

    .sort-select {
        min-width: 100%;
        font-size: 16px;
    }

    /* â”€â”€ Filter / purpose tabs â”€â”€ */
    .purpose-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }

    .purpose-tab {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px 10px;
        font-size: 12px;
        text-align: center;
    }

    /* â”€â”€ Badges â”€â”€ */
    .badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* â”€â”€ Alerts â”€â”€ */
    .alert {
        padding: 12px 14px;
        font-size: 13px;
        border-radius: 10px;
    }

    /* â”€â”€ Modals â”€â”€ */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-dialog {
        width: 100%;
        max-width: 100% !important;
        margin: 0;
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 18px 20px;
    }

    .modal-footer {
        padding: 14px 20px 20px;
        gap: 10px;
    }

    .modal-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
        flex: 1;
    }

    /* â”€â”€ Pagination â”€â”€ */
    .pagination-controls {
        gap: 4px;
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .pagination-number {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .pagination-container {
        padding: 14px;
    }

    /* â”€â”€ Announcements grid â”€â”€ */
    .announcements-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .announcement-item-image {
        max-height: 200px;
    }

    .announcement-description {
        min-height: auto;
    }

    /* â”€â”€ QR / Scanner â”€â”€ */
    .qr-container,
    .scanner-container {
        padding: 16px;
        margin: 12px 0;
        border-radius: 14px;
    }

    .qr-code-img {
        max-width: 220px;
    }

    /* â”€â”€ Profile page tables â”€â”€ */
    .card-body .table-container {
        margin: 12px -4px 0;
        padding: 0;
    }

    /* â”€â”€ Schedule calendar â”€â”€ */
    .schedule-calendar-container {
        padding: 10px;
        overflow-x: auto;
    }

    .schedule-calendar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .schedule-calendar-title {
        font-size: 15px;
    }

    .schedule-month-nav {
        width: 100%;
        justify-content: space-between;
    }

    .schedule-day-btn {
        height: 75px;
        padding: 2px;
    }

    .schedule-day-number {
        font-size: 11px;
    }

    .schedule-slot {
        font-size: 9px;
        padding: 2px 3px;
    }

    /* â”€â”€ Admin / HW user table action buttons â”€â”€ */
    td>div[style*="display: flex"] {
        flex-wrap: wrap;
        gap: 6px !important;
    }

    .btn-view-id {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* â”€â”€ Profile picture / avatar â”€â”€ */
    .profile-avatar,
    .profile-photo-wrapper {
        max-width: 120px;
        margin: 0 auto;
    }

    /* â”€â”€ View resident / appointment detail pages â”€â”€ */
    .resident-detail-grid,
    .appointment-detail-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* â”€â”€ Inventory name column â”€â”€ */
    .inventory-name {
        max-width: 160px;
    }

    .inventory-name .name-text {
        white-space: normal;
        word-break: break-word;
    }

    /* â”€â”€ Time slot grid â”€â”€ */
    .time-slot-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .time-chip {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* â”€â”€ Quick actions heading â”€â”€ */
    .quick-actions h2 {
        font-size: 17px;
    }

    /* â”€â”€ Dashboard announcements â”€â”€ */
    .dashboard-announcements-grid {
        grid-template-columns: 1fr;
    }

    /* â”€â”€ Announcement detail â”€â”€ */
    .announcement-detail-body {
        padding: 18px 16px;
    }

    .announcement-detail-image {
        max-height: 260px;
    }

    .announcement-detail-text {
        font-size: 14px;
    }
}

/* â”€â”€ Small Mobile: â‰¤ 480px â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 480px) {

    /* â”€â”€ Content header â”€â”€ */
    .content-header {
        padding: 10px 10px 10px 58px;
    }

    .content-header h1 {
        font-size: 16px;
    }

    /* â”€â”€ Dashboard â”€â”€ */
    .dashboard-content {
        padding: 10px;
    }

    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto;
    }

    .stat-info h3 {
        font-size: 22px;
    }

    .stat-info p {
        font-size: 12px;
    }

    /* â”€â”€ Cards â”€â”€ */
    .card {
        padding: 12px;
        border-radius: 10px;
    }

    .card-header h2 {
        font-size: 14px;
    }

    /* â”€â”€ Tables â”€â”€ */
    table {
        min-width: 480px;
        font-size: 11px;
    }

    table th,
    table td {
        padding: 7px 6px;
        font-size: 11px;
    }

    /* â”€â”€ Buttons â”€â”€ */
    .btn {
        padding: 9px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 32px;
    }

    /* â”€â”€ Purpose tabs: full row â”€â”€ */
    .purpose-tab {
        min-width: 100%;
    }

    /* â”€â”€ Time slot grid: single column on tiny screens â”€â”€ */
    .time-slot-grid {
        grid-template-columns: 1fr;
    }

    /* â”€â”€ Pagination â”€â”€ */
    .pagination-numbers {
        gap: 2px;
    }

    .pagination-number {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* â”€â”€ Modal â”€â”€ */
    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 16px 16px;
    }

    .modal-btn {
        width: 100%;
        min-width: unset;
    }

    /* â”€â”€ Alert â”€â”€ */
    .alert {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* â”€â”€ Form â”€â”€ */
    .form-container {
        padding: 12px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        padding: 10px;
    }

    /* â”€â”€ Schedule calendar â”€â”€ */
    .schedule-day-btn {
        height: 60px;
    }

    .schedule-slot {
        font-size: 8px;
    }

    /* â”€â”€ Sidebar brand compact â”€â”€ */
    .sidebar-brand-label {
        font-size: 8px;
        letter-spacing: 0.8px;
    }

    .sidebar-brand-title {
        font-size: 11px;
    }

    .sidebar-logo {
        width: 28px;
        height: 28px;
    }

    /* â”€â”€ Announcement image â”€â”€ */
    .announcement-item-image {
        max-height: 160px;
    }

    /* â”€â”€ QR code â”€â”€ */
    .qr-code-img {
        max-width: 200px;
    }

    /* â”€â”€ Search â”€â”€ */
    .search-controls {
        padding: 10px;
        gap: 8px;
    }

    .search-input {
        padding: 8px 12px 8px 36px;
        font-size: 14px;
    }

}

/* Premium Floating Info Window */
.info-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    width: 90%;
    max-width: 550px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(16, 185, 129, 0.1);
    overflow: hidden;
}

.info-window.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.info-window-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.info-window-overlay.show {
    opacity: 1;
    visibility: visible;
}

.info-window-header {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 24px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-window-header h3 {
    margin: 0 !important;
    font-size: 20px;
    color: #065f46;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-window-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.info-window-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.info-window-body {
    padding: 30px;
    color: #334155;
    font-size: 15px;
    line-height: 1.8;
}

.info-window-body p {
    margin-bottom: 20px;
}

.info-window-body .info-highlight {
    background: #f0fdf4;
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #10b981;
    margin-top: 10px;
}

.info-window-footer {
    padding: 20px 30px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.loading-spinner {
    text-align: center;
    color: #ffffff;
}

.loading-logo {
    width: 300px;
    height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto 20px;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.3));
    animation: logoPulse 1.8s ease-in-out infinite;
    border-color: #064e3b;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.07);
        opacity: 0.85;
    }
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;

}

.loading-spinner p {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--primary-white);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}