/* ==========================================================================
   Semargres — Semarang Great Sale 2026
   Custom theme layer on top of DashLite

   Palette:
     Primary   #F1582C  Bold Orange
     Secondary #FBCDC0  Soft Orange
     Tertiary  #B7B7B7  Soft Grey
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base palette hooks (Bootstrap / DashLite variables)
   -------------------------------------------------------------------------- */
:root {
    --sgr-primary: #F1582C;
    --sgr-primary-600: #d94a1f;
    --sgr-primary-700: #c24018;
    --sgr-primary-800: #a93410;
    --sgr-secondary: #FBCDC0;
    --sgr-tertiary: #B7B7B7;

    --bs-primary: #F1582C;
    --bs-primary-rgb: 241, 88, 44;
    --bs-link-color: #F1582C;
    --bs-link-hover-color: #c24018;
}

/* Focus state for every form control */
.form-control:focus,
.form-select:focus {
    border-color: #F1582C;
    box-shadow: 0 0 0 4px rgba(241, 88, 44, 0.12);
}

/* Links & primary helpers */
.link-primary {
    color: #F1582C;
}
.link-primary:hover,
.link-primary:focus {
    color: #c24018;
}
.text-primary-alt {
    color: #F1582C;
}
.bg-primary-dim {
    background-color: rgba(241, 88, 44, 0.12);
    color: #F1582C;
}

/* --------------------------------------------------------------------------
   2. Buttons
   -------------------------------------------------------------------------- */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #F1582C;
    --bs-btn-border-color: #F1582C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #d94a1f;
    --bs-btn-hover-border-color: #cf451d;
    --bs-btn-focus-shadow-rgb: 241, 88, 44;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #c24018;
    --bs-btn-active-border-color: #b83d16;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #F1582C;
    --bs-btn-disabled-border-color: #F1582C;
}
.btn-dim.btn-primary {
    color: #F1582C;
    background-color: #fde9e2;
    border-color: transparent;
}
.btn-dim.btn-primary:not(:disabled):not(.disabled):hover,
.btn-dim.btn-primary:not(:disabled):not(.disabled):focus,
.btn-dim.btn-primary:not(:disabled):not(.disabled):active {
    color: #fff;
    background-color: #F1582C;
    border-color: #F1582C;
}
.btn-outline-primary {
    --bs-btn-color: #F1582C;
    --bs-btn-border-color: #F1582C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #F1582C;
    --bs-btn-hover-border-color: #F1582C;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #c24018;
    --bs-btn-active-border-color: #c24018;
}

/* --------------------------------------------------------------------------
   3. Sidebar (light) accents
   -------------------------------------------------------------------------- */
.is-light .nk-menu-item.active > .nk-menu-link,
.is-light .nk-menu-item.current-menu > .nk-menu-link {
    background-color: #fde9e2;
    color: #F1582C;
}
.is-light .nk-menu-item.active > .nk-menu-link .nk-menu-icon,
.is-light .nk-menu-item.current-menu > .nk-menu-link .nk-menu-icon {
    color: #F1582C;
}
.is-light .nk-menu-link:hover {
    color: #F1582C;
    background-color: #fdf3ef;
}
/* Icon menu ikut oranye saat hover (default DashLite: ungu #9769ff) */
.is-light .nk-menu-link:hover .nk-menu-icon,
.is-light .nk-menu-link:focus .nk-menu-icon {
    color: #F1582C;
}

/* ------------------   --------------------------------------------------------
   3b. Header accents
   -------------------------------------------------------------------------- */
/* Avatar profil memakai warna brand Semargres */
.nk-header .user-avatar {
    background: #F1582C;
    color: #fff;
}
/* Burger & logo header jangan menyusut/terpotong saat ruang sempit */
.nk-header .nk-menu-trigger,
.nk-header .nk-header-brand {
    flex-shrink: 0;
}
/* Burger compact (minimize/maximize) di sidebar head — selalu di atas logo */
.nk-sidebar .nk-menu-trigger {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* ------------------   --------------------------------------------------------
   4. Brand logo (image)
   -------------------------------------------------------------------------- */
.sgr-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}
.sgr-brand:hover {
    text-decoration: none;
}
.sgr-brand-logo {
    display: block;
    height: 48px;
    width: auto;
}
/* Pasangan logo dark/light ditumpuk (absolute) seperti DashLite: hanya logo
   pertama yang mengambil ruang layout, logo kedua jadi overlay swap opacity.
   Tanpa ini, logo transparan (mis. logo-white) tetap memakan lebar penuh
   sehingga mendorong/menutup icon burger di sidebar & header. */
