/* ============================================
   SIDEBAR RESPONSIVE STYLES
   ============================================ */

/* Sidebar Toggle Button - Hidden on Desktop */
.sidebar-toggle {
    display: none;
    /* Hidden by default on desktop */
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    width: 45px;
    height: 45px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 254, 254, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--primary-dark, #1d4ed8);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Sidebar Overlay - Hidden by default */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Sidebar Close Button - Hidden on Desktop */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.sidebar-close:hover {
    color: var(--primary-color);
}

/* Sidebar Base Styles with Enhanced Scrollbar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    overflow-y: hidden;
    /* Hidden by default as requested */
    overflow-x: hidden;
    z-index: 1040;
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease-in-out;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

/* Show scrollbar only on hover */
.sidebar:hover {
    overflow-y: auto;
}

/* Custom Scrollbar for Sidebar (Webkit: Chrome, Safari, Edge) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
    /* Invisible track */
    margin: 0.5rem 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    /* Invisible thumb by default */
    border-radius: 10px;
    transition: background 0.2s;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    /* Visible on hover */
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color, #2563eb);
}

/* Firefox Scrollbar Styling */
.sidebar {
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Sidebar Animation */
.nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.fa-chevron-down {
    transition: transform 0.3s ease;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    width: calc(100% - 260px);
    transition: margin-left 0.3s ease, width 0.3s ease;
    padding-top: 80px;
    /* Space for fixed header */
    padding-bottom: 2rem;
}

/* Navigation Links */
.nav-link {
    color: #475569;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-link i {
    width: 1.25rem;
}

/* Top Navbar - Fixed Position */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    right: 0;
    left: 260px;
    /* Matches sidebar width */
    height: 80px;
    z-index: 1030;
    /* Higher than sidebar overlay */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: left 0.3s ease;
}

/* Standardize Container / Modal Styles */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 2px solid #f1f5f9;
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-weight: 700;
    color: #1e293b;
}

/* Modern Form Styling (Universal) */
.form-card,
.modern-form-card {
    background: #ffffff;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.form-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    color: #334155;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

.required-star {
    color: #dc2626;
    margin-left: 2px;
}

.btn-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Search Bar */
.search-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    width: 350px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-bar:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Profile Dropdown */
.profile-dropdown img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Welcome Section */
.welcome-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Stats Cards - Matching index.html Design */
.stat-card {
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.25);
}

