/* ============================================================
   NARVÉL — COURSE SPACE DESIGN SYSTEM
   Learn. Do. Grow.
   ============================================================ */

:root {
    --sat:           env(safe-area-inset-top, 0px);
    --sar:           env(safe-area-inset-right, 0px);
    --sab:           env(safe-area-inset-bottom, 0px);
    --sal:           env(safe-area-inset-left, 0px);
    --primary:       #081A30;   /* Midnight Navy */
    --primary-light: #126BEE;   /* Electric Blue */
    --primary-dark:  #05101E;   /* Deep Midnight */
    --accent:        #126BEE;   /* Electric Blue */
    --accent-light:  #35CDE8;   /* Cyan Accent */
    --success:       #10b981;
    --danger:        #ef4444;
    --warning:       #f59e0b;
    --info:          #35CDE8;
    --bg:            #F4F7FB;   /* Soft White */
    --card-bg:       #ffffff;
    --text-main:     #081A30;   /* Midnight Navy Text */
    --text-muted:    #64748B;   /* Neutral Gray */
    --border-color:  #E2E8F0;   /* Subtle Border */
    --sidebar-w:     240px;
}

/* ===================== GLOBAL RESPONSIVE SCALING (100% CHROME ZOOM FRIENDLY) ===================== */
html {
    font-size: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

@media (min-width: 1600px) {
    html { font-size: 14.5px; }
}

@media (max-width: 480px) {
    html { font-size: 13.5px; }
}

/* ===================== LOGIN PAGE ===================== */
.login-wrapper {
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    background: #f1f5f9;
}

.login-left {
    background: linear-gradient(150deg, #07192c 0%, #0f2942 35%, #1e3a8a 70%, #172554 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
    text-align: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.login-logo {
    width: 80px; height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
    position: relative; z-index: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.login-university { font-size: .88rem; font-weight: 800; letter-spacing: .05em; color: #ffffff; }
.login-faculty    { font-size: .78rem; opacity: .9; margin-top: .2rem; font-weight: 600; color: #e2e8f0; }
.login-prodi      { font-size: .72rem; opacity: .8; font-weight: 600; color: #cbd5e1; }

.login-divider {
    width: 44px; height: 3px;
    background: var(--accent);
    margin: 1.15rem 0;
    border-radius: 2px;
}

.login-app-name { font-size: 1.05rem; font-weight: 800; color: var(--accent-light); text-transform: uppercase; letter-spacing: .04em; }
.login-course   { font-size: .84rem; margin-top: .25rem; color: #ffffff; font-weight: 600; }
.login-meta     { font-size: .74rem; opacity: .85; margin-top: .2rem; color: #cbd5e1; }

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.75rem;
    background: radial-gradient(circle at 85% 15%, rgba(219, 234, 254, 0.6) 0%, transparent 45%),
                radial-gradient(circle at 15% 85%, rgba(226, 232, 240, 0.7) 0%, transparent 50%),
                linear-gradient(145deg, #f8fafc 0%, #edf2f7 50%, #e2e8f0 100%);
    position: relative;
}

.login-form-box {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 16px;
    padding: 1.65rem 1.65rem;
    box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.1),
                0 4px 14px -2px rgba(15, 23, 42, 0.04),
                0 0 0 1px rgba(226, 232, 240, 0.9);
    position: relative;
    z-index: 2;
}

.login-form-box .form-control {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.52rem 0.8rem;
    font-size: 0.85rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.login-form-box .form-control:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.login-form-box .form-label {
    font-weight: 700;
    font-size: 0.8rem;
    color: #334155;
    margin-bottom: 0.3rem;
}

.login-form-title {
    font-size: 1.38rem;
    font-weight: 800;
    color: #1e1b4b;
    margin: 0 0 .25rem 0;
    letter-spacing: -0.02em;
}

.login-form-subtitle {
    font-size: .8rem;
    color: #64748b;
    margin-bottom: 1.15rem;
    line-height: 1.4;
}

/* TOGGLE EYE INPUT GROUP */
.input-group-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-toggle .form-control {
    padding-right: 2.5rem;
}

.toggle-eye-btn {
    position: absolute;
    right: .55rem;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: .25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color .15s;
}

.toggle-eye-btn:hover {
    color: var(--primary);
}

@media (max-width: 900px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }
    .login-left {
        padding: 1.75rem 1.25rem;
    }
    .login-right {
        padding: 1.5rem 1.25rem;
    }
}

* { 
    box-sizing: border-box; 
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================== SIDEBAR UTAMA ===================== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary);
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .25s ease;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(15, 23, 42, 0.15);
}

.sidebar-brand {
    padding: 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: .85rem;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.sidebar-brand img {
    width: 44px; height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    line-height: 1.25;
}

.sidebar-brand-text .app-name {
    font-size: .78rem;
    font-weight: 800;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.sidebar-brand-text .class-name {
    font-size: .72rem;
    color: #e0e7ff;
    margin-top: 3px;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-nav {
    flex: 1;
    padding: .75rem 0 1.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ffffff rgba(0, 0, 0, 0.3);
}

.sidebar-nav::-webkit-scrollbar {
    width: 7px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    margin: 6px 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    min-height: 45px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.9);
}

.nav-section {
    padding: .65rem 1.1rem .3rem;
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.45);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.1rem;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 500;
    transition: all .15s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,.08);
    color: #ffffff;
}

.nav-item.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.nav-item.active::before {
    display: none;
}

.nav-item .icon {
    width: 19px; height: 19px;
    flex-shrink: 0;
    opacity: .9;
}

.nav-item-danger { color: #fca5a5 !important; }
.nav-item-danger:hover { background: rgba(220,38,38,.25) !important; color: #ffffff !important; }

.sidebar-footer {
    padding: .85rem 1.1rem;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: .74rem;
    color: rgba(255,255,255,.5);
    background: rgba(0,0,0,0.1);
}

/* ===================== MAIN LAYOUT ===================== */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
    touch-action: manipulation;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    box-sizing: border-box;
    padding-top: var(--sat);
    padding-left: var(--sal);
    padding-right: var(--sar);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.layout-wrapper { 
    display: flex; 
    min-height: 100vh; 
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
    position: relative;
}

button, a, input, select, textarea, .btn, .nav-item, .sidebar-link, .topbar-btn, .mobile-nav-item {
    touch-action: manipulation;
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - var(--sidebar-w));
    max-width: calc(100% - var(--sidebar-w));
    box-sizing: border-box;
    position: relative;
    overflow-x: clip;
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 95% 8%, rgba(2, 132, 199, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 5% 92%, rgba(14, 165, 233, 0.06) 0%, transparent 45%),
        linear-gradient(180deg, #edf3fa 0%, #e1ebf5 100%);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── NARVÉL Watermark Ambient Background ── */
.siperkul-watermark-bg {
    position: fixed;
    top: 50%;
    left: calc(50% + (var(--sidebar-w) / 2));
    transform: translate(-50%, -50%) translateZ(0);
    width: min(540px, 48vw);
    height: min(540px, 48vw);
    background-image: url('../images/brand/seraviq-mark.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.045;
    pointer-events: none;
    z-index: 0;
    filter: drop-shadow(0 0 50px rgba(18, 107, 238, 0.12));
    will-change: transform;
}

body.dark-mode .siperkul-watermark-bg {
    opacity: 0.055;
    filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 50px rgba(53, 205, 232, 0.15));
}

@media (max-width: 900px) {
    .siperkul-watermark-bg {
        left: 50%;
        width: min(340px, 78vw);
        height: min(340px, 78vw);
        opacity: 0.038;
    }
}

.page-content {
    position: relative;
    z-index: auto !important;
    flex: 1;
}

.app-content-footer {
    background: #091a2e;
    color: #94a3b8;
    padding: 2.25rem 1.5rem 1.75rem 1.5rem;
    text-align: center;
    font-size: .85rem;
    border-top: 1px solid #133358;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.app-footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.topbar {
    background: linear-gradient(135deg, #ffffff 0%, #f0f6fc 50%, #e0effe 100%);
    border-bottom: 2px solid #93c5fd;
    padding: .85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 18px rgba(12, 35, 64, 0.06);
    backdrop-filter: blur(10px);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0c2340;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .85rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.topbar-user-badge {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #ffffff;
    border: 1.5px solid #bfdbfe;
    padding: .3rem .85rem .3rem .4rem;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.05);
    cursor: default !important;
    user-select: none;
    pointer-events: auto;
}

.topbar-user-badge:hover {
    border-color: #bfdbfe !important;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.05) !important;
}

/* ── Topbar Official UNDHI Campus Badge (HD++ Official Crest) ── */
.topbar-siperkul-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.28rem 0.75rem 0.28rem 0.45rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1.5px solid #93c5fd;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.06);
    text-decoration: none;
    cursor: default;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.topbar-siperkul-badge:hover {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.topbar-siperkul-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
    transition: transform 0.25s ease;
    display: block;
}

.topbar-siperkul-badge:hover .topbar-siperkul-logo {
    transform: scale(1.08);
}

.topbar-siperkul-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    user-select: none;
}

.topbar-siperkul-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: 0.04em;
    line-height: 1.15;
}

.topbar-siperkul-sub {
    font-size: 0.62rem;
    font-weight: 700;
    color: #d97706;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

@media (max-width: 640px) {
    .topbar-siperkul-text {
        display: none;
    }
    .topbar-siperkul-badge {
        padding: 0.25rem 0.35rem;
    }
    .topbar-siperkul-logo {
        height: 28px;
    }
}

.topbar-avatar {
    width: 35px; height: 35px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: .8rem;
    flex-shrink: 0;
    border: 2px solid #2563eb;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.5);
    overflow: hidden;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: .25rem;
    color: #1e3a8a;
}

.page-content { padding: 1.25rem 1.5rem; flex: 1; }

/* ===================== CARDS & CONTAINER ===================== */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(12, 35, 64, 0.05);
}

.card-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: linear-gradient(135deg, #f0f6fc 0%, #e6eff9 100%);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.card-body { padding: 1.15rem 1.25rem; }

/* ===================== STAT CARDS ===================== */
.stat-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.05rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.95rem;
    box-shadow: 0 3px 10px rgba(12, 35, 64, 0.04);
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: #e0f2fe;
    color: #0369a1;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.stat-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 600;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .48rem 1rem;
    border-radius: 8px;
    font-size: .83rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s ease;
    white-space: nowrap;
    line-height: 1.35;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn-submitting {
    opacity: .75 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.btn-primary { 
    background: linear-gradient(135deg, #0c2340 0%, #1e3a8a 100%); 
    color: #ffffff; 
    border-color: #0c2340;
    box-shadow: 0 2px 6px rgba(12, 35, 64, 0.2);
}
.btn-primary:hover { 
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%); 
    color: #ffffff; 
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-accent { 
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); 
    color: #ffffff; 
}
.btn-accent:hover { 
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%); 
    color: #ffffff; 
}

.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover { background: #166534; color: #ffffff; }

.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover { background: #991b1b; color: #ffffff; }

.btn-outline {
    background: #ffffff;
    border: 1.5px solid #c5d7ec;
    color: var(--text-main);
}
.btn-outline:hover { 
    border-color: #0284c7; 
    color: #0284c7; 
    background: #f0f7ff; 
}

.btn-sm { padding: .32rem .7rem; font-size: .76rem; border-radius: 6px; }
.btn-lg { padding: .65rem 1.35rem; font-size: .9rem; font-weight: 700; border-radius: 10px; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: .3rem;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: .5rem .75rem;
    font-size: .84rem;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid #c5d7ec;
    border-radius: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* HIGH CONTRAST READONLY & DISABLED INPUTS */
.readonly-input,
.form-control:disabled,
.form-control[readonly],
input:disabled,
input[readonly] {
    background-color: #eaf0f8 !important;
    border-color: #c5d7ec !important;
    color: #0c1e33 !important;
    opacity: 1 !important;
    font-weight: 800 !important;
    -webkit-text-fill-color: #0c1e33 !important;
    cursor: not-allowed;
}

/* ===================== TABLES ===================== */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
    text-align: left;
}

.table th {
    background: #e4eef8;
    color: #0c2340;
    font-weight: 800;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .75rem .95rem;
    border-bottom: 2px solid #c5d7ec;
}

.table td {
    padding: .75rem .95rem;
    border-bottom: 1px solid #e1ebf5;
    vertical-align: middle;
    color: var(--text-main);
}

.table tbody tr:hover { background: #edf4fc; }

/* Sticky columns */
.table th[style*="position:sticky"],
.table td[style*="position:sticky"] {
    background-color: #ffffff !important;
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0,0,0,0.03);
}

/* ===================== BADGES ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .24rem .55rem;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ===================== ALERTS ===================== */
.alert {
    padding: .8rem 1.1rem;
    border-radius: 6px;
    font-size: .84rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info    { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ===================== ADAPTIVE & ZOOM-RESILIENT GRID SYSTEM ===================== */
.grid-2 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); 
    gap: 1.25rem; 
    width: 100%;
}
.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); 
    gap: 1.25rem; 
    width: 100%;
}
.grid-4 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); 
    gap: 1rem; 
    width: 100%;
}

/* Ensure card elements and flex children gracefully shrink and prevent zoom overflow */
.stat-card,
.card,
.page-content > *,
.dosen-hero-card,
.hero-pertemuan {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.page-header-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.page-header-subtitle {
    font-size: .86rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

/* ===================== DARK MODE DIHAPUS — SELALU MODE TERANG ===================== */
/* Dark mode telah dinonaktifkan. Semua halaman selalu tampil terang & cerah. */

/* ===================== ADVANCED RESPONSIVE SYSTEM (ZOOM & MULTI-DEVICE) ===================== */
.table-responsive,
.card-body:has(> .table),
.card-body:has(> .table-responsive),
.card:has(> .table) {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* ── PC & Layar Lebar Monitor / Zoom Out (≥ 1440px) ── */
@media (min-width: 1440px) {
    .page-content {
        padding: 2rem 2.25rem;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }
}

/* ── Desktop: Topbar user info selalu tampil ── */
.d-sm-flex { display: flex !important; }

/* ────────────────────────────────────────────────────────────
   TABLET BESAR / LAPTOP KECIL / ZOOM IN (≤ 1280px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
    :root { --sidebar-w: 240px; }
    .page-content { padding: 1.5rem 1.25rem; }
}

/* ────────────────────────────────────────────────────────────
   TABLET (≤ 1024px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    :root { --sidebar-w: 220px; }
    .topbar { padding: .75rem 1.25rem; }
}

/* ────────────────────────────────────────────────────────────
   DESKTOP MODE (≥ 901px) — PC, LAPTOP, & CHROME ANDROID "SITUS DESKTOP" (980px)
   ──────────────────────────────────────────────────────────── */
@media (min-width: 901px) {
    .hamburger { display: none !important; }
    .mobile-bottom-nav { display: none !important; }
    .mobile-submenu-drawer { display: none !important; }
    .mobile-submenu-backdrop { display: none !important; }
}

/* ────────────────────────────────────────────────────────────
   🖥️ SITUS DESKTOP FORCED (HP ANDROID CHROME & IOS SAFARI)
   ──────────────────────────────────────────────────────────── */
html.desktop-site-forced {
    min-width: 1200px !important;
    overflow-x: visible !important;
    touch-action: manipulation !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}
html.desktop-site-forced body {
    min-width: 1200px !important;
    width: 100% !important;
    overflow-x: visible !important;
    touch-action: manipulation !important;
}
html.desktop-site-forced .layout-wrapper {
    min-width: 1200px !important;
    width: 100% !important;
    overflow-x: visible !important;
}
html.desktop-site-forced .hamburger { display: none !important; }
html.desktop-site-forced .mobile-bottom-nav { display: none !important; }
html.desktop-site-forced .mobile-submenu-drawer { display: none !important; }
html.desktop-site-forced .mobile-submenu-backdrop { display: none !important; }
html.desktop-site-forced .sidebar-overlay { display: none !important; }
html.desktop-site-forced .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 240px !important;
    transform: none !important;
    display: flex !important;
    box-shadow: none !important;
    z-index: 100 !important;
}
html.desktop-site-forced .main-content {
    margin-left: 240px !important;
    width: calc(100% - 240px) !important;
    max-width: none !important;
    min-width: 960px !important;
}

/* ────────────────────────────────────────────────────────────
   MOBILE & TABLET PORTRAIT (≤ 900px)
   Sidebar masuk ke mode drawer (hidden by default, slide-in)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    /* Sidebar: drawer slide-in */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
        box-shadow: none;
        width: 260px !important; /* Lebar tetap saat drawer terbuka */
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.55);
    }

    /* Overlay gelap saat sidebar terbuka */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    /* Main content full-width tanpa margin sidebar */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Hamburger button tampil prima di seluruh HP Android & iPhone */
    .hamburger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0 !important;
        min-width: 40px !important;
        min-height: 40px !important;
        width: 40px !important;
        height: 40px !important;
        cursor: pointer;
        padding: 0 !important;
        background: #eff6ff !important;
        border: 1.5px solid #bfdbfe !important;
        color: #1e40af !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 5px rgba(37,99,235,0.12) !important;
        touch-action: manipulation;
        transition: all .15s ease;
        z-index: 102 !important;
    }
    .hamburger:hover, .hamburger:active {
        background: #dbeafe !important;
        border-color: #93c5fd !important;
        color: #1d4ed8 !important;
        transform: scale(0.97);
    }

    /* Page content padding lebih kecil */
    .page-content { padding: 1rem 0.9rem; }

    /* Grid adaptif pada layar tablet, zoom laptop & mode desktop site HP */
    .grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem; }
    .grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; }
    .grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }

    /* Topbar */
    .topbar { padding: 0.6rem 0.9rem; gap: .6rem; }
    .topbar-title {
        font-size: 0.92rem;
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Sembunyikan teks nama user di topbar, hanya tampil avatar */
    .d-sm-flex { display: none !important; }
    .topbar-user-badge {
        padding: .28rem .5rem .28rem .28rem;
    }

    /* Sembunyikan teks "Keluar" di topbar, hanya ikon */
    .topbar .btn-danger span { display: none; }
    .topbar .btn-danger {
        padding: .35rem .5rem !important;
        border-radius: 50% !important;
    }

    @media (max-width: 640px) {
        .prayer-btn-text { display: none !important; }
        .btn-prayer-quick { padding: 4px 7px !important; min-width: 36px !important; height: 36px !important; justify-content: center !important; }
        .topbar-title { max-width: 120px !important; font-size: 0.85rem !important; }
    }


}

/* ────────────────────────────────────────────────────────────
   HP  (≤ 768px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Login Page */
    .login-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .login-left { padding: 2rem 1.25rem; }
    .login-right { padding: 1.75rem 1rem; }
    .login-form-box {
        max-width: 100%;
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }

    /* Page Header: tombol full width di bawah judul */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }
    .page-header > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
    }
    .page-header > div:last-child .btn {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
        min-width: 0;
    }
    .page-header-title { font-size: 1.25rem; }
    .page-header-subtitle { font-size: .8rem; }

    /* Cards */
    .card { border-radius: 10px; }
    .card-header {
        padding: .8rem .95rem;
        flex-wrap: wrap;
        gap: .45rem;
    }
    .card-body { 
        padding: 1rem; 
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tabel horizontal scroll */
    .card-body > .table,
    .table { min-width: 560px; }

    /* Stat Cards: auto grid */
    .stat-card {
        padding: 1rem !important;
        gap: .75rem;
    }
    .stat-icon { width: 42px; height: 42px; font-size: 1.15rem; }
    .stat-value { font-size: 1.4rem; }

    /* Forms */
    .form-group { margin-bottom: .85rem; }
    .form-control { font-size: 0.88rem; padding: 0.58rem 0.75rem; }

    /* Alert */
    .alert { font-size: .84rem; padding: .8rem 1rem; }

    /* BMKG Widget compact */
    #bmkgAlertWidget { bottom: 12px !important; right: 12px !important; left: 12px !important; right: 12px !important; }
}

/* ────────────────────────────────────────────────────────────
   HP KECIL / IPHONE SE  (≤ 480px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .page-content { padding: .85rem .75rem; }
    .page-header-title { font-size: 1.1rem; }
    .topbar-title { max-width: 110px; font-size: .82rem; }
    .btn { padding: .42rem .7rem; font-size: .8rem; }
    .stat-value { font-size: 1.25rem !important; }
    .card-header { padding: .7rem .85rem; }
    .card-body { padding: .85rem .75rem; }
    .nav-item { padding: .6rem .95rem; font-size: .83rem; }
    .sidebar-brand { padding: 1rem .95rem; }
    .sidebar-brand img { width: 38px; height: 38px; }
}

/* ────────────────────────────────────────────────────────────
   "REQUEST DESKTOP SITE" di Chrome Android
   Chrome memaksa viewport jadi lebar (biasanya ~980px–1280px).
   Kita pastikan layout tetap rapi seperti desktop sebenarnya.
   ──────────────────────────────────────────────────────────── */
@media (min-width: 980px) {
    /* Pastikan sidebar selalu tampil di desktop mode */
    .sidebar {
        transform: translateX(0) !important;
        position: fixed !important;
        box-shadow: 2px 0 10px rgba(15,23,42,0.15) !important;
    }
    .sidebar-overlay { display: none !important; }
    .main-content { margin-left: var(--sidebar-w) !important; }
    .hamburger { display: none !important; }
    .d-sm-flex { display: flex !important; }

    /* Kembalikan tampilan teks di topbar */
    .topbar .btn-danger span { display: inline !important; }
    .topbar .btn-danger { padding: .35rem .75rem !important; border-radius: 20px !important; }

}

/* ────────────────────────────────────────────────────────────
   IPHONE SAFE AREA (Notch / Dynamic Island)
   ──────────────────────────────────────────────────────────── */
@supports (padding: env(safe-area-inset-top)) {
    .topbar {
        padding-left: max(1.25rem, env(safe-area-inset-left));
        padding-right: max(1.25rem, env(safe-area-inset-right));
    }
    .page-content {
        padding-left: max(.9rem, env(safe-area-inset-left));
        padding-right: max(.9rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    .sidebar {
        padding-top: env(safe-area-inset-top);
        height: calc(100vh + env(safe-area-inset-top));
    }
}

/* ────────────────────────────────────────────────────────────
   TOUCH DEVICE: Remove hover ghost effects on iOS/Android
   ──────────────────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    .btn:hover { opacity: 1; }
    .nav-item:hover { background: transparent; }
    .nav-item.active { background: rgba(255,255,255,.14); }
    .table tbody tr:hover { background: transparent; }
}


/* ========================================================== */
/* ANIMATIONS & SESSION TIMEOUT MODAL STYLES                  */
/* ========================================================== */

/* ── Card Fade-In (Intersection Observer) ── */
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Loader Bar ── */
@keyframes loaderSlide {
    0%   { width: 0%;   margin-left: 0; }
    50%  { width: 70%;  margin-left: 15%; }
    100% { width: 0%;   margin-left: 100%; }
}

@keyframes modalPop {
    0% { transform: scale(0.88); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes modalSlideDown {
    0%   { opacity: 0; transform: translateY(-20px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.85; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── GPU Acceleration Hints (Critical Elements) ── */
.sidebar {
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.topbar {
    will-change: auto;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Nav items: contain layout recalculation */
.nav-item {
    contain: layout style;
}

/* Cards: promote to own layer only when animating */
.card, .stat-card {
    contain: layout;
}

/* Buttons: instant response */
.btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Smooth transitions for interactive elements ── */
.nav-item,
.btn,
.form-control,
.card,
.stat-card,
.topbar-user-badge {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
    will-change: opacity;
}

/* ── Alert: overflow hidden for smooth dismiss ── */
.alert {
    overflow: hidden;
    max-height: 200px;
    transition: opacity .3s ease, max-height .4s ease, margin .4s ease;
}


.session-modal-card {
    background: #ffffff;
    width: 92%;
    max-width: 450px;
    border-radius: 20px;
    box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.4);
    overflow: hidden;
    border: 2px solid #fde68a;
    animation: modalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
    margin: auto;
}

@media (max-width: 480px) {
    .session-modal-card {
        padding: 1.5rem 1.15rem;
        border-radius: 16px;
    }
}

/* ===================== FLOATING TOP NOTIFICATIONS (ALL DEVICES) ===================== */
.floating-notif-container {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 14px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999999 !important;
    width: 92%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
}

.floating-notif-card {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 14px 38px -4px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.9);
    border-left: 5px solid #2563eb;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin 0.28s ease, max-height 0.28s ease;
    animation: slideDownFloat 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-height: 250px;
    overflow: hidden;
    touch-action: pan-y;
}

body.dark-mode .floating-notif-card {
    background: #1e293b;
    box-shadow: 0 14px 38px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.floating-notif-card.is-danger {
    border-left-color: #dc2626;
    background: #fffdfd;
}
body.dark-mode .floating-notif-card.is-danger {
    background: #2a1518;
}

.floating-notif-card.is-warning {
    border-left-color: #d97706;
    background: #fffefb;
}
body.dark-mode .floating-notif-card.is-warning {
    background: #2d2013;
}

.floating-notif-card.is-success {
    border-left-color: #15803d;
    background: #fcfdfc;
}
body.dark-mode .floating-notif-card.is-success {
    background: #13271b;
}

@keyframes slideDownFloat {
    from {
        opacity: 0;
        transform: translateY(-25px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-notif-card.dismissing {
    opacity: 0 !important;
    transform: translateY(-20px) scale(0.95) !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: -0.65rem !important;
    border-width: 0 !important;
    pointer-events: none !important;
}

.floating-notif-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 1px;
    line-height: 1;
}

.floating-notif-body {
    flex: 1;
    min-width: 0;
}

.floating-notif-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    line-height: 1.3;
}
body.dark-mode .floating-notif-title {
    color: #f8fafc;
}

.floating-notif-text {
    font-size: 0.82rem;
    color: #334155;
    margin-top: 0.25rem;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
}
body.dark-mode .floating-notif-text {
    color: #cbd5e1;
}

.floating-notif-meta {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
body.dark-mode .floating-notif-meta {
    color: #94a3b8;
}

.floating-notif-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563eb;
    margin-top: 0.35rem;
    text-decoration: underline;
    cursor: pointer;
}
.floating-notif-link:hover {
    color: #1d4ed8;
}
body.dark-mode .floating-notif-link {
    color: #60a5fa;
}

.floating-notif-close {
    background: rgba(148, 163, 184, 0.15);
    border: none;
    color: #64748b;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: -2px;
    margin-right: -4px;
}
.floating-notif-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: scale(1.08);
}
body.dark-mode .floating-notif-close {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.1);
}
body.dark-mode .floating-notif-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

@media (max-width: 640px) {
    .floating-notif-container {
        top: max(10px, env(safe-area-inset-top, 10px)) !important;
        width: calc(100% - 1.25rem) !important;
        max-width: 100% !important;
        gap: 0.5rem;
        z-index: 99999999 !important;
    }
    .floating-notif-card {
        padding: 0.75rem 0.9rem;
        border-radius: 12px;
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
    }
    .floating-notif-icon {
        font-size: 1.2rem;
    }
    .floating-notif-title {
        font-size: 0.85rem;
    }
    .floating-notif-text {
        font-size: 0.78rem;
    }
}

/* ==============================================================================
   ULTRA SAT-SET PERFORMANCE & RESPONSIVE ENGINE (MOBILE, TABLET & DESKTOP)
   Zero Layout Shift • Instant Touch Feedback • 60 FPS Fluidity • Anti-Anomaly
   ============================================================================== */

/* 1. Global Viewport & Container Safety (Zero Horizontal Bleed & Full Touch Zoom Support) */
html, body {
    overflow-x: visible !important;
    touch-action: manipulation;
}
.layout-wrapper, .main-content {
    max-width: 100%;
    overflow-x: clip;
}

/* 2. Responsive Table Wrapper: Anti-Break & Smooth Touch Scroll */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

/* Auto-safety for tables directly inside cards on mobile devices */
@media (max-width: 768px) {
    .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .card {
        max-width: 100%;
        min-width: 0;
    }
}

/* 3. Automatic Grid Collapse for Mobile & Tablets (Sat Set & Rapi) */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 0.75rem !important;
    }
    div[style*="grid-template-columns: 1fr 340px"],
    div[style*="grid-template-columns:1fr 340px"],
    div[style*="grid-template-columns: 1.2fr 0.8fr"],
    div[style*="grid-template-columns:1.2fr 0.8fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    /* Responsive Content Padding */
    .page-content {
        padding: 0.85rem 0.75rem !important;
    }

    /* Collapse hardcoded 2-column inline grids on small screens */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: repeat(2, 1fr)"],
    div[style*="grid-template-columns:repeat(2, 1fr)"],
    div[style*="grid-template-columns: repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Mobile Form Elements & Touch Targets (Prevent iOS Safari auto-zoom) */
    .form-control, .form-select, select.form-control, input[type="text"], input[type="password"], input[type="email"], input[type="number"] {
        font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
        min-height: 42px;
    }

    .btn {
        min-height: 40px;
        touch-action: manipulation;
    }

    /* Topbar compact layout */
    .topbar {
        padding: 0.55rem 0.75rem !important;
    }

    /* Main Content Bottom Spacing for Mobile Bottom Nav */
    .page-content {
        padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    }
}

/* 4. Instant Hardware Accelerated Rendering Hints */
.card, .stat-card, .sidebar, .topbar, .btn {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 5. Smooth High-Frequency Scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ==============================================================================
   6. SIDEBAR SUBMENU ACCORDIONS WITH HAMBURGER TOGGLE (DESKTOP & MOBILE)
   ============================================================================== */
.sidebar-submenu-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.85rem 0.55rem;
    margin: 0.25rem 0.65rem 0.45rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 0.72rem;
    color: #cbd5e1;
}

.sidebar-submenu-toolbar-title {
    font-weight: 800;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #93c5fd;
    text-transform: uppercase;
}

.sidebar-submenu-toggle-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sidebar-submenu-toggle-btn:hover {
    background: #2563eb;
    border-color: #60a5fa;
}

.nav-section {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    user-select: none !important;
    border-radius: 8px !important;
    margin: 0.4rem 0.5rem 0.2rem !important;
    padding: 0.55rem 0.75rem !important;
    transition: background 0.18s ease, color 0.18s ease !important;
}
.nav-section:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

.nav-section-hamburger-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #93c5fd;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    transition: all 0.2s ease;
}
.nav-section:hover .nav-section-hamburger-tag {
    background: #2563eb;
    color: #ffffff;
    border-color: #60a5fa;
}

.nav-section-chevron {
    width: 13px !important;
    height: 13px !important;
    max-width: 13px !important;
    max-height: 13px !important;
    flex-shrink: 0 !important;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    stroke: currentColor;
    display: block;
}
.nav-section.collapsed .nav-section-chevron {
    transform: rotate(-90deg);
}

.nav-submenu-content {
    max-height: 1200px;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
    opacity: 1;
}
.nav-section.collapsed + .nav-submenu-content {
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==============================================================================
   7. 📱 MOBILE BOTTOM NAVIGATION (HP ANDROID & IPHONE)
   ============================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1.5px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    z-index: 9998;
    align-items: center;
    justify-content: space-around;
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
}

@media (max-width: 768px) {
    html:not(.desktop-site-forced) .mobile-bottom-nav {
        display: flex !important;
    }
    /* Geser widget BMKG agar tidak menabrak bottom nav */
    html:not(.desktop-site-forced) #disaster-pill {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
    html:not(.desktop-site-forced) #disaster-popup {
        bottom: calc(118px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

.mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    color: #64748b;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 0;
    transition: all 0.16s ease;
    touch-action: manipulation;
}
.mobile-nav-btn:active {
    transform: scale(0.92);
}
.mobile-nav-btn.active {
    color: #10b981;
}
.mobile-nav-btn.active .mobile-nav-icon {
    stroke: #10b981;
    stroke-width: 2.8;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.55));
}
.mobile-nav-btn.active .mobile-nav-label {
    font-weight: 800;
    color: #10b981;
}

.mobile-nav-icon {
    width: 21px;
    height: 21px;
    stroke: #64748b;
    transition: stroke 0.15s ease;
}

.mobile-nav-label {
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}

/* Tombol Hamburger Submenu Tengah Spesial */
.mobile-nav-btn-center {
    position: relative;
    top: -12px;
    flex: 1;
    max-width: 68px;
}
.mobile-hamburger-pill {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0284c7 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mobile-nav-btn-center:active .mobile-hamburger-pill {
    transform: scale(0.9);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}
.hamburger-center-svg {
    stroke: #ffffff;
}
.mobile-nav-label-center {
    font-size: 0.68rem;
    font-weight: 800;
    color: #1e40af;
    margin-top: 3px;
    line-height: 1;
}

/* ==============================================================================
   8. 📱 MODAL DRAWER SUBMENU SLIDE-UP (ACCORDION & HAMBURGER BOTTOM SHEET)
   ============================================================================== */
.mobile-submenu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.26s ease, visibility 0.26s ease;
}
.mobile-submenu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.mobile-submenu-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 86vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    z-index: 99999;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}
.mobile-submenu-drawer.open {
    transform: translateY(0);
}

.mobile-drawer-handle-bar {
    padding: 10px 0 4px;
    display: flex;
    justify-content: center;
    cursor: pointer;
}
.mobile-drawer-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
}
.mobile-drawer-title-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.mobile-drawer-hamburger-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-drawer-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}
.mobile-drawer-badge {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}
.mobile-drawer-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.35rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}
.mobile-drawer-close:active {
    background: #e2e8f0;
}

.mobile-drawer-search-wrap {
    padding: 0.65rem 1.25rem 0.45rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}
.mobile-drawer-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.mobile-drawer-search-box:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.mobile-search-icon {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-right: 6px;
}
.mobile-drawer-search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.55rem 0;
    font-size: 16px; /* 16px to prevent iOS Safari auto zoom */
    color: #0f172a;
    background: transparent;
    font-family: inherit;
}
.mobile-search-clear {
    background: none;
    border: none;
    font-size: 1.15rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.85rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Accordion Group di Drawer */
.mobile-sub-group {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s ease;
}
.mobile-sub-group.open {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.mobile-sub-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.mobile-sub-group.open .mobile-sub-group-header {
    background: #f0f7ff;
    border-bottom: 1px solid #dbeafe;
}
.mobile-sub-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 0.88rem;
    color: #1e293b;
}
.mobile-sub-cat-emoji {
    font-size: 1.15rem;
}
.mobile-sub-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
}
.mobile-sub-group.open .mobile-sub-count {
    background: #2563eb;
    color: #ffffff;
}

.mobile-sub-group-action {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.mobile-sub-hamburger-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e2e8f0;
    color: #334155;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
}
.mobile-sub-chevron {
    stroke: #64748b;
    transition: transform 0.22s ease;
}
.mobile-sub-group.open .mobile-sub-chevron {
    transform: rotate(180deg);
}

.mobile-sub-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-sub-group.open .mobile-sub-group-content {
    max-height: 800px;
}

.mobile-sub-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    padding: 0.75rem;
    background: #ffffff;
}
@media (max-width: 380px) {
    .mobile-sub-items-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-sub-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.15s ease;
    position: relative;
    min-height: 42px;
}
.mobile-sub-card:active {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: scale(0.97);
}
.mobile-sub-card.active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #047857;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}
.mobile-sub-card-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}
.mobile-sub-card-text {
    flex: 1;
    line-height: 1.25;
}
.mobile-sub-card.active .mobile-sub-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    flex-shrink: 0;
}

