/**
 * SPATLAS PIKET - Design System & Stylesheet Profesional Premium
 * Sekolah: SMP Negeri 14 Samarinda
 * Fitur: Animasi Logo Elegan ala MyASN, Ultra-Responsif Tanpa Elemen Tertutupi
 */

:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #0f172a;
    --primary-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
    --primary-glow: rgba(37, 99, 235, 0.35);
    
    --accent: #6366f1;
    --success: #059669;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --card-shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

/* ===================================================
   BASE TYPOGRAPHY & RESET
   =================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--slate-50);
    color: var(--slate-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
    /* Menjamin konten bawah TIDAK AKAN PERNAH tertutupi bilah navigasi mobile */
    padding-bottom: 90px;
}

@media (min-width: 992px) {
    .app-wrapper {
        padding-bottom: 0 !important;
    }
}

/* ===================================================
   LOGO SMPN 14 SAMARINDA - INSTITUTIONAL EMBLEM STYLING & DYNAMIC MOTION
   Background Transparan Murni & Efek Mengambang Elegan Tanpa Bingkai Putih
   =================================================== */
.brand-logo-container {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
    animation: spatlasLogoFloatMotion 3.8s ease-in-out infinite;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo-container img,
.logo-nav {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent !important;
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.3s ease, filter 0.35s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

@keyframes spatlasLogoFloatMotion {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
    }
    25% {
        transform: translateY(-2.5px) rotate(-1.5deg) scale(1.035);
        filter: drop-shadow(0 5px 12px rgba(56, 189, 248, 0.45));
    }
    75% {
        transform: translateY(-1px) rotate(1.5deg) scale(1.015);
        filter: drop-shadow(0 3px 8px rgba(99, 102, 241, 0.35));
    }
}

.brand-logo-container:hover {
    transform: translateY(-2.5px) scale(1.1) rotate(3deg);
}

.brand-logo-container:hover img,
.brand-logo-container:hover .logo-nav {
    filter: drop-shadow(0 8px 18px rgba(56, 189, 248, 0.7));
}

/* Fallback class untuk kompatibilitas */
.logo-myasn-float {
    display: inline-block;
    transition: transform 0.3s ease, filter 0.35s ease;
    animation: spatlasLogoFloatMotion 4s ease-in-out infinite;
    image-rendering: -webkit-optimize-contrast;
}
.logo-myasn-float:hover {
    transform: scale(1.08) rotate(3deg);
}
.logo-glow-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: spatlasLogoFloatMotion 4s ease-in-out infinite;
}

/* ===================================================
   RUNNING TEXT / ANNOUNCEMENT TICKER (DI BAWAH MENU NAVIGASI)
   Tampilan Institusional Elegan, Bersih & Tidak Menutupi Menu
   =================================================== */
.sub-navbar-announcement,
.top-announcement-bar {
    background: linear-gradient(90deg, #090e1a 0%, #0d1b3e 50%, #090e1a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-size: 0.74rem;
    padding: 5px 0;
    overflow: hidden;
    position: relative;
    z-index: 1010;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
}

.ticker-inner-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ticker-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.65rem;
    padding: 2.5px 9px;
    border-radius: 999px;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-badge-blue,
.ticker-badge.ticker-badge-blue {
    background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.68rem;
    padding: 2.5px 10px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.45) !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-badge .pulse-light {
    width: 6px;
    height: 6px;
    background: #0f172a;
    border-radius: 50%;
    animation: pulseDotAnim 1.4s infinite;
}

.ticker-marquee-track {
    overflow: hidden;
    white-space: nowrap;
    flex-grow: 1;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 2.5%, black 97.5%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 2.5%, black 97.5%, transparent);
}

.ticker-marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeTextAnim 34s linear infinite;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #f1f5f9;
}

.ticker-marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marqueeTextAnim {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* ===================================================
   INSTITUTIONAL ON/OFF THEME SWITCH
   =================================================== */
.theme-switch-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 3px 6px 3px 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
}

.theme-switch-wrapper:hover {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.35);
}

.theme-switch-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.theme-toggle-switch {
    width: 44px;
    height: 24px;
    background: #334155;
    border-radius: 999px;
    position: relative;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    vertical-align: middle;
}

