@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Tema Lalai: Hijau KKL (Teal / Medical Green) */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #f0fdfa;
    --primary-alpha: rgba(13, 148, 136, 0.15);
    
    --accent: #10b981;
    --accent-hover: #059669;
    
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --card-hover: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --border-focus: #0d9488;
    
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active-bg: rgba(13, 148, 136, 0.2);
    --sidebar-active-text: #38bdf8;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    
    --topbar-bg: rgba(255, 255, 255, 0.85);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.2);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tema Biru */
[data-theme="biru"] {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-alpha: rgba(37, 99, 235, 0.15);
    --border-focus: #2563eb;
    --sidebar-active-bg: rgba(37, 99, 235, 0.25);
    --sidebar-active-text: #60a5fa;
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);
}

/* Tema Ungu */
[data-theme="ungu"] {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #f5f3ff;
    --primary-alpha: rgba(124, 58, 237, 0.15);
    --border-focus: #7c3aed;
    --sidebar-active-bg: rgba(124, 58, 237, 0.25);
    --sidebar-active-text: #c084fc;
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.2);
}

/* Tema Gelap (Dark Mode) */
[data-theme="gelap"] {
    --bg-page: #0b0f19;
    --card-bg: #111827;
    --card-hover: #1f2937;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --border: #1f2937;
    --topbar-bg: rgba(17, 24, 39, 0.85);
    --primary: #38bdf8;
    --primary-hover: #0284c7;
    --primary-light: rgba(56, 189, 248, 0.1);
    --primary-alpha: rgba(56, 189, 248, 0.15);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    font-size: 14px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ── LAYOUT STRUKTUR (Non-active for AdminLTE transition) ───────── */
.old-layout .app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* Sidebar Sisi */
.old-layout .sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    transition: var(--transition);
}

.old-layout .sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

.old-layout .sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.old-layout .sidebar-logo-text h2 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.old-layout .sidebar-logo-text span {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.old-layout .sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.old-layout .nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 12px 6px;
}

.old-layout .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--sidebar-text);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 13.5px;
    transition: var(--transition);
    position: relative;
}

.old-layout .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(4px);
}

.old-layout .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.old-layout .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: var(--sidebar-active-text);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px var(--sidebar-active-text);
}

.old-layout .nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.old-layout .sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.15);
}

/* Main Wrapper */
.old-layout .main-wrapper {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100vw - 260px);
}

/* Topbar Atas */
.old-layout .topbar {
    height: 68px;
    background: var(--topbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.old-layout .topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.old-layout .page-title h1 {
    font-size: 20px;
    margin: 0;
}

.old-layout .topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.old-layout .user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--primary-light);
    border-radius: 30px;
    border: 1px solid var(--border);
}

.old-layout .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.old-layout .user-info {
    display: flex;
    flex-direction: column;
}

.old-layout .user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.2;
}

.old-layout .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Content Area */
.old-layout .content {
    flex: 1;
    padding: 28px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}


/* ── KAD & KOMPONEN ────────────────────────────────────────────── */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid Statistik */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--primary);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: #dcfce7; color: #16a34a; }
.stat-icon.warning { background: #fef9c3; color: #ca8a04; }
.stat-icon.danger  { background: #fee2e2; color: #dc2626; }
.stat-icon.purple  { background: #f3e8ff; color: #9333ea; }

.stat-details h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

.stat-details p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 0;
    font-weight: 500;
}

/* ── BUTANG (BUTTONS) ──────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-alpha);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    color: #fff;
    box-shadow: 0 6px 16px var(--primary-alpha);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-success {
    background: #10b981;
    color: #fff;
}
.btn-success:hover { background: #059669; color: #fff; }

.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ── BORANG (FORMS) ────────────────────────────────────────────── */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-main);
    background: var(--card-bg);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* ── JADUAL (TABLES) ───────────────────────────────────────────── */

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

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: var(--bg-page);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child  { border-top-right-radius: var(--radius); }

.table td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

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

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

.table tbody tr:hover {
    background: var(--primary-light);
}

/* ── LENCANA (BADGES) ──────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-purple  { background: #f3e8ff; color: #7e22ce; }

/* ── ALERT MAKLUMAN ────────────────────────────────────────────── */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

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

/* ── DIARI GRID SPESIFIK ───────────────────────────────────────── */

.slot-grid {
    display: grid;
    grid-template-columns: 85px 1fr;
    border-bottom: 1px solid var(--border);
    min-height: 54px;
    transition: var(--transition);
}

.slot-grid:hover {
    background: var(--primary-light);
}

.slot-time {
    padding: 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.015);
}