.mobile-drawer-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}
.mobile-footer-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #1e293b;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    min-height: 42px;
}
.mobile-footer-action-btn:active {
    background: #e2e8f0;
}
.mobile-footer-action-btn.btn-logout-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}
.mobile-footer-action-btn.btn-logout-danger:active {
    background: #fee2e2;
}

/* ==============================================================================
   SERAVIQ UNIVERSAL GRID & MODERN UTILITY SYSTEM (ZERO-DEPENDENCY BOOTSTRAP-COMPAT)
   Gives pixel-perfect responsive layouts, stat cards, flexbox, split panes & modals
   ============================================================================== */
.container-fluid {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
    box-sizing: border-box;
}
.row > * {
    box-sizing: border-box;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

.row.g-0 { margin-right: 0; margin-left: 0; }
.row.g-0 > * { padding-right: 0; padding-left: 0; margin-bottom: 0; }
.row.g-1 { margin-right: -0.25rem; margin-left: -0.25rem; }
.row.g-1 > * { padding-right: 0.25rem; padding-left: 0.25rem; }
.row.g-2 { margin-right: -0.375rem; margin-left: -0.375rem; }
.row.g-2 > * { padding-right: 0.375rem; padding-left: 0.375rem; }
.row.g-3 { margin-right: -0.5rem; margin-left: -0.5rem; }
.row.g-3 > * { padding-right: 0.5rem; padding-left: 0.5rem; }
.row.g-4 { margin-right: -0.75rem; margin-left: -0.75rem; }
.row.g-4 > * { padding-right: 0.75rem; padding-left: 0.75rem; }

/* Grid Columns */
.col-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
.col-6  { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
.col-4  { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
.col-3  { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }

@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 16.666667% !important; width: 16.666667% !important; max-width: 16.666667% !important; }
    .col-md-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
    .col-md-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
    .col-md-5 { flex: 0 0 41.666667% !important; width: 41.666667% !important; max-width: 41.666667% !important; }
    .col-md-6 { flex: 0 0 50% !important; width: 50% !important; max-width: 50% !important; }
    .col-md-7 { flex: 0 0 58.333333% !important; width: 58.333333% !important; max-width: 58.333333% !important; }
    .col-md-8 { flex: 0 0 66.666667% !important; width: 66.666667% !important; max-width: 66.666667% !important; }
    .col-md-9 { flex: 0 0 75% !important; width: 75% !important; max-width: 75% !important; }
    .col-md-12 { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; }
    .flex-md-row { flex-direction: row !important; }
    .align-items-md-center { align-items: center !important; }
    .justify-content-md-between { justify-content: space-between !important; }
    .px-md-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25% !important; width: 25% !important; max-width: 25% !important; }
    .col-lg-4 { flex: 0 0 33.333333% !important; width: 33.333333% !important; max-width: 33.333333% !important; }
    .col-lg-8 { flex: 0 0 66.666667% !important; width: 66.666667% !important; max-width: 66.666667% !important; }
    .col-lg-9 { flex: 0 0 75% !important; width: 75% !important; max-width: 75% !important; }
}

