:root {
    --primary: #0f5132; 
    --primary-hover: #146c43;
    --bg: #f4f6f8; /* Background utama aplikasi dikembalikan kalem terang */
    --card: #ffffff; /* Card dan Pop-up kembali jadi Putih bersih */
    --text: #1e293b;
    --border: #e2e8f0; 
    --success: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Penyesuaian UI Modern */
.card, .card-grid > div { 
    background: var(--card);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px; 
    border: none; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* ← TAMBAHKAN DI SINI ↓ */
#kantong-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Ukuran minimal diubah dari 200px jadi 320px agar kartu tetap besar */
  gap: 20px; /* Jarak antar kartu sedikit dilegakan */
  width: 100%;
  align-content: start;
}

/* Desain Kartu Dashboard ala POS Pro Go */
.balance-card:nth-child(1) { background: var(--primary); color: white; }
.balance-card:nth-child(1) h3, .balance-card:nth-child(1) p { color: white; }

.balance-card h3 { font-size: 14px; color: #64748b; }
.balance-card p { font-size: 24px; font-weight: bold; margin-top: 5px; }

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

input, select { 
    width: 100%;
    padding: 12px;
    border-radius: 8px !important; 
    background: #f8fafc; 
    transition: 0.3s; 
    border: 1px solid #cbd5e1;
}

input:focus, select:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(15, 81, 50, 0.2); 
    background: white;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
    letter-spacing: 0.5px;
}

.btn-submit:hover { background-color: var(--primary-hover); }
.btn-submit:active { transform: scale(0.98); }

.history-container ul { list-style: none; }
.history-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}
.history-item:first-child { border-radius: 12px 12px 0 0; }
.history-item:last-child { border-bottom: none; border-radius: 0 0 12px 12px; }

.text-success { color: var(--success); font-weight: bold; }
.text-danger { color: var(--danger); font-weight: bold; }

/* TAMPILAN SIDEBAR & LAYOUT BARU (TEMA EXTRA GELAP & KONTRAST TINGGI) */
.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    background: var(--bg); /* Kembali ke background abu-abu terang */
}

.sidebar {
    width: 270px;
    background: #1e293b !important; /* Biru Dongker / Abu-abu gelap elegan (Lebih terang dari sebelumnya) */
    margin: 15px 0 15px 15px !important; 
    height: calc(100vh - 30px) !important; 
    border-radius: 24px !important; 
    box-shadow: 6px 12px 35px rgba(0, 0, 0, 0.15) !important; /* Bayangan dibuat sedikit lebih soft */
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #334155 !important; /* Garis tepi disesuaikan agar menyatu */
    overflow: hidden !important; 
}

.sidebar-header {
    padding: 25px 20px;
    background: #1e293b !important; /* Samakan dengan sidebar */
    color: #ffffff !important; 
    position: relative;
    z-index: 10;
    border-bottom: 1px solid #334155 !important; 
}

