/* === GENERAL STYLING === */
:root {
    --bg-dark: #1F2937;
    --bg-surface: #374151;
    --primary-color: #EC4899;
    --primary-color-dark: #DB2777;
    --success-color: #10B981;
    --danger-color: #F43F5E;
    --warning-color: #F59E0B;
    --muted-color: #a7a9be;
    --text-color: #F3F4F6;
    --border-color: #4B5563;
}
body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    overflow-x: hidden;
}
.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}
h2, h3, h4 {
    color: var(--primary-color);
}
h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}
h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}
h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Ini akan membuat konten utama mengisi ruang yang tersedia */
.dashboard-container, .order-page-wrapper, .pricelist-container {
    flex-grow: 1;
}



/* === HOMEPAGE & GENERAL SECTIONS === */
.hero-section {
    margin: 1rem 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.hero-placeholder {
    background-color: var(--bg-surface);
    height: clamp(160px, 22vw, 260px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    font-size: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.content-section {
    margin-bottom: 1.5rem;
}
.product-grid, .product-grid-small {
    display: grid;
    gap: 1rem;
}
.product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.product-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Untuk Flash Sale Card */
.product-card-small {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    aspect-ratio: 16 / 9;
}
.product-card-small:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

/* --- KODE BARU UNTUK KARTU GAME UTAMA --- */
.product-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    height: 180px; /* Atur tinggi yang tetap untuk semua kartu */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Mendorong konten ke atas dan bawah */
    align-items: center;
    padding: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: var(--text-color);
    overflow: hidden; /* Sembunyikan konten yang meluber */
}

.product-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.product-card img {
    width: 100%;
    height: 100px; /* Beri tinggi tetap untuk area gambar */
    border-radius: 8px;
    object-fit: cover; /* Pastikan gambar mengisi area tanpa distorsi */
    margin-bottom: 0.5rem; /* Beri sedikit jarak */
}

.product-card span {
    display: block;
    width: 100%;
    text-align: center;
    white-space: nowrap; /* Mencegah teks turun baris */
    overflow: hidden; /* Sembunyikan teks yang terlalu panjang */
    text-overflow: ellipsis; /* Tampilkan '...' jika teks terpotong */
}

footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}
.card {
    background-color: var(--bg-surface);
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.ui-state {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--muted-color);
    padding: 1rem;
    text-align: center;
    line-height: 1.5;
}

.ui-state.error {
    background-color: rgba(244, 63, 94, 0.08);
    border-color: var(--danger-color);
    color: #fecdd3;
}

.ui-state.success {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: var(--success-color);
    color: #bbf7d0;
}

.ui-state.loading {
    background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin-bottom: 0.25rem;
}

.section-header .form-description {
    margin: 0;
    text-align: left;
}

/* === MODAL & FORM STYLING === */
.hidden {
    display: none !important;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal-content {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-sizing: border-box;
}
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
}
.modal-content h3 {
    text-align: center;
    margin-bottom: 1rem;
}
.form-description {
    text-align: center;
    font-size: 0.9rem;
    color: #a7a9be;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}
.modal-content input, .admin-form input, .admin-form select, #order-form input, .deposit-form-section input, #sync-products-form input, #margin-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    box-sizing: border-box;
}
.password-wrapper {
    position: relative;
    width: 100%;
}
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-75%);
    cursor: pointer;
}
.forgot-password {
    display: block;
    text-align: right;
    margin: -0.5rem 0 1rem 0;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
}
.modal-content button[type="submit"], .admin-form button, .deposit-form-section button, #margin-form button, #sync-products-form button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}
.switch-form {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}
.switch-form a {
    color: var(--primary-color);
    font-weight: bold;
}
.terms {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    text-align: left;
}
.terms input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}
.terms a {
    color: var(--primary-color);
}

/* === DASHBOARD & ADMIN SHARED LAYOUT === */
.dashboard-container, .admin-page-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}
.sidebar, .admin-sidebar {
    flex: 1;
    max-width: 250px;
    background-color: var(--bg-surface);
    padding: 1rem;
    border-radius: 8px;
    position: sticky;
    top: 2rem;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
}
.sidebar-nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s;
    cursor: pointer;
}
.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}
.dashboard-content, .admin-content {
    flex: 3;
    min-width: 0;
}
.dashboard-section, .admin-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* === DASHBOARD PAGE SPECIFIC === */
.dashboard-content .card {
    margin-bottom: 2rem;
}
.profile-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.profile-details p {
    margin: 0.5rem 0;
}
.edit-btn, .topup-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 0.5rem;
}
.edit-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.topup-btn {
    background-color: var(--primary-color);
    color: white;
}
.balance-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.balance-amount {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}
.history-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}
.order-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.stat-item span {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}
.api-key-container {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}
#api-key-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: #a7a9be;
    word-break: break-all;
}
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.tab-link {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 1rem;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
}
.tab-link.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

