/* =====================================================
   Sistem Absensi Pegawai - Kantor Imigrasi
   Main Stylesheet
   ===================================================== */

:root {
    --navy:         #1a3a5c;
    --navy-dark:    #122843;
    --navy-light:   #234975;
    --navy-accent:  #2e5f8a;
    --white:        #ffffff;
    --gray-100:     #f8f9fa;
    --gray-200:     #e9ecef;
    --gray-500:     #6c757d;
    --sidebar-w:    260px;
    --topbar-h:     64px;
    --transition:   0.25s ease;
    --shadow-sm:    0 2px 8px rgba(0,0,0,.08);
    --shadow-md:    0 4px 16px rgba(0,0,0,.12);
    --radius:       10px;
}

/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: #f0f4f8;
    color: #2d3748;
    font-size: 14px;
    overflow-x: hidden;
}
a { color: var(--navy-accent); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: none; }

/* ── Sidebar ─────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: transform var(--transition), width var(--transition);
    overflow: hidden;
}
#sidebar.collapsed { width: 68px; }
#sidebar.collapsed .sidebar-label,
#sidebar.collapsed .sidebar-logo-text,
#sidebar.collapsed .sidebar-section-title { display: none; }
#sidebar.collapsed .nav-item .nav-link { justify-content: center; padding: 12px 0; }
#sidebar.collapsed .nav-item .nav-link i { margin-right: 0; font-size: 18px; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: var(--topbar-h);
}
.sidebar-logo-icon {
    width: 38px; height: 38px;
    background: var(--white);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-logo-icon img { width: 28px; height: 28px; object-fit: contain; }
.sidebar-logo-text h6 {
    color: var(--white);
    font-size: 13px; font-weight: 700;
    margin: 0; line-height: 1.3;
}
.sidebar-logo-text small {
    color: rgba(255,255,255,.55);
    font-size: 11px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.sidebar-section-title {
    color: rgba(255,255,255,.4);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 18px 6px;
}

#sidebar .nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0;
    color: rgba(255,255,255,.7);
    padding: 11px 18px;
    border-radius: 0;
    transition: background var(--transition), color var(--transition), padding-left var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}
#sidebar .nav-item .nav-link i {
    width: 22px;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
    text-align: center;
}
#sidebar .nav-item .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    padding-left: 24px;
}
#sidebar .nav-item .nav-link.active {
    background: rgba(255,255,255,.13);
    color: #fff;
    font-weight: 600;
    border-left: 3px solid #fff;
}
#sidebar .nav-item .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: rgba(255,255,255,.9);
    border-radius: 0 2px 2px 0;
}

.sidebar-badge {
    margin-left: auto;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.7);
    font-size: 12.5px;
}
.sidebar-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--navy-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user-info .user-name { font-weight: 600; color: #fff; }
.sidebar-user-info .user-role { font-size: 11px; color: rgba(255,255,255,.5); }

/* ── Topbar ──────────────────────────────────────── */
#topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1040;
    gap: 16px;
    transition: left var(--transition);
    box-shadow: var(--shadow-sm);
}
#sidebar.collapsed ~ #main-wrapper #topbar { left: 68px; }

#btn-toggle-sidebar {
    background: none;
    border: none;
    color: var(--navy);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.topbar-title { font-weight: 600; font-size: 16px; color: var(--navy); }

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-date {
    color: var(--gray-500);
    font-size: 12.5px;
    display: flex; align-items: center; gap: 5px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background var(--transition);
}
.topbar-user:hover { background: var(--gray-100); }
.topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--navy);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px;
}
.topbar-user-info .user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.topbar-user-info .user-role { font-size: 11px; color: var(--gray-500); }

/* ── Main Content ─────────────────────────────────── */
#main-wrapper {
    margin-left: var(--sidebar-w);
    transition: margin-left var(--transition);
}
#sidebar.collapsed ~ #main-wrapper { margin-left: 68px; }

#main-content {
    padding: 90px 24px 32px;
    min-height: 100vh;
}

