/* ===== Hotspot RT-RW Net — gaya dasar ===== */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1f2933; background: #f0f2f5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2ff; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

/* ---- Portal & login card ---- */
.portal-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.login-card { background: #fff; width: 360px; max-width: 92%; padding: 30px; border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.brand { margin: 0 0 4px; font-size: 24px; color: #1e3a8a; text-align: center; }
.subtitle { margin: 0 0 20px; text-align: center; color: #64748b; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .grid-form input, .grid-form select, .filter-bar input, .filter-bar select {
    width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
.hint { color: #94a3b8; font-size: 11px; }

/* Toggle show/hide password */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 78px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: #eef2ff; color: #2563eb; border: 0; border-radius: 6px;
    padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.pw-toggle:hover { background: #e0e7ff; }
.btn-primary { width: 100%; padding: 12px; background: #2563eb; color: #fff; border: 0;
    border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.device-info { display: flex; gap: 12px; justify-content: center; margin-top: 16px;
    font-size: 11px; color: #94a3b8; }
.footer-note { text-align: center; font-size: 12px; color: #94a3b8; margin-top: 18px; }

/* ---- Alerts ---- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #dcfce7; color: #15803d; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* ---- Admin layout ---- */
.admin-bg { background: #f0f2f5; }
.topbar { display: flex; align-items: center; gap: 20px; background: #1e293b; color: #fff;
    padding: 12px 22px; flex-wrap: wrap; }
.topbar-brand { font-weight: 700; }
.topbar-nav { display: flex; gap: 16px; flex: 1; }
.topbar-nav a { color: #cbd5e1; font-size: 14px; }
.topbar-nav a:hover { color: #fff; text-decoration: none; }
.nav-badge { display: inline-block; min-width: 16px; padding: 1px 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 1.4; }
.topbar-user { font-size: 13px; color: #cbd5e1; display: flex; align-items: center; gap: 12px; }
.btn-logout { background: #ef4444; color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
.btn-logout:hover { text-decoration: none; background: #dc2626; }
.container { max-width: 1100px; margin: 24px auto; padding: 0 18px; }
.page-title { font-size: 22px; margin: 0 0 18px; }
.appfoot { text-align: center; color: #94a3b8; font-size: 12px; padding: 24px; }

/* ---- Cards ---- */
.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: #fff; border-radius: 12px; padding: 18px 22px; flex: 1; min-width: 180px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 6px; }
.card-num { font-size: 26px; font-weight: 700; color: #1e293b; }
.card-label { font-size: 13px; color: #64748b; }
.card-money .card-num { color: #15803d; }

/* ---- Forms ---- */
.form-box { background: #fff; border-radius: 12px; padding: 8px 18px; margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.form-box summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 10px 0 16px; }
.grid-form label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.grid-form .btn-primary { grid-column: 1 / -1; width: auto; justify-self: start; padding: 10px 24px; }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { width: auto; }

/* ---- Buttons kecil ---- */
.btn-secondary, .btn-secondary-sm { background: #e2e8f0; color: #1e293b; border: 0; border-radius: 7px;
    padding: 9px 16px; cursor: pointer; font-size: 13px; }
.btn-secondary-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger-sm { background: #fee2e2; color: #b91c1c; border: 0; border-radius: 7px;
    padding: 5px 10px; cursor: pointer; font-size: 12px; }

/* ---- Tabel ---- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px;
    overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; font-size: 13px;
    border-bottom: 1px solid #eef2f7; }
.data-table th { background: #f8fafc; color: #475569; font-weight: 600; }
.data-table .empty { text-align: center; color: #94a3b8; padding: 24px; }
.data-table .actions { display: flex; gap: 6px; }
.voucher-code { font-size: 15px; letter-spacing: 1px; }
.muted { color: #94a3b8; font-size: 13px; }

/* ---- Badge status ---- */
.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.badge-unused, .badge-active { background: #dcfce7; color: #15803d; }
.badge-expired { background: #fef3c7; color: #b45309; }
.badge-disabled, .badge-suspended { background: #fee2e2; color: #b91c1c; }

@media (max-width: 600px) { .grid-form { grid-template-columns: 1fr; } }

/* ---- Tombol WhatsApp mengambang ---- */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 9999;
    display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wa-float .wa-label { background: #fff; color: #1e293b; font-weight: 600; font-size: 13px;
    padding: 9px 14px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.18); white-space: nowrap; }
.wa-float .wa-icon { width: 56px; height: 56px; border-radius: 50%; background: #25d366;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(37,211,102,.5); transition: transform .15s; }
.wa-float:hover .wa-icon { transform: scale(1.08); }
@media (max-width: 480px) { .wa-float .wa-label { display: none; } }

/* ===== Responsif / mobile-optimized ===== */
.nav-toggle { display: none; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22);
    color: #fff; font-size: 20px; cursor: pointer; padding: 6px 12px; border-radius: 9px; line-height: 1; }
.nav-toggle:hover { background: rgba(255,255,255,.18); }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.table-scroll .data-table { box-shadow: none; }
/* Hover & halaman aktif pada menu */
.topbar-nav a { border-radius: 7px; transition: background .15s, color .15s; }
.topbar-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar-nav a.active { color: #fff; font-weight: 700; background: rgba(59,130,246,.35); }

@media (max-width: 820px) {
    /* Topbar: brand + hamburger sebaris, menu turun ke bawah saat dibuka */
    .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
    .topbar-brand { flex: 1; font-size: 15px; }
    .nav-toggle { display: inline-flex; order: 2; }
    .topbar-user { order: 3; font-size: 12px; }
    .topbar-nav { order: 4; flex-basis: 100%; display: none; flex-direction: column;
        gap: 0; margin-top: 6px; }
    .topbar-nav.open { display: flex; }
    .topbar-nav a { padding: 11px 6px; border-top: 1px solid rgba(255,255,255,.10); }

    .container { margin: 16px auto; padding: 0 12px; }
    .page-title { font-size: 19px; }
    .cards { gap: 10px; }
    .card { min-width: calc(50% - 8px); padding: 14px 16px; }
    .card-num { font-size: 22px; }

    /* Tabel data: scroll horizontal (dibungkus .table-scroll oleh JS layout) */
    .data-table { font-size: 12.5px; min-width: 520px; }
    .data-table th, .data-table td { padding: 8px 10px; }

    .grid-form { grid-template-columns: 1fr; }
    .filter-bar { gap: 8px; }
    .login-card { padding: 24px 20px; }
}

@media (max-width: 460px) {
    .card { min-width: 100%; }
    .topbar-brand { font-size: 14px; }
}