/* === ADMIN PAGE SPECIFIC === */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.table-container {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}
table th, table td {
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    text-align: left;
    vertical-align: middle;
}
table th {
    background-color: rgba(255, 255, 255, 0.05);
    color: #dbe3ef;
}
.approve-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}
.approve-btn:disabled {
    background-color: #6c757d;
}
.failed-btn {
    background-color: var(--danger-color);
}
.manual-balance-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.manual-balance-actions button {
    flex-grow: 1;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
.admin-forms-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.admin-form {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}
.admin-form h4 {
    margin-top: 0;
    text-align: center;
}
.admin-form label, #margin-form label, #sync-products-form label {
    font-size: 0.9rem;
    color: #a7a9be;
    margin-top: 0;
    margin-bottom: 0.2rem;
}
.admin-form input, .admin-form select {
    margin-top: -0.8rem;
}
.admin-master-detail {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.master-list {
    flex: 1;
    min-width: 0;
}
.detail-list {
    flex: 2;
    min-width: 0;
}
#games-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}
#games-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
#games-table tbody tr.active-row {
    background-color: rgba(236, 72, 153, 0.2);
    font-weight: bold;
}
#margin-fields-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.form-group-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.form-group-horizontal label {
    font-weight: bold;
}
.form-group-horizontal div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-group-horizontal input {
    width: 80px;
    text-align: right;
    margin-bottom: 0;
}
#sync-products-form {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
#sync-products-form .form-group {
    display: flex;
    flex-direction: column;
}
#sync-products-form button {
    padding: 0.7rem 1.5rem;
    height: fit-content;
}

/* === DEPOSIT & MUTASI & TRANSAKSI PAGE === */
.deposit-wrapper, .mutasi-wrapper, .main-wrapper {
    max-width: 800px;
    margin: 2rem auto;
}
.payment-instructions-section {
    margin-top: 2rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 5px solid var(--primary-color);
}
.payment-instructions-section p {
    line-height: 1.6;
}
#mutasi-table .amount-in {
    color: var(--success-color);
    font-weight: bold;
}
#mutasi-table .amount-out {
    color: var(--danger-color);
    font-weight: bold;
}
.status-badge, .badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-transform: capitalize;
}
.status-success, .badge.type-deposit {
    background-color: var(--success-color);
}
.status-pending, .badge.type-purchase {
    background-color: var(--warning-color);
    color: #111827;
}
.status-failed, .status-refunded, .badge.type-refund {
    background-color: var(--danger-color);
}
.status-processing {
    background-color: #3B82F6;
}

.status-note {
    color: var(--muted-color);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

/* === PRODUCT ORDER PAGE === */
.order-page-wrapper {
    max-width: 920px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
#game-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
#game-info img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
}
#game-info h2 {
    margin: 0;
}
#game-info p {
    margin: 0.25rem 0 0 0;
    color: #a7a9be;
    font-size: 0.9rem;
}
.order-page-wrapper .card h3 > span {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.order-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
#target-game-id:only-child {
    grid-column: 1 / -1;
}

/* === CSS UNTUK KARTU PEMILIHAN PRODUK (DIPERBAIKI) === */
.product-card-selectable {
    border: 2px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 85px; /* Beri tinggi minimal agar rapi */
    box-sizing: border-box;
    background-color: rgba(31, 41, 55, 0.45);
}
.product-card-selectable:hover {
    border-color: var(--primary-color);
    background-color: rgba(236, 72, 153, 0.08);
}
.product-card-selectable.selected {
    border-color: var(--primary-color);
    background-color: rgba(236, 72, 153, 0.2);
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
}
.product-card-selectable span {
    font-weight: bold;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
    white-space: normal; /* PENTING: Izinkan teks untuk pindah baris (wrapping) */
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.product-card-selectable small {
    color: #a7a9be;
    font-size: 0.8rem;
}

#payment-info {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}
#payment-info p {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
}
#payment-info hr {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border-color);
}
.order-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: none;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}
.order-button:not(:disabled):hover,
.topup-btn:hover,
.edit-btn:hover,
.btn-submit-deposit:hover {
    filter: brightness(1.08);
}
.order-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}
/* === DASHBOARD & ADMIN SHARED LAYOUT === */
.dashboard-container, .admin-page-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    align-items: flex-start;
}
.sidebar, .admin-sidebar {
    flex: 1;
    min-width: 200px; /* Tambahkan min-width agar tidak terlalu kecil */
    max-width: 250px;
    background-color: var(--bg-surface);
    padding: 1rem;
    border-radius: 8px;
    position: sticky;
    top: 2rem;
    min-height: calc(100vh - 4rem);
    box-sizing: border-box;
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
}
.sidebar-nav h4 { /* Style untuk judul sidebar */
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}
.sidebar-nav a { /* Pastikan link game di sidebar memiliki padding dan display block */
    color: var(--text-color);
    text-decoration: none;
    padding: 0.8rem 1rem; /* Sedikit lebih kecil dari nav header */
    border-radius: 5px;
    margin-bottom: 0.5rem;
    display: block; /* Pastikan mengambil seluruh lebar */
    align-items: center; /* Untuk ikon jika ada */
    gap: 1rem;
    transition: background-color 0.2s;
    cursor: pointer;
    white-space: nowrap; /* Mencegah nama game pecah baris */
    overflow: hidden; /* Sembunyikan overflow jika nama sangat panjang */
    text-overflow: ellipsis; /* Tambahkan elipsis jika terpotong */
}
.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}