.slot-content {
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.apt-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.apt-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.apt-card.hadir {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.apt-card.belum {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

/* ── MODAL ─────────────────────────────────────────────────────── */

.custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1050; /* Above AdminLTE layers */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.custom-modal-backdrop.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.custom-modal-dialog {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    transform: scale(0.95);
    transition: var(--transition);
    pointer-events: auto !important; /* Force enable click events */
}

.custom-modal-backdrop.active .custom-modal-dialog {
    transform: scale(1);
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-page);
}

/* ── RESPONSIVE / MOBILE-FIRST ─────────────────────────────────── */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    transition: var(--transition);
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    background: var(--primary-alpha);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 45;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* Mobile Bottom Tab Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    z-index: 60;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    padding: 0 4px;
    align-items: stretch;
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 2px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.mobile-bottom-nav a:hover,
.mobile-bottom-nav button:hover {
    color: var(--primary);
    background: var(--primary-alpha);
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a.active-tab {
    color: var(--primary);
}

.mobile-bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav .nav-tab-icon {
    font-size: 18px;
    line-height: 1;
}

/* ── TABLET (≤ 1024px) ─────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 50;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.3);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100vw;
    }

    .hamburger-btn {
        display: flex;
    }

    .topbar {
        padding: 0 16px;
        height: 58px;
    }

    .page-title h1 {
        font-size: 16px;
    }

    .content {
        padding: 16px;
    }

    /* Hide date text in topbar on tablet */
    .topbar-date-text {
        display: none;
    }
}

/* ── MOBILE (≤ 640px) ──────────────────────────────────── */
@media (max-width: 640px) {
    .topbar {
        padding: 0 12px;
        height: 54px;
    }

    .page-title h1 {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }

    /* Compact user profile — icon only */
    .user-info {
        display: none;
    }

    .user-profile {
        padding: 4px;
        border-radius: 50%;
    }

    /* Bottom nav bar shows on mobile */
    .mobile-bottom-nav {
        display: flex;
    }

    /* Push content above bottom nav */
    .content {
        padding: 12px 10px 76px;
    }

    /* Hide desktop sidebar scroll on mobile — bottom nav replaces it */
    .main-wrapper {
        padding-bottom: 0;
    }

    /* Cards — reduce padding */
    .card {
        border-radius: var(--radius-sm);
    }

    /* Stat grid: 2 cols on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Tables — allow horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Forms — full width inputs */
    .form-control,
    .form-group select,
    .form-group input {
        font-size: 16px; /* Prevents iOS zoom */
    }

    /* Buttons compact */
    .btn {
        padding: 7px 12px;
        font-size: 12.5px;
    }

    /* Modal: full screen on mobile */
    .custom-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .custom-modal-dialog {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
    }

    /* 3-col → 1 col */
    .layout-3col {
        grid-template-columns: 1fr !important;
    }

    /* 2-col → 1 col */
    .layout-2col {
        grid-template-columns: 1fr !important;
    }

    /* Alerts */
    .alert {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Hide topbar date */
    .topbar-right > div:first-child {
        display: none;
    }
}

.table-success-soft {
    background-color: rgba(40, 167, 69, 0.08) !important;
}

/* ── PRINTING STYLES (A4 PORTRAIT) ────────────────────────────── */
.print-area {
    display: none;
}

@media print {
    /* Hide all screen layout wrappers and sidebar elements */
    .d-print-none,
    .main-header,
    .main-sidebar,
    .main-footer,
    .content-header,
    .bottom-nav,
    .sidebar-overlay {
        display: none !important;
    }

    /* Position the print area absolutely at the top-left to bypass layout offsets */
    .print-area {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    /* Reset wrapper layouts to ensure no scrollbars or offsets */
    .wrapper,
    .content-wrapper,
    .content,
    .container-fluid,
    body,
    html {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Set up A4 page properties */
    @page {
        size: A4 portrait !important;
        margin: 1.2cm 1.2cm 1.2cm 1.2cm !important;
    }

    /* Force background colors and colors to print */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Print Table Styles */
    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-top: 12px !important;
        font-size: 8.5pt !important;
    }

    .print-table th, .print-table td {
        border: 1px solid #000000 !important;
        padding: 6px 8px !important;
        text-align: left;
        vertical-align: middle;
    }

    .print-table th {
        background-color: #f2f2f2 !important;
        font-weight: bold !important;
        text-align: center;
    }

    .print-patient-name {
        font-weight: bold !important;
        color: #000000 !important;
    }

    .print-header {
        text-align: center !important;
        margin-bottom: 18px !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 8px !important;
    }

    .print-title {
        font-size: 15pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        margin-bottom: 2px !important;
    }

    .print-subtitle {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin-bottom: 6px !important;
    }

    .print-meta {
        font-size: 8.5pt !important;
        color: #333333 !important;
    }

    .print-footer {
        margin-top: 20px !important;
        font-size: 7.5pt !important;
        text-align: right !important;
        color: #555555 !important;
        border-top: 1px dashed #aaaaaa !important;
        padding-top: 6px !important;
    }

    .print-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}