/* Flexbox utilities */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* Spacing */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-auto { margin-top: auto !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }

.h-100 { height: 100% !important; }
.w-100 { width: 100% !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

/* Borders & Shapes */
.border-0 { border: 0 !important; }
.border-bottom { border-bottom: 1px solid #e2e8f0 !important; }
.border-top { border-top: 1px solid #e2e8f0 !important; }
.border-end { border-right: 1px solid #e2e8f0 !important; }
.border-start { border-left: 1px solid #e2e8f0 !important; }
.rounded-1 { border-radius: 4px !important; }
.rounded-2 { border-radius: 8px !important; }
.rounded-3 { border-radius: 12px !important; }
.rounded-4 { border-radius: 16px !important; }
.rounded-pill { border-radius: 50rem !important; }
.rounded-circle { border-radius: 50% !important; }
.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04) !important; }
.shadow { box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08) !important; }

/* Typography & Colors */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.text-muted { color: #64748b !important; }
.text-dark { color: #0f172a !important; }
.text-white { color: #ffffff !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.75) !important; }
.text-primary { color: #2563eb !important; }
.text-success { color: #059669 !important; }
.text-warning { color: #d97706 !important; }
.text-danger { color: #dc2626 !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 0.82rem; }
.fs-1 { font-size: 2.25rem !important; line-height: 1; }
.fs-4 { font-size: 1.35rem !important; line-height: 1; }
.h3 { font-size: 1.45rem; font-weight: 800; line-height: 1.25; margin: 0; }
.h4 { font-size: 1.25rem; font-weight: 800; line-height: 1.3; margin: 0; }
.h5 { font-size: 1.1rem; font-weight: 700; line-height: 1.35; margin: 0; }
.h6 { font-size: 0.95rem; font-weight: 700; line-height: 1.4; margin: 0; }

/* Backgrounds & Badges */
.bg-white { background-color: #ffffff !important; }
.bg-light { background-color: #f8fafc !important; }
.bg-light-green { background-color: #ecfdf5 !important; }
.badge.bg-success { background: #10b981 !important; color: #ffffff !important; }
.badge.bg-warning { background: #f59e0b !important; color: #ffffff !important; }
.badge.bg-warning.text-dark { color: #0f172a !important; background: #fbbf24 !important; }
.badge.bg-danger { background: #ef4444 !important; color: #ffffff !important; }
.badge.bg-primary { background: #2563eb !important; color: #ffffff !important; }
.badge.bg-secondary { background: #64748b !important; color: #ffffff !important; }
.badge.bg-info { background: #06b6d4 !important; color: #ffffff !important; }

/* Buttons & Inputs */
.btn-group { display: inline-flex; vertical-align: middle; }
.btn-group-sm > .btn { padding: 0.25rem 0.65rem; font-size: 0.76rem; }
.btn-outline-success { color: #059669 !important; border: 1.5px solid #059669 !important; background: transparent !important; }
.btn-outline-success:hover { background: #059669 !important; color: #ffffff !important; }
.btn-outline-secondary { color: #64748b !important; border: 1.5px solid #cbd5e1 !important; background: transparent !important; }
.btn-outline-secondary:hover { background: #f1f5f9 !important; color: #0f172a !important; border-color: #94a3b8 !important; }
.btn-light { background: #f1f5f9 !important; color: #0f172a !important; border: 1px solid #cbd5e1 !important; }
.btn-light:hover { background: #e2e8f0 !important; }

.form-control {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.5;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    border-color: #2563eb;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.form-select {
    display: block;
    padding: 0.45rem 1.85rem 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-family: inherit;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
}
.form-control-sm, .form-select-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}
.modal.show { display: block !important; }
.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 720px;
    pointer-events: none;
    padding: 0 1rem;
    box-sizing: border-box;
}
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    outline: 0;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid #e2e8f0;
}
.btn-close {
    box-sizing: content-box;
    width: 1.25em;
    height: 1.25em;
    padding: 0.25em;
    color: #64748b;
    background: transparent;
    border: 0;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
}
.btn-close::before { content: "✕"; }

/* ==============================================================================
   UNIVERSAL RESPONSIVE MODAL ENGINE (ANTI-CUTOFF & ULTRA-RESPONSIVE ACROSS ALL ZOOM LEVELS)
   Mendukung Zoom 100%, 125%, 150%, 175%, 200% & Semua Resolusi Layar Laptop / HP
   ============================================================================== */
.page-content {
    position: relative;
    z-index: auto !important;
}

/* Semua modal overlay berstatus fixed di seluruh aplikasi */
div[id^="modal"][style*="position: fixed"],
div[id^="modal"][style*="position:fixed"],
div[id*="Modal"][style*="position: fixed"],
div[id*="Modal"][style*="position:fixed"],
div[id*="modal_"][style*="position: fixed"],
div[id*="modal_"][style*="position:fixed"],
div[id^="rejectModal"],
div[id^="editScheduleModal"],
div[id^="meetingEditorModal"],
div[id^="editLeaderModal"],
div[id^="importCourseModal"],
div[id^="quickEditScheduleModal"],
div[id^="quickAddClassModal"],
div[id^="extractModal"],
div[id^="addIpModal"],
div[id^="quickTokenModal"],
div[id^="videoModal"],
.custom-modal-backdrop,
.modal-dosen-note-overlay,
.siperkul-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999999 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
    padding: 1.5rem 1rem !important;
}

/* Saat modal ditampilkan dengan display: flex */
div[id^="modal"][style*="display: flex"],
div[id^="modal"][style*="display:flex"],
div[id*="Modal"][style*="display: flex"],
div[id*="Modal"][style*="display:flex"],
div[id*="modal_"][style*="display: flex"],
div[id*="modal_"][style*="display:flex"],
div[id^="rejectModal"][style*="display: flex"],
div[id^="rejectModal"][style*="display:flex"],
div[id^="editScheduleModal"][style*="display: flex"],
div[id^="editScheduleModal"][style*="display:flex"],
div[id^="meetingEditorModal"][style*="display: flex"],
div[id^="meetingEditorModal"][style*="display:flex"],
div[id^="editLeaderModal"][style*="display: flex"],
div[id^="editLeaderModal"][style*="display:flex"],
div[id^="importCourseModal"][style*="display: flex"],
div[id^="importCourseModal"][style*="display:flex"],
div[id^="quickEditScheduleModal"][style*="display: flex"],
div[id^="quickEditScheduleModal"][style*="display:flex"],
div[id^="quickAddClassModal"][style*="display: flex"],
div[id^="quickAddClassModal"][style*="display:flex"],
div[id^="extractModal"][style*="display: flex"],
div[id^="extractModal"][style*="display:flex"],
div[id^="addIpModal"][style*="display: flex"],
div[id^="addIpModal"][style*="display:flex"],
div[id^="quickTokenModal"][style*="display: flex"],
div[id^="quickTokenModal"][style*="display:flex"],
div[id^="videoModal"][style*="display: flex"],
div[id^="videoModal"][style*="display:flex"],
.custom-modal-backdrop[style*="display: flex"],
.custom-modal-backdrop[style*="display:flex"],
.siperkul-modal-backdrop[style*="display: flex"],
.siperkul-modal-backdrop[style*="display:flex"],
.modal-dosen-note-overlay.open {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

/* Kartu Dialog Modal: Auto center & anti cut-off di zoom 100% - 200% */
div[id^="modal"][style*="position: fixed"] > div:first-child,
div[id^="modal"][style*="position:fixed"] > div:first-child,
div[id*="Modal"][style*="position: fixed"] > div:first-child,
div[id*="Modal"][style*="position:fixed"] > div:first-child,
div[id*="modal_"][style*="position: fixed"] > div:first-child,
div[id*="modal_"][style*="position:fixed"] > div:first-child,
div[id^="rejectModal"] > div:first-child,
div[id^="editScheduleModal"] > div:first-child,
div[id^="meetingEditorModal"] > div:first-child,
div[id^="editLeaderModal"] > div:first-child,
div[id^="importCourseModal"] > div:first-child,
div[id^="quickEditScheduleModal"] > div:first-child,
div[id^="quickAddClassModal"] > div:first-child,
div[id^="extractModal"] > div:first-child,
div[id^="addIpModal"] > div:first-child,
div[id^="quickTokenModal"] > div:first-child,
div[id^="videoModal"] > div:first-child,
.custom-modal-backdrop > div:first-child,
.modal-dosen-note-overlay > div:first-child,
.siperkul-modal-backdrop > .siperkul-modal-dialog {
    margin: auto !important;
    max-height: calc(100vh - 2.5rem) !important;
    max-height: calc(100dvh - 2.5rem) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
}