/* Tambahan untuk scrollable tables di Admin Panel/Compare Prices Page */
.table-container {
    width: 100%;
    overflow-x: auto; /* Memungkinkan tabel di-scroll horizontal */
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    white-space: nowrap; /* Mencegah teks dalam sel pecah baris */
}
table th, table td {
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    text-align: left;
}
table th {
    background-color: rgba(255, 255, 255, 0.05);
}
/* Mengatur lebar kolom agar lebih proporsional untuk banyak harga */
table th:nth-child(1), table td:nth-child(1) { min-width: 150px; } /* Nama Game/Produk */
table th:nth-child(2), table td:nth-child(2) { min-width: 200px; } /* Produk/Harga Pokok */
table th:nth-child(3), table td:nth-child(3) { min-width: 100px; } /* SKU */
table th:nth-child(4), table td:nth-child(4) { min-width: 120px; } /* Harga Pokok */
/* CSS untuk Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px; /* Lebar switch */
    height: 28px; /* Tinggi switch */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Ukuran knob */
    width: 20px;  /* Ukuran knob */
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3; /* Warna saat ON */
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(22px);
    -ms-transform: translateX(22px);
    transform: translateX(22px);
}

@media (max-width: 768px) {
    .product-grid {
       
        grid-template-columns: repeat(4, 1fr);
    }
}


@media (max-width: 480px) {
    .product-grid {
      
        grid-template-columns: repeat(3, 1fr);
    }

    .product-card {
        
        height: 140px; 
        padding: 0.5rem;
    }

    .product-card img {
        height: 70px; 
    }

    
    h2 {
        font-size: 1.2rem;
    }

.logo {
        font-size: 1.5rem; 
    }

  
    header nav a, .header-btn {
        padding: 0.4rem 0.8rem; 
        font-size: 0.8rem; 
    }

 
    .hero-placeholder {
        height: 150px; 
        font-size: 1rem;
    }

  
    .product-card-small {
        font-size: 0.9rem; 
    }
}

 /* === CSS UNTUK FLASH SALE BERJALAN === */
.flash-sale-container {
  overflow: hidden; /* Sembunyikan semua yang keluar dari kotak */
}
.flash-sale-track {
  display: flex; /* Buat item berjajar ke samping */
  width: max-content; /* Lebar sesuai total item di dalamnya */
  animation: scroll-left 30s linear infinite; /* Terapkan animasi */
}
.flash-sale-card {
  background-color: var(--bg-surface);
  border-radius: 8px;
  width: 160px; /* Lebar setiap kartu flash sale */
  margin-right: 1rem;
  flex-shrink: 0; /* Mencegah kartu 'penyok' saat ruang sempit */
}
.flash-sale-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.flash-sale-info {
  padding: 0.5rem;
}
.fs-product-name, 
.fs-price-discounted, 
.fs-price-original {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-product-name {
  font-size: 0.8rem;
  font-weight: bold;
}
.fs-price-discounted {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--primary-color);
}
.fs-price-original {
  font-size: 0.75rem;
  text-decoration: line-through;
  color: #9ca3af;
}


@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); } /* Geser sejauh setengah dari total lebar track */
}

/* === FINAL HEADER & SEARCH STYLING === */

/* 1. Mencegah Layar Geser di HP 
html, body {
    max-width: 100%;
    overflow-x: hidden; 
}*/

/* 2. Struktur & Elemen Header Utama */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    height: 56px;
}
.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.header-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.logo { 
    margin: 0; 
    font-size: 1.6rem;
    color: var(--primary-color);
    font-weight: bold;
}
.logo-link { text-decoration: none; }
.header-btn {
    color: white;
    background-color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.search-container {
    position: relative;
    width: 100%;
    max-width: 450px;
}
.search-input-wrapper {
    position: relative;
}
.search-input-wrapper .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}
#search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 40px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-color);
    box-sizing: border-box;
}
.search-results-list {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 40vh;
    overflow-y: auto;
    z-index: 200;
}
.search-results-list a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-color);
}
.search-results-list a:hover {
    background-color: var(--primary-color);
}
.search-results-list a img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
}

