body{
    margin:0;
    padding:0;
    background:#f4f6f9;
    font-family:Segoe UI,sans-serif;
}

.container {
    width: 100%;
    max-width: 560px;
    min-height: 400px;
    margin: 20px auto;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    font-family: "Poppins", sans-serif;
}

.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px 20px;
    margin: -26px -26px 25px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 15px 15px 0 0;
    font-size: 0.85em;
}

.user-menu{
    display:flex;
    position:relative;
    flex-direction:column;
    align-items:flex-start;
    line-height:1.1;
}

.user-role{
    font-size:10px;
    opacity:.7;
    margin-top:2px;
}

.user-btn{
    border:none;
    background: none;
    padding:10px 14px;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
}

.user-btn i,
.user-dropdown i{
    font-size:13px;
}

.user-dropdown{
    position:absolute;
    top: 43px;
    right: -20px;
    background: #f8f9fa;
    padding: 8px 14px;
    min-width: 130px;
    box-shadow:0 6px 20px rgba(0,0,0,0.12);
    overflow:hidden;
    display:none;
    z-index:1000;
}

/* =========================
   TITLE
========================= */

h2 {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #374151;
}

.section-title {
    display: block;
    text-align: center;
    margin: 15px 0 10px;
    padding: 5px;
    background: #eee;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

/* =========================
   FOOTER
========================= */

.footer {
    clear: both;

    margin-top: 20px;
    padding: 20px;

    text-align: center;
    font-size: 12px;
    color: #999;

    transition: 0.3s;
}

/* =========================
   RESPONSIVE
========================= */

@media screen and (max-width: 768px) {
    .user-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        margin: 0;
        border-radius: 0;
    }
    
    .container {
        width: 83%;
        margin: 80px auto 20px;
    }
}

/* =========================
   SERVICE
========================= */

.service-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 25px !important;
}

.btn-service {
    flex: 1;
    padding: 12px;

    background: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;

    cursor: pointer;

    font-weight: bold;

    transition: 0.3s;
}

.btn-service.active {
    background: #e7f1ff;
    border-color: #007bff;
    color: #007bff;
    cursor: default;
}

.btn-service:hover {
    background: #51719f !important;
}

/* Mematikan efek hover dan aktif pada tombol yang sedang AKTIF */
.btn-service.active:hover,
.btn-service.active:focus,
.btn-service.active:active {
    /* Mengunci agar background dan teks tidak berubah saat di-hover */
    background-color: #0d6efd !important; 
    color: #fff !important;
    
    /* Menghilangkan efek bayangan atau transformasi jika ada */
    box-shadow: none !important;
    transform: none !important;
}

/* =========================================
   LOADING OVERLAY
========================================= */

.loading-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999 !important;
    backdrop-filter: blur(2px);
}

.loading-overlay.show{
    display: flex;
}

.loading-box{
    background: #ffffff97;
    padding: 28px 34px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    text-align: center;
    min-width: 180px;
}

.loading-spinner{
    width: 55px;
    height: 55px;
    border: 8px solid #e5e5e5;
    border-top: 8px solid #0d6efd;
    border-radius: 50%;
    margin: auto;
    animation: spinLoading 0.8s linear infinite;
}