/* Stat Card Color Variants */
.blue-card {
    background: linear-gradient(45deg, #4099ff, #73b4ff);
}

.purple-card {
    background: linear-gradient(45deg, #d946ef, #ec4899);
}

.red-card {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
}

.teal-card {
    background: linear-gradient(45deg, #2ed8b6, #59e0c5);
}

.green-card {
    background: linear-gradient(45deg, #43a047, #66bb6a);
}

.orange-card {
    background: linear-gradient(45deg, #fb8c00, #ffa726);
}

/* Stat Card Content */

.card-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.big-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.card-content p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
}

/* Icon Watermark */
.icon-watermark {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 6rem;
    opacity: 0.15;
    transform: rotate(-15deg);
    transition: all 0.3s ease;
}

.stat-card:hover .icon-watermark {
    transform: rotate(0deg) scale(1.1);
    opacity: 0.25;
}

/* Chart Cards */
.chart-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Dashboard Cards */
.card-dashboard {
    border: none;
    border-radius: 1rem;
    color: white;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

.card-dashboard:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.15);
}

.card-dashboard h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-dashboard h6 {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 1rem;
}

.card-dashboard .icon-wrapper {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 6rem;
    opacity: 0.3;
    transform: rotate(-15deg);
    transition: all 0.3s;
}

.card-dashboard:hover .icon-wrapper {
    transform: rotate(0deg) scale(1.1);
    opacity: 0.4;
}

/* Floating Action Button */
.floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s;
    z-index: 1000;
}

.floating-btn:hover {
    transform: scale(1.1);
    color: white;
}

/* Announcement Card Styles */
.announcement-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.announcement-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

/* Birthday List Styles */
.birthday-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.birthday-item:hover {
    background-color: #f8fafc;
}

.birthday-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Needs Attention Styles */
.attention-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.attention-badge.critical {
    background-color: #fee2e2;
    color: #dc2626;
}

.bg-light-success {
    background-color: #f0fdf4;
}

.bg-light-warning {
    background-color: #fefce8;
}

.text-sm {
    font-size: 0.875rem;
}

/* ============================================
   PROFESSIONAL RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Tablet Landscape (992px-1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .big-number {
        font-size: 1.8rem !important;
    }

    .chart-card {
        padding: 1.25rem;
    }

    .card-content h4 {
        font-size: 0.78rem;
    }
}

/* Tablet Portrait (768px-991px) */
@media (max-width: 991px) {

    /* === Sidebar: becomes a slide-over overlay === */
    .sidebar-toggle {
        display: flex !important;
    }

    .sidebar-close {
        display: block !important;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 80px;
        padding-bottom: 80px;
        /* Safe padding for mobile/tablet */
    }

    .top-navbar {
        left: 0 !important;
        padding: 0.5rem 1rem;
    }

    /* === Sub-header: keep controls visible but wrap nicely === */
    .bg-white.border-bottom {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    /* === Stat Cards: 2 per row on tablets (proper size) === */
    .row.g-3>.col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .stat-card {
        padding: 1.25rem !important;
        min-height: 130px;
    }

    .big-number {
        font-size: 2rem !important;
    }

    .card-content h4 {
        font-size: 0.8rem !important;
    }

    .card-content p {
        font-size: 0.78rem !important;
    }

    .icon-watermark {
        font-size: 4.5rem !important;
    }

    /* === Chart Cards: 2 per row on tablet (not 4!) === */
    .row.g-3>.col-12.col-md-6.col-lg-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* Bottom section cards (Recent Activity, Income) stay at 50% each */
    .row.g-3>.col-lg-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Chart heights */
    .chart-card {
        padding: 1.1rem !important;
    }

    .chart-title {
        font-size: 0.9rem;
    }

    /* === Quick Access section: 2-col buttons === */
    .card-body .row.row-cols-lg-4 {
        --bs-columns: 2;
    }

    .card-body .row.row-cols-lg-3 {
        --bs-columns: 2;
    }

    .stat-card {
        margin-bottom: 0.5rem;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {

    /* Sidebar mobile */
    .sidebar-toggle {
        display: flex !important;
    }

    .sidebar-close {
        display: block !important;
    }

    .sidebar {
        width: 85%;
        max-width: 300px;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 70px;
        padding-bottom: 80px;
        /* Mobile safe bottom */
    }

    .top-navbar {
        left: 0 !important;
        padding: 0.5rem 1rem;
        height: 70px;
    }

    .top-header h5 {
        font-size: 0.85rem !important;
        letter-spacing: 0.3px;
    }

    /* Main dashboard content padding */
    .p-3.mx-auto {
        padding: 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Welcome section */
    .mb-3>h4.fw-bold {
        font-size: 1.1rem !important;
    }

    .mb-3>p .float-end {
        float: none !important;
        display: block;
        margin-top: 0.25rem;
    }

    /* Sub-header: stack dropdowns */
    .bg-white.border-bottom.py-3 {
        padding: 0.75rem !important;
    }

    .bg-white.border-bottom.py-3>.d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .bg-white.border-bottom.py-3 .d-flex.align-items-center.gap-2.flex-wrap {
        width: 100%;
        gap: 0.5rem !important;
    }

    .bg-white.border-bottom.py-3 .dropdown .btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.65rem !important;
        white-space: nowrap;
    }

    /* Stat cards: Changed to 1 per row on mobile to increase width and avoid squeezing */
    .row.g-3>.col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Legacy selector fallback */
    .row.g-3>.col-xl-3.col-md-6,
    .row.g-3>.col-lg-3.col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .stat-card {
        padding: 1rem !important;
        display: flex;
        flex-direction: column;
        /* Changed to column for better vertical stack */
        align-items: flex-start;
        gap: 0.5rem;
        overflow: hidden;
        margin-bottom: 0;
        width: 100%;
        /* Ensure card fills the column */
        min-height: 120px;
        /* Ensure consistent height */
    }

    .stat-card .card-content {
        flex: 1;
        min-width: 0;
    }

    .stat-card .card-content h4 {
        font-size: 0.75rem !important;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 0.25rem;
        line-height: 1.2;
        width: 100%;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .stat-card .card-content p {
        font-size: 0.68rem !important;
        margin: 0;
        opacity: 0.9;
        line-height: 1.1;
    }

    .big-number {
        font-size: 1.5rem !important;
    }

    .card-content h4 {
        font-size: 0.75rem !important;
    }

    .card-content p {
        font-size: 0.7rem !important;
    }

    .icon-watermark {
        font-size: 3.5rem !important;
        right: -8px;
        bottom: -8px;
    }

    /* Chart cards */
    .chart-card {
        padding: 1rem !important;
    }

    .chart-title {
        font-size: 0.85rem !important;
    }

    .chart-header {
        margin-bottom: 1rem;
    }

    /* Chart columns: Changed to 1 per row for symmetry with stat cards */
    .row.g-3>.col-6.col-md-6.col-lg-3,
    .row.g-3>.col-lg-3.col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Bottom rows (Recent Activities, Income Manager) go full width */
    .row.g-3>.col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Quick Access buttons */
    .btn.py-3 {
        padding: 0.6rem 0.5rem !important;
        font-size: 0.78rem !important;
    }

    .btn.py-2 {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.78rem !important;
    }

    /* Card headers in Quick Access */
    .card-header {
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem !important;
    }

    .card-body {
        padding: 0.75rem !important;
    }

    /* Activity/announcement items */
    .announcement-card,
    .birthday-item {
        padding: 0.65rem;
    }

    .birthday-avatar {
        width: 32px;
        height: 32px;
    }

    .attention-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Recent Activities section */
    .list-group-item.d-flex.align-items-center.gap-3 {
        gap: 0.5rem !important;
        padding: 0.6rem 0 !important;
    }

    .list-group-item h6 {
        font-size: 0.8rem !important;
    }

    .list-group-item p {
        font-size: 0.75rem !important;
    }
}

/* Extra Small Mobile (<=480px) */
@media (max-width: 480px) {

    .sidebar {
        width: 90%;
    }

    .top-navbar {
        padding: 0.5rem !important;
    }

    .top-header {
        padding: 0.5rem 0.5rem 0.5rem 50px !important;
    }

    .top-header h5 {
        font-size: 0.75rem !important;
    }

    /* Stack all cards to full width on very small screens */
    .row.g-3>.col-6,
    .row.g-3>.col-xl-3.col-md-6,
    .row.g-3>.col-lg-3.col-md-6,
    .row.g-3>.col-6.col-md-6.col-xl-3,
    .row.g-3>.col-6.col-md-6.col-lg-3 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .stat-card {
        padding: 1rem !important;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .stat-card .card-content {
        flex: 1;
    }

    .big-number {
        font-size: 1.75rem !important;
        margin-bottom: 0.25rem;
    }

    .icon-watermark {
        position: static !important;
        font-size: 2.5rem !important;
        opacity: 0.25;
        transform: none !important;
    }

    /* Chart cards full width on very small screens */
    .row.g-3>.col-lg-3.col-md-6,
    .row.g-3>.col-6.col-md-6.col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .chart-card {
        padding: 0.75rem !important;
    }

    .chart-title {
        font-size: 0.8rem !important;
    }

    /* Quick Access: stack buttons */
    .row-cols-lg-4>*,
    .row-cols-lg-3>*,
    .row-cols-md-2>* {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .btn.py-3,
    .btn.py-2 {
        padding: 0.65rem 0.5rem !important;
        font-size: 0.8rem !important;
        text-align: left;
        justify-content: flex-start !important;
    }

    /* Sub-header dropdowns: wrap and shrink */
    .bg-white.border-bottom.py-3 .dropdown .btn {
        font-size: 0.72rem;
        padding: 0.35rem 0.5rem !important;
    }

    /* Welcome */
    .mb-3>h4.fw-bold {
        font-size: 1rem !important;
    }

    /* Main padding */
    .p-3.mx-auto {
        padding: 0.5rem !important;
    }

    /* Promotion card text */
    .chart-card.bg-primary h4,
    .chart-card.bg-primary h5 {
        font-size: 1rem !important;
    }

    .chart-card.bg-primary p {
        font-size: 0.78rem !important;
    }
}

/* Large Desktop (>=1920px) */
@media (min-width: 1920px) {
    .main-wrapper {
        max-width: 1920px;
    }

    .container,
    .container-fluid {
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .sidebar-toggle,
    .sidebar-overlay,
    .top-header,
    button,
    .dropdown {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .stat-card,
    .chart-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body {
        background: white !important;
    }
}

/* Utility Classes */
.bg-light-primary {
    background-color: var(--primary-light);
}

/* ============================================
   THEME TOGGLE & LOGO STYLES
   ============================================ */

/* Logo Styling */
.sidebar-logo {
    padding: 0.5rem 0;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-text h6 {
    color: var(--primary-color);
    font-weight: 700;
}

.logo-text p {
    color: #64748b;
    font-weight: 500;
}

/* Theme Toggle Section */
.theme-toggle-section {
    padding: 0.75rem;
    margin: 1rem 0;
}

#themeColorBox {
    width: 30px;
    height: 30px;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#changeThemeBtn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

#changeThemeBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* Theme Options Modal */
.theme-option {
    aspect-ratio: 1;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid transparent;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.theme-option:hover {
    transform: scale(1.05);
    border-color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.theme-option span {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive logo adjustments */
@media (max-width: 991px) {
    .logo-img {
        width: 45px;
        height: 45px;
    }

    .logo-text h6 {
        font-size: 0.85rem !important;
    }

    .logo-text p {
        font-size: 0.7rem !important;
    }
}

/* ============================================
   UNIVERSAL FORM SYSTEM (PREMIUM BLUE)
   ============================================ */

/* Main Centering Wrapper - Professional Top Margin */
.form-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Aligns to top, not center */
    padding-top: 3rem;
    /* Spacing relative to the pushed-down content */
    padding-bottom: 3rem;
    min-height: calc(100vh - 80px);
    /* Adjust min-height for fixed header */
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Universal Form Card */
.form-card {
    background: #ffffff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 720px;
    /* Default width */
    border: 1px solid #eef2f6;
    margin: 0 auto;
    /* Horizontal centering */
}

/* Typography */
.form-title {
    font-size: 1.625rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -0.5px;
}

/* Form Rows & Layout */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0;
    text-align: left;
    /* Keep left aligned */
}

/* Inputs & Selects */
.form-control,
.form-select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    /* Softer border */
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #f8fafc;
    color: #334155;
    margin-bottom: 0px !important;
    /* Ensure input doesn't have extra bottom margin in row */
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    /* Blue border */
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    /* Blue glow */
    outline: none;
}

/* Buttons - Premium Blue */
.btn-submit {
    width: 100%;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    /* Blue Gradient */
    color: white;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.required-star {
    color: #ef4444;
    margin-left: 3px;
}

/* ============================================================
   ALL-DEVICE RESPONSIVE SYSTEM
   Desktop ≥1280px | Laptop 992-1279px | Tablet 768-991px
   Large Phone 600-767px | Phone ≤599px | Small Phone ≤480px
   ============================================================ */

/* ── Global Touch / Base Improvements ─────────────────────── */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* Ensure images never overflow their containers */
img {
    max-width: 100%;
    height: auto;
}

/* Tables scroll horizontally on small screens */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* All interactive elements have adequate tap targets on touch */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .nav-link,
    .dropdown-item,
    a.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }
}

/* ── Desktop ≥1280px — Sidebar always visible & fixed ──────── */
@media (min-width: 1280px) {
    .sidebar {
        transform: translateX(0) !important;
        width: 260px;
    }

    .main-wrapper {
        margin-left: 260px;
        width: calc(100% - 260px);
    }

    .top-navbar {
        left: 260px;
    }

    /* Collapsed sidebar state (toggled via JS) */
    body.sidebar-collapsed .sidebar {
        width: 70px;
    }

    body.sidebar-collapsed .sidebar .nav-link span,
    body.sidebar-collapsed .sidebar .logo-text,
    body.sidebar-collapsed .sidebar .theme-toggle-section {
        display: none;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 70px;
        width: calc(100% - 70px);
    }

    body.sidebar-collapsed .top-navbar {
        left: 70px;
    }
}

/* ── Laptop 992px–1279px — Narrower sidebar, full layout ───── */
@media (min-width: 992px) and (max-width: 1279px) {
    .sidebar {
        width: 230px;
    }

    .main-wrapper {
        margin-left: 230px;
        width: calc(100% - 230px);
    }

    .top-navbar {
        left: 230px;
    }

    .form-card {
        max-width: 680px;
        padding: 2.5rem;
    }

    .big-number {
        font-size: 1.75rem;
    }

    .stat-card {
        padding: 1.25rem;
    }
}

/* ── iPad Pro / Large Tablet Landscape (1024px) ────────────── */
@media (min-width: 992px) and (max-width: 1024px) {
    .sidebar {
        width: 210px;
    }

    .main-wrapper {
        margin-left: 210px;
        width: calc(100% - 210px);
    }

    .top-navbar {
        left: 210px;
    }

    .form-card {
        padding: 2rem;
    }

    .big-number {
        font-size: 1.6rem;
    }

    .card-content h4 {
        font-size: 0.77rem;
    }
}

/* ── Tablet / iPad Portrait 768px–991px ─────────────────────── */
@media (max-width: 991px) {

    /* Sidebar slides in as overlay — already handled by JS toggle */
    .sidebar {
        transform: translateX(-100%);
        width: 270px;
        z-index: 1045;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex !important;
    }

    .sidebar-close {
        display: block !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 72px;
    }

    .top-navbar {
        left: 0 !important;
        height: 72px;
        padding: 0.5rem 1rem;
    }

    /* Content wrapper fills full width */
    .content-wrapper {
        width: 100% !important;
    }

    /* Search bar shrinks */
    .search-bar,
    .top-navbar input[type="text"] {
        width: 180px !important;
    }

    /* Form card adjustments */
    .form-card {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .form-row {
        align-items: flex-start !important;
        margin-bottom: 1.25rem !important;
    }

    .form-label {
        margin-bottom: 0.4rem !important;
    }

    .form-wrapper {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    /* Modal adjustments */
    .modal-body {
        padding: 1.5rem;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    /* Stat grid: 2 columns on tablets */
    .row.g-3>.col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Chart cards: full width on tablet */
    .row>.col-lg-8,
    .row>.col-lg-6,
    .row>.col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Subheader bar wraps gracefully */
    .bg-white.border-bottom>.d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Tables: horizontal scroll */
    table {
        min-width: 500px;
    }

    /* Page container full width */
    .p-4.mx-auto,
    .p-3.mx-auto {
        padding: 1rem !important;
        max-width: 100% !important;
    }

    /* Dashboard sub-header: keep row layout but smaller */
    .big-number {
        font-size: 1.65rem;
    }

    .stat-card {
        padding: 1.1rem;
    }
}

/* ── Large Phone / Small Tablet 600px–767px ─────────────────── */
@media (max-width: 767px) and (min-width: 600px) {
    .main-wrapper {
        padding-top: 68px;
    }

    .top-navbar {
        height: 68px;
        left: 0 !important;
        padding: 0.4rem 0.75rem;
    }

    /* 2-column stat grid on large phones */
    .row.g-3>.col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .form-card {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .search-bar,
    .top-navbar input[type="text"] {
        width: 140px !important;
    }

    /* Tables scroll */
    table {
        min-width: 480px;
    }

    .table-responsive {
        border-radius: 8px;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-body {
        padding: 1.25rem;
    }
}

/* ── Android Phones & Small Mobiles ≤599px ──────────────────── */
@media (max-width: 599px) {
    .main-wrapper {
        padding-top: 64px;
        padding-bottom: 1rem;
    }

    .top-navbar {
        height: 64px;
        left: 0 !important;
        padding: 0.35rem 0.75rem;
    }

    /* School name abbreviation already in navbar PHP */
    .top-navbar h5 {
        font-size: 0.85rem !important;
    }

    /* Full-width stat cards on phones */
    .row.g-3>.col-6,
    .row.g-3>.col-xl-3,
    .row.g-3>.col-md-4,
    .row.g-3>.col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .stat-card {
        padding: 0.9rem 1rem;
        min-height: 110px;
    }

    .big-number {
        font-size: 1.5rem;
    }

    .icon-watermark {
        font-size: 3.5rem !important;
    }

    /* Chart row full width */
    .row>[class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Form card full width, comfortable padding */
    .form-card {
        padding: 1.25rem 1rem;
        border-radius: 10px;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .form-wrapper {
        padding: 0.75rem;
        min-height: auto;
    }

    .form-title {
        font-size: 1.15rem;
        margin-bottom: 1.5rem;
    }

    /* Modals full-screen on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100%;
    }

    .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header {
        padding: 0.85rem 1rem;
    }

    /* Buttons full-width in modals */
    .modal-footer .btn {
        width: 100%;
        margin: 0.25rem 0;
    }

    .modal-footer {
        flex-direction: column;
    }

    /* Tables */
    table {
        min-width: 420px;
    }

    .table td,
    .table th {
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }

    /* Hide non-essential elements */
    .d-none-mobile {
        display: none !important;
    }

    /* Page section padding */
    .p-4,
    .p-4.mx-auto {
        padding: 0.75rem !important;
    }

    .p-3,
    .p-3.mx-auto {
        padding: 0.65rem !important;
    }

    /* Card body compact */
    .card-body {
        padding: 0.75rem !important;
    }

    .card-header {
        padding: 0.6rem 0.75rem !important;
        font-size: 0.85rem;
    }

    /* Quick action buttons */
    .btn.py-3 {
        padding: 0.6rem !important;
        font-size: 0.8rem !important;
    }

    /* Stack all action row buttons */
    .d-flex.gap-2.flex-wrap {
        gap: 0.4rem !important;
    }

    .d-flex.gap-2.flex-wrap .btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }
}

/* ── Very Small Phones ≤380px (Samsung Galaxy A series etc.) ── */
@media (max-width: 380px) {
    .top-navbar h5 {
        font-size: 0.75rem !important;
    }

    .big-number {
        font-size: 1.3rem;
    }

    .stat-card {
        min-height: 100px;
        padding: 0.75rem;
    }

    .form-card {
        padding: 1rem 0.75rem;
    }

    .icon-watermark {
        font-size: 3rem !important;
    }

    .sidebar {
        width: 92% !important;
        max-width: 290px;
    }

    /* Subheader chips collapse further */
    .bg-white.border-bottom span[style*="border-radius:20px"] {
        font-size: 0.65rem !important;
        padding: 2px 7px !important;
    }
}

/* ── Landscape Phone (height ≤500px) — e.g. iPhone SE landscape ─ */
@media (max-height: 500px) and (orientation: landscape) {
    .top-navbar {
        height: 56px;
    }

    .main-wrapper {
        padding-top: 56px;
    }

    .sidebar {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .sidebar-logo {
        margin-bottom: 0.5rem !important;
    }

    .logo-img {
        width: 36px;
        height: 36px;
    }

    .form-wrapper {
        padding-top: 1rem;
        min-height: auto;
    }
}

/* ── iPad / Tablet Landscape (1024px–1180px) ───────────────── */
@media (min-width: 1025px) and (max-width: 1180px) {
    .sidebar {
        width: 240px;
    }

    .main-wrapper {
        margin-left: 240px;
        width: calc(100% - 240px);
    }

    .top-navbar {
        left: 240px;
    }

    .form-card {
        max-width: 700px;
    }

    .big-number {
        font-size: 1.7rem;
    }
}

/* ── Fix: content-wrapper should always grow to fill ─────────── */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Fix: main-wrapper overflow on any device ────────────────── */
.main-wrapper {
    overflow-x: hidden;
}

/* ── Fix: prevent horizontal scroll on body globally ─────────── */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Fix: dropdown menus don't go off-screen on mobile ──────── */
@media (max-width: 767px) {
    .dropdown-menu {
        position: fixed !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto !important;
        max-width: calc(100vw - 1.5rem);
    }

    .dropdown-menu.dropdown-menu-end {
        left: auto !important;
        right: 0.75rem !important;
    }
}

/* ── Fix: search bar hidden on mobile but visible placeholder ─── */
@media (max-width: 575px) {
    .top-navbar .d-none.d-md-block {
        display: none !important;
    }
}

/* ── Utility: full-width buttons on small screens ───────────── */
@media (max-width: 480px) {
    .btn-block-mobile {
        width: 100% !important;
        display: block !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   DARK MODE  –  [data-theme="dark"]
   Applied to <html> by JS in top-navbar.php
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --bg-navbar: #1e293b;
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --input-bg: #0f172a;
    --input-text: #f1f5f9;
    --table-stripe: #1e293b;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ── Body & Root ─────────────────────────────────────────────── */
[data-theme="dark"] body {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

/* ── Sidebar ─────────────────────────────────────────────────── */
[data-theme="dark"] .sidebar {
    background: var(--bg-sidebar) !important;
    border-right: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .sidebar a,
[data-theme="dark"] .sidebar .nav-link {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .sidebar .nav-link:hover,
[data-theme="dark"] .sidebar .nav-link.active {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .sidebar-brand {
    border-bottom: 1px solid var(--border-color) !important;
}

/* ── Top Navbar ──────────────────────────────────────────────── */
[data-theme="dark"] .top-navbar {
    background: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .top-navbar .btn-light {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: transparent !important;
}

[data-theme="dark"] .top-navbar .form-control {
    background: #0f172a !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .top-navbar .input-group-text {
    background: #0f172a !important;
    border-color: var(--border-color) !important;
}

/* ── Cards ───────────────────────────────────────────────────── */
[data-theme="dark"] .card,
[data-theme="dark"] .form-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--border-color) !important;
}

/* ── Tables ──────────────────────────────────────────────────── */
[data-theme="dark"] .table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table thead th {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08) !important;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .bg-light {
    background: #334155 !important;
}

/* ── Forms & Inputs ──────────────────────────────────────────── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

/* ── Dropdowns ───────────────────────────────────────────────── */
[data-theme="dark"] .dropdown-menu {
    background: #1e293b !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dropdown-item {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-color) !important;
}

/* ── Alerts & Badges ──────────────────────────────────────────── */
[data-theme="dark"] .alert-success {
    background: #14532d !important;
    color: #bbf7d0 !important;
    border-color: #166534 !important;
}

[data-theme="dark"] .alert-danger {
    background: #7f1d1d !important;
    color: #fecaca !important;
    border-color: #991b1b !important;
}

[data-theme="dark"] .alert-info {
    background: #1e3a5f !important;
    color: #bae6fd !important;
    border-color: #1e40af !important;
}

[data-theme="dark"] .alert-warning {
    background: #78350f !important;
    color: #fef3c7 !important;
    border-color: #92400e !important;
}

/* ── Modals ──────────────────────────────────────────────────── */
[data-theme="dark"] .modal-content {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color) !important;
}

/* ── Misc ────────────────────────────────────────────────────── */
[data-theme="dark"] .border-bottom {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .btn-light {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .list-group-item {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .form-wrapper {
    background: var(--bg-card) !important;
}

/* =====================================================================
   PRODUCTION RESPONSIVE PATCH - Final Hardening Layer
   ===================================================================== */

/* 1. Table horizontal scroll on ALL pages */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.table-responsive .table th,
.table-responsive .table td {
    white-space: nowrap;
    /* Prevent ugly column squishing */
}

@media (max-width: 767px) {

    .card-body table,
    .main-wrapper table {
        overflow-x: auto;
        display: block;
        max-width: 100%;
    }

    .table td,
    .table th {
        font-size: 0.82rem;
        padding: 0.6rem 0.5rem;
    }

    .table-responsive {
        border-radius: 8px;
    }
}

/* 2. Login Page Mobile Improvements */
@media (max-width: 599px) {
    .right-panel {
        padding: 1.25rem 1rem !important;
        padding-top: 5rem !important;
        min-height: 100vh;
        align-items: flex-start;
    }

    .right-panel>div {
        max-width: 100% !important;
        width: 100% !important;
    }

    .tab-button {
        font-size: 0.78rem !important;
        padding: 0.5rem 0.25rem !important;
    }
}

/* 3. Subheader Bar Overflow Prevention */
@media (max-width: 767px) {
    .bg-white.border-bottom {
        overflow-x: hidden;
    }
}

/* 4. Touch Targets - 44px minimum on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn-sm {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
    }

    .page-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-check-input {
        width: 1.2em;
        height: 1.2em;
        cursor: pointer;
    }
}

/* 5. Card action buttons wrap gracefully */
.card-header .d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 6. Long words / URLs do not break layout */
.card-body p,
.list-group-item p,
.announcement-card p {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 7. iOS smooth scrolling */
@supports (-webkit-touch-callout: none) {

    .main-wrapper,
    .content-wrapper,
    .sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* 8. Input autofill background - Chrome/Edge light & dark */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    -webkit-text-fill-color: #334155 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 9. Enhanced Print Styles */
@media print {

    .sidebar,
    .sidebar-toggle,
    .sidebar-overlay,
    .top-navbar,
    .d-print-none,
    .floating-btn {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        padding-top: 0 !important;
        width: 100% !important;
    }

    .stat-card,
    .chart-card,
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }

    body {
        background: white !important;
        font-size: 12pt;
    }

    table,
    .card-body table {
        display: table !important;
        width: 100% !important;
        overflow: visible !important;
    }
}