@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/outfit/outfit-variable.woff2') format('woff2');
}

body {
    font-family: 'Outfit', 'Segoe UI', Roboto, Arial, sans-serif;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Fancy checkbox (2026-09-24, user-requested design — adapted to this
   app's brand-500 instead of the original #07f, plus dark mode). Markup:
   <label class="cbx"><input type="checkbox" class="inp-cbx" ...>
     <span><svg width="12" height="10"><use xlink:href="#app-cbx-check"/></svg></span>
     <span>Label text</span>
   </label>
   The #app-cbx-check <symbol> is defined ONCE per page in the layout
   (see layouts/admin.php / layouts/employee.php) — svg <use> just
   references it, so many checkboxes on one page never duplicate an id. */
.cbx { user-select: none; cursor: pointer; display: inline-flex; align-items: center; }
.cbx .inp-cbx { position: absolute; opacity: 0; width: 0; height: 0; }
.cbx > span:first-of-type {
    position: relative;
    width: 18px; height: 18px;
    border-radius: 4px;
    border: 1px solid #d0d5dd;
    background-color: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 1px rgba(0,16,75,0.05);
    flex-shrink: 0;
}
.cbx > span:first-of-type svg {
    position: absolute;
    top: 3px; left: 2px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 16px;
    stroke-dashoffset: 16px;
    transition: stroke-dashoffset 0.3s ease 0.1s;
}
.cbx > span:last-child { padding-left: 8px; line-height: 18px; }
.cbx:hover > span:first-of-type { border-color: #465fff; }
.cbx .inp-cbx:checked + span:first-of-type {
    background: #465fff;
    border-color: #465fff;
    animation: cbx-wave 0.4s ease;
}
.cbx .inp-cbx:checked + span:first-of-type svg { stroke-dashoffset: 0; }
.cbx .inp-cbx:focus-visible + span:first-of-type { outline: 2px solid #465fff; outline-offset: 2px; }
@keyframes cbx-wave { 50% { transform: scale(0.9); } }

html.dark .cbx > span:first-of-type { border-color: #313d56; background-color: #131b2c; }
html.dark .cbx:hover > span:first-of-type { border-color: #8fa1ff; }
html.dark .cbx .inp-cbx:checked + span:first-of-type { background: #465fff; border-color: #465fff; }

/* [x-cloak] hides an element until Alpine has initialized — Alpine
   itself only removes the attribute, the actual hiding needs this rule.
   Shared by both layouts/admin.php and layouts/employee.php (both load
   this file via layouts/_tailwind_config.php), so it only needs to
   exist once. */
[x-cloak] { display: none !important; }

/* Smooth dark/light switch (2026-09-24, user-requested) — one rule
   covers every element's color-related properties without needing a
   `transition-colors` utility class added everywhere; layout-affecting
   properties are deliberately untouched so this can't cause jank. */
:where(*, *::before, *::after) {   /* :where = spesifisitas 0, supaya utilitas/komponen yang punya transisi sendiri tidak ditimpa (docs/erp/ANIMASI-UI.md §1) */
    transition-property: background-color, border-color, color, fill, stroke, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* DataTables RowGroup header rows (2026-09-24, user-requested — group Hari
   Raya by year / Slip Gaji by periode, matching the old app's "Tahun 2026"
   style group headers). RowGroup 1.4.x's default className is "dtrg-group"
   (NOT "group" — an earlier version of this rule targeted the wrong class,
   so only rowGroup.dataTables.min.css's own plain-gray default applied). */
table.dataTable tr.dtrg-group td,
table.dataTable tr.group td {
    background-color: #eef2ff !important;
    color: #465fff;
    font-weight: 600;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: none;
}
html.dark table.dataTable tr.dtrg-group td,
html.dark table.dataTable tr.group td {
    background-color: rgba(70, 95, 255, 0.14) !important;
    color: #8fa1ff;
}

/* DataTables — light theme tweaks so it blends with the TailAdmin look
   instead of its plain default styling (see memory/feedback_datatables.md:
   every table in this app uses DataTables). */
.dataTables_wrapper { font-family: 'Outfit', 'Segoe UI', Roboto, Arial, sans-serif; font-size: 13px; color: #475467; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
}
table.dataTable thead th { color: #667085; font-weight: 500; border-bottom: 1px solid #e4e7ec !important; }
table.dataTable tbody td { border-bottom: 1px solid #f2f4f7; padding: 0.5rem 0.75rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #465fff !important;
    color: #fff !important;
    border-radius: 6px;
    border: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 6px; }

/* ===== Gerak antarmuka (2026-10-10; spesifikasi docs/erp/ANIMASI-UI.md, sumber pertama sistem-saas) ===== */
/* Dialog Alpine (overlay fixed inset-0 ber-x-show): kotaknya naik + membesar halus; latar memakai x-transition.opacity bawaan. Tanpa buram latar (berat digambar ulang). */
@keyframes dlg-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.fixed.inset-0[x-show] { backdrop-filter: none !important; }
.fixed.inset-0[x-show] > :is(div, img, form) { animation: dlg-in 380ms cubic-bezier(.25, .8, .25, 1) both; will-change: transform, opacity; }

/* Isi halaman muncul (scroll-reveal) kini ditangani Motion Kit (public/assets/js/motion-app.js memasang data-mo-reveal). Aturan di bawah hanya
   menyembunyikan blok sejak cat pertama agar tidak berkedip; html.mo-pre dipasang skrip di <head> (kecuali prefers-reduced-motion) dan dilepas motion-app.js. */
html.mo-pre main > :where(*:not(.fixed):not(.modal-bg):not(script):not(style):not(template):not([data-no-motion])),
html.mo-pre main > .grid > * { opacity: 0; animation: mo-failsafe-o .01s 2.5s forwards; }
@media print { html.mo-pre main > *, html.mo-pre main > .grid > * { opacity: 1 !important; animation: none !important; } }
@media (prefers-reduced-motion: reduce) {
    .fixed.inset-0[x-show] > :is(div, img, form) { animation: none; }
}

/* ===== Sidebar: geser di HP, mode ringkas (ikon saja) di desktop (2026-10-10) ===== */
html.sb-init aside, html.sb-init .sb-content { transition: none !important; }
@media (max-width: 1023px) { aside.sb-m-open { --tw-translate-x: 0px; } }
@media (min-width: 1024px) {
    html.sb-rail aside { width: 76px; }
    html.sb-rail .sb-content { margin-left: 76px; }
    html.sb-rail aside .sb-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    html.sb-rail aside .sb-brand-text { display: none; }
    html.sb-rail aside #sidebarScroll { padding-left: .75rem; padding-right: .75rem; }
    html.sb-rail aside nav > p { font-size: 0; height: 1px; margin: .9rem .5rem; background: #eceff4; }
    html.sb-rail aside nav a, html.sb-rail aside nav button { justify-content: center; padding-left: 0; padding-right: 0; }
    html.sb-rail aside nav a > :not(svg) { display: none; }
    html.sb-rail aside nav button > span:first-child { font-size: 0; gap: 0; }
    html.sb-rail aside nav button > span:last-child { display: none; }
    html.sb-rail aside nav [class*="grid-rows-"] { display: none; }
}
html.dark aside nav > p { background-color: transparent; }

/* ===== Daftar seragam ala Oriel Tech (2026-10-11): kolom cari di kanan atas, tabel lapang, footer info + jumlah + halaman ===== */
.dataTables_wrapper .dt-top { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
div.dataTables_filter, .dataTables_wrapper .dataTables_filter { float: none; text-align: right; margin: 0; }
div.dataTables_filter input, .dataTables_wrapper .dataTables_filter input { margin-left: 0 !important; height: 2.5rem; width: 16rem; max-width: 100%; border: 1px solid #d0d5dd !important; border-radius: .6rem !important; padding: 0 .85rem !important; font-size: .875rem; color: #344054; background: #fff; }
.dataTables_filter input:focus { outline: none; border-color: #9cb9ff; box-shadow: 0 0 0 3px rgba(70, 95, 255, .1); }
.dataTables_filter input::placeholder { color: #98a2b3; }
.dataTables_wrapper .dt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .75rem; }
.dataTables_wrapper .dt-foot-r { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { float: none; padding: 0; margin: 0; }
.dataTables_wrapper .dataTables_length select { height: 2.1rem; padding: 0 .5rem; }
table.dataTable thead th { font-size: .8rem; padding: .85rem .75rem; text-align: left; background: transparent; }
table.dataTable tbody td { padding: .8rem .75rem; }
table.dataTable tbody tr { background: transparent; transition: background-color .15s ease; }
table.dataTable tbody tr:hover { background: #f9fafb; }
.dataTables_wrapper .dataTables_paginate .paginate_button { min-width: 2.1rem; height: 2.1rem; padding: 0 .65rem !important; line-height: 2.1rem; text-align: center; border: none !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) { background: #f2f4f7 !important; color: #344054 !important; border: none !important; }
html.dark table.dataTable tbody tr:hover { background: rgba(255, 255, 255, .04); }
html.dark .dataTables_filter input { background: #131b2c; border-color: #313d56; color: #e1e6f3; }

/* ===== Cetak kode cadangan 2FA: hanya kotak kode, tanpa sidebar/header (2026-10-12) ===== */
.print-only { display: none; }
@media print {
    body.print-codes aside, body.print-codes header, body.print-codes .no-print { display: none !important; }
    body.print-codes .sb-content { margin-left: 0 !important; }
    body.print-codes main > *:not(#recoveryBox) { display: none !important; }
    body.print-codes main { padding: 0 !important; }
    body.print-codes #recoveryBox { border: 1px solid #ccc; background: #fff; }
    body.print-codes .print-only { display: block; }
}

/* ===== Sorotan menu aktif sidebar yang meluncur (sidebar-pill.js + clip-thumb.js; dari sistem-saas, 2026-10-28) ===== */
.sb-pill{position:absolute;inset:0;z-index:0;pointer-events:none;opacity:0;clip-path:inset(0 100% 100% 0);transition:opacity .25s ease}
.sb-pill-on #sidebarScroll nav a{position:relative;z-index:1}
.sb-pill-on #sidebarScroll nav a[data-sidebar-active]{background:transparent!important}
@media(prefers-reduced-motion:reduce){.sb-pill{transition:none}}
#sidebarScroll nav a{transition:box-shadow .35s ease}
#sidebarScroll nav a.sb-click,html.sb-pre #sidebarScroll nav a[data-sidebar-active]{box-shadow:inset 0 0 0 1.5px rgba(70,95,255,.7)}
html.sb-pre #sidebarScroll nav a[data-sidebar-active]{background:transparent!important}
html.sb-pre #sidebarScroll nav a{position:relative;z-index:1}   /* teks menu tetap terlihat di atas sorotan lama selama menunggu */
/* ganti tema: lingkaran membesar dari tombol (View Transitions); animasi bawaan dimatikan, gerak dibuat di toggleDarkMode() layouts/admin.php */
html.theme-vt::view-transition-old(root),html.theme-vt::view-transition-new(root){mix-blend-mode:normal;animation:none}
/* sidebar punya nama VT sendiri untuk perpindahan halaman; saat ganti tema namanya dilepas supaya ikut tercakup lingkaran (bukan berganti warna duluan),
   dan transisi warna CSS dimatikan supaya isi halaman tidak memudar pelan di bawah lingkaran yang sedang membesar */
html.theme-vt aside{view-transition-name:none}
html.theme-vt *,html.theme-vt *::before,html.theme-vt *::after{transition:none!important}

/* ===== Perpindahan halaman mulus (2026-10-28): View Transitions lintas-dokumen. Browser menahan halaman lama sampai halaman baru siap dicat, lalu halaman baru
   memudar masuk: tidak ada layar putih/kedipan antar-halaman. Sidebar diberi nama sendiri sehingga tetap diam (tidak ikut memudar). Chrome/Edge 126+; browser lain: pindah biasa. ===== */
@view-transition { navigation: auto; }
aside { view-transition-name: vt-side; }
::view-transition-group(vt-side), ::view-transition-old(vt-side), ::view-transition-new(vt-side) { animation: none; }
::view-transition-old(vt-side) { display: none; }
::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }   /* isi halaman memakai reveal berurutan (motion-app.js); transisi ini hanya mencegah kedipan putih */