.loading-text{
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

@keyframes spinLoading{
    0%{
        transform: rotate(0deg);
    }

    100%{
        transform: rotate(360deg);
    }
}

.user-bar{
    display:flex;
    justify-content:flex-end;
    align-items:center;
    gap:10px;
    margin-bottom:15px;
}

.darkmode-btn{
    width:42px;
    height:42px;
    border:none;
    border-radius:10px;
    background: none;
    cursor:pointer;
    font-size:16px;
}

.darkmode-btn:hover{
    transform:scale(1.03);
}

.spacerz{
    height: 18px;
}

/* =========================
   DARK MODE
========================= */

body.dark-mode{
    background:#141b2d;
    color:#b0b3b9;
}

/* =========================
   CONTAINER
========================= */

body.dark-mode .container{
    background:#1f293f;
    box-shadow:0 0 15px rgba(0,0,0,0.35);
}

/* =========================
   USER BAR
========================= */

body.dark-mode .user-bar{
    background: #1f293f;
    border: none;
}

body.dark-mode .user-btn,
body.dark-mode .darkmode-btn{
    background: transparent;
    color:#ffffff;
    box-shadow:none;
}

body.dark-mode .user-dropdown{
    background:#242424;
    border:1px solid #333;
}

body.dark-mode .user-dropdown a{
    color:#ffffff;
}

body.dark-mode .user-dropdown a:hover{
    background:#333333;
}

/* =========================
   TITLE & LABEL
========================= */

body.dark-mode h2,
body.dark-mode label{
    color:#ffffff;
}

body.dark-mode .section-title{
    background: #3d5a79;
    color:#d6dae5;
    border-bottom:1px solid #8489af;
}

/* =========================
   MENU GRID
========================= */

body.dark-mode .dashboard-menu-card{
    background:#2f3a50;
    border:1px solid #333;
    color:#ffffff;
    box-shadow:none;
}

body.dark-mode .menu-card:hover{
    background:#2d2d2d;
}

/* =========================
   FORM INPUT
========================= */

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select{
    background:#283247 !important;
    color:#b3b7c1;
    border:1px solid #444;
}

body.dark-mode select:focus{
    outline: none !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder{
    color:#aaaaaa;
}

body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus{
    -webkit-text-fill-color:#fff !important;

    -webkit-box-shadow:
        0 0 0px 1000px #2a2a2a inset !important;

    transition:
        background-color 5000s ease-in-out 0s;
}

input:focus {
    border: 1px solid #7b7b7b !important;
    outline: none;
}

textarea:focus {
    border: 1px solid #7b7b7b !important;
    outline: none;
}

body.dark-mode input:focus {
    border: 1px solid #7f7f7f !important;
    outline: none;
}

/* =========================
   DROPDOWN SLOT
========================= */

body.dark-mode .dropdown-btn,
body.dark-mode .dropdown-content{
    background:#283247;
    color:#b3b7c1;
    border:1px solid #333;
}

/* =========================
   SLOT BUTTON
========================= */

body.dark-mode .slot-item{
    background:#2d2d2d;
    color:#ffffff;
    border:1px solid #444;
}

body.dark-mode .slot-item:hover,
body.dark-mode .slot-item.active{
    background:#0d6efd;
    color:#ffffff;
}

/* =========================
   BUTTONS
========================= */

body.dark-mode .btn-action,
body.dark-mode .btn-service,
body.dark-mode button{
    border:none;
}

body.dark-mode .btn-copy{
    background: #40485f;
}

/* =========================
   FORM BOX / CARD
========================= */

body.dark-mode .form-group{
    color:#ffffff;
}

/* =========================
   FOOTER
========================= */

body.dark-mode .footer{
    color:#aaaaaa;
}

/* =========================
   SERVICE BUTTON
========================= */

body.dark-mode .btn-service{
    background:#4b4b53;
    color:#d6dae5;
    border:1px solid #333;
}

body.dark-mode .btn-service.active{
    background:#0d6efd;
    color:#ffffff;
}

/* =========================
   SMALL ACTION BUTTON
========================= */

body.dark-mode #btnScanUncfg,
body.dark-mode #btnScan,
body.dark-mode #btnCopyPass,
body.dark-mode #btnCheckOnu{
    background: #414141;
    color:#ffffff;
    border:1px solid #777;
    border-radius: 4px;
}

body.dark-mode button[onclick="generatePass()"] {
    background: #414141;
    color:#ffffff;
    border:1px solid #777;
    border-radius: 4px;
    padding: 10px 7px;
}

/* =========================
   BUTTON HOVER
========================= */

body.dark-mode #btnScanUncfg:hover,
body.dark-mode #btnScan:hover,
body.dark-mode #btnCopyPass:hover,
body.dark-mode #btnCheckOnu:hover,
body.dark-mode button[onclick="generatePass()"]:hover,
body.dark-mode .btn-service:hover{
    background:#333333;
}

/* =========================
   LOADING OVERLAY
========================= */

body.dark-mode .loading-box{
    background:#24242497;
}

body.dark-mode .loading-text{
    color:#ffffff;
}

body.dark-mode .loading-spinner{
    border:8px solid #444;
    border-top:8px solid #0d6efd;
}

/* =========================
   DARK MODE ADMIN MENU
========================= */

body.dark-mode .admin-menu-card{
    background:#1f2937;
}

body.dark-mode .admin-menu-title{
    color:#fff;
}

body.dark-mode .admin-menu-desc{
    color:#9ca3af;
}

body.dark-mode .admin-menu-arrow{
    color:#d1d5db;
}

.separator{
    width:100%;
    height:1px;
    background:#d1d5db;
    margin:28px 0;
}

body.dark-mode .separator{
    background:#374151;
}

.btn-history {

    background: #007bff;

    color: white;

    border: none;

    padding: 10px 16px;

    border-radius: 6px;

    cursor: pointer;
}

.app-modal-box {

    width: 95%;

    max-width: 1400px;

    max-height: 90vh;

    overflow: hidden;
}

.app-modal-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;
}