@media (max-width: 768px) {
    /* 1. Layout Dasar HP */
    .container {
        width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    /* 2. Header di index.html */
    .header-container {
        flex-wrap: wrap;
        position: relative;
        height: auto;
        min-height: 60px;
        padding-top: 0.5rem;
    }
    .header-center {
        order: 3;
        width: 100%;
        display: flex;
        padding: 0.5rem 0.5rem 0.5rem;
    }
    #hamburger-btn {
        display: block;
        padding-left: 0;
        margin-right: 0.5rem;
    }
    .header-right .pricelist-btn, .header-right .validate-btn { display: none; }
    .header-right { gap: 0.5rem; }

    /* 3. Dropdown Menu di index.html */
    .dropdown-menu {
        position: fixed;
        left: -100%;
        top: 0;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--bg-dark);
        padding: 1.5rem;
        transition: left 0.3s ease-in-out;
        border: none;
        border-right: 1px solid var(--border-color);
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        z-index: 200;
    }
    .dropdown-menu.active { left: 0; }
    .dropdown-menu a {
        color: var(--text-color);
        text-decoration: none;
        display: block;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.1rem;
    }

    /* 4. Layout Admin & Dashboard di HP */
    .dashboard-container, .admin-page-container {
        flex-direction: column;
    }
    #menu-toggle-btn {
        display: block;
        background: none; border: none;
        color: var(--text-color);
        font-size: 1.5rem; cursor: pointer;
    }
      .sidebar, .admin-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 300;
        transition: left 0.3s ease-in-out;
        max-width: 300px;
        width: 75%;
        /* Pastikan sidebar tidak 'sticky' di HP */
        position: fixed;
    }
    .sidebar.active, .admin-sidebar.active {
        left: 0;
    }
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 299;
    }

    /* 5. Flash Sale Mepet */
    .flash-sale-container {
        margin-left: -1rem;
        margin-right: -1rem;
    }
    .flash-sale-track {
        padding-left: 1rem;
    }
}


@media (min-width: 769px) {
    #hamburger-btn { display: none; }
    #menu-toggle-btn { display: none; }
}

.admin-master-detail {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.table-container {
    width: 100%;
    overflow-x: auto; 
}
.toggle-password {
    color: var(--primary-color); /* Ubah warna ikon mata */
}


@media (max-width: 768px) {
    .store-link-btn {
        display: none !important;
    }
}
.store-link-btn-mobile {
    display: none; 
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    
    .sidebar .store-link-btn-mobile {
        display: flex !important;
    }

    
    .header-right .store-link-btn {
        display: none !important;
    }
}
/* === CSS UNTUK LOGOUT BUTTON DAN SEARCH INPUT === */
#logout-button {
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s;
    cursor: pointer;
}
#logout-button:hover {
    background-color: var(--danger-color); /* Warna merah saat di-hover */
    color: white;
}
#game-search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-color);
    box-sizing: border-box;
}


@media (min-width: 769px) {
    #dropdown-menu {
        display: none !important;
    }
}
@media (max-width: 480px) {
    #game-search-input {
        font-size: 0.85rem;
        padding: 6px 10px;
        height: 36px;
    }
}
/* Style untuk dropdown server (SESUAI TEMA GELAP) */
#server-input-container select {
    width: 100%;
    box-sizing: border-box; /* Agar padding tidak merusak lebar */
    padding: 0.8rem; /* Samakan dengan input lain */
    margin-bottom: 1rem; /* Samakan dengan input lain */
    background-color: var(--bg-dark); /* Warna background gelap */
    border: 1px solid var(--border-color); /* Warna border */
    border-radius: 5px; /* Samakan dengan input lain */
    color: var(--text-color); /* Warna teks putih */
    font-size: 1em;
    cursor: pointer;

    /* Menghilangkan panah default dan menggantinya dengan ikon kustom */
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23F3F4F6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

#server-input-container select:hover,
#server-input-container select:focus {
    border-color: var(--primary-color); /* Warna pink saat hover/fokus */
    outline: none;
    box-shadow: 0 0 5px rgba(236, 72, 153, 0.3); /* Bayangan pink lembut */
}
/* Tata letak untuk form pencarian dan dropdown */
.game-selector-form {
    display: flex;
    gap: 1rem;
    margin: 1rem 0 2rem 0;
    flex-wrap: wrap; /* Agar responsif di layar kecil */
}

/* Membuat input pencarian dan dropdown mengisi ruang yang tersedia */
.game-selector-form input,
.game-selector-form select {
    flex: 1;
    min-width: 250px; /* Lebar minimum sebelum pindah baris */
}

/* Style konsisten untuk dropdown (menggunakan style select yang ada) */
#game-selector-dropdown {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23F3F4F6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