.theme-toggle-knob {
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

[data-bs-theme="dark"] .theme-toggle-switch {
    background: #2563eb;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

[data-bs-theme="dark"] .theme-toggle-knob {
    transform: translateX(20px);
    background: #ffffff;
    color: #2563eb;
}

[data-bs-theme="light"] .theme-toggle-switch {
    background: #cbd5e1;
}

[data-bs-theme="light"] .theme-toggle-knob {
    transform: translateX(0);
    background: #f59e0b;
    color: #ffffff;
}

.logo-auth {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    image-rendering: -webkit-optimize-contrast;
    animation: spatlasLogoFloatMotion 4s ease-in-out infinite;
}

.logo-card {
    width: 42px;
    height: 42px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

.logo-digital {
    width: 62px;
    height: 62px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    animation: spatlasLogoFloatMotion 4s ease-in-out infinite;
}

/* ===================================================
   PROFESSIONAL NAVBAR
   =================================================== */
.main-navbar {
    background: linear-gradient(135deg, #090d16 0%, #0f172a 40%, #1e3a8a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.brand-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88) !important;
    padding: 0.42rem 0.65rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.22) !important;
    font-weight: 600;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.nav-clock-wrap {
    user-select: none;
    flex-shrink: 0;
}

@media (min-width: 992px) and (max-width: 1320px) {
    .nav-link {
        font-size: 0.77rem;
        padding: 0.36rem 0.48rem !important;
        gap: 3.5px;
    }
    .brand-logo-container {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .ticker-badge {
        font-size: 0.58rem;
        padding: 2px 7px;
    }
    .sub-navbar-announcement,
    .top-announcement-bar {
        font-size: 0.7rem;
        padding: 4px 0;
    }
}

.pulse-green {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGreenAnim 1.8s infinite;
}

@keyframes pulseGreenAnim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ===================================================
   MOBILE BOTTOM BAR (PWA Native Feel)
   =================================================== */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--slate-200);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

@media (max-width: 991.98px) {
    .mobile-bottom-bar {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--slate-500);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    min-width: 58px;
}

.mobile-bottom-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.mobile-bottom-item.active {
    color: var(--primary-light);
    background: var(--primary-bg);
}

.mobile-bottom-item.active i {
    transform: scale(1.1);
}

/* ===================================================
   RESPONSIVE CONTAINERS & FLUID CARDS
   =================================================== */
.container, .container-fluid {
    width: 100%;
    padding-right: clamp(12px, 3vw, 24px);
    padding-left: clamp(12px, 3vw, 24px);
    margin-right: auto;
    margin-left: auto;
}

.card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    max-width: 100%;
}

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

.shadow-xs {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04) !important;
}

/* KPI Cards */
.kpi-card {
    position: relative;
    overflow: hidden;
    padding: clamp(0.85rem, 2vw, 1.25rem);
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid var(--slate-200);
    transition: all 0.25s ease;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.kpi-icon-bg {
    position: absolute;
    right: -8px;
    bottom: -12px;
    font-size: clamp(3.5rem, 6vw, 4.5rem);
    opacity: 0.08;
    pointer-events: none;
}

/* Table Responsiveness Anti-Tertutup */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.table {
    width: 100%;
    margin-bottom: 0;
    --bs-table-hover-bg: #f8fafc;
}

.table th {
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-500);
    background-color: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
    padding: 0.75rem 0.85rem;
    white-space: nowrap;
}

.table td {
    padding: 0.8rem 0.85rem;
    vertical-align: middle;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--slate-100);
}

/* Badges */
.badge {
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-subtle-success {
    background-color: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0;
}

.badge-subtle-warning {
    background-color: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fde68a;
}

.badge-subtle-danger {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca;
}

.badge-subtle-info {
    background-color: #f0f9ff !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd;
}

.badge-subtle-primary {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe;
}

/* ===================================================
   MODERN CAMERA SCANNER HUD & ANIMATION
   =================================================== */
.scanner-viewport-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    width: 100%;
}

#reader {
    width: 100% !important;
    min-height: 280px;
    background: #000;
    border: none !important;
}

#reader video {
    object-fit: cover !important;
    border-radius: var(--radius-lg);
    width: 100% !important;
    height: auto !important;
}

/* Scanning Laser Line */
.scanner-laser-line {
    position: absolute;
    top: 15%;
    left: 8%;
    right: 8%;
    height: 3px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0) 0%, #38bdf8 50%, rgba(59, 130, 246, 0) 100%);
    box-shadow: 0 0 14px 4px #38bdf8;
    border-radius: 50%;
    animation: scannerScanAnim 2s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes scannerScanAnim {
    0% { top: 18%; opacity: 0.7; }
    50% { opacity: 1; }
    100% { top: 82%; opacity: 0.7; }
}

