
        /* --- CSS Variables --- */
        :root {
            --bg-body: #f0f2f5;
            --bg-sidebar: #ffffff;
            --primary: #4361ee;
            --primary-dark: #304ffe;
            --primary-light: #eef2ff;
            --text-main: #2c3e50;
            --text-muted: #95a5a6;
            --card-radius: 20px;
            --btn-radius: 14px;
            --sidebar-width: 280px;
            --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 8px 24px rgba(149, 157, 165, 0.1);
            --shadow-lg: 0 15px 35px rgba(149, 157, 165, 0.2);
            --shadow-primary: 0 10px 25px rgba(67, 97, 238, 0.4);
        }

        body {
            font-family: 'Kanit', sans-serif;
            background-color: var(--bg-body);
            margin: 0;
            display: flex;
            height: 100vh;
            overflow: hidden;
            color: var(--text-main);
            position: relative;
        }

        /* Animation Background - ปิดตามค่าระบบ */
        .bg-animation {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: -1;
            pointer-events: none;
        }

        @media print {
            body * {
                visibility: hidden;
            }

            .section.active,
            .section.active * {
                visibility: visible;
            }

            .section.active {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                margin: 0;
                padding: 20px;
                background: white;
            }

            .sidebar,
            .header-bar,
            .floating-shapes,
            .ledger-toolbar,
            #ledgerMatSelect,
            .btn,
            button,
            .content-card>h3,
            label {
                display: none !important;
            }

            .print-input {
                border: none !important;
                border-bottom: 1px solid #000 !important;
                background: transparent !important;
                width: auto !important;
                text-align: left !important;
            }

            table {
                width: 100% !important;
                border-collapse: collapse !important;
            }

            th,
            td {
                border: 1px solid #000 !important;
                color: #000 !important;
            }
        }

        /* --- Material Ledger Report (ทะเบียนคุมบัญชีวัสดุ) --- */
        .ledger-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: flex-end;
            justify-content: space-between;
            margin-bottom: 18px;
        }

        .ledger-toolbar .ledger-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            align-items: flex-end;
            flex: 1;
        }

        .ledger-toolbar .ledger-actions {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .ledger-sheet {
            background: white;
            border-radius: var(--card-radius);
            padding: 18px;
            border: 1px solid #eef2f7;
        }

        .ledger-title {
            text-align: center;
            font-size: 20px;
            font-weight: 700;
            margin: 6px 0 14px 0;
        }

        .ledger-meta-grid {
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            gap: 10px 14px;
            margin-bottom: 12px;
            font-size: 14px;
        }

        .ledger-meta-item {
            grid-column: span 6;
            display: flex;
            gap: 10px;
            align-items: baseline;
            flex-wrap: wrap;
        }

        .ledger-meta-item.full {
            grid-column: span 12;
        }

        .ledger-line-input {
            border: none;
            border-bottom: 1px dotted #111;
            outline: none;
            padding: 2px 4px;
            font-family: 'Kanit', sans-serif;
            font-size: 14px;
            min-width: 120px;
            flex: 1;
            background: transparent;
        }

        .ledger-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 900px;
        }

        .ledger-table th,
        .ledger-table td {
            border: 1px solid #111;
            padding: 8px 8px;
            font-size: 13px;
            vertical-align: middle;
            background: #fff;
        }

        .ledger-table thead th {
            background: #f8fafc;
            text-align: center;
            font-weight: 700;
        }

        .ledger-table td.num {
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

        .ledger-table td.center {
            text-align: center;
        }

        .ledger-summary {
            margin-top: 10px;
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            flex-wrap: wrap;
            color: #334155;
            font-size: 13px;
        }

        .ledger-summary .pill {
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: 6px 10px;
            border-radius: 999px;
        }

        @media (prefers-reduced-motion: reduce) {
            .floating-item {
                animation: none !important;
            }
        }

        .floating-item {
            position: absolute;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            color: var(--primary);
            opacity: 0.08;
            font-size: 24px;
            bottom: -100px;
            animation: floatUp linear infinite;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        .floating-item:nth-child(1) {
            left: 5%;
            width: 60px;
            height: 60px;
            font-size: 30px;
            animation-duration: 15s;
            animation-delay: 0s;
        }

        .floating-item:nth-child(2) {
            left: 15%;
            width: 40px;
            height: 40px;
            font-size: 20px;
            animation-duration: 25s;
            animation-delay: 2s;
        }

        .floating-item:nth-child(3) {
            left: 25%;
            animation-duration: 18s;
            animation-delay: 5s;
        }

        .floating-item:nth-child(4) {
            left: 35%;
            width: 55px;
            height: 55px;
            font-size: 28px;
            animation-duration: 22s;
            animation-delay: 1s;
        }

        .floating-item:nth-child(5) {
            left: 45%;
            animation-duration: 30s;
            animation-delay: 7s;
        }

        .floating-item:nth-child(6) {
            left: 55%;
            width: 45px;
            height: 45px;
            animation-duration: 19s;
            animation-delay: 3s;
        }

        .floating-item:nth-child(7) {
            left: 65%;
            animation-duration: 24s;
            animation-delay: 6s;
        }

        .floating-item:nth-child(8) {
            left: 75%;
            width: 70px;
            height: 70px;
            font-size: 35px;
            animation-duration: 20s;
            animation-delay: 0s;
        }

        .floating-item:nth-child(9) {
            left: 85%;
            animation-duration: 28s;
            animation-delay: 4s;
        }

        .floating-item:nth-child(10) {
            left: 95%;
            width: 50px;
            height: 50px;
            animation-duration: 16s;
            animation-delay: 2s;
        }

        @keyframes floatUp {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 0;
            }

            20% {
                opacity: 0.15;
            }

            80% {
                opacity: 0.15;
            }

            100% {
                transform: translateY(-120vh) rotate(360deg);
                opacity: 0;
            }
        }

        /* Sidebar & Layout */
        .overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1040;
            display: none;
            opacity: 0;
            transition: all 0.3s;
            backdrop-filter: blur(4px);
        }

        .overlay.active {
            display: block;
            opacity: 1;
        }

        .sidebar {
            width: var(--sidebar-width);
            background: var(--bg-sidebar);
            display: flex;
            flex-direction: column;
            padding: 25px 15px;
            border-right: 1px solid rgba(0, 0, 0, 0.04);
            z-index: 1050;
            position: fixed;
            height: 100%;
            left: 0;
            top: 0;
            transform: translateX(-100%);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-md);
        }

        @media (min-width: 992px) {
            .sidebar {
                transform: translateX(0);
            }

            body.menu-collapsed .sidebar {
                transform: translateX(-100%);
            }

            .main-content {
                margin-left: var(--sidebar-width);
                width: calc(100% - var(--sidebar-width));
            }
        }

        @media (max-width: 991px) {
            .sidebar.active {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
                width: 100%;
                padding: 15px !important;
            }

            .header-bar {
                padding: 15px !important;
                flex-wrap: wrap;
                gap: 10px;
            }

            .branding-container {
                flex: 1;
                overflow: hidden;
            }

            .app-logo {
                width: 80px;
                height: auto;
            }

            .sub-dept-title {
                display: none;
            }

            .main-app-title {
                font-size: 18px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .current-page-title {
                width: 100%;
                text-align: left;
                margin-top: 10px;
                border-top: 1px solid #eee;
                padding-top: 10px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 12px;
            }

            .current-page-title h2 {
                text-align: left;
                font-size: 16px;
                margin-right: 10px;
            }

            .toggle-btn {
                min-width: 45px;
                z-index: 1001;
            }
        }

        .menu-item {
            padding: 14px 18px;
            border-radius: var(--btn-radius);
            cursor: pointer;
            color: var(--text-muted);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 15px;
            transition: all 0.2s;
            margin-bottom: 8px;
            font-size: 15px;
        }

        .menu-item:hover {
            background-color: var(--primary-light);
            color: var(--primary);
            transform: translateX(5px);
        }

        .menu-item.active {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            box-shadow: var(--shadow-primary);
        }

        .main-content {
            padding: 25px 30px;
            overflow-y: auto;
            scroll-behavior: smooth;
            transition: margin-left 0.3s;
        }

        .header-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 35px;
            padding: 20px 25px;
            background: white;
            border-radius: var(--card-radius);
            box-shadow: var(--shadow-sm);
            position: sticky;
            top: 0;
            z-index: 80;
            transition: all 0.3s;
        }

        .header-bar.sticky-shadow {
            box-shadow: var(--shadow-lg);
        }

        .header-left-section {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .toggle-btn {
            font-size: 20px;
            color: var(--primary);
            cursor: pointer;
            background: var(--primary-light);
            width: 45px;
            height: 45px;
            border-radius: 12px;
            display: flex;
            justify-content: center;
            align-items: center;
            border: none;
            transition: all 0.2s;
        }

        .toggle-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
        }

        .branding-container {
            display: flex;
            align-items: center;
            gap: 25px;
        }

        .app-logo {
            width: 120px;
            height: auto;
            transition: transform 0.3s;
        }

        .app-logo:hover {
            transform: rotate(-2deg) scale(1.05);
        }

        .main-app-title {
            margin: 0;
            font-size: 22px;
            font-weight: 700;
            color: var(--primary);
            background: linear-gradient(90deg, var(--primary), var(--primary-dark));
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .sub-dept-title {
            margin: 4px 0 0 0;
            font-size: 12px;
            color: #95a5a6;
        }

        .current-page-title {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .current-page-title h2 {
            margin: 0;
            font-size: 18px;
            color: var(--text-muted);
            font-weight: 500;
        }

        .header-right-tools {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .visit-counter-btn {
            position: relative;
            width: 44px;
            height: 44px;
            border: none;
            border-radius: 12px;
            background: linear-gradient(135deg, #e6f4ff 0%, #f1f8ff 100%);
            color: #1864ab;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(24, 100, 171, 0.18);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            font-size: 16px;
        }

        .visit-counter-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 18px rgba(24, 100, 171, 0.22);
        }

        .visit-counter-badge {
            position: absolute;
            top: -7px;
            right: -8px;
            min-width: 22px;
            height: 22px;
            padding: 0 6px;
            border-radius: 999px;
            background: #e03131;
            color: #fff;
            font-size: 11px;
            line-height: 22px;
            font-weight: 700;
            box-shadow: 0 4px 12px rgba(224, 49, 49, 0.35);
            text-align: center;
        }

        /* --- Dashboard & Content --- */
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 25px;
        }

        .year-selector-wrapper {
            position: relative;
        }

        .year-select {
            padding: 10px 20px;
            border-radius: 30px;
            border: 2px solid #eef2ff;
            font-family: 'Kanit';
            font-size: 15px;
            font-weight: 600;
            color: var(--primary);
            background: white;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            transition: all 0.3s;
            outline: none;
            appearance: none;
            padding-right: 40px;
        }

        .year-select:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .year-icon {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--primary);
            pointer-events: none;
        }

        .base-card {
            background: white;
            border-radius: var(--card-radius);
            padding: 25px;
            box-shadow: var(--shadow-md);
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            border: 1px solid rgba(255, 255, 255, 0.6);
        }

        .content-card {
            background: white;
            border-radius: var(--card-radius);
            padding: 25px;
            box-shadow: var(--shadow-md);
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            border: 1px solid rgba(255, 255, 255, 0.6);
        }

        .content-card:hover,
        .chart-box:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-lg);
        }

        .stats-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 25px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: white;
            border-radius: 24px;
            box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            color: white;
            position: relative;
            overflow: hidden;
            padding: 25px;
        }

        .stat-card:hover {
            transform: translateY(-10px) scale(1.03);
            box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
        }

        .stat-card i {
            position: absolute;
            right: -15px;
            bottom: -15px;
            font-size: 90px;
            opacity: 0.15;
            transform: rotate(-15deg);
            transition: all 0.3s;
        }

        .stat-card:hover i {
            transform: rotate(0deg) scale(1.1);
            opacity: 0.25;
        }

        .bg-blue {
            background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
        }

        .bg-teal {
            background: linear-gradient(135deg, #06d6a0 0%, #05b286 100%);
        }

        .bg-purple {
            background: linear-gradient(135deg, #7209b7 0%, #560bad 100%);
        }

        .bg-orange {
            background: linear-gradient(135deg, #f72585 0%, #e31b6d 100%);
        }

        .stat-label {
            font-size: 15px;
            font-weight: 300;
            opacity: 0.9;
        }

        .stat-val {
            font-size: 38px;
            font-weight: 700;
            margin-top: 10px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .charts-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 25px;
            margin-bottom: 30px;
        }

        @media (min-width: 992px) {
            .charts-grid {
                grid-template-columns: 2fr 1fr;
            }
        }

        .chart-box {
            background: white;
            border-radius: 24px;
            box-shadow: var(--shadow-md);
            padding: 30px;
            transition: all 0.3s;
        }

        /* Tables & Forms */
        .table-responsive {
            overflow-x: auto;
            border-radius: var(--card-radius);
        }

        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            min-width: 700px;
        }

        th {
            text-align: left;
            padding: 18px 15px;
            color: var(--text-muted);
            font-size: 14px;
            font-weight: 600;
            background: #f8f9fa;
            border-bottom: 2px solid #edf2f7;
        }

        td {
            padding: 18px 15px;
            background: #fff;
            border-bottom: 1px solid #edf2f7;
            font-size: 15px;
            transition: background 0.2s;
        }

        tr:hover td {
            background: #f8faff;
        }

        .action-btn-group {
            display: flex;
            gap: 10px;
        }

        .btn-icon {
            padding: 0;
            font-size: 15px;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .btn-icon:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .btn-edit {
            background: #fff8e1;
            color: #f59f00;
        }

        .btn-delete {
            background: #ffe3e3;
            color: #e03131;
        }

        .btn {
            padding: 14px;
            border-radius: var(--btn-radius);
            border: none;
            cursor: pointer;
            font-family: 'Kanit';
            font-weight: 600;
            font-size: 16px;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: all 0.3s;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            color: white;
            box-shadow: var(--shadow-primary);
        }

        .form-control {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid #edf2f7;
            border-radius: 12px;
            font-family: 'Kanit';
            font-size: 15px;
            box-sizing: border-box;
            background: #ffffff;
            margin-bottom: 20px;
            transition: all 0.3s;
        }

        .form-control:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 4px var(--primary-light);
            transform: translateY(-2px);
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-size: 15px;
            font-weight: 500;
        }

        .form-grid {
            max-width: 550px;
            margin: 20px auto;
        }

        .section {
            display: none;
        }

        .section.active {
            display: block;
            animation: slideUp 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        #loading {
            position: fixed;
            inset: 0;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(5px);
            z-index: 999;
            display: none;
            justify-content: center;
            align-items: center;
        }

        .loader {
            width: 50px;
            height: 50px;
            border: 5px solid var(--primary-light);
            border-top: 5px solid var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            box-shadow: var(--shadow-lg);
        }

        @keyframes spin {
            100% {
                transform: rotate(360deg);
            }
        }

        div:where(.swal2-container) {
            font-family: 'Kanit', sans-serif !important;
        }

        div:where(.swal2-container) .swal2-popup {
            width: 95% !important;
            max-width: 650px;
            padding: 15px !important;
            border-radius: 24px;
            box-shadow: var(--shadow-lg);
        }

        .swal2-html-container {
            margin: 10px 0 !important;
        }

        /* --- Modern Edit Modal & Manual Styles --- */
        .edit-modal-wrapper {
            text-align: left;
            padding: 0 10px;
        }

        .id-badge-container {
            background: #f8f9fa;
            border: 1px dashed #cbd5e1;
            border-radius: 12px;
            padding: 12px 15px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--text-muted);
        }

        .id-badge-icon {
            background: #eef2ff;
            color: var(--primary);
            width: 35px;
            height: 35px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }

        .id-text {
            font-family: 'Courier New', monospace;
            font-weight: 700;
            font-size: 18px;
            color: var(--primary-dark);
            letter-spacing: 1px;
        }

        .modern-form-group {
            margin-bottom: 18px;
        }

        .modern-label {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-main);
            margin-bottom: 6px;
            display: block;
        }

        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .input-icon {
            position: absolute;
            left: 15px;
            color: #94a3b8;
            font-size: 16px;
            pointer-events: none;
            transition: color 0.3s;
        }

        .modern-input-field {
            width: 100%;
            padding: 12px 15px 12px 45px;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            font-family: 'Kanit', sans-serif;
            font-size: 15px;
            color: #334155;
            transition: all 0.2s;
            background: #fff;
            box-sizing: border-box;
        }

        .modern-input-field:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px var(--primary-light);
            outline: none;
        }

        .modern-input-field:focus+.input-icon,
        .input-wrapper:focus-within .input-icon {
            color: var(--primary);
        }

        .row-split {
            display: flex;
            gap: 15px;
        }

        .col-half {
            flex: 1;
        }

        .manual-list {
            text-align: left;
            padding: 0 5px;
            max-height: 400px;
            overflow-y: auto;
        }

        .manual-item {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #f0f0f0;
        }

        .manual-item:last-child {
            border-bottom: none;
        }

        .manual-icon {
            width: 45px;
            height: 45px;
            background: var(--primary-light);
            color: var(--primary);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
        }

        .manual-content h4 {
            margin: 0 0 5px 0;
            font-size: 16px;
            color: var(--text-main);
        }

        .manual-content p {
            margin: 0;
            font-size: 14px;
            color: var(--text-muted);
            line-height: 1.5;
        }
    

        /* --- Mobile Responsive Enhancements --- */
        @media (max-width: 767px) {

            /* 1. Stack Form Elements */
            .row-split {
                flex-direction: column;
                gap: 0;
            }

            .col-half {
                margin-bottom: 15px;
            }

            /* 2. Compact Spacing */
            .main-content {
                padding: 15px 10px;
            }

            .content-card,
            .base-card {
                padding: 15px;
            }

            .form-grid {
                margin: 5px auto;
            }

            /* 3. Table Adjustments */
            th,
            td {
                padding: 10px 8px;
                font-size: 13px;
                white-space: nowrap;
                /* Prevent wrap causing messy rows, let scroll handle it */
            }

            .btn-icon {
                width: 30px;
                height: 30px;
                font-size: 12px;
            }

            .action-btn-group {
                gap: 5px;
            }

            /* 4. Stat Cards */
            .stats-container {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .stat-card {
                padding: 20px;
            }

            .stat-val {
                font-size: 28px;
            }

            /* 5. Header Adjustments */
            .header-bar {
                margin-bottom: 20px;
            }

            .main-app-title {
                font-size: 18px;
            }

            /* 6. Modal Adjustments */
            div:where(.swal2-container) .swal2-popup {
                padding: 10px !important;
            }

            .edit-modal-wrapper {
                padding: 0;
            }
        }
    

        /* --- Improved Mobile Responsive Styles (Overrides) --- */
        @media (max-width: 767px) {
            .header-bar {
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 15px !important;
            }

            .header-left-section {
                width: 100%;
            }

            .branding-container {
                width: 100%;
                display: flex;
                align-items: center;
            }

            .titles-container {
                flex: 1;
                min-width: 0;
            }

            .main-app-title {
                font-size: 16px !important;
                white-space: normal !important;
                word-wrap: break-word;
            }

            .sub-dept-title {
                display: none !important;
            }

            .app-logo {
                width: 45px !important;
            }

            .current-page-title {
                width: 100%;
                justify-content: space-between;
            }

            .visit-counter-btn {
                width: 40px;
                height: 40px;
            }
        }
    

        /* --- Print Styles --- */
        @media print {
            @page {
                size: A4;
                margin: 10mm;
            }

            body {
                background: white !important;
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
                height: auto !important;
                overflow: visible !important;
            }

            /* Hide UI Elements */
            .sidebar,
            .header-bar,
            .bg-animation,
            .floating-item,
            .toggle-btn,
            .year-selector-wrapper,
            .overlay,
            #loading,
            .btn,
            .ledger-toolbar,
            .action-btn-group,
            .content-card>h3 {
                display: none !important;
            }

            /* Main Layout Adjustments */
            .main-content {
                margin: 0 !important;
                padding: 0 !important;
                width: 100% !important;
                border: none !important;
            }

            .section {
                padding: 0 !important;
                display: none !important;
            }

            .section.active {
                display: block !important;
            }

            .content-card,
            .base-card {
                box-shadow: none !important;
                border: none !important;
                padding: 0 !important;
                background: white !important;
            }

            /* Table Styles for Print */
            .table-responsive {
                overflow: visible !important;
                border: none !important;
                box-shadow: none !important;
                border-radius: 0 !important;
            }

            table {
                width: 100% !important;
                border: 2px solid #000 !important;
                border-collapse: collapse !important;
                margin: 0 !important;
                background: white !important;
            }

            th,
            td {
                border: 1px solid #000 !important;
                color: #000 !important;
                padding: 8px !important;
                font-size: 12px !important;
                vertical-align: middle !important;
            }

            th {
                background: #f0f0f0 !important;
                font-weight: 600 !important;
                text-align: center !important;
                font-weight: bold !important;
            }

            /* Ensure background colors print */
            tr,
            td,
            th {
                background-color: white !important;
            }
        }
    
