/* =====================================================================
 * PRESENSI DIGITAL — NAZEXA MODERN INDIGO-NAVY & ATMOSPHERIC SAAS THEME
 * Inspired by Reference Design (image_233022.jpg & image_2daca9.png):
 * 1. Pure White Surface Cards : #FFFFFF with soft indigo elevation shadow
 * 2. Cool Lavender-Indigo Bg  : #F4F7FE / #EEF2FF / #E0E7FF
 * 3. Electric Royal Indigo    : #2563EB -> #4F46E5 (Buttons, Highlights, Charts)
 * 4. Deep Midnight Navy       : #0F172A / #172554 / #1E1B4B (Sidebar, Headings)
 * 5. Semantic Accents         : Emerald (#10B981), Amber (#F59E0B), Rose (#EF4444)
 * ===================================================================== */

:root {
    --nz-bg-card: #ffffff;
    --nz-bg-page: #f4f7fe;
    --nz-indigo-soft: #eef2ff;
    --nz-indigo-border: #e0e7ff;
    --nz-slate-border: #e2e8f0;
    --nz-navy-deep: #0f172a;
    --nz-navy-sidebar: #172554;
    --nz-indigo-primary: #2563eb;
    --nz-indigo-vivid: #4f46e5;
    --nz-text-main: #0f172a;
    --nz-text-muted: #475569;
}

body {
    background-color: var(--nz-bg-page);
    background-image:
        radial-gradient(at 90% 0%, rgba(79, 70, 229, 0.07) 0px, transparent 45%),
        radial-gradient(at 10% 20%, rgba(37, 99, 235, 0.05) 0px, transparent 40%);
    background-attachment: fixed;
    color: var(--nz-text-main);
    overflow-x: hidden;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Custom Scrollbar — Sleek Indigo-Slate */
.custom-scrollbar::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #eef2ff;
    border-radius: 6px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 6px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* =====================================================================
 * FLASH NOTIFICATION FADE-IN & AUTO FADE-OUT ANIMATION
 * ===================================================================== */
@keyframes flashFadeInSlide {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flashTimerShrink {
    0% { width: 100%; }
    100% { width: 0%; }
}

.flash-alert-item {
    position: relative;
    overflow: hidden;
    animation: flashFadeInSlide 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.45s ease, margin 0.45s ease, padding 0.45s ease;
    max-height: 220px;
}

.flash-alert-item.is-fading-out {
    opacity: 0 !important;
    transform: translateY(-6px) scale(0.99) !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 0 !important;
    pointer-events: none;
}

.flash-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2.5px;
    background: currentColor;
    opacity: 0.3;
    animation: flashTimerShrink 5.5s linear forwards;
}

.flash-alert-item:hover .flash-progress-bar {
    animation-play-state: paused;
}

/* =====================================================================
 * NAZEXA SOFT FLOATING CARDS, GRADIENT BUTTONS & TABLE POLISH
 * ===================================================================== */
.ent-card,
.ent-page-header {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 30px -10px rgba(30, 58, 138, 0.07) !important;
    padding: 1.25rem;
}

.ent-hero-banner {
    background: linear-gradient(135deg, #172554 0%, #1e3a8a 55%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 1.125rem !important;
    box-shadow: 0 14px 32px -8px rgba(37, 99, 235, 0.25) !important;
    padding: 1.35rem;
}

@media (min-width: 640px) {
    .ent-page-header,
    .ent-hero-banner {
        padding: 1.5rem 1.75rem;
    }
}

/* Soft Indigo Elevation pada Kartu Putih di dalam Workspace */
main .bg-white.rounded-2xl,
main .bg-white.rounded-xl {
    border-color: #e2e8f0 !important;
    box-shadow: 0 8px 26px -8px rgba(30, 58, 138, 0.06), 0 2px 6px -1px rgba(30, 58, 138, 0.03) !important;
}

/* Aksen garis atas kartu berwarna Indigo-Blue modern */
main .border-t-4.border-t-\[\#0f2547\] {
    border-top-width: 3px !important;
    border-top-color: #2563eb !important;
}

/* Header Tabel Beraksen Soft Indigo-Slate (#EEF2FF / #1E293B) */
main table thead tr.bg-\[\#0f2547\],
main table thead tr.bg-navy-900 {
    background: linear-gradient(90deg, #172554 0%, #1e3a8a 100%) !important;
    color: #ffffff !important;
}

main table thead tr.bg-\[\#0f2547\] th,
main table thead tr.bg-navy-900 th {
    color: #ffffff !important;
    font-weight: 700 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Tombol Aksi Utama dengan Gradasi Royal Blue-Indigo (#2563EB -> #4F46E5) */
.nz-btn-primary,
main button.bg-\[\#0f2547\],
main a.bg-\[\#0f2547\],
main button.bg-\[\#2563EB\],
main a.bg-\[\#2563EB\],
main button.bg-teal-600,
main a.bg-teal-600,
main button.bg-indigo-600,
main a.bg-indigo-600 {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.38) !important;
    transition: all 0.2s ease !important;
}

.nz-btn-primary:hover,
main button.bg-\[\#0f2547\]:hover,
main a.bg-\[\#0f2547\]:hover,
main button.bg-\[\#2563EB\]:hover,
main a.bg-\[\#2563EB\]:hover,
main button.bg-teal-600:hover,
main a.bg-teal-600:hover,
main button.bg-indigo-600:hover,
main a.bg-indigo-600:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%) !important;
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.5) !important;
    transform: translateY(-1px);
}

/* Standardized Button Sizes */
.ent-btn-md {
    min-height: 2.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ent-btn-sm {
    min-height: 2rem;
    padding: 0.375rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* =====================================================================
 * ONE-HANDED TOUCH TARGET & OUTDOOR SUNLIGHT CONTRAST SYSTEM
 * ===================================================================== */
.touch-target-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

/* Mode Sinar Matahari (Outdoor High Contrast Mode) */
body.sunlight-mode,
.sunlight-mode .absensi-container-panel {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.sunlight-mode .student-attendance-card {
    background-color: #ffffff !important;
    border: 2px solid #0f172a !important;
}

.sunlight-mode .student-name-label {
    color: #000000 !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
}

.sunlight-mode .status-pill-btn:not(.is-selected) {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border: 1.5px solid #475569 !important;
    font-weight: 700 !important;
}

.sunlight-mode .status-pill-btn.is-selected[data-status="Hadir"] {
    background-color: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.sunlight-mode .status-pill-btn.is-selected[data-status="Izin"] {
    background-color: #f59e0b !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}

.sunlight-mode .status-pill-btn.is-selected[data-status="Sakit"] {
    background-color: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.sunlight-mode .status-pill-btn.is-selected[data-status="Alpa"] {
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}