/* Corner guides on camera view */
.scanner-corners {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(240px, 70%);
    height: min(240px, 70%);
    pointer-events: none;
    z-index: 5;
}

.scanner-corners::before,
.scanner-corners::after,
.scanner-corners-inner::before,
.scanner-corners-inner::after {
    content: '';
    position: absolute;
    width: clamp(20px, 8vw, 32px);
    height: clamp(20px, 8vw, 32px);
    border-color: #38bdf8;
    border-style: solid;
}

.scanner-corners::before {
    top: 0; left: 0; border-width: 3px 0 0 3px; border-top-left-radius: 8px;
}
.scanner-corners::after {
    top: 0; right: 0; border-width: 3px 3px 0 0; border-top-right-radius: 8px;
}
.scanner-corners-inner::before {
    bottom: 0; left: 0; border-width: 0 0 3px 3px; border-bottom-left-radius: 8px;
}
.scanner-corners-inner::after {
    bottom: 0; right: 0; border-width: 0 3px 3px 0; border-bottom-right-radius: 8px;
}

/* Flash feedback */
.scan-flash-success { animation: flashGreen 0.45s ease-out; }
.scan-flash-late { animation: flashYellow 0.45s ease-out; }
.scan-flash-error { animation: flashRed 0.45s ease-out; }