.app-modal-close {

    cursor: pointer;

    font-size: 24px;

    font-weight: bold;
}

.app-modal-content {

    overflow-x: auto;

    overflow-y: auto;

    max-height: 75vh;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {

    width: 100%;

    padding: 10px;
    color:#666;
    border: 1px solid #ddd;

    border-radius: 8px;

    box-sizing: border-box;
}

select:focus{
    outline: none !important;
}

.btn-submit {

    width: 100%;
    margin-top: 20px;
    padding: 12px;

    border: none;

    border-radius: 8px;

    background: #2196f3;

    color: #fff;

    cursor: pointer;

    font-weight: 600;
}

.btn-submit:hover {
    opacity: .9;
}

/*==============================================================
    CUSTOM CECKBOX AGGREMENT 
==============================================================*/
.custom-checkbox {
  display: inline-flex;
  align-items: flex-start; /* Menjaga teks panjang tetap rapi */
  gap: 12px; /* Jarak antara checkbox dan teks */
  cursor: pointer;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: #333333;
  line-height: 1.5;
  user-select: none;
}

/* Sembunyikan Checkbox Asli Browser */
.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Membuat Kotak Checkbox Kustom */
/* MODIFIKASI 1: Menaikkan Kotak Checkbox Kustom */
.custom-checkbox .checkbox-text::before {
  content: "";
  display: inline-block;
  min-width: 12px;
  height: 12px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  
  /* PERUBAHAN DI SINI: Menggunakan posisi relatif untuk kontrol presisi */
  position: relative;
  top: -2px; /* Nilai minus akan menggeser kotak ke atas. Sesuaikan jika kurang tinggi */
  
  vertical-align: middle;
  margin-right: 8px;
  transition: all 0.2s ease-in-out;
}

/* MODIFIKASI 2: Menyesuaikan Posisi Tanda Centang (Checkmark) */
/* Karena kotaknya naik, posisi tanda centang di dalamnya juga harus ikut disesuaikan */
.custom-checkbox .checkbox-text::after {
  content: "";
  position: absolute;
  
  /* PERUBAHAN DI SINI: Menyesuaikan koordinat agar centang tetap di tengah kotak */
  left: 7px;
  top: 2px; /* Diturunkan sedikit agar pas di dalam kotak yang sudah bergeser */
  
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease-in-out;
}

/* Efek Hover (Saat Kursor di Atas Label) */
.custom-checkbox:hover input[type="checkbox"] ~ .checkbox-text::before {
  border-color: #3b82f6; /* Berubah jadi biru saat di-hover */
}

/* Gaya Ketika Checkbox Tercentang (Checked) */
.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-text::before {
  background-color: #3b82f6; /* Warna utama (Biru Profesional) */
  border-color: #3b82f6;
}

/* Membuat Tanda Centang (Checkmark) Menggunakan Pseudo-element */
.custom-checkbox .checkbox-text {
  position: relative;
}

/* Menampilkan Tanda Centang Saat Di-klik */
.custom-checkbox input[type="checkbox"]:checked ~ .checkbox-text::after {
  transform: rotate(45deg) scale(1);
}

/* Efek Fokus untuk Aksesibilitas (Keyboard User) */
.custom-checkbox input[type="checkbox"]:focus-visible ~ .checkbox-text::before {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

/* Opsional: Gaya untuk Link Syarat & Ketentuan */
.custom-checkbox a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.custom-checkbox a:hover {
  text-decoration: underline;
}

/* =========================================
   GLOBAL CUSTOM SCROLLBAR (LIGHT & DARK)
========================================= */

/* Lebar scrollbar vertikal & tinggi scrollbar horizontal */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

/* Jalur/lintasan scrollbar (Light Mode) */
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

/* Batang scrollbar (Light Mode) */
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    transition: background 0.2s ease;
}

/* Batang scrollbar saat di-hover (Light Mode) */
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Kustomisasi Jalur & Batang Scrollbar (Dark Mode) */
body.dark-mode ::-webkit-scrollbar-track {
    background: #1e293b;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #475569;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}