/*
 * Panel Admin OSM di atas tema Conca (public/vendor/conca, disalin apa adanya dari ERP).
 * Aturan bingkai disalin dari SecureFirst public/css/sms-conca.css (yang mengikuti public/css/erp.css di repo erp)
 * — samakan kalau salah satu berubah. Bagian khusus OSM ada di paling bawah.
 */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
}

:root { --dkm-blue: #1d4ed8; --dkm-blue-dark: #1e3a8a; --dkm-blue-soft: #eff6ff; }

/* ---- logo ---------------------------------------------------------------- */
.app-sidebar-logo { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.brand-logo { display: inline-flex; align-items: center; gap: .7rem; color: #1C2333; }
.brand-logo-mark { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--dkm-blue); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; }
.brand-logo-mark svg { width: 22px; height: 22px; }
.brand-logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-logo-name { font-size: 1.35rem; font-weight: 500; letter-spacing: -.01em; }
.brand-logo-name b { font-weight: 800; }
.brand-logo-tagline { margin-top: 3px; font-size: .62rem; letter-spacing: .03em; color: #6B7280; white-space: nowrap; }

.avatar-initials { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700;
    flex-shrink: 0; background: rgba(var(--bs-primary-rgb), .14); color: var(--bs-primary); }
.avatar-initials.sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar-initials.md { width: 38px; height: 38px; font-size: .8rem; }

/* ---- sidebar: grup akordeon (spt ERP) ------------------------------------ */
.app-sidebar-menu .menu-icon svg { width: 17px; height: 17px; }
.app-sidebar-menu .osm-menu-badge { background: #dc2626; color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700;
    padding: .05rem .45rem; line-height: 1.4; margin-left: .5rem; }
.app-sidebar-menu .erp-menu-group { border-top: 1px solid rgba(0, 0, 0, .07); }
.app-sidebar-menu .erp-menu-group:first-child { border-top: 0; }
.app-sidebar-menu .app-sidebar-menu-item + .erp-menu-group { margin-top: 8px; }
.app-sidebar-menu .erp-menu-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 13px 16px; margin: 0; border: 0; border-radius: 8px; background: none; text-align: start; cursor: pointer;
}
.app-sidebar-menu .erp-menu-toggle:hover { background: rgba(var(--bs-primary-rgb), .06); }
.app-sidebar-menu .erp-menu-toggle:focus-visible { outline: 2px solid var(--dkm-blue); outline-offset: -2px; }
.app-sidebar-menu ul .erp-menu-toggle > span { padding: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--dkm-blue); }
.app-sidebar-menu .erp-menu-chevron { color: var(--dkm-blue); transition: transform .2s ease; transform: rotate(-90deg); width: 15px; height: 15px; }
.app-sidebar-menu .erp-menu-group.open .erp-menu-chevron { transform: rotate(0deg); }
/* Ikon judul grup — sama dgn ERP (public/css/erp.css, commit 9892a7d). */
.app-sidebar-menu .erp-menu-heading { display: inline-flex; align-items: center; gap: .7rem; }
.app-sidebar-menu .erp-menu-icon { flex-shrink: 0; vertical-align: 0; padding: 4px; width: 26px; height: 26px; border-radius: 7px;
    background: rgba(var(--bs-primary-rgb), .1); color: var(--dkm-blue); }
.app-sidebar-menu .erp-menu-group.open .erp-menu-icon { background: var(--dkm-blue); color: #fff; }
.app-sidebar-menu .erp-menu-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.app-sidebar-menu .erp-menu-items > ul { overflow: hidden; min-height: 0; }
.app-sidebar-menu .erp-menu-group.open .erp-menu-items { grid-template-rows: 1fr; }
.app-sidebar-menu .erp-menu-group.open .erp-menu-items > ul { padding-bottom: 8px; }
@media (prefers-reduced-motion: reduce) {
    .app-sidebar-menu .erp-menu-items, .app-sidebar-menu .erp-menu-chevron { transition: none; }
}

/* ---- header biru DKM (sama di semua app DKM) ----------------------------- */
.app-header,
.app-header.bg-card { background-color: var(--dkm-blue) !important; border-bottom: 0; box-shadow: 0 1px 4px rgba(0, 40, 90, .25); }
.app-header,
.app-header .text-custom-body,
.app-header .header-nav-link { color: #fff !important; }
.app-header .app-header-bar-btn span { background-color: #fff !important; }
.app-header .header-nav-link:hover { background-color: rgba(255, 255, 255, .15); }
.app-header .avatar-initials { background: #fff; color: var(--dkm-blue); }
/* Tombol header Conca berbentuk bulat lebar tetap — utk menu akun (nama + avatar) jadi pil selebar isinya,
   nama satu baris (dipotong "…" kalau panjang), tanpa garis bawah link. */
.app-header .header-nav-link,
.app-header .header-nav-link:hover,
.app-header .header-nav-link:focus { text-decoration: none !important; }
.app-header .header-user .header-nav-link { width: auto !important; height: auto !important; min-height: 38px;
    padding: .2rem .25rem .2rem .75rem; border-radius: 999px; }
.app-header .header-user .header-nav-link > span:first-child { white-space: nowrap; max-width: 180px;
    overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }

/* ---- judul halaman + breadcrumb ------------------------------------------ */
.page-title .breadcrumb { margin: .35rem 0 0; font-size: .8rem; background: none; padding: 0; }
.page-title .breadcrumb svg { width: 14px; height: 14px; vertical-align: -2px; }
.page-title .breadcrumb a { color: var(--dkm-blue); text-decoration: none; }

/* ---- tabel: kepala tabel bergaya ERP ------------------------------------- */
.app-content-wrapper .table > thead th {
    background-color: rgba(var(--bs-primary-rgb), .08);
    color: var(--dkm-blue-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--dkm-blue);
    white-space: nowrap;
}
.app-content-wrapper .table-hover > tbody > tr:hover > * { background-color: rgba(var(--bs-primary-rgb), .04); }
.app-content-wrapper .card-header { background: transparent; }

/* Ikon feather (data-feather) di dalam isi halaman: ukuran wajar di tombol/teks. */

/* ---- cetak: sembunyikan bingkai ------------------------------------------ */
@media print {
    .app-sidebar, .app-header, .app-footer, .app-backdrop, .page-title, .no-print { display: none !important; }
    .app-wrapper, .app-content-wrapper { margin: 0 !important; padding: 0 !important; }
    body { background: #fff !important; }
}

/* Badge status "Menunggu ..." (bg-*-subtle + text-*-emphasis): bootstrap Conca punya
   bg-*-subtle tapi TIDAK punya text-*-emphasis -> teks badge putih di atas merah muda,
   nyaris tak terbaca (user 2026-10-26). */
.text-danger-emphasis { color: #b42318 !important; }
.text-warning-emphasis { color: #92400e !important; }
.text-success-emphasis { color: #0f5132 !important; }
.text-primary-emphasis { color: #1447b3 !important; }
.text-secondary-emphasis { color: #475569 !important; }
.text-info-emphasis { color: #055160 !important; }

/* Sidebar: tinggi menu & guliran (
   Conca menghitung tinggi menu SEKALI lewat JS (tinggi jendela − 120px) dan menggulirnya dgn
   PerfectScrollbar -> rawan meleset (zoom, ukuran jendela, grup akordeon dibuka). Diganti: tinggi
   diatur flex (mengisi ruang header↔footer) + guliran bawaan browser. */
.app-sidebar-wrapper { display: flex; flex-direction: column; height: 100%; }
.app-sidebar-header, .app-sidebar-footer { flex-shrink: 0; }
.app-sidebar-menu, .app-sidebar-menu.ps {
    flex: 1 1 auto; min-height: 0; height: auto !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .25) transparent;
}
.app-sidebar-menu > .ps__rail-x, .app-sidebar-menu > .ps__rail-y { display: none !important; }

/* Tabel lebar & panjang (Payroll: Data Upah, Gaji Guard, Slip Gaji -- user 2026-10-28): area gulir sendiri
   setinggi layar -> penggulung samping selalu kelihatan, judul kolom menempel di atas, kolom pertama
   (nama guard/lokasi) menempel di kiri, baris total menempel di bawah. Warna judul HARUS padat (#edf2fc =
   biru 8% di atas putih, sama dgn kepala tabel ERP) -- warna transparan bawaan bikin baris tembus pandang. */
.table-sticky { max-height: calc(100vh - 150px); overflow: auto !important; overscroll-behavior: contain; }
.table-sticky > table { margin-bottom: 0; border-collapse: separate; border-spacing: 0; }
.app-content-wrapper .table-sticky > .table > thead { position: sticky; top: 0; z-index: 3; }
.app-content-wrapper .table-sticky > .table > thead th { background-color: #edf2fc; }
.app-content-wrapper .table-sticky > .table > tfoot { position: sticky; bottom: 0; z-index: 3; }
.app-content-wrapper .table-sticky > .table > tfoot td { background-color: #edf2fc; box-shadow: inset 0 1px 0 #d6e0f5; }
.app-content-wrapper .table-sticky > .table > tbody > tr > td:first-child,
.app-content-wrapper .table-sticky > .table > tfoot > tr > td:first-child { position: sticky; left: 0; z-index: 2; background-color: #fff; box-shadow: inset -1px 0 0 #e5e9f2; }
.app-content-wrapper .table-sticky > .table > tfoot > tr > td:first-child { background-color: #edf2fc; z-index: 4; }
.app-content-wrapper .table-sticky > .table > tbody > tr.pc-group-head > td:first-child { background-color: #f5f7fb; }
.app-content-wrapper .table-sticky > .table > thead > tr:first-child > th:first-child { position: sticky; left: 0; z-index: 4; }

/* ---- khusus OSM ----------------------------------------------------------- */
/* Judul halaman dibuat oleh tiap view (blok .content-header berisi judul + tombol aksi), bukan oleh layout. */
.app-content-wrapper .content-header { padding: 0 0 .75rem; margin-bottom: .5rem; }
.app-content-wrapper .content-header h4 { font-size: 1.35rem; color: #1C2333; }
.app-content-wrapper .content-header p a { color: var(--dkm-blue); text-decoration: none; }
/* Kartu dengan gaya inline lama (radius 12px + bayangan) tetap rapi di latar Conca. */
.app-content-wrapper .card { border: 0; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04); }
/* Ikon + teks di tombol diberi jarak; tombol ikon saja tidak terpengaruh. */
.app-content-wrapper .btn:has(> svg.feather) { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
/* Tautan nama di tabel: tanpa garis bawah, biru DKM saat disorot. */
.app-content-wrapper .table a:not(.btn) { text-decoration: none; }
.app-content-wrapper .table a:not(.btn):hover { color: var(--dkm-blue); }
/* Layar sempit: tombol aksi di judul halaman turun ke baris berikutnya, tidak melebarkan halaman. */
.app-content-wrapper .content-header .col-auto.d-flex { flex-wrap: wrap; }
@media (max-width: 575.98px) {
    .app-content-wrapper .content-header .row > .col-auto { flex: 1 0 100%; }
}