.sgr-brand .sgr-brand-logo + .sgr-brand-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}
/* Compact (collapsed) sidebar — wordmark diganti ikon favicon */
.sgr-brand-logo-mini {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

/* Compact (collapsed) sidebar */
.nk-sidebar.is-compact .sgr-brand {
    justify-content: center;
}
.nk-sidebar.is-compact .sgr-brand-logo {
    display: none;
}
.nk-sidebar.is-compact .sgr-brand-logo-mini {
    display: block;
}

/* Brand di header (mobile) sedikit lebih ramping */
.nk-header-brand .sgr-brand-logo {
    height: 40px;
}

/* Brand di panel auth (aside oranye) sedikit lebih besar */
.sgr-auth-aside .sgr-brand-logo {
    height: 60px;
}

/* Logo register lebih besar */
.brand-logo .logo-img-lg {
    max-height: 64px;
}

/* --------------------------------------------------------------------------
   5. Auth page — clean split login
   -------------------------------------------------------------------------- */
.sgr-auth-body {
    background: #fff;
}

.sgr-auth {
    display: flex;
    min-height: 100vh;
}

/* Branding panel */
.sgr-auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 55%;
    max-width: 55%;
    padding: 2.75rem 3.25rem;
    color: #fff;
    background: linear-gradient(160deg, #F1582C 0%, #d94a1f 55%, #c24018 100%);
    overflow: hidden;
}

/* Pattern samar (bg-default.png, pattern putih) di atas panel oranye */
.sgr-auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('/images/bg-default.png');
    background-repeat: repeat;
    background-size: 220px;
    opacity: 0.08;
    pointer-events: none;
}

.sgr-auth-aside > * {
    position: relative;
    z-index: 1;
}

.sgr-auth-hero {
    max-width: 31rem;
    margin: auto 0;
}
.sgr-auth-title {
    margin: 0;
    font-size: clamp(1.9rem, 2.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: #fff;
}
.sgr-auth-desc {
    max-width: 30rem;
    margin: 1.1rem 0 0;
    font-size: 0.97rem;
    line-height: 1.7;
    color: #fff;
    opacity: 0.92;
}

.sgr-auth-foot {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.88);
}

/* Form panel */
.sgr-auth-main {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: #fff;
}
.sgr-auth-card {
    width: 100%;
    max-width: 26.5rem;
}
.sgr-auth-mobile-brand {
    margin-bottom: 2.25rem;
}

.sgr-auth-card-head {
    margin-bottom: 1.9rem;
}
.sgr-auth-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #243447;
}
.sgr-auth-card-sub {
    margin: 0;
    font-size: 0.93rem;
    color: #8094ae;
}

/* Form fields */
.sgr-auth-card .form-group {
    margin-bottom: 1.35rem;
}
.sgr-auth-card .form-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #243447;
}
.sgr-auth-card .form-control-wrap {
    position: relative;
}
.sgr-auth-card .form-control {
    height: 3.1rem;
    border-radius: 0.85rem;
    border: 1.5px solid #e5e9f0;
    background: #f8fafc;
    font-size: 0.95rem;
    padding-left: 2.9rem;
    padding-right: 1.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.sgr-auth-card .form-control::placeholder {
    color: #b3becb;
}
.sgr-auth-card .form-control:focus {
    background: #fff;
    border-color: #F1582C;
    box-shadow: 0 0 0 4px rgba(241, 88, 44, 0.12);
}
.sgr-auth-card .form-control.is-invalid {
    border-color: #f84f4f;
    background: #fff;
}
.sgr-auth-card .form-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 1.05rem;
    width: auto;
    height: auto;
    z-index: 2;
}
.sgr-auth-card .form-icon .icon {
    font-size: 1.05rem;
    color: #9aa7b5;
}
.sgr-auth-card .form-icon.form-icon-right {
    left: auto;
    right: 1.05rem;
}
.sgr-auth-card .form-control-wrap:has(.form-icon-right) .form-control {
    padding-right: 2.9rem;
}
.sgr-auth-card .invalid-feedback {
    font-size: 0.8rem;
    margin-top: 0.45rem;
}
.sgr-auth-card .g-recaptcha {
    margin-top: 0.1rem;
}