/* Tata letak untuk kartu info game yang muncul */
.game-info-details {
    display: grid;
    /* Membuat 2 kolom, dan menjadi 1 kolom di layar kecil */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.game-info-details p {
    margin: 0;
    padding: 0.8rem;
    background-color: var(--bg-dark);
    border-radius: 5px;
    text-align: center;
}

/* Tata letak untuk setiap baris toggle */
.game-info-toggle {
    display: flex;
    justify-content: space-between; /* Tulisan di kiri, tombol di kanan */
    align-items: center;
    padding: 0.8rem;
    background-color: var(--bg-dark);
    border-radius: 5px;
}
/* Style untuk dropdown di halaman admin agar sesuai tema */
#game-selector-dropdown {
    padding: 0.8rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23F3F4F6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
}
/* Perbaikan untuk form sinkronisasi agar selaras */
#sync-products-form {
    align-items: flex-end; /* Pastikan semua item rata bawah */
}

#sync-products-form .form-group {
    margin-bottom: 0; /* Hapus margin bawah dari grup form */
}

#sync-products-form button {
    /* Samakan padding vertikal dengan input field */
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}
@media (min-width: 769px) {
  .admin-page-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
  }

  .admin-sidebar {
    flex: 0 0 250px;
    max-width: 250px;
    position: sticky;
    top: 2rem;
  }

  .admin-content {
    flex: 1;
    min-width: 0;
  }

  .admin-section {
    width: 100%;
  }
}
@media (min-width: 769px) {
  .admin-page-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
  }

  .admin-sidebar {
    flex: 0 0 250px;
    max-width: 250px;
    position: sticky;
    top: 2rem;
  }

  .admin-content {
    flex: 1;
    min-width: 0;
  }

  .admin-section {
    width: 100%;
  }
}
/* Style untuk wrapper input pencarian di halaman validasi */
.pricelist-search-wrapper {
    padding: 0 1rem; /* Beri jarak di dalam sidebar */
    margin-bottom: 1rem;
}

#game-validate-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-color);
}

/* Style untuk hasil validasi (pesan sukses/error) */
#validator-result-container .card {
    border-left-width: 5px;
    padding: 1.5rem;
}

#validator-result-container .card p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

#validator-result-container .card h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}
.edit-btn.edit-validation-btn {
    position: relative;
    z-index: 2;
    cursor: pointer;
}
.validation-result {
   margin-top: 1rem;
   padding: 1rem;
   border-radius: 5px;
}

.validation-result.success {
   background-color: #e6ffed;
   border: 1px solid #a7ffa3;
   color: #28a745;
}

.validation-result.error {
   background-color: #ffe6e6;
   border: 1px solid #ffa3a3;
   color: #dc3545;
}

.validation-title {
   font-weight: bold;
   margin-bottom: 0.5rem;
}

.validation-title i {
   margin-right: 0.5rem;
}
/* Perbaikan untuk teks tenggelam di form validasi admin */
#validation-rules-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Memberi jarak antar input */
}
#validation-rules-container input {
    margin-bottom: 0; /* Hapus margin bawah dari input di dalam container ini */
}
/* Perbaikan untuk hasil validasi di halaman produk */
.validation-result-inline {
    margin-top: 0.5rem; /* Mengurangi jarak dari atas */
    padding: 0.8rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    display: flex; /* Menggunakan flexbox */
    flex-direction: column; /* Menyusun konten dari atas ke bawah */
    align-items: flex-start; /* Rata kiri */
    grid-column: 1 / -1; /* Membuat div ini mengambil 2 kolom grid */
}
.validation-result-inline p {
    margin: 0; /* Hapus margin default dari paragraf */
}
.validation-result-inline.success {
    background-color: #1a3a32;
    border: 1px solid var(--success-color);
    color: var(--success-color);
}
.validation-result-inline.error {
    background-color: #3e2227;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}
.validation-result-inline i {
    margin-right: 0.5rem;
}
/* Styling untuk Modal Konfirmasi Pesanan */
.confirmation-details h4 {
    color: var(--text-color);
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.confirmation-details p {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.6rem 0;
    font-size: 0.9rem;
}
.confirmation-details strong {
    text-align: right;
    overflow-wrap: anywhere;
}

.confirmation-details p span {
    color: #a7a9be;
}

.confirmation-details .total-payment {
    font-size: 1.1rem;
    font-weight: bold;
}

.confirmation-details hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.confirmation-actions .order-button,
.confirmation-actions .edit-btn {
    width: auto;
    padding: 0.8rem 1.5rem;
}
.footer-content { display: flex; flex-direction: column; align-items: center; }
.footer-links { display: flex; gap: 1.5rem; margin-bottom: 1rem; }
.footer-links a { color: var(--primary-color); text-decoration: none; }

/* Style untuk teks minimum deposit */
.deposit-note {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  text-align: center;
}

/* Style tombol agar di tengah dan menarik */
.center-btn {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.btn-submit-deposit {
  background-color: var(--primary-color);
  color: white;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-submit-deposit:hover {
  background-color: #db2777; /* Lebih gelap dari primary */
}

/* Style untuk container input kode promo */
.promo-container {
display: flex;
margin-bottom: 10px;
}

#promo-code-input {
flex-grow: 1;
padding: 8px;
border: 1px solid #ccc;
border-radius: 5px 0 0 5px;
font-size: 0.9rem;
}

#apply-promo-btn {
padding: 8px 15px;
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 0 5px 5px 0;
cursor: pointer;
font-size: 0.9rem;
}

#apply-promo-btn:hover {
background-color: var(--primary-color-dark);
}

.promo-result {
margin-top: 5px;
font-size: 0.85rem;
}

/* Style baru untuk pesan promo */
.promo-result span {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: bold;
}
.promo-result .success {
    background-color: #1a3a32;
    border: 1px solid var(--success-color);
    color: var(--success-color);
}
.promo-result .error {
    background-color: #3e2227;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}
.promo-result i {
    margin-right: 0.5rem;
}

/* Style tambahan untuk informasi potongan di modal */
.order-summary-promo {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 0.9rem;
color: #888;
}

.order-summary-promo strong {
color: green;
}
/* Style untuk Notifikasi */
#notification-container {
    position: relative;
    cursor: pointer;
}
.badge-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid var(--bg-dark);
}
.notification-panel {
    position: absolute;
    top: 150%;
    right: 0;
    width: 320px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 200;
    overflow: hidden;
}
.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.notification-header h4 {
    margin: 0;
}
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}
.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: block;
    text-decoration: none;
    color: var(--text-color);
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.notification-item.unread {
    background-color: rgba(236, 72, 153, 0.1);
}