/* ── Breadcrumb ──────────────────────────────────── */
.breadcrumb-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}
.breadcrumb {
    background: transparent;
    padding: 0; margin: 0;
    font-size: 12.5px;
}
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--gray-500); }
.breadcrumb-item a { color: var(--navy-accent); }
.breadcrumb-item.active { color: var(--gray-500); }

/* ── Cards ───────────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--navy);
}
.card-body { padding: 20px; }

/* ── Stat Widgets ─────────────────────────────────── */
.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    border-left: 4px solid transparent;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.green  { border-left-color: #27ae60; }
.stat-card.yellow { border-left-color: #f39c12; }
.stat-card.blue   { border-left-color: #2980b9; }
.stat-card.red    { border-left-color: #e74c3c; }
.stat-card.purple { border-left-color: #8e44ad; }
.stat-card.orange { border-left-color: #e67e22; }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-card.green  .stat-icon { background: #eafaf1; color: #27ae60; }
.stat-card.yellow .stat-icon { background: #fef9e7; color: #f39c12; }
.stat-card.blue   .stat-icon { background: #eaf4fb; color: #2980b9; }
.stat-card.red    .stat-icon { background: #fdedec; color: #e74c3c; }
.stat-card.purple .stat-icon { background: #f5eef8; color: #8e44ad; }
.stat-card.orange .stat-icon { background: #fdf2e9; color: #e67e22; }

.stat-info .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.stat-info .stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ── Tables ──────────────────────────────────────── */
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.table { margin: 0; }
.table thead tr th {
    background: var(--gray-100);
    color: var(--navy);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 14px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.table tbody tr td {
    padding: 11px 14px;
    vertical-align: middle;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f3f5;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr.row-alpha { background: #fff5f5; }
.table tbody tr.row-alpha:hover { background: #fee; }

/* ── Badges ──────────────────────────────────────── */
.badge { font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.badge-aktif    { background: #eafaf1; color: #1e8449; }
.badge-nonaktif { background: #fdf2f2; color: #c0392b; }
.badge-hadir    { background: #eafaf1; color: #1e8449; }
.badge-izin     { background: #fef9e7; color: #b7770d; }
.badge-sakit    { background: #eaf3fb; color: #1a5276; }
.badge-cuti     { background: #f5eef8; color: #6c3483; }
.badge-alpha    { background: #fdf2f2; color: #c0392b; }
.badge-pending  { background: #fef9e7; color: #b7770d; }
.badge-approved { background: #eafaf1; color: #1e8449; }
.badge-rejected { background: #fdf2f2; color: #c0392b; }

/* ── Table Row Animations ───────────────────────── */
@keyframes newRowSlide {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes highlightPulse {
    0% {
        background-color: #d4edda;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }
    50% {
        background-color: #e8f5e9;
        box-shadow: 0 0 0 8px rgba(40, 167, 69, 0);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes updateGlow {
    0% {
        background-color: #fff3cd;
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        background-color: #fffbeb;
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.table tbody tr.new-row {
    animation: newRowSlide 0.5s ease-out, highlightPulse 2s ease-out;
}

.table tbody tr.updated-row {
    animation: updateGlow 1.5s ease-out;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-navy {
    background: var(--navy);
    color: #fff;
    border: none;
    font-weight: 600;
}
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-sm { font-size: 12px; padding: 4px 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ── Form Controls ───────────────────────────────── */
.form-control, .custom-select {
    border-radius: 8px;
    border: 1.5px solid #dde1e7;
    font-size: 13.5px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .custom-select:focus {
    border-color: var(--navy-accent);
    box-shadow: 0 0 0 3px rgba(46,95,138,.15);
}
.input-group-text { background: var(--gray-100); border-color: #dde1e7; }
.form-label { font-weight: 600; font-size: 12.5px; color: #4a5568; margin-bottom: 6px; }

/* ── Search Bar ──────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap .form-control { padding-left: 38px; }
.search-wrap .search-icon {
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-500); font-size: 14px;
    pointer-events: none;
}

/* ── Pagination ──────────────────────────────────── */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    border: 1.5px solid var(--gray-200);
    color: var(--navy);
    font-size: 13px;
    padding: 5px 12px;
}
.pagination .page-item.active .page-link {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.pagination .page-link:hover { background: var(--gray-100); color: var(--navy); border-color: #c8d0db; }
.pagination-info { font-size: 12.5px; color: var(--gray-500); }

/* ── Alerts / Banners ────────────────────────────── */
.alert { border-radius: var(--radius); border: none; font-size: 13.5px; }
.alert-warning { background: #fef9e7; color: #7d6608; border-left: 4px solid #f1c40f; }
.alert-danger  { background: #fdf2f2; color: #7b241c; border-left: 4px solid #e74c3c; }
.alert-success { background: #eafaf1; color: #1a5631; border-left: 4px solid #27ae60; }

/* ── Progress Bar ────────────────────────────────── */
.progress { border-radius: 10px; background: var(--gray-100); }
.progress-bar { border-radius: 10px; }

/* ── Charts ──────────────────────────────────────── */
.chart-container { position: relative; }

/* ── Absensi Status Dropdown ─────────────────────── */
.status-select { min-width: 110px; }
.status-select.hadir  { background: #eafaf1; border-color: #a9dfbf; color: #1e8449; }
.status-select.izin   { background: #fef9e7; border-color: #f9e79f; color: #b7770d; }
.status-select.sakit  { background: #eaf3fb; border-color: #aed6f1; color: #1a5276; }
.status-select.cuti   { background: #f5eef8; border-color: #d2a8e2; color: #6c3483; }
.status-select.alpha  { background: #fdf2f2; border-color: #f1948a; color: #c0392b; }

/* ── Login Page ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: hidden;
}
.login-header {
    background: var(--navy-dark);
    padding: 32px 36px 24px;
    text-align: center;
    color: #fff;
}
.login-logo {
    width: 70px; height: 70px;
    background: #fff;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.login-logo img { width: 48px; height: 48px; object-fit: contain; }
.login-header h4 { font-weight: 700; font-size: 18px; margin: 0; }
.login-header p  { font-size: 12.5px; color: rgba(255,255,255,.6); margin: 6px 0 0; }
.login-body { background: #fff; padding: 32px 36px; }
.login-body .form-control { height: 46px; border-radius: 10px; }
.password-wrap { position: relative; }
.password-wrap .toggle-password {
    position: absolute;
    right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--gray-500);
    cursor: pointer; font-size: 16px; padding: 0;
}
.btn-login {
    width: 100%; height: 46px;
    background: var(--navy);
    border: none; border-radius: 10px;
    color: #fff; font-weight: 700; font-size: 15px;
    transition: background var(--transition);
}
.btn-login:hover { background: var(--navy-dark); }

/* ── Countdown Timer ─────────────────────────────── */
.countdown-timer {
    font-weight: 700;
    font-size: 1.1em;
    font-variant-numeric: tabular-nums;
}

/* ── Mini Calendar ────────────────────────────────── */
.mini-calendar { font-size: 12.5px; }
.mini-calendar .cal-header {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 13px; margin-bottom: 8px;
    color: var(--navy);
}
.mini-calendar .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.mini-calendar .cal-day-label {
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--gray-500);
    padding: 4px 0;
}
.mini-calendar .cal-day {
    text-align: center;
    padding: 5px 2px;
    border-radius: 6px;
    cursor: default;
    line-height: 1;
    position: relative;
    font-size: 13px;
}
.mini-calendar .cal-day:hover { background: var(--gray-100); }
.mini-calendar .cal-day[data-clickable="1"] {
    cursor: pointer;
}
.mini-calendar .cal-day[data-clickable="1"]:hover {
    background: var(--navy-light);
    color: #fff;
    transform: scale(1.05);
    transition: all 0.2s ease;
}
.mini-calendar .cal-day.today {
    background: var(--navy);
    color: #fff;
    font-weight: 700;
}
.mini-calendar .cal-day.holiday {
    background: #fef9e7;
    color: #b7770d;
    font-weight: 600;
    border: 1px solid #f1c40f;
}
.mini-calendar .cal-day.has-data {
    background: #e8f8f5;
    color: #27ae60;
    font-weight: 600;
}
.mini-calendar .cal-day.has-data::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #27ae60;
}
.mini-calendar .cal-day.today.has-data::after {
    background: #fff;
}
.mini-calendar .cal-day.other-month { color: #ccc; }
.mini-calendar .cal-day.weekend { color: #e74c3c; }

/* ── DateTime Widget ─────────────────────────────── */
.datetime-widget {
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5f8d 50%, #3a7ab5 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(26, 58, 92, 0.25);
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.datetime-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.datetime-widget::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.datetime-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 40px;
    position: relative;
    z-index: 1;
}

.datetime-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.datetime-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.datetime-icon i {
    font-size: 32px;
    color: #fff;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.datetime-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.datetime-date {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.datetime-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.datetime-location i {
    font-size: 12px;
}

.datetime-right {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.12);
    padding: 20px 32px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.datetime-time {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Courier New', 'Courier', monospace;
    letter-spacing: 2px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    line-height: 1;
    transition: transform 0.2s ease;
}

.datetime-time:hover {
    transform: scale(1.02);
}

.datetime-zone {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 8px;
    letter-spacing: 1px;
}

/* Responsive datetime widget */
@media (max-width: 992px) {
    .datetime-content {
        padding: 24px 30px;
    }
    
    .datetime-date {
        font-size: 24px;
    }
    
    .datetime-time {
        font-size: 40px;
    }
}

@media (max-width: 768px) {
    .datetime-content {
        flex-direction: column;
        gap: 20px;
        padding: 24px 20px;
    }
    
    .datetime-left {
        width: 100%;
        justify-content: center;
    }
    
    .datetime-right {
        width: 100%;
        justify-content: center;
    }
    
    .datetime-date {
        font-size: 20px;
    }
    
    .datetime-time {
        font-size: 36px;
    }
}

/* ── Loading Spinner ─────────────────────────────── */
.spinner-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.spinner-overlay.show { display: flex; }
.spinner-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-md);
}
.spinner-box .spinner-text { font-size: 13px; color: var(--navy); font-weight: 600; }

/* ── Modal ───────────────────────────────────────── */
.modal-header { background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.modal-header .close { color: #fff; opacity: .8; }
.modal-footer { border-top: 1px solid var(--gray-200); }

/* ── Print ───────────────────────────────────────── */
@media print {
    #sidebar, #topbar, .no-print { display: none !important; }
    #main-wrapper { margin-left: 0 !important; }
    #main-content { padding: 0 !important; }
    .card { box-shadow: none !important; }
    .table tbody tr.row-alpha { background: #ffe0e0 !important; -webkit-print-color-adjust: exact; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    #sidebar.mobile-open {
        transform: translateX(0);
    }
    #main-wrapper { margin-left: 0 !important; }
    #topbar { left: 0 !important; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1045;
    }
    .sidebar-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
    #main-content { padding: 80px 14px 24px; }
    .stat-card { padding: 14px; }
    .stat-info .stat-value { font-size: 22px; }
}

/* ── Badge Status Absensi ────────────────────────── */
.badge-hadir    { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.badge-izin     { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.badge-sakit    { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.badge-alpha    { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.badge-cuti     { background: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.badge-default  { background: var(--gray-200); color: var(--gray-500); border: 1px solid #c8c9ca; }

.badge-sm {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* ── Auto Refresh Countdown ──────────────────────── */
.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--gray-500);
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.auto-refresh-indicator i {
    font-size: 10px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auto-refresh-indicator #countdown {
    font-weight: 700;
    color: var(--navy-accent);
    min-width: 8px;
    text-align: center;
}

/* ── Utilities ───────────────────────────────────── */
.text-navy    { color: var(--navy) !important; }
.bg-navy      { background: var(--navy) !important; }
.fw-600       { font-weight: 600; }
.rounded-10   { border-radius: 10px; }
.gap-2        { gap: 8px; }
.nip-text     { font-family: 'Courier New', monospace; font-size: 12.5px; color: var(--navy-accent); font-weight: 600; }
