/* ==========================================================================
   VISA Member Portal Theme - M-Banking Style
   ========================================================================== */

/* 1. SETUP & CONFIGURATION
   ========================================================================== */
@import url('../../../fonts.googleapis.com/css2fb67.css?family=Inter:wght@400;500;600;700&amp;display=swap');
body { font-family: 'Inter', sans-serif; background-color: #F4F6F9; color: #111827; margin: 0; }
.dashboard-header { background-color: #FFFFFF; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #E5E7EB; }
.dashboard-header .visa-logo { max-width: 70px; height: auto; }
.dashboard-header .logout-link { color: #14205A; text-decoration: none; font-weight: 600; }
.logo-link { display: inline-block; line-height: 0; }
.dashboard-container { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
.welcome-message { font-size: 1.5rem; font-weight: 600; margin-bottom: 1.5rem; }
.card { background-color: #FFFFFF; padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); }
.card h3 { font-size: 1.25rem; margin-top: 0; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #E5E7EB; }
.quota-card { background: linear-gradient(45deg, #14205A, #1A2871); color: #FFFFFF; }
.quota-card h3 { color: #FFFFFF; border-bottom-color: rgba(255, 255, 255, 0.2); }
.quota-display { text-align: center; padding: 1rem 0; }
.quota-display .value { font-size: 3rem; font-weight: 700; line-height: 1.2; }
.quota-display .total { font-size: 1rem; opacity: 0.8; }
.card form label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 0.5rem; }
.card form input, .card form button, .btn-visa-primary, .action-link { box-sizing: border-box; width: 100%; border-radius: 8px; font-size: 1rem; }
.card form input { padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid #E5E7EB; }
.card form button, .btn-visa-primary, .action-link { display: block; text-align: center; padding: 0.75rem 1.5rem; border: none; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
.btn-visa-primary, .action-link { background: #14205A; color: #FFFFFF; text-decoration: none; }
.btn-visa-primary:disabled { background-color: #A0AEC0; cursor: not-allowed; }
.card form button { background: #F7B600; color: #14205A; }
.message { padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; font-weight: 500; }
.message-success { color: #0f5132; background-color: #d1e7dd; }
.message-error { color: #842029; background-color: #f8d7da; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #F4F6F9; /* Light grey background */
    color: #111827;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   2. LOGIN PAGE (`member_login.php`)
   ========================================================================== */

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: #FFFFFF;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-card .visa-logo {
    max-width: 90px;
    height: auto;
    margin-bottom: 1.5rem;
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-card p {
    color: #6B7280;
    margin-bottom: 2rem;
}

.login-card form label {
    display: block;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.login-card form input {
    box-sizing: border-box;
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card form input:focus {
    box-sizing: border-box;
    border-color: #14205A;
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 32, 90, 0.15);
}

.login-card form button {
    width: 100%;
    background: #14205A;
    color: white;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.login-card form button:hover {
    background-color: #101947;
}

/* Header lebih menarik */
.dashboard-header {
    background: linear-gradient(90deg, #14205A, #1A2871);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-header .visa-logo {
    max-width: 70px;
    height: auto;
}

.dashboard-header .logout-link {
    background: #F7B600;
    color: #14205A;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.dashboard-header .logout-link:hover {
    background-color: #e0a800;
    color: #fff;
}

/* Quota Card dengan progress bar */
.quota-card {
    background: linear-gradient(135deg, #14205A, #1A2871);
    color: #FFFFFF;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.quota-card h3 {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.2);
}
.quota-display .value {
    font-size: 3rem;
    font-weight: 700;
}
.progress-bar {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    height: 10px;
    margin-top: 1rem;
    overflow: hidden;
}
.progress-bar span {
    display: block;
    height: 100%;
    background: #F7B600;
    width: 60%; /* contoh: 60% kuota terpakai */
}

/* Table striping */
.history-table tbody tr:nth-child(even) {
    background-color: #F9FAFB;
}

/* Pesan dengan ikon */
.message-success::before {
    content: "✔ ";
    font-weight: bold;
}
.message-error::before {
    content: "✖ ";
    font-weight: bold;
}

/* ==========================================================================
   4. TOKEN & STATUS STYLES
   ========================================================================== */

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-active { 
    color: #0f5132;
    background-color: #d1e7dd;
}
.status-inactive { 
    color: #842029;
    background-color: #f8d7da;
}

.action-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background-color: #14205A;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.action-link:hover {
    background-color: #101947;
    transform: scale(1.05);
}

/* ==========================================================================
   REVISI: Fitur Tambahan Halaman Pembayaran
   ========================================================================== */

/* 1. QR Code Modal (Galeri) */
.qr-code-thumb {
    max-width: 150px; /* Batasi ukuran thumbnail */
    height: 150px;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    transition: transform 0.2s;
}
.qr-code-thumb:hover {
    transform: scale(1.05);
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 80%;
    max-height: 80%;
    animation: zoomIn 0.3s;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.modal-close:hover {
    color: #bbb;
}

@keyframes zoomIn {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

/* 2. Form Input dengan Nuansa VISA */
.warning-text {
    color: #dc3545;
    font-weight: bold;
    margin-top: 1rem;
}

.input-visa {
    box-sizing: border-box;
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-visa:focus {
    box-sizing: border-box;
    border-color: #14205A;
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 32, 90, 0.15);
}

.file-upload-visa {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    padding: 2rem 1rem;
    margin-bottom: 1.5rem;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.file-upload-visa:hover {
    border-color: #14205A;
    background-color: #f8f9fa;
}
.file-upload-visa input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}
.file-upload-visa span {
    font-weight: 500;
    color: #6B7280;
}

/* 3. Tombol Kembali ke Dashboard */
.back-link-container {
    text-align: center;
    margin-top: 1.5rem;
}
.back-link {
    color: #6B7280;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.back-link:hover {
    color: #14205A;
}

/* Logo yang Bisa Diklik */
.logo-link {
    display: inline-block;
    line-height: 0; /* Menghilangkan spasi ekstra di bawah gambar */
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .login-card, .dashboard-container {
        padding: 1.5rem;
    }
    .package-options, .payment-details {
        flex-direction: column; /* Buat kartu paket & detail pembayaran menjadi vertikal */
    }
    .welcome-message {
        font-size: 1.25rem;
    }
    .quota-display .value {
        font-size: 2.5rem;
    }
}

/* ==========================================================================
   REVISI: Desain Responsif yang Lebih Baik
   ========================================================================== */

@media (max-width: 768px) {
    /* --- Umum untuk Semua Halaman Member --- */
    .dashboard-container {
        padding: 1rem; /* Kurangi padding di layar kecil */
    }

    .welcome-message {
        font-size: 1.25rem;
        text-align: center; /* Pusatkan teks sambutan */
    }

    .card {
        padding: 1.5rem; /* Kurangi padding di dalam kartu */
    }

    /* --- Khusus Halaman Login --- */
    .login-card {
        padding: 2rem 1.5rem;
    }

    /* --- Khusus Halaman Dasbor --- */
    .quota-display .value {
        font-size: 2.5rem; /* Kecilkan sedikit ukuran angka kuota */
    }

    /* --- Khusus Halaman Pembayaran (Payment Page) --- */
    .payment-details {
        /* Ubah tata letak dari berdampingan menjadi vertikal */
        flex-direction: column;
        align-items: center; /* Pusatkan item di tengah */
        gap: 2rem; /* Tambah jarak antar elemen */
    }

    .address-info {
        text-align: center; /* Pusatkan teks alamat */
    }

    .address-info .address {
        font-size: 0.9rem; /* Kecilkan font alamat agar muat */
        padding: 0.75rem;
    }

    .qr-code-thumb {
        width: 180px; /* Sedikit perbesar QR code di mobile */
        height: 180px;
    }

    .file-upload-visa {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    /* Penyesuaian ekstra untuk layar yang sangat kecil */
    .login-card {
        padding: 2rem 1rem;
    }
    .package-options {
        flex-direction: column;
    }
    .dashboard-header {
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: 1rem;
    }
}

/* ==========================================================================
   REVISI: Halaman Pembayaran yang Lebih Kompleks & Realistis
   ========================================================================== */

/* Stepper / Progress Bar */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #A0AEC0;
    transition: color 0.3s;
}
.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s;
}
.step-label {
    font-size: 0.875rem;
    font-weight: 600;
}
.step-connector {
    flex-grow: 1;
    height: 2px;
    background-color: #E2E8F0;
    margin: 0 1rem;
    transform: translateY(-1rem);
}
.step.step-active {
    color: #14205A;
}
.step.step-active .step-icon {
    background-color: #14205A;
    color: #FFFFFF;
}

/* Payment Step Cards */
.payment-step {
    animation: fadeIn 0.5s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step 1: Confirmation Details */
.confirmation-details {
    margin: 2rem 0;
}
.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #E5E7EB;
}
.detail-item:last-child {
    border-bottom: none;
}
.detail-item span {
    color: #6B7280;
}
.detail-item strong {
    font-weight: 600;
}
.total-amount strong {
    font-size: 1.5rem;
    color: #14205A;
}

/* Step 2: Payment Grid */
.payment-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}
.wallet-address-box {
    display: flex;
    align-items: center;
    background-color: #F4F6F9;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}
.wallet-address-box span {
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
    flex-grow: 1;
    padding: 0 0.5rem;
}
.wallet-address-box button {
    background-color: #E2E8F0;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.timer-box {
    text-align: center;
    margin-top: 1.5rem;
}
.timer-box #countdown-timer {
    font-size: 2rem;
    font-weight: 700;
    color: #D97706;
    display: block;
}
.timer-box span {
    font-size: 0.875rem;
    color: #6B7280;
}
.payment-qr {
    text-align: center;
    border-left: 1px solid #E5E7EB;
    padding-left: 2rem;
}
.payment-qr img {
    max-width: 180px;
    border-radius: 8px;
}

/* Tombol Utama */
.btn-visa-primary {
    display: block;
    width: 100%;
    background: #14205A;
    color: white;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-visa-primary:hover {
    background-color: #101947;
}

/* Penyesuaian Responsif untuk Halaman Pembayaran */
@media (max-width: 768px) {
    .payment-grid {
        grid-template-columns: 1fr; /* Ubah menjadi satu kolom */
    }
    .payment-qr {
        border-left: none;
        padding-left: 0;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid #E5E7EB;
    }
    .stepper {
        flex-direction: column;
        align-items: flex-start;
    }
    .step-connector {
        width: 2px;
        height: 30px;
        transform: translate(17px, 0);
    }
}

/* ==========================================================================
   VISA Member Portal Theme - M-Banking Style (Revisi)
   ========================================================================== */



/* --- TATA LETAK DASBOR BARU --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Kolom kiri lebih besar */
    gap: 1.5rem;
}

/* --- FITUR BIN CHECKER BARU --- */
.bin-checker-form {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}
.bin-checker-form input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}
.bin-checker-form button {
    background-color: #14205A;
    color: #FFFFFF;
    border: none;
    padding: 0 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.bin-result-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #E5E7EB;
}
.bin-result-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}
.bin-result-item span {
    color: #6B7280;
}
.bin-result-item strong {
    color: #111827;
}
.bin-loading, .bin-error {
    text-align: center;
    color: #6B7280;
    font-style: italic;
}
.bin-error {
    color: #B91C1C;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Tumpuk menjadi satu kolom */
    }
}

/* ===== Dashboard UI Enhancements (append) ===== */

/* Palette & base */
:root{
  --visa-primary:#1A2871;     /* Navy Visa */
  --visa-primary-2:#1A73E8;   /* Accent blue */
  --text:#111827;             /* Gray-900 */
  --muted:#6B7280;            /* Gray-500 */
  --line:#E5E7EB;             /* Gray-200 */
  --bg:#FFFFFF;               /* Light */
  --card:#FFFFFF;
  --ok:#10B981;               /* Emerald-500 */
  --warn:#F59E0B;             /* Amber-500 */
  --err:#EF4444;              /* Red-500 */
  --radius:16px;
  --radius-sm:10px;
  --shadow:0 10px 20px rgba(17,24,39,.06);
}

body{
  background:#F9FAFB;
  color:var(--text);
  font:14px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Inter,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}

a { color: var(--visa-primary); text-decoration: none; }
a:hover { opacity: .9; }

/* Grid helpers */
.grid{ display:grid; gap:18px; }
.grid.cols-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid.cols-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }

@media (max-width:1200px){
  .grid.cols-4{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px){
  .grid.cols-4, .grid.cols-2{ grid-template-columns:1fr; }
}

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px 20px;
}
.card > h3{
  margin:0 0 8px 0;
  font-size:16px;
  color:var(--visa-primary);
  letter-spacing:.2px;
}

/* Quota / KPI */
.quota-card .quota-display{
  display:flex; flex-direction:column; gap:6px;
}
.quota-card .quota-display .value{
  font-size:28px; font-weight:800; color:#0B1220;
}
.quota-card .quota-display .total{
  font-size:12px; color:var(--muted);
}

/* Buttons */
.btn-visa-primary{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 14px; border-radius:12px; font-weight:700;
  background:linear-gradient(135deg, var(--visa-primary) 0%, var(--visa-primary-2) 100%);
  color:#fff; border:1px solid transparent; box-shadow:var(--shadow);
  cursor:pointer; transition:transform .06s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn-visa-primary[disabled]{ opacity:.6; cursor:not-allowed; }
.btn-visa-primary:hover{ transform:translateY(-1px); }

/* Forms */
input[type="number"], input[type="text"], input[type="password"], input[type="email"]{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
  background:#FFF; color:var(--text);
}
input:focus{
  border-color:#C7D2FE;
  box-shadow:0 0 0 3px rgba(199,210,254,.6);
}
label{ display:block; font-weight:600; margin:0 0 8px 0; color:#374151; }
form .btn-visa-primary{ margin-top:10px; }

/* Tables */
.table-wrap{ width:100%; overflow:auto; }
.table{
  width:100%;
  border-collapse:separate; border-spacing:0;
  font-size:14px;
}
.table thead th{
  text-align:left; padding:12px 14px; font-weight:700;
  color:#374151; background:#F3F4F6; border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:1;
}
.table tbody td{
  padding:12px 14px; border-bottom:1px solid var(--line);
}
.table tbody tr:hover{ background:#F9FAFB; }
.truncate{ max-width:320px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Badges */
.badge{
  display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:800;
  border:1px solid transparent;
}
.badge.ok{ background:rgba(16,185,129,.12); color:var(--ok); border-color:rgba(16,185,129,.35); }
.badge.warn{ background:rgba(245,158,11,.12); color:var(--warn); border-color:rgba(245,158,11,.35); }
.badge.danger{ background:rgba(239,68,68,.12); color:var(--err); border-color:rgba(239,68,68,.35); }

/* Utilities */
.welcome-message{ margin:0 0 12px 0; color:#0B1220; }
.table small, .card small{ color:var(--muted); }

/* ===== Dashboard Cohesive Fixes (append) ===== */

/* Layout guard: cegah horizontal scroll */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }

/* Container widths */
.app-shell { width: 100%; }
.content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 20px; }
@media (max-width: 900px){ .content { padding: 16px; } }

/* Topbar: hamburger hanya mobile, logo VISA hanya desktop */
@media (min-width: 901px){
  .logo-visa { display: block; height: 28px; width: auto; }
  .hamburger { display: none; }
}
@media (max-width: 900px){
  .logo-visa { display: none; }
}

/* Sidebar behavior & smooth scrolling (iOS friendly) */
.sidebar { overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 900px){
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
}

/* Grid utilities (responsif) */
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 1200px){ .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px){ .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; } }

/* Tables: cegah overflow panjang, dukung geser halus */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.table code { word-break: break-all; white-space: normal; }
.truncate { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Badges lebih tebal */
.badge { font-weight: 800; }

/* Check BIN key-value layout */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.kv .key { color: #6B7280; }
.kv .val { font-weight: 600; }

/* Media safety: cegah elemen melebar keluar */
img, svg, canvas, video { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; }

/* ===== Test Card Generator (SCOPED) — REPLACE OLD BLOCK ===== */
.gen-page {
  --gen-gap: 14px;
  --gen-radius: 16px;
  --gen-border: #E5E7EB;
  --gen-shadow: 0 10px 20px rgba(17,24,39,.06);
  --gen-muted: #6B7280;
  --gen-text: #111827;
  --gen-primary: #1A2871;
}

/* Tabs */
.gen-page .gen-tabs {
  display: flex; gap: 12px;
  background: #fff; border: 1px solid var(--gen-border);
  border-radius: 14px; padding: 6px; max-width: 520px;
}
.gen-page .gen-tab {
  flex: 1; text-align: center; padding: 10px 12px;
  border-radius: 10px; font-weight: 700; color: var(--gen-text);
  border: 1px solid transparent; background: transparent;
  cursor: not-allowed; opacity: .5;
}
.gen-page .gen-tab.active {
  background: #EEF2FF; border-color: #C7D2FE; color: var(--gen-primary);
  cursor: default; opacity: 1;
}

/* Panel / form */
.gen-page .gen-panel {
  background: #fff; border: 1px solid var(--gen-border);
  border-radius: var(--gen-radius); box-shadow: var(--gen-shadow);
  padding: 16px 20px; margin-top: 16px;
}
.gen-page .gen-grid {
  display: grid; gap: var(--gen-gap);
  grid-template-columns: repeat(12, minmax(0,1fr));
}
.gen-page .gen-field { grid-column: span 6; }
.gen-page .gen-field.gen-switch {
  grid-column: span 6; display: inline-flex; align-items: center; gap: 8px;
}
.gen-page .gen-actions {
  grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}

/* Inputs */
.gen-page .gen-label { display:block; font-weight:700; color:#374151; margin-bottom:6px; }
.gen-page .gen-input,
.gen-page .gen-panel select,
.gen-page .gen-panel input[type="text"],
.gen-page .gen-panel input[type="number"]{
  width:100%; padding:10px 12px; border:1px solid var(--gen-border);
  border-radius:10px; outline:none; background:#fff; color:var(--gen-text);
}
.gen-page .gen-input:focus,
.gen-page .gen-panel select:focus,
.gen-page .gen-panel input[type="text"]:focus,
.gen-page .gen-panel input[type="number"]:focus{
  border-color:#C7D2FE; box-shadow:0 0 0 3px rgba(199,210,254,.6);
}
.gen-page .muted{ color:var(--gen-muted); font-size:12px; }

/* Notice */
.gen-page .notice{
  margin:16px 0; padding:12px 14px; border-radius:12px;
  background:#EEF6FF; border:1px solid #BFDBFE; color:#1E40AF; font-weight:600;
}

/* Cards grid — 2 desktop, 1 mobile */
.gen-page .cards{
  display:grid; gap:18px; align-items:stretch; /* memastikan tinggi konsisten */
}
.gen-page .cards.two-col{ grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (max-width: 900px){
  .gen-page .gen-field, .gen-page .gen-field.gen-switch { grid-column: 1 / -1; }
  .gen-page .gen-actions { grid-column: 1 / -1; }
  .gen-page .cards.two-col { grid-template-columns: 1fr; }
}

/* Credit card */
.gen-page .ccard{
  display:flex; flex-direction:column; justify-content:flex-start;
  background: linear-gradient(135deg,#3b4354,#283142); /* ditimpa JS sesuai brand */
  color:#f5f7fb; border-radius:22px; padding:20px;
  box-shadow:0 14px 28px rgba(0,0,0,.12); min-height:220px;
  position:relative; overflow:hidden;
}
.gen-page .ccard .brand-dot{
  position:absolute; right:24px; top:24px; width:56px; height:56px;
  border-radius:50%; opacity:.95;
}
.gen-page .ccard .brand-dot::after{
  content:""; position:absolute; right:-18px; top:8px;
  width:56px; height:56px; border-radius:50%; opacity:.9;
}
.gen-page .ccard h4{
  margin:0 0 12px 0; font-size:13px; color:#e6e9f2; letter-spacing:.06em;
}
.gen-page .ccard .name{ font-weight:800; font-size:18px; letter-spacing:.6px; margin-bottom:12px; }
.gen-page .ccard .number{
  font-weight:900; font-size:20px; letter-spacing:1.3px;
  margin:6px 0 14px 0; cursor:pointer; word-break:break-word;
}
.gen-page .ccard .meta{
  margin-top:auto; /* dorong ke bawah agar tinggi tiap kartu setara */
  display:grid; grid-template-columns:1fr auto; gap:10px;
}
.gen-page .ccard small{ opacity:.85; }
.gen-page .ccard .copy-hint{
  position:absolute; left:20px; bottom:16px; font-size:12px; color:#dbe2f0; opacity:.85;
}

/* Toast (scoped) */
.gen-page ~ .toast{
  position:fixed; bottom:18px; left:50%; transform:translateX(-50%);
  background:#111827; color:#fff; padding:10px 14px; border-radius:12px;
  box-shadow:0 10px 20px rgba(0,0,0,.18); opacity:0; pointer-events:none; transition:opacity .2s ease;
}
.gen-page ~ .toast.show{ opacity:1; }

/* ===== Base Layout & Components (shared) ===== */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }

.app-shell {
  display: grid; grid-template-columns: 280px 1fr;
  min-height: 100vh; overflow-x: hidden;
}

/* Topbar */
.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid #E5E7EB;
  position: sticky; top: 0; z-index: 40; width: 100%;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-visa { height: 28px; display: none; }
.hamburger {
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid #E5E7EB; background: transparent; cursor: pointer;
  display: inline-grid; place-items: center;
}
.hamburger span { display: block; width: 20px; height: 2px; background: #111827; margin: 3px 0; }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-weight: 700; color: #14205A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { color: #6B7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px; border-radius: 10px; border: 1px solid #E5E7EB;
  color: #14205A; text-decoration: none; margin-left: 8px; font-weight: 600; white-space: nowrap;
}
.topbar-actions a.primary { border-color: #1A2871; background: #1A2871; color: #fff; }

/* Sidebar */

.sidebar .inner { padding: 18px; }
.sidebar .title { font-size: 11px; text-transform: uppercase; color: #6B7280; margin-bottom: 8px; letter-spacing: .08em; }
.sidebar .nav { list-style: none; padding: 0; margin: 0; }
.sidebar .nav li { margin: 2px 0; }
.sidebar .nav li a {
  display: block; padding: 10px 12px; color: #111827; text-decoration: none;
  border-radius: 10px; font-weight: 600;
}
.sidebar .nav li a:hover { background: #F3F4F6; }
.sidebar .nav li a.active { background: #EEF2FF; border: 1px solid #C7D2FE; }

/* Content */
.content { grid-row: 2; grid-column: 2; padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* Cards / components umum */
.card {
  background: #fff; border: 1px solid #E5E7EB; border-radius: 16px;
  box-shadow: 0 10px 20px rgba(17,24,39,.06); padding: 16px 20px;
}
.btn-visa-primary{
  display:inline-flex; align-items:center; justify-content:center; padding:10px 14px; border-radius:12px; font-weight:700;
  background:linear-gradient(135deg, #1A2871 0%, #1A73E8 100%); color:#fff; border:1px solid transparent;
  box-shadow:0 10px 20px rgba(17,24,39,.06); cursor:pointer; transition:transform .06s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn-visa-primary[disabled]{ opacity:.6; cursor:not-allowed; }
.btn-visa-primary:hover{ transform:translateY(-1px); }

/* Tables */
.table-wrap { width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table thead th { text-align: left; padding: 12px 14px; font-weight: 700; color: #374151; background: #F3F4F6; border-bottom: 1px solid #E5E7EB; position: sticky; top: 0; z-index: 1; }
.table tbody td { padding: 12px 14px; border-bottom: 1px solid #E5E7EB; }
.table tbody tr:hover { background: #F9FAFB; }

.badge{ display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:800; border:1px solid transparent; }
.badge.ok{ background:rgba(16,185,129,.12); color:#10B981; border-color:rgba(16,185,129,.35) }
.badge.warn{ background:rgba(245,158,11,.12); color:#F59E0B; border-color:rgba(245,158,11,.35) }
.badge.danger{ background:rgba(239,68,68,.12); color:#EF4444; border-color:rgba(239,68,68,.35) }

/* Responsive: desktop vs mobile */
@media (min-width: 901px){
  .logo-visa{ display:block; }
  .hamburger{ display:none; }
}
@media (max-width: 900px){
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed; top: 62px; left: 0; right: 0; height: calc(100vh - 62px);
    transform: translateX(-100%); transition: transform .2s ease; z-index: 60;
  }
  .sidebar.open{ transform: translateX(0); }
  .content{ padding: 16px; }
  .topbar-actions a:not(.primary){ display:none; }
}

/* === Brand logo (resmi) di kanan atas kartu === */
.gen-page .brand-logo{
  position:absolute; right:18px; top:14px;
  width:64px; height:36px;
  display:flex; align-items:center; justify-content:center;
  opacity:.98;
}
.gen-page .brand-logo img{
  width:100%; height:auto; display:block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
}

/* === Fancy Switch (scoped) === */
.gen-page .switch-row{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border:1px dashed #E5E7EB; border-radius:12px; background:#FAFAFB;
}
.gen-page .switch-text{ font-weight:700; color:#111827; }

/* toggle */
.gen-page .switch{ position:relative; display:inline-block; width:48px; height:28px; }
.gen-page .switch input{ position:absolute; opacity:0; width:0; height:0; }
.gen-page .slider{
  position:absolute; inset:0; background:#E5E7EB; border-radius:999px;
  transition:.2s ease; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.gen-page .slider::before{
  content:""; position:absolute; height:22px; width:22px; left:3px; top:3px;
  background:#fff; border-radius:50%; transition:.2s ease; box-shadow:0 1px 3px rgba(0,0,0,.18);
}
.gen-page .switch input:checked + .slider{ background:#1A73E8; }
.gen-page .switch input:checked + .slider::before{ transform: translateX(20px); }

/* Disabled look for fields ketika randomized ON */
.gen-page .is-disabled{
  opacity:.65; pointer-events:none; filter: saturate(.6);
}

/* === Compact switch size (override) === */
.gen-page { --sw-w: 36px; --sw-h: 20px; --sw-pad: 2px; }

.gen-page .switch-row{
  padding: 4px 6px;           /* lebih ringkas */
  gap: 8px;
}

.gen-page .switch { 
  width: var(--sw-w); 
  height: var(--sw-h); 
  vertical-align: middle;
}
.gen-page .switch input{ cursor: pointer; }
.gen-page .slider{
  border-radius: 999px;
}
.gen-page .slider::before{
  width: calc(var(--sw-h) - var(--sw-pad)*2);
  height: calc(var(--sw-h) - var(--sw-pad)*2);
  left: var(--sw-pad);
  top: var(--sw-pad);
}
.gen-page .switch input:checked + .slider::before{
  /* pindah sejauh (lebar - tinggi) agar sejajar presisi */
  transform: translateX(calc(var(--sw-w) - var(--sw-h)));
}

/* Fokus/aksesibilitas lebih halus */
.gen-page .switch input:focus + .slider{
  box-shadow: 0 0 0 3px rgba(199,210,254,.5);
}

.gen-page .switch-text{
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}


/*
=========================================
CSS untuk Notifikasi Update Aplikasi
=========================================
*/
.alert-update {
    background: #ffffff;
    border: 1px solid #E5E7EB;      /* Meniru style .dash-card */
    border-radius: 16px;            /* Meniru style .dash-card */
    box-shadow: 0 10px 20px rgba(17, 24, 39, .06); /* Meniru style .dash-card */
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    border-left: 5px solid #3B82F6; /* Aksen biru dari .alert-info */
}

.alert-update-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.alert-update-icon {
    font-size: 24px;
    line-height: 1.2;
    margin-top: 2px;
}

.alert-update-title {
    font-size: 16px;
    font-weight: 700;
    color: #0B1220; /* Teks gelap kuat */
    margin: 0 0 4px 0;
}

.alert-update-text {
    font-size: 14px;
    color: #5E6C84; /* Teks subjudul */
    margin: 0 0 16px 0; /* Jarak ke tombol */
    line-height: 1.5;
    max-width: 90%;
}

.alert-update-btn {
    background-color: #1A73E8; /* Biru primer */
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.alert-update-btn:hover {
    background-color: #0A5BC4; /* Biru lebih gelap saat hover */
}

/* Style untuk tombol jika di-disable */
.alert-update-btn-disabled {
    background-color: #E5E7EB; /* Abu-abu */
    color: #9CA3AF;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: not-allowed;
}


.alert-update-dismiss {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    color: #9CA3AF; /* Abu-abu */
    text-decoration: none;
    transition: color 0.2s;
}

.alert-update-dismiss:hover {
    color: #111827; /* Abu-abu gelap */
}