/* === TOAST NOTIFICATION STYLING === */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--danger-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    font-weight: bold;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.hidden {
    display: none;
}
/* === PERBAIKAN UNTUK TEKS TENGGELAM DI FORM MARGIN GAME === */
#custom-margin-fields label {
    margin-bottom: 0.5rem; /* Beri sedikit jarak antara label dan input */
}
#custom-margin-fields input {
    margin-top: 0; /* Hapus margin negatif yang bermasalah */
}
/* === PERBAIKAN UNTUK TEKS TENGGELAM DI SEMUA FORM ADMIN === */
#custom-margin-fields label,
#manual-price-fields label {
    margin-bottom: 0.5rem;
}
#custom-margin-fields input,
#manual-price-fields input {
    margin-top: 0;
}
/* === STYLE BARU UNTUK HALAMAN INTEGRASI === */
.api-key-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

#api-key-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: #a7a9be;
    word-break: break-all;
}

.api-key-actions {
    display: flex;
    gap: 0.5rem;
}

.api-key-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: #a7a9be;
    cursor: pointer;
    border-radius: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.api-key-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
/* Memberi jarak pada tombol di halaman Integrasi */
.center-btn {
  display: flex;
  gap: 1rem; /* Properti ini akan memberi jarak 1rem antar item di dalamnya */
}
/* === STYLE UNTUK FORM SEJAJAR DI DASHBOARD (DIPERBAIKI) === */
.form-row-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-row-container input {
    flex-grow: 1; /* Membuat input mengambil sisa ruang */
    margin-bottom: 0 !important;
    
    /* ▼▼▼ PENYESUAIAN UKURAN ▼▼▼ */
    padding: 0.8rem 1rem; /* Perbesar padding vertikal & horizontal */
    font-size: 1rem;      /* Perbesar ukuran font di dalam input */
    height: auto;         /* Biarkan tinggi menyesuaikan padding */
}

.form-row-container button {
    width: auto; /* Lebar tombol menyesuaikan teks */
    white-space: nowrap;
    
    /* ▼▼▼ PENYESUAIAN UKURAN TOMBOL AGAR SERASI ▼▼▼ */
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}
/* Style untuk input field di dashboard agar seragam */
.dashboard-input {
    background-color: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    font-size: 1rem !important;
}
.dashboard-input::placeholder {
    color: #8b96a8;
}

/* Style untuk container tag IP */
#current-ips-list {
    min-height: 38px;
    padding-top: 0.5rem;
}

/* Style untuk setiap tag IP */
.ip-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-dark);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Style untuk tombol hapus (x) di dalam tag IP */
.ip-tag-delete {
    background: none;
    border: none;
    color: #ff7aa3;
    margin-left: 0.5rem;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}
.ip-tag-delete:hover {
    color: #ffffff;
}
/* === PERBAIKAN RESPONSIVE DASHBOARD (B1) === */