.sidebar-header h2 { margin: 0; font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.sidebar-header h2 .material-symbols-rounded { font-size: 28px; background: #38bdf8; color: #1e293b; padding: 4px; border-radius: 8px; }

/* Scrollbar di dalam daftar menu */
.sidebar-menu { 
    flex: 1; 
    list-style: none; 
    padding: 15px 10px 20px 0; 
    margin-right: 5px; 
    overflow-y: auto; 
}

/* Desain Scrollbar Khusus Menu Samping (Diterangkan warnanya) */
.sidebar-menu::-webkit-scrollbar { width: 5px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb { background-color: #475569; border-radius: 10px; }
.sidebar-menu::-webkit-scrollbar-thumb:hover { background-color: #64748b; }

/* KOTAK ESTETIK UNTUK JUDUL KATEGORI MENU (Cth: Data Dasar) */
.menu-title {
    font-size: 10.5px;
    color: #7dd3fc !important; /* Biru terang es agar sangat terbaca */
    padding: 6px 12px;
    margin: 20px 16px 10px 16px; /* Jarak pas di dalam sidebar */
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), transparent) !important; /* Efek gradasi menghilang ke kanan */
    border-left: 3px solid #38bdf8 !important; /* Garis aksen neon di kiri */
    border-radius: 4px 8px 8px 4px; 
    display: block;
}

/* KOTAK ESTETIK UNTUK ITEM MENU UTAMA (Cth: Dashboard, POS, dll) */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 16px; /* Jarak antar kotak sedikit dilegakan */
    cursor: pointer;
    color: #f8fafc !important; 
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    
    /* EFEK KOTAK KACA GELAP (Dark Glassmorphism) */
    background: rgba(255, 255, 255, 0.03) !important; /* Latar putih sangat-sangat tipis */
    border: 1px solid rgba(255, 255, 255, 0.07) !important; /* Garis tepi samar agar membentuk kotak */
    border-radius: 12px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important; /* Bayangan kotak 3D */
}

.menu-item .material-symbols-rounded { font-size: 20px; color: #94a3b8; transition: 0.3s; }

/* Efek Hover (Saat Kotak Disentuh Mouse) */
.menu-item:hover { 
    background: rgba(255, 255, 255, 0.08) !important; /* Kotak jadi sedikit lebih terang */
    border-color: rgba(56, 189, 248, 0.4) !important; /* Garis tepi menyala biru */
    color: #38bdf8 !important; 
    transform: translateX(4px) !important; /* Geser cantik ke kanan */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
}
.menu-item:hover .material-symbols-rounded { color: #38bdf8 !important; }

/* Efek Menu Sedang Aktif (Halaman yang sedang dibuka) */
.menu-item.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(15, 23, 42, 0)) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important; 
    border-left: 4px solid #38bdf8 !important; /* Pita tebal di sebelah kiri kotak */
    font-weight: 800 !important; 
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15) !important;
}
.menu-item.active .material-symbols-rounded { color: #38bdf8 !important; font-variation-settings: 'FILL' 1; }

.has-sub .sub-menu {
    display: none;
    list-style: none;
    background: transparent;
    padding-bottom: 5px;
}

.has-sub.open .sub-menu { display: block; animation: fadeIn 0.3s ease-in; }
.has-sub.open .chevron { transform: rotate(180deg); color: #38bdf8; }

.sub-menu li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 45px;
    font-size: 13.5px;
    cursor: pointer;
    color: #cbd5e1 !important; 
    transition: 0.2s;
    font-weight: 600;
    border-left: 2px solid transparent;
}
.sub-menu li .material-symbols-rounded { font-size: 16px; opacity: 0.8; }

.sub-menu li:hover { color: #ffffff !important; font-weight: 700; border-left: 2px solid #38bdf8; background: #334155; }
.sub-menu li.active { color: #38bdf8 !important; font-weight: 800; }

/* Khusus Tombol Keluar (Merah) */
#btn-logout { color: #f87171 !important; }
#btn-logout .material-symbols-rounded { color: #f87171 !important; }
#btn-logout:hover { background: #ef4444 !important; color: white !important; transform: translateX(0) !important; }
#btn-logout:hover .material-symbols-rounded { color: white !important; }

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    position: relative;
}

main { padding: 0; max-width: 100%; margin: 0; }

/* --- TATA LETAK LOGIN SPLIT SCREEN POS Pro Go --- */
.login-split {
    display: flex !important;
    height: 100vh;
    width: 100vw;
    margin: 0 !important;
    max-width: 100% !important;
}
#login-sec:not(.active) { display: none !important; }

.login-left {
    flex: 1.2;
    background-color: var(--primary);
    color: white;
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.circle-bg {
    position: absolute; top: 10%; right: -20%; width: 600px; height: 600px;
    background: rgba(255,255,255,0.03); border-radius: 50%; z-index: 0;
}
.login-brand { position: relative; z-index: 1; }
.login-brand h1 { font-size: 28px; margin-bottom: 40px; font-weight: 800; }
.login-brand h2 { font-size: 42px; line-height: 1.2; margin-bottom: 20px; font-weight: 700; }
.login-brand p { font-size: 16px; opacity: 0.8; line-height: 1.6; margin-bottom: 40px; max-width: 500px; }
.login-features { display: flex; gap: 20px; font-size: 13px; font-weight: 600; opacity: 0.9; }

.login-right {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card-modern { width: 100%; max-width: 400px; padding: 40px; background: white; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); }
.login-card-modern h2 { font-size: 24px; margin-bottom: 5px; color: var(--text); font-weight: 800; }
.login-card-modern p { font-size: 13px; color: #64748b; margin-bottom: 30px; }

.role-toggle { display: flex; background: #f1f5f9; border-radius: 30px; padding: 5px; margin-bottom: 25px; }
.role-toggle button { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 25px; font-weight: 600; cursor: pointer; color: #64748b; transition: 0.2s;}
.role-toggle button.active { background: var(--primary); color: white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.login-secure { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 25px; font-weight: 600; }

/* --- MODERNISASI & RESPONSIVITAS MOBILE --- */
.mobile-header {
    display: none;
    background: var(--card);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* --- TABEL & TOMBOL AKSI --- */
.btn-primary { background: var(--primary); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn-secondary:hover { background: #e2e8f0; }

.table-responsive { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: #f8fafc; color: #475569; font-size: 13px; font-weight: 700; text-transform: uppercase; border-bottom: 2px solid var(--border); padding: 12px; text-align: left; }
td { padding: 15px 12px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
.btn-detail { background: #eff6ff; color: #2563eb; border: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: bold; cursor: pointer; }
.btn-detail:hover { background: #dbeafe; }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .login-left { display: none; }
    .login-split { flex-direction: column; }
    .login-right { background: var(--bg); padding: 20px; }
    
    .mobile-header { display: flex; }
    
    .sidebar {
        position: fixed;
        left: -280px; 
        width: 280px;
        height: 100vh;
        z-index: 100;
        transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.show { left: 0; }
    .sidebar-overlay.show { display: block; animation: fadeIn 0.3s; }

    .main-content { padding: 0; } 
    main { padding: 15px; padding-bottom: 80px; }

    .card-grid { grid-template-columns: 1fr; } 
    #kantong-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-layout { overflow-x: hidden; }
}

/* ===== POS FORM BARU ===== */
.opt-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s;
  white-space: nowrap;
}
.opt-btn:hover { border-color: var(--primary); color: var(--primary); }
.opt-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.opt-btn .material-symbols-rounded { font-size: 16px; }

.pos-item-row {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.2s;
}
.pos-item-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }

.pos-summary-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 10px;
  border: 1px solid #e2e8f0;
}
.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}
.pos-total-box {
  background: var(--primary);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin: 10px 0;
}
.pos-total-box p { margin: 0; }
.pos-total-label { font-size: 11px; color: rgba(255,255,255,0.75); letter-spacing: 1px; text-transform: uppercase; }
.pos-total-nominal { font-size: 2em; font-weight: 800; color: white; line-height: 1.2; }

.pos-opt-section {
  display: none;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: white;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-5px); } to { opacity:1; transform:translateY(0); } }

.item-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 480px) {
  .item-grid-3 { grid-template-columns: 1fr 1fr; }
}
.item-grid-label {
  font-size: 11px;
  color: #64748b;
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}
.pos-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.pos-input:focus { outline: none; border-color: var(--primary); }

.pos-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 768px) {
  .pos-layout { flex-direction: column; }
  .pos-summary-box { position: static; width: 100% !important; box-sizing: border-box; }
}

.badge-type {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.pos-small-input {
  width: 55px;
  padding: 3px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
}
.btn-add-item {
  flex: 1;
  padding: 10px;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: bold;
  font-size: 14px;
  transition: opacity 0.2s;
}
.btn-add-item:hover { opacity: 0.88; }
.btn-submit-pos {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.btn-submit-pos:hover { opacity: 0.9; }
.pos-divider { border: none; border-top: 1px dashed #cbd5e1; margin: 8px 0; }
.hutang-warning {
  background: #fff0f0;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  padding: 12px;
}

/* ===== CUSTOMER SECTION ===== */
.cust-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.cust-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.cust-search-wrap .material-symbols-rounded {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: #94a3b8;
  pointer-events: none;
}
.cust-search {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.cust-search:focus { outline: none; border-color: var(--primary); }

.cust-table-wrap { overflow-x: auto; border-radius: 10px; }
.cust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.cust-table thead tr {
  background: #f1f5f9;
}
.cust-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.cust-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.cust-table tbody tr:hover { background: #f8fafc; }
.cust-table tbody tr:last-child td { border-bottom: none; }
.cust-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.cust-name-cell { display: flex; align-items: center; gap: 10px; }
.cust-badge-new {
  font-size: 10px;
  background: #dcfce7;
  color: #166534;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 700;
  margin-left: 6px;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-info { font-size: 13px; color: #64748b; }
.pagination-btns { display: flex; gap: 6px; align-items: center; }
.page-btn {
  padding: 6px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-number { font-size: 13px; font-weight: 600; color: #475569; padding: 0 4px; }

/* Modal Customer */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  background: var(--primary);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { margin: 0; color: white; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 20px; }
.modal-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--primary); }
.form-field textarea { resize: vertical; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-modal-cancel {
  padding: 9px 18px;
  border: 1.5px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #64748b;
  font-size: 14px;
}
.btn-modal-save {
  padding: 9px 22px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-modal-save:hover { opacity: 0.9; }
.cust-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.cust-action-btn:hover { background: #f1f5f9; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}
.empty-state .material-symbols-rounded { font-size: 48px; display: block; margin-bottom: 10px; }

/* ===== SETTINGS ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

.tema-color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.tema-color-btn:hover { transform: scale(1.15); }
.tema-color-btn.active {
  border-color: white;
  box-shadow: 0 0 0 3px var(--primary);
  transform: scale(1.1);
}

/* Log Badge Tipe */
.log-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.log-LOGIN    { background:#dcfce7; color:#166534; }
.log-LOGOUT   { background:#fef9c3; color:#854d0e; }
.log-TRANSAKSI{ background:#dbeafe; color:#1e40af; }
.log-CUSTOMER { background:#f3e8ff; color:#6b21a8; }
.log-SETTINGS { background:#e0f2fe; color:#075985; }
.log-HAPUS    { background:#fee2e2; color:#991b1b; }
.log-INFO     { background:#f1f5f9; color:#475569; }

/* ===== FULL DARK MODE MAKSIMAL (REVISI SEMPURNA) ===== */
body.dark-mode {
  background: #0f172a !important;
  color: #f8fafc !important;
}

/* 1. Kotak Utama, Pop-up, & Notifikasi */
body.dark-mode .card,
body.dark-mode .sidebar,
body.dark-mode .sidebar-header,
body.dark-mode .mobile-header,
body.dark-mode .login-right,
body.dark-mode .login-card-modern,
body.dark-mode .modal-box,
body.dark-mode .edit-tx-box,
body.dark-mode .filter-panel,
body.dark-mode .pos-summary-box,
body.dark-mode .jasa-picker-dropdown,
body.dark-mode .pos-opt-section,
body.dark-mode .hutang-warning {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* 2. Input, Select, Option (Dropdown), & Item Jasa */
body.dark-mode input, 
body.dark-mode select, 
body.dark-mode option,
body.dark-mode textarea,
body.dark-mode .cust-search,
body.dark-mode .jasa-picker-item,
body.dark-mode .jasa-picker-add,
body.dark-mode .jasa-stat {
  background: #0f172a !important; 
  color: #f8fafc !important; 
  border-color: #334155 !important;
}

/* Hover / Sorotan pada dropdown Jasa */
body.dark-mode .jasa-picker-item:hover,
body.dark-mode .jasa-picker-add:hover {
  background: #334155 !important;
}

/* 3. Tabel & Garis Pemisah */
body.dark-mode .cust-table thead tr { background: #0f172a !important; border-bottom: 2px solid #334155 !important; }
body.dark-mode .cust-table td, body.dark-mode .cust-table th, 
body.dark-mode .jasa-picker-item, body.dark-mode .edit-summary-row { 
  border-color: #334155 !important; color: #e2e8f0 !important; 
}
body.dark-mode .cust-table tbody tr:hover { background: #0f172a !important; }

/* 4. Tombol & Menu */
body.dark-mode .menu-item { color: #cbd5e1 !important; }
body.dark-mode .menu-item:hover, body.dark-mode .sub-menu li:hover { background: #0f172a !important; color: var(--primary) !important; }
body.dark-mode .opt-btn, body.dark-mode .page-btn, body.dark-mode .btn-secondary, body.dark-mode .btn-modal-cancel {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* 5. Trik Sapu Jagat Tambahan untuk Background Halus di HTML/JS */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #eff6ff"],
body.dark-mode [style*="background:#eff6ff"],
body.dark-mode [style*="background: #fff0f0"],
body.dark-mode [style*="background:#fff0f0"],
body.dark-mode .pos-item-row,
body.dark-mode .jasa-card,
body.dark-mode .edit-item-row {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

/* 6. Menerangkan warna teks abu-abu tua agar terbaca jelas */
body.dark-mode [style*="color: #475569"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#334155"] {
    color: #cbd5e1 !important;
}

/* Amankan background layar utama agar tetap full gelap */
body.dark-mode .dashboard-layout { background: #0f172a !important; }

/* ===== JASA MASTER ===== */
.jasa-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.jasa-card {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.jasa-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: var(--primary); }
.jasa-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
}
.jasa-card-name {
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
  margin: 8px 0 4px;
}
.jasa-price-tag {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.jasa-stat-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.jasa-stat {
  flex: 1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.jasa-stat-label { font-size: 10px; color: #94a3b8; text-transform: uppercase; font-weight: 600; }
.jasa-stat-val { font-size: 13px; font-weight: 700; color: #334155; margin-top: 2px; }
.jasa-stat-val.profit { color: #16a34a; }
.jasa-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}
.jasa-action-btn {
  flex: 1;
  padding: 6px;
  border-radius: 7px;
  border: 1.5px solid #e2e8f0;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  transition: all 0.15s;
}
.jasa-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.jasa-action-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Selector Jasa di POS Form */
.jasa-picker-wrap {
  position: relative;
}
.jasa-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: white;
  border: 1.5px solid var(--primary);
  border-radius: 0 0 10px 10px;
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.jasa-picker-item {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}
.jasa-picker-item:hover { background: #f0fdf4; }
.jasa-picker-item:last-child { border-bottom: none; }
.jasa-picker-add {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
}
.jasa-picker-add:hover { background: #dcfce7; }
.profit-indicator {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.profit-full { background: #dcfce7; color: #166534; }
.profit-partial { background: #dbeafe; color: #1e40af; }

/* ===== FILTER PANEL POS ===== */
.filter-panel {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  display: none;
}
.filter-panel.show { display: block; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.filter-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.filter-field input,
.filter-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  box-sizing: border-box;
  background: white;
  transition: border-color 0.2s;
}
.filter-field input:focus,
.filter-field select:focus { outline: none; border-color: var(--primary); }

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.filter-tag button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}
.filter-tag button:hover { color: white; }
.filter-reset-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #fff0f0;
  color: var(--danger);
  border: 1.5px solid #fecaca;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-reset-btn:hover { background: #fee2e2; }
.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-toggle-btn:hover,
.filter-toggle-btn.active { border-color: var(--primary); color: var(--primary); background: #f0fdf4; }
.filter-active-dot {
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  display: none;
}
.filter-active-dot.show { display: inline-block; }

/* ===== EDIT TRANSAKSI MODAL ===== */
.edit-tx-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.edit-tx-modal.show { display: flex; }
.edit-tx-box {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 820px;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
  overflow: hidden;
}
.edit-tx-header {
  background: var(--primary);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.edit-tx-header h3 {
  margin: 0;
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.edit-tx-body { padding: 20px; max-height: 80vh; overflow-y: auto; }
.edit-tx-footer {
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.edit-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.edit-section-title:first-child { margin-top: 0; }
.edit-items-list { display: flex; flex-direction: column; gap: 8px; }
.edit-item-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}
.edit-item-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
@media (max-width: 600px) {
  .edit-item-grid { grid-template-columns: 1fr 1fr; }
}
.edit-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.edit-total-display {
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.status-lunas { background: #dcfce7; color: #166534; }
.status-hutang { background: #fee2e2; color: #991b1b; }
.status-piutang { background: #fef3c7; color: #92400e; }

/* ===== USER MANAGEMENT ===== */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.role-superadmin { background: #fef3c7; color: #92400e; }
.role-admin      { background: #dbeafe; color: #1e40af; }
.role-kasir      { background: #dcfce7; color: #166534; }
.role-manager    { background: #f3e8ff; color: #6b21a8; }

.status-aktif    { background: #dcfce7; color: #166534; }
.status-nonaktif { background: #fee2e2; color: #991b1b; }

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
}
.permission-item:hover { border-color: var(--primary); background: #f0fdf4; }
.permission-item input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }

/* ===== PROFIL USER DI BAWAH SIDEBAR (KOTAK KEREN & ELEGAN) ===== */
.user-info-sidebar {
    padding: 12px 15px !important;
    margin: 10px 16px 15px 16px !important; /* Memberi jarak agar membentuk kotak melayang */
    background: linear-gradient(145deg, #334155, #1e293b) !important; /* Gradasi elegan abu gelap ke biru dongker */
    border: 1px solid #475569 !important; /* Garis tepi tegas namun soft */
    border-radius: 16px !important; /* Sudut kotak membulat modern */
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important; /* Bayangan 3D */
    transition: all 0.3s ease;
}

/* Efek Nyala / Terangkat saat disentuh mouse */
.user-info-sidebar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.15) !important;
    border-color: #38bdf8 !important; /* Kotak menyala biru neon di pinggirnya */
}

/* Sembunyikan Kotak Avatar (Angka 0) */
.user-avatar-lg {
    display: none !important;
}

/* Membungkus teks nama dan jabatan agar rata tengah (Center) */
.user-info-sidebar > div {
    display: flex;
    flex-direction: column;
    align-items: center; /* Bikin teks otomatis ke tengah */
    justify-content: center;
    width: 100%; /* Memenuhi lebar kotak */
    overflow: hidden;
}

/* Teks Nama User */
.user-info-sidebar .name { 
    font-weight: 800 !important; 
    font-size: 15px !important; 
    color: #ffffff !important; /* Putih terang murni */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Teks Role / Jabatan */
.user-info-sidebar .role { 
    font-size: 11px !important; 
    color: #7dd3fc !important; /* Biru langit sangat terang (Light Sky Blue) */
    font-weight: 700 !important;
    text-transform: uppercase; /* Huruf besar semua */
    letter-spacing: 1px; /* Jarak antar huruf dilegakan sedikit */
    margin-top: 4px;
    text-align: center;
}

/* ===== MODE FULLSCREEN POS ===== */
body.pos-fullscreen-mode .sidebar {
  display: none !important;
}
body.pos-fullscreen-mode .mobile-header {
  display: none !important;
}
body.pos-fullscreen-mode .main-content {
  padding: 15px !important;
}

/* ===== 7. MEMBUNUH WARNA PUTIH BAWAAN BROWSER (AUTOFILL & FOCUS) ===== */

/* Menghilangkan paksaan warna terang saat kotak diklik */
body.dark-mode input:focus, 
body.dark-mode select:focus, 
body.dark-mode textarea:focus {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(15, 81, 50, 0.3) !important;
}

/* Menghilangkan warna kuning/putih jelek saat Autofill dari Chrome/Edge */
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover, 
body.dark-mode input:-webkit-autofill:focus, 
body.dark-mode input:-webkit-autofill:active,
body.dark-mode select:-webkit-autofill,
body.dark-mode select:-webkit-autofill:hover,
body.dark-mode select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Memaksa isi menu pilihan (Options) tetap gelap saat terbuka */
body.dark-mode select option {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Mewarnai teks yang sedang di-blok (Select Text) agar senada */
body.dark-mode ::selection {
    background: var(--primary) !important;
    color: white !important;
}

/* ===== 10. KANTONG: UKURAN NOMINAL DINAMIS ===== */
/* Mengatur angka di kotak ringkasan atas agar mengecil di HP */
#summary-total-semua,
#summary-total-cash,
#summary-total-bank {
    font-size: clamp(16px, 4vw, 20px) !important; /* FITUR BARU: Batas maksimal diturunkan menjadi 20px */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Mengatur angka saldo di kartu-kartu kantong bawah agar mengecil di HP */
#kantong-grid .card > p:last-child {
    font-size: clamp(16px, 4vw, 20px) !important; /* FITUR BARU: Ukuran maksimal diturunkan ke 20px */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* =========================================================
   FITUR: SCROLLBAR ELEGAN (MAC OS STYLE) UNTUK MENU SAMPING
   ========================================================= */

/* Ganti '#sidebar' atau '.sidebar' sesuai dengan ID/Class menu samping Anda. 
   Kode ini juga bisa dipakai untuk elemen tabel yang bisa di-scroll. */

#sidebar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.menu-samping::-webkit-scrollbar,
aside::-webkit-scrollbar {
    width: 5px; /* Sangat tipis dan elegan */
    height: 5px; /* Untuk scroll horizontal jika ada */
}

#sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.menu-samping::-webkit-scrollbar-track,
aside::-webkit-scrollbar-track {
    background: transparent; /* Latar belakang guliran tembus pandang */
}

#sidebar::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.menu-samping::-webkit-scrollbar-thumb,
aside::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* Warna abu-abu lembut / kalem */
    border-radius: 10px; /* Bentuk ujungnya membulat rapi */
}

#sidebar::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.menu-samping::-webkit-scrollbar-thumb:hover,
aside::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8; /* Sedikit lebih gelap saat kursor menyentuh */
}

/* =====================================================================
   FITUR: SEMBUNYIKAN ELEMEN SAAT MODE FULLSCREEN (VERSI MODERN)
   ===================================================================== */
@media screen and (display-mode: fullscreen) {
    .sembunyi-saat-fullscreen {
        display: none !important;
    }
}

/* Fallback untuk browser Apple/Safari/Lama */
@media screen and (-webkit-view-mode: fullscreen) {
    .sembunyi-saat-fullscreen {
        display: none !important;
    }
}

/* Jika Anda punya tombol Fullscreen buatan sendiri yang menambahkan class ke Body */
body.is-fullscreen .sembunyi-saat-fullscreen {
    display: none !important;
}

/* =====================================================================
   PERBAIKAN: SEMBUNYIKAN SCROLL & GARIS HITAM SIDEBAR DI LAYAR HP
   ===================================================================== */
@media screen and (max-width: 768px) {
    .sidebar {
        margin: 0 !important; /* Hilangkan jarak ngambang agar bisa terdorong keluar 100% */
        border-radius: 0 !important; /* Buat sudutnya kotak agar rapat ke dinding HP */
        height: 100vh !important; /* Tinggi penuh layaknya aplikasi mobile */
        border: none !important; /* Hilangkan garis tepi yang mengintip */
        box-shadow: none !important; /* Hilangkan bayangan hitam yang tertinggal */
    }
}