/* Action button */
.sgr-auth-card .btn-primary {
    height: 3.1rem;
    border-radius: 0.85rem;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 22px rgba(241, 88, 44, 0.3);
}
.sgr-auth-card .btn-primary .icon {
    font-size: 1rem;
    transition: transform 0.25s ease;
}
.sgr-auth-card .btn-primary:hover {
    box-shadow: 0 12px 26px rgba(241, 88, 44, 0.36);
    transform: translateY(-1px);
}
.sgr-auth-card .btn-primary:hover .icon {
    transform: translateX(4px);
}
.sgr-auth-card .btn-primary:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 991.98px) {
    .sgr-auth-aside {
        display: none;
    }
    .sgr-auth-main {
        padding: 2rem 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   6. DataTables server-side — tabel selalu selebar container.
      Scroll horizontal aktif otomatis bila lebar kolom melebihi container.
   -------------------------------------------------------------------------- */
.dataTables_scrollHeadInner table.dataTable,
.dataTables_scrollBody table.dataTable {
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   7. Tabs & Pagination — warna brand Semargres
   -------------------------------------------------------------------------- */

/* Tabs: padding kiri/kanan + aksen aktif oranye */
.nav-tabs {
    padding: 0 1.25rem;
}
/* Matikan transisi warna Bootstrap .nav-link (.15s) agar tidak ada flash
   ungu default (#854fff) dari state :focus saat tab diaktifkan. */
.nav-tabs .nav-link {
    transition: none;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.active .nav-link,
.nav-tabs .nav-link:focus {
    color: #F1582C;
}
.nav-tabs .nav-link:after {
    background: #F1582C;
}

/* Pagination (Bootstrap 5 via CSS variables; berlaku juga utk DataTables) */
.pagination {
    --bs-pagination-hover-color: #c24018;
    --bs-pagination-active-bg: #F1582C;
    --bs-pagination-active-border-color: #F1582C;
}
.pagination .page-link:focus {
    color: #F1582C;
}

/* --------------------------------------------------------------------------
   8. DataTables — aksi dropdown, posisi kontrol & header
   -------------------------------------------------------------------------- */

/* Hover aksi dropdown (default DashLite ungu #854fff -> Semargres oranye) */
.link-list-opt a:hover,
.link-list-opt a:focus {
    color: #F1582C;
    background: #fde9e2;
}

/* Balik posisi kontrol atas: Search di kiri, "Show X entries" di kanan.
   Baris wrapper yang berisi dataTables_length + dataTables_filter. */
.dataTables_wrapper > .row:has(.dataTables_length) {
    flex-direction: row-reverse;
}

/* Konten kanan: "Show X entries" rata kanan (pojok kanan) */
.dataTables_wrapper div.dataTables_length {
    text-align: right;
}

/* Gap antar kata Show / <select> / entries (label DashLite pakai inline-flex
   sehingga whitespace antar item flex diabaikan -> perlu margin eksplisit) */
.dataTables_wrapper div.dataTables_length select {
    margin: 0 0.5rem;
}

/* Search: label + input satu baris di kiri, ada gap antar keduanya */
.dataTables_wrapper div.dataTables_filter {
    text-align: left;
}
.dataTables_wrapper div.dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}
.dataTables_wrapper div.dataTables_filter input {
    width: 220px;
    max-width: 100%;
    margin: 0;
}

/* Gap antar label header datatable */
.dataTable thead th {
    padding-right: 1rem;
    white-space: nowrap;
}

/* Perataan vertikal sel datatable di tengah (default Bootstrap: top) */
.dataTable thead th,
.dataTable tbody td {
    vertical-align: middle;
}