@media (max-width: 768px) {
    /* Perkecil padding di semua kartu dashboard */
    .dashboard-content .card {
        padding: 1rem;
    }

    /* Perkecil ukuran judul h3 di dalam dashboard */
    .dashboard-content h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Perkecil ukuran font saldo utama */
    .balance-amount {
        font-size: 2rem;
    }

    /* Buat form sejajar (input & tombol) menjadi vertikal di HP */
    .form-row-container {
        flex-direction: column;
        align-items: stretch; /* Membuat input dan tombol selebar kontainer */
        gap: 0.8rem;
    }

    .form-row-container button {
        width: 100%;
    }

    /* Membuat tabel bisa di-scroll horizontal di dalam kotaknya */
    .table-container {
        overflow-x: auto;
        /* Tambahkan border untuk memberi petunjuk bahwa area ini bisa di-scroll */
        border: 1px solid var(--border-color);
        border-radius: 5px;
    }

    /* Perkecil ukuran teks dan padding di dalam tabel */
    table th, table td {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    /* Perbaikan spesifik untuk tombol hapus IP agar tidak terlalu besar */
    .ip-tag-delete {
        font-size: 0.9rem;
    }
}
/* === STYLE UNTUK FORM PROMO BARU === */
.promo-form-container {
    display: flex;
    gap: 0.5rem; /* Jarak antara input dan tombol */
}

.promo-form-container input {
    flex-grow: 1; /* Input mengambil sisa ruang */
    padding: 0.8rem 1rem;
    margin: 0; /* Hapus margin default */
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
}

.promo-form-container button {
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    padding: 0.8rem 1.5rem;
    white-space: nowrap; /* Mencegah teks tombol turun baris */
}

/* Mengatur pesan hasil promo agar memiliki jarak atas */
#promo-result {
    margin-top: 1rem;
    min-height: 20px;
}

/* === SAFE UI/UX POLISH === */
.product-grid .ui-state {
    grid-column: 1 / -1;
}

.product-selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--muted-color);
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

.product-card-selectable.is-flash-sale {
    border-color: var(--warning-color);
}

.product-card-selectable .product-tag {
    margin-top: 0.4rem;
    color: var(--warning-color);
    font-size: 0.75rem;
    font-weight: bold;
}

.dashboard-section .card > h3:first-child,
.admin-section .card > h3:first-child {
    margin-bottom: 1rem;
}

.table-container {
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    margin-top: 0;
}

.table-empty-row td,
.table-loading-row td,
.table-error-row td {
    white-space: normal;
}

.table-empty-row .ui-state,
.table-loading-row .ui-state,
.table-error-row .ui-state {
    border: none;
    background: transparent;
    padding: 0.75rem;
}

.modal-content input,
.modal-content select,
.dashboard-input,
#order-form input,
#order-form select,
.promo-form-container input {
    min-height: 44px;
}

button,
.header-btn,
.edit-btn,
.topup-btn,
.order-button,
.btn-submit-deposit {
    min-height: 40px;
}

button:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

@media (min-width: 900px) {
    .order-page-wrapper {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
        align-items: start;
    }

    #game-info,
    .order-page-wrapper > .card:nth-of-type(2),
    .order-page-wrapper > .card:nth-of-type(3) {
        grid-column: 1;
    }

    .order-page-wrapper > .card:nth-of-type(4),
    .order-page-wrapper > .card:nth-of-type(5) {
        grid-column: 2;
    }

    .order-page-wrapper > .card:nth-of-type(5) {
        position: sticky;
        top: 1rem;
    }
}

@media (max-width: 900px) {
    .dashboard-container,
    .admin-page-container {
        gap: 1rem;
    }

    .sidebar,
    .admin-sidebar {
        min-width: 190px;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(94%, 100% - 1rem);
    }

    .card {
        padding: 1rem;
    }

    .dashboard-container,
    .admin-page-container {
        margin-top: 1rem;
    }

    #game-info {
        align-items: flex-start;
        gap: 1rem;
    }

    #game-info img {
        width: 72px;
        height: 72px;
    }

    .product-grid {
        gap: 0.75rem;
    }

    .product-card-selectable {
        min-height: 78px;
        padding: 0.65rem;
    }

    .promo-form-container,
    .confirmation-actions,
    .manual-balance-actions,
    .center-btn {
        flex-direction: column;
        align-items: stretch;
    }

    .confirmation-actions .order-button,
    .confirmation-actions .edit-btn {
        width: 100%;
    }

    .api-key-wrapper {
        align-items: stretch;
        flex-direction: column;
        gap: 0.75rem;
    }

    .api-key-actions {
        justify-content: flex-end;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem 1rem;
    }
}
/* === STYLE UNTUK DROPDOWN GAME DI PRICELIST === */
#game-selector-dropdown {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    
    /* Menambahkan panah dropdown kustom */
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23F3F4F6" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

#game-selector-dropdown:hover {
    border-color: var(--primary-color);
}


/* REMOVED: pricelist-container overflow-x:auto caused sidebar to scroll with table */

@media (max-width: 768px) {

  /* 1. PERBAIKAN: Membuat tabel di dashboard bisa di-scroll */
  #transactions-table, #mutasi-table {
    white-space: nowrap;
  }

  /* 2. PERBAIKAN: Memperlebar kotak deposit di dashboard */
 main.dashboard-content #deposit-tab .card {
  width: 100%;
  max-width: none;
}

}

.order-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Membuat dua kolom sama besar */
  gap: 1rem;
}