@keyframes flashGreen {
    0% { box-shadow: inset 0 0 0 14px #10b981; }
    100% { box-shadow: inset 0 0 0 0 transparent; }
}
@keyframes flashYellow {
    0% { box-shadow: inset 0 0 0 14px #f59e0b; }
    100% { box-shadow: inset 0 0 0 0 transparent; }
}
@keyframes flashRed {
    0% { box-shadow: inset 0 0 0 14px #ef4444; }
    100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* ===================================================
   AUTHENTIC DIGITAL STUDENT ID CARD (E-CARD)
   =================================================== */
.digital-student-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.16), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--slate-200);
    position: relative;
    transition: transform 0.3s ease;
    width: 100%;
}

.digital-student-card:hover {
    transform: translateY(-4px);
}

.digital-card-header {
    background: linear-gradient(135deg, #090d16 0%, #1e3a8a 65%, #2563eb 100%);
    color: #ffffff;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}

.digital-card-header::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.digital-card-body {
    background: #ffffff;
    padding: 28px 20px 20px;
}

.qr-display-box {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    border: 2px solid var(--slate-100);
    display: inline-block;
    max-width: 100%;
}

.qr-display-box canvas, .qr-display-box img {
    max-width: 100%;
    height: auto;
}

/* ===================================================
   PRINTABLE PHYSICAL STUDENT ID CARD (8 PER A4)
   =================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.id-card-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.id-card {
    width: 100%;
    max-width: 336px;
    height: 210px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.id-card-header {
    background: linear-gradient(135deg, #090d16 0%, #1e3a8a 70%, #1d4ed8 100%);
    color: #ffffff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #38bdf8;
}

.id-card-header .school-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.id-card-header .school-info {
    line-height: 1.15;
    min-width: 0;
}

.id-card-header .school-name {
    font-size: 0.74rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.3px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.id-card-header .card-title-text {
    font-size: 0.6rem;
    font-weight: 700;
    color: #93c5fd;
    margin: 2px 0 0 0;
}

.id-card-header .npsn-text {
    font-size: 0.52rem;
    color: rgba(255, 255, 255, 0.75);
}

.id-card-body {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    background: #ffffff;
}

.student-photo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 68px;
    flex-shrink: 0;
}

.student-photo-box {
    width: 62px;
    height: 74px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.student-details-col {
    flex-grow: 1;
    min-width: 0;
}

.student-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-row {
    display: flex;
    font-size: 0.65rem;
    line-height: 1.25;
    margin-bottom: 2px;
}

.detail-label {
    width: 48px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}

.detail-val {
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-col {
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qr-box {
    width: 72px;
    height: 72px;
}

.qr-label {
    font-size: 0.54rem;
    color: #64748b;
    margin-top: 3px;
    font-weight: 600;
}

.id-card-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 4px 12px;
    font-size: 0.58rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===================================================
   RESPONSIVE PRINT STYLES (@media print)
   =================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 6mm;
    }

    body {
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        color: #000000 !important;
    }

    .top-announcement-bar,
    .main-navbar,
    .mobile-bottom-bar,
    .app-footer,
    .btn-floating-lapor,
    .d-print-none,
    button,
    .btn,
    form,
    .modal {
        display: none !important;
    }

    .container,
    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Print Single Card (Cetak Mandiri Depan Belakang) */
    .print-cards-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8mm !important;
        margin: 10mm auto !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Print Multi-Cards Grid (8 cards per A4 page) */
    .cards-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 85.6mm) !important;
        grid-template-rows: repeat(4, 54mm) !important;
        gap: 3mm 6mm !important;
        margin: 2mm auto !important;
        page-break-after: always;
        break-after: page;
        justify-content: center !important;
        align-content: center !important;
    }

    .id-card {
        width: 85.6mm !important;
        height: 54mm !important;
        box-shadow: none !important;
        border: 1px dashed #cbd5e1 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .id-card-header,
    .id-card-body,
    .id-card-footer {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .badge {
        border: 1px solid #cbd5e1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Scanner Viewport Camera Optimization */
#reader {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    overflow: hidden !important;
    border-radius: var(--radius-md);
}

#reader video {
    width: 100% !important;
    height: auto !important;
    max-height: 480px !important;
    object-fit: cover !important;
    border-radius: var(--radius-md);
}

#reader__scan_region {
    background: transparent !important;
}

/* ===================================================
   DARK THEME SYSTEM (NIGHT MODE / AUTOMATIC NIGHT TIME)
   =================================================== */
[data-bs-theme="dark"] {
    --bs-body-bg: #090d16;
    --bs-body-color: #f8fafc;
    --bs-border-color: #1e293b;
    --bs-card-bg: #111827;
    
    background-color: #090d16 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] body {
    background-color: #090d16 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .bg-slate-50,
[data-bs-theme="dark"] .bg-light {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #111827 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card {
    background-color: #111827 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
    background-color: #111827 !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] h1, 
[data-bs-theme="dark"] h2, 
[data-bs-theme="dark"] h3, 
[data-bs-theme="dark"] h4, 
[data-bs-theme="dark"] h5, 
[data-bs-theme="dark"] h6 {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-label {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .border {
    border-color: #1e293b !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: #111827;
    --bs-table-color: #f8fafc;
    --bs-table-hover-bg: #1e293b;
    --bs-table-border-color: #1e293b;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .table thead th {
    color: #94a3b8 !important;
    background-color: #0f172a !important;
    border-bottom-color: #1e293b !important;
}

[data-bs-theme="dark"] .table td {
    color: #f1f5f9 !important;
    border-color: #1e293b !important;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #0f172a !important;
    --bs-table-color: #cbd5e1 !important;
    border-color: #1e293b !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0b1120 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0b1120 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(56, 189, 248, 0.25) !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #111827 !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
}

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

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #1e293b !important;
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #1f2937 !important;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .nav-pills {
    background-color: #0b1120 !important;
}

[data-bs-theme="dark"] .nav-pills .nav-link:not(.active) {
    color: #94a3b8;
}

[data-bs-theme="dark"] .nav-pills .nav-link:not(.active):hover {
    color: #f8fafc;
    background-color: #1e293b;
}

[data-bs-theme="dark"] .kpi-card {
    background-color: #111827 !important;
    border-color: #1f2937;
}

[data-bs-theme="dark"] .mobile-bottom-bar {
    background-color: rgba(11, 17, 32, 0.96) !important;
    border-top-color: #1f2937 !important;
}

[data-bs-theme="dark"] .mobile-bottom-item {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .mobile-bottom-item.active {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .brand-logo-container {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

[data-bs-theme="dark"] .badge.bg-light {
    background-color: #1f2937 !important;
    color: #e2e8f0 !important;
    border-color: #374151 !important;
}

[data-bs-theme="dark"] .bg-success-subtle {
    background-color: rgba(5, 150, 105, 0.15) !important;
}

[data-bs-theme="dark"] .bg-danger-subtle {
    background-color: rgba(220, 38, 38, 0.15) !important;
}

[data-bs-theme="dark"] .bg-warning-subtle {
    background-color: rgba(217, 119, 6, 0.15) !important;
}

[data-bs-theme="dark"] .bg-info-subtle {
    background-color: rgba(2, 132, 199, 0.15) !important;
}

[data-bs-theme="dark"] .bg-primary-subtle {
    background-color: rgba(37, 99, 235, 0.15) !important;
}

/* Multiline Truncate Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
