/* ==========================================================================
   Absensi Online — tema dashboard admin
   ========================================================================== */
:root {
    --brand-1: #4338ca;
    --brand-2: #7c3aed;
    --brand-3: #a855f7;
    --ink: #1e1b3a;
    --muted: #6b7280;
    --bg: #f4f5fb;
    --card: #ffffff;
    --line: #eceef5;
    --radius: 18px;
    --shadow: 0 10px 30px -12px rgba(49, 46, 129, .18);
    --sidebar-w: 260px;
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    /* Warna tema (ditimpa oleh html[data-theme=...] di bawah) */
    --sb-1: #1e1b4b; --sb-2: #312e81; --sb-3: #4c1d95;
    --sb-text: #c7d2fe; --sb-label: #818cf8; --sb-glow: 168, 85, 247;
    --logo-1: #818cf8; --logo-2: #c084fc;
    --accent-1: #6366f1; --accent-2: #7c3aed; --accent-soft: #e0e7ff;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: var(--bs-primary);
    --bs-link-color-rgb: var(--bs-primary-rgb);
    --bs-border-radius: 12px;
}

body { background: var(--bg); color: var(--ink); font-family: var(--bs-body-font-family); }
a { text-decoration: none; }

/* ---------- Layout ---------- */
.app-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
    background: linear-gradient(165deg, var(--sb-1) 0%, var(--sb-2) 45%, var(--sb-3) 100%);
    color: var(--sb-text); display: flex; flex-direction: column; padding: 22px 16px;
    overflow-y: auto;
}
.app-sidebar::after {
    content: ''; position: absolute; width: 260px; height: 260px; right: -120px; top: -80px;
    background: radial-gradient(circle, rgba(var(--sb-glow), .35), transparent 70%); pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 4px 10px 22px; font-weight: 800; font-size: 1.1rem; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem;
    background: linear-gradient(135deg, var(--logo-1), var(--logo-2)); box-shadow: 0 8px 20px -6px rgba(var(--sb-glow), .7);
}
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--sb-text); opacity: .8; letter-spacing: .04em; }
.nav-section { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-label); margin: 18px 12px 8px; font-weight: 700; }
.side-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
    color: var(--sb-text); font-weight: 600; font-size: .92rem; margin-bottom: 2px; transition: .15s;
}
.side-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-link.active { background: #fff; color: var(--bs-primary); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
.side-link .count {
    margin-left: auto; background: #f59e0b; color: #fff; border-radius: 99px; font-size: .7rem;
    padding: 2px 8px; font-weight: 800;
}

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.app-topbar {
    position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px;
    padding: 16px 28px; background: rgba(244, 245, 251, .85); backdrop-filter: blur(10px);
}
.app-topbar h1 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.app-topbar .sub { color: var(--muted); font-size: .85rem; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.tool-btn { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 0; border-radius: 14px; padding: 6px 10px; box-shadow: var(--shadow); color: var(--ink); font-weight: 700; font-size: .88rem; }
.tool-btn:hover { background: #fafbff; }
.tool-btn .bi-palette-fill { color: var(--bs-primary); font-size: 1.15rem; }
.tool-btn .who { line-height: 1.15; text-align: left; }
.tool-btn .who small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.dropdown-menu { border: 0; border-radius: 16px; box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .3); padding: 8px; }
.dropdown-item { border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.dropdown-item.active, .dropdown-item:active { background: var(--accent-soft); color: var(--ink); }
.swatch { width: 22px; height: 22px; border-radius: 8px; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.theme-item .bi-check2 { margin-left: auto; color: var(--bs-primary); visibility: hidden; }
.theme-item.active .bi-check2 { visibility: visible; }
.app-content { padding: 8px 28px 40px; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .app-sidebar.show { transform: none; box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .45); }
    .app-main { margin-left: 0; }
    .app-topbar, .app-content { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Tema warna (dipilih di topbar, disimpan per browser) ---------- */
html[data-theme='biru'] {
    --sb-1: #0b1b3d; --sb-2: #1e3a8a; --sb-3: #1d4ed8; --sb-text: #bfdbfe; --sb-label: #60a5fa; --sb-glow: 56, 189, 248;
    --logo-1: #60a5fa; --logo-2: #38bdf8; --accent-1: #3b82f6; --accent-2: #2563eb; --accent-soft: #dbeafe;
    --bs-primary: #2563eb; --bs-primary-rgb: 37, 99, 235;
}
html[data-theme='hijau'] {
    --sb-1: #022c22; --sb-2: #065f46; --sb-3: #047857; --sb-text: #a7f3d0; --sb-label: #34d399; --sb-glow: 45, 212, 191;
    --logo-1: #34d399; --logo-2: #2dd4bf; --accent-1: #10b981; --accent-2: #059669; --accent-soft: #d1fae5;
    --bs-primary: #059669; --bs-primary-rgb: 5, 150, 105;
}
html[data-theme='oranye'] {
    --sb-1: #431407; --sb-2: #9a3412; --sb-3: #c2410c; --sb-text: #fed7aa; --sb-label: #fb923c; --sb-glow: 251, 191, 36;
    --logo-1: #fb923c; --logo-2: #fbbf24; --accent-1: #f97316; --accent-2: #ea580c; --accent-soft: #ffedd5;
    --bs-primary: #ea580c; --bs-primary-rgb: 234, 88, 12;
}
html[data-theme='merah'] {
    --sb-1: #4c0519; --sb-2: #9f1239; --sb-3: #be123c; --sb-text: #fecdd3; --sb-label: #fb7185; --sb-glow: 244, 114, 182;
    --logo-1: #fb7185; --logo-2: #f472b6; --accent-1: #f43f5e; --accent-2: #e11d48; --accent-soft: #ffe4e6;
    --bs-primary: #e11d48; --bs-primary-rgb: 225, 29, 72;
}
html[data-theme='gelap'] {
    --sb-1: #020617; --sb-2: #0f172a; --sb-3: #1e293b; --sb-text: #cbd5e1; --sb-label: #64748b; --sb-glow: 148, 163, 184;
    --logo-1: #475569; --logo-2: #94a3b8; --accent-1: #334155; --accent-2: #0f172a; --accent-soft: #e2e8f0;
    --bs-primary: #334155; --bs-primary-rgb: 51, 65, 85;
}

/* ---------- Kartu ---------- */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 16px 20px; font-weight: 700; }
.card-title-sm { font-weight: 800; font-size: 1rem; margin: 0; }

.stat {
    position: relative; overflow: hidden; border-radius: var(--radius); padding: 20px; color: #fff;
    box-shadow: var(--shadow); min-height: 122px;
}
.stat::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -40px; top: -40px; background: rgba(255, 255, 255, .14); }
.stat .label { font-size: .82rem; opacity: .9; font-weight: 600; }
.stat .value { font-size: 2.1rem; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.stat .hint { font-size: .78rem; opacity: .85; }
.stat i.bg-icon { position: absolute; right: 18px; bottom: 12px; font-size: 2.6rem; opacity: .35; }
.g-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.g-green { background: linear-gradient(135deg, #34d399, #059669); }
.g-amber { background: linear-gradient(135deg, #fbbf24, #f97316); }
.g-sky { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.g-rose { background: linear-gradient(135deg, #fb7185, #e11d48); }
.g-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

/* ---------- Tabel ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: 14px 16px; border-color: var(--line); }
.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    font-weight: 700; background: #fafbff; border-bottom: 1px solid var(--line);
}
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(var(--bs-primary-rgb), .04); }
.person { display: flex; align-items: center; gap: 12px; }
.person .name { font-weight: 700; }
.person .meta { color: var(--muted); font-size: .8rem; }

/* ---------- Avatar & badge ---------- */
.avatar {
    display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 14px; font-weight: 800;
    color: #fff; background: var(--av, #6366f1); box-shadow: 0 6px 14px -6px var(--av, #6366f1);
}
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; border-radius: 10px; }
.avatar-md { width: 40px; height: 40px; font-size: .85rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }

.soft-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.soft-success { background: #d1fae5; color: #047857; }
.soft-warning { background: #fef3c7; color: #b45309; }
.soft-danger { background: #ffe4e6; color: #be123c; }
.soft-info { background: #e0f2fe; color: #0369a1; }
.soft-primary { background: var(--accent-soft); color: var(--bs-primary); }
.soft-violet { background: #ede9fe; color: #6d28d9; }
.soft-muted { background: #f1f5f9; color: #64748b; }

.badge { border-radius: 99px; font-weight: 700; padding: .4em .75em; }

/* ---------- Form & tombol ---------- */
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); border: 0; box-shadow: 0 8px 18px -8px rgba(var(--bs-primary-rgb), .8); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); filter: brightness(.92); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); border: 0; }
.form-control, .form-select { border-radius: 12px; border-color: #e5e7eb; padding: .6rem .9rem; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15); }
.form-label { font-weight: 600; font-size: .88rem; }

.seg { display: inline-flex; background: #fff; border-radius: 14px; padding: 4px; box-shadow: var(--shadow); gap: 2px; flex-wrap: wrap; }
.seg a { padding: 7px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; gap: 6px; }
.seg a.active { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: #fff; }
.seg .count { background: #f59e0b; color: #fff; border-radius: 99px; font-size: .68rem; padding: 1px 7px; }

.selfie { width: 40px; height: 40px; object-fit: cover; border-radius: 12px; cursor: zoom-in; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); }
.alert { border: 0; border-radius: 14px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty i { font-size: 2.6rem; color: rgba(var(--bs-primary-rgb), .3); display: block; margin-bottom: 8px; }

.request-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.request-item:last-child { border-bottom: 0; }
.kind-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.05rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
    position: relative; overflow: hidden; color: #fff; padding: 56px;
    background: linear-gradient(150deg, #1e1b4b, #4338ca 50%, #9333ea);
    display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero .blob { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.login-hero h2 { font-size: 2.4rem; font-weight: 800; line-height: 1.2; max-width: 460px; }
.login-hero .feature { display: flex; gap: 12px; align-items: center; margin-top: 14px; color: #e0e7ff; }
.login-hero .feature i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); }
.login-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.login-form .inner { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}

/* ---------- Halaman Karyawan ---------- */
.mini-stat { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); height: 100%; }
.ms-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.35rem; color: #fff; background: var(--c); box-shadow: 0 10px 20px -10px var(--c); }
.ms-value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.ms-value small { font-size: .9rem; color: var(--muted); font-weight: 700; }
.ms-label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.ms-bar { height: 6px; border-radius: 99px; background: #eef0f7; overflow: hidden; margin-top: 6px; }
.ms-bar span { display: block; height: 100%; border-radius: 99px; }

.emp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.emp-toolbar .seg { box-shadow: none; background: #f4f5fb; }
.search-box { position: relative; flex: 1 1 260px; max-width: 360px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .form-control { padding-left: 40px; background: #f8f9fc; }

.avatar-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.avatar-wrap .dot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.avatar-wrap .dot.on { background: #10b981; }
.avatar-wrap.big .avatar { box-shadow: 0 0 0 4px #fff, 0 12px 24px -10px var(--av, #6366f1); }
.avatar-wrap.big .dot { width: 16px; height: 16px; right: 0; bottom: 0; border-width: 3px; }
.chip-dept { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 2px 10px; font-size: .72rem; font-weight: 700; }
.info-line { display: flex; align-items: center; gap: 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 12px; font-size: .75rem; font-weight: 700; background: #f1f5f9; color: #64748b; }
.status-pill i { font-size: .5rem; }
.status-pill.on { background: #d1fae5; color: #047857; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; display: inline-grid; place-items: center; background: #f4f5fb; color: var(--muted); transition: .15s; }
.icon-btn:hover { background: rgba(var(--bs-primary-rgb), .1); color: var(--bs-primary); }
.emp-table tr.is-inactive > td { opacity: .55; }
.emp-table tr.is-inactive > td:last-child { opacity: 1; }

.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 18px; }
.emp-card { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 16px; overflow: hidden; transition: transform .15s, box-shadow .15s; background: #fff; }
.emp-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 78px; background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); opacity: .14; }
.emp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.emp-card > * { position: relative; }
.emp-card.is-inactive { filter: grayscale(.8); opacity: .7; }
.emp-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.emp-card .name { font-weight: 800; }
.emp-card .meta { color: var(--muted); font-size: .8rem; }
.emp-card-facts { display: grid; gap: 6px; font-size: .82rem; margin: 14px 0 12px; padding: 12px; border-radius: 14px; background: #f8f9fc; }
.emp-card-facts div { display: flex; gap: 8px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) {
    .mini-stat { padding: 12px; gap: 10px; }
    .ms-icon { width: 40px; height: 40px; font-size: 1.1rem; }
    .ms-value { font-size: 1.25rem; }
    .emp-grid { padding: 12px; }
    .search-box { max-width: none; }
}