#order-form input, 
#server-input-container {
  grid-column: auto; /* Biarkan mengisi satu kolom */
}

#validation-result {
  grid-column: 1 / -1; /* Ambil semua kolom (dari kolom 1 sampai terakhir) */
}

.order-form-grid.single-input #target-game-id {
  grid-column: 1 / -1; /* Buat input User ID mengambil lebar penuh */
}

@media (max-width: 768px) {
  .order-form-grid {
    grid-template-columns: 1fr; /* Ubah menjadi satu kolom saja */
  }
  
  /* Di mobile, semua input otomatis akan mengambil lebar penuh, jadi tidak perlu aturan tambahan. */
}
/* PERBAIKAN: Scroll tabel di Dashboard Mobile */
@media (max-width: 768px) {

  /* 1. Pastikan wadah tabel bisa di-scroll */
  #transaksi-tab .table-container,
  #mutasi-saldo .table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color); /* Memberi petunjuk visual */
    border-radius: 5px;
  }

  /* 2. Pastikan isi tabel tidak terpotong ke bawah */
  #transactions-table,
  #mutasi-table {
    white-space: nowrap;
  }
}
/* PERBAIKAN FINAL: Scroll tabel di Dashboard Mobile */
@media (max-width: 768px) {

  /* Aturan ini akan berlaku untuk SEMUA table-container 
    di dalam konten dashboard (Transaksi, Mutasi, dan Hasil Cek Pesanan)
  */
  .dashboard-content .table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color); /* Memberi petunjuk visual */
    border-radius: 5px;
  }

  /* Memastikan semua tabel di dalam container tersebut tidak memecah baris,
    sehingga scrollbar bisa muncul.
  */
  .dashboard-content .table-container table {
    white-space: nowrap;
  }
}
@media (max-width: 768px) {
  
  /* Aturan ini menargetkan SEMUA div dengan class .table-container
     ketika lebar layar 768px ke bawah. */
  .table-container {
    overflow-x: auto; /* MEMBUAT SCROLLBAR HORIZONTAL MUNCUL */
    border: 1px solid var(--border-color);
    border-radius: 5px;
  }

  /* Aturan ini memastikan konten di dalam tabel tidak turun baris,
     sehingga tabel akan melebar dan memicu scrollbar di atas. */
  .table-container table {
    white-space: nowrap;
  }
}
/* === MODERN PRICE COMPARISON UI STYLING === */
.compare-card {
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.compare-header {
    margin-bottom: 2rem;
}

.compare-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.compare-header .form-description {
    text-align: left;
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 0;
}

.modern-table-wrapper {
    background-color: var(--bg-dark);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden; /* Contains the scrollable container's child elements */
}

/* Enhancing horizontal scroll behavior specifically for this table */
.modern-table-wrapper .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile iOS */
    border: none;
    border-radius: 0;
}

/* Custom scrollbar for modern table */
.modern-table-wrapper .table-container::-webkit-scrollbar {
    height: 8px;
}
.modern-table-wrapper .table-container::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 0 0 10px 10px;
}
.modern-table-wrapper .table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.modern-table-wrapper .table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
}

.modern-table th,
.modern-table td {
    padding: 1.2rem 1.5rem;
    border: none; /* Remove harsh borders */
    border-bottom: 1px solid var(--border-color);
}

.modern-table th {
    background-color: var(--bg-surface);
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.modern-table th:first-child { border-top-left-radius: 10px; }
.modern-table th:last-child { border-top-right-radius: 10px; }

.modern-table tbody tr {
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background-color: rgba(236, 72, 153, 0.05); /* Slight primary color tint on hover */
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column specific alignment */
.modern-table th:nth-child(n+4),
.modern-table td:nth-child(n+4) {
    text-align: right;
    font-family: 'Courier New', Courier, monospace; /* Use tabular numbers implicitly */
    font-variant-numeric: tabular-nums; /* Ensure numbers line up perfectly */
}

/* Better responsive handling */
@media (max-width: 768px) {
    .compare-card {
        padding: 1rem;
    }

    .compare-header h3 {
        font-size: 1.25rem;
    }

    .modern-table th,
    .modern-table td {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* Consolidated mobile fix for content sidebar (Compare Prices & Validate ID) */
@media (max-width: 768px) {
    .pricelist-container {
        flex-direction: column;
    }

    .pricelist-container .game-selector {
        /* Reset drawer-related properties from .sidebar */
        position: static;
        left: 0;
        height: auto;
        min-height: auto;
        max-height: none;
        width: 100%;
        max-width: 100%;
        z-index: auto;
        transition: none;
        transform: none;

        /* Styling as a clean card section */
        margin-bottom: 1.5rem;
        padding: 1.5rem;
        background-color: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        box-sizing: border-box;
    }

    /* Ensure search input inside the card is well-spaced */
    .pricelist-container .game-selector .pricelist-search-wrapper {
        padding: 0;
        margin-bottom: 1rem;
    }
}
