/* =========================================================================
   STYLE POPUP MODAL, GATE AKSES (PIN 24 JAM / TRIAL / WA) & PANEL ADMIN
   ========================================================================= */
.mk-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(4, 5, 8, 0.78);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mk-modal-backdrop.open {
    display: flex;
    animation: mkModalFadeIn 0.16s ease-out;
}
.mk-modal-box {
    width: 100%;
    max-width: 390px;
    background: linear-gradient(180deg, #232831 0%, #14171d 100%);
    border: 1.5px solid #3c4352;
    border-top-color: #606a7d;
    border-radius: 10px;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.92), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    overflow: hidden;
}
.mk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #101216;
    border-bottom: 1px solid #2b303c;
}
.mk-modal-title {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fbbf24;
}
.mk-modal-x {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.mk-modal-x:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
.mk-modal-body {
    padding: 16px 14px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #e5e7eb;
    text-align: center;
    word-break: break-word;
}
.mk-modal-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px 13px;
    background: rgba(12, 14, 18, 0.65);
    border-top: 1px solid #252a34;
}
.mk-modal-footer.dual {
    justify-content: flex-end;
    margin: 12px -14px -14px;
}
.mk-modal-ok {
    min-width: 96px;
    padding: 7px 18px;
    border-radius: 6px;
    border: 1px solid #1e3a8a;
    border-top-color: #93c5fd;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.45);
}
.mk-modal-ok:hover {
    filter: brightness(1.08);
}
.mk-modal-cancel {
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid #3f4654;
    background: #1f242c;
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}
.mk-modal-cancel:hover {
    background: #2b313c;
    color: #ffffff;
}

/* Form Input PIN di Dalam Popup Modal Mode Trial */
.mk-pin-form {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mk-pin-device {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d0f13;
    border: 1px solid #2b303a;
    border-radius: 6px;
    padding: 7px 10px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #9ca3af;
}
.mk-pin-device strong {
    color: #38bdf8;
    letter-spacing: 1px;
}
.mk-pin-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid #ef4444;
    color: #fecaca;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    text-align: center;
}
.mk-pin-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: #cbd5e1;
}
.mk-pin-input {
    width: 100%;
    background: #0b0d11;
    color: #fef08a;
    border: 1.5px solid #475569;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}
.mk-pin-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}
.mk-pin-hint {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}
.mk-pin-hint a {
    color: #4ade80;
    font-weight: 700;
    text-decoration: none;
}
.mk-pin-hint a:hover {
    text-decoration: underline;
}

@keyframes mkModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.access-pill {
    font-family: 'Courier New', monospace;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}
.access-pill.full {
    color: #bbf7d0;
    background: #052e16;
    border: 1px solid #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}
.access-pill.trial {
    color: #fde68a;
    background: #451a03;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.gate-pin-mini {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff !important;
    border: 1px solid #1e3a8a;
    border-top-color: #93c5fd;
    padding: 4px 8px;
    font-size: 10.5px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.gate-pin-mini:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.gate-wa-mini {
    text-decoration: none;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #ffffff !important;
    border: 1px solid #14532d;
    border-top-color: #86efac;
    padding: 4px 8px;
    font-size: 10.5px;
}

body.trial-mode .trial-locked-knob {
    opacity: 0.42;
    cursor: not-allowed !important;
}
body.trial-mode .lux-btn.trial-locked-btn {
    opacity: 0.42;
    cursor: not-allowed !important;
}

/* =========================================================================
   OVERLAY GERBANG MASUK (GATE SCREEN) + BLOK INFO SEO
   ========================================================================= */
.gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: radial-gradient(circle at 50% 35%, #1c2029 0%, #090b0e 75%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 28px 16px 36px;
}

.gate-shell {
    width: 100%;
    max-width: 540px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.gate-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, #22262e 0%, #14171c 100%);
    border: 1.5px solid #363c48;
    border-top-color: #525b6c;
    border-radius: 14px;
    padding: 24px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gate-brand { text-align: center; }
.gate-badge {
    margin: 0;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #f8fafc;
}
.gate-badge span { color: #f59e0b; }
.gate-sub {
    font-size: 10px;
    letter-spacing: 1.8px;
    color: #94a3b8;
    margin-top: 3px;
}

.gate-device-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d0f13;
    border: 1px solid #2b303a;
    border-radius: 6px;
    padding: 7px 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #9ca3af;
}
.gate-device-pill strong { color: #38bdf8; letter-spacing: 1px; }

.gate-alert {
    background: rgba(220, 38, 38, 0.18);
    border: 1px solid #ef4444;
    color: #fecaca;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

.gate-pin-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gate-pin-form label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    color: #cbd5e1;
}
.gate-pin-row {
    display: flex;
    gap: 8px;
}
.gate-pin-row input {
    flex: 1;
    background: #0c0e12;
    color: #fef08a;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 9px 11px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    outline: none;
}
.gate-pin-row input:focus { border-color: #38bdf8; }

.gate-btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border: 1px solid #1e3a8a;
    border-top-color: #93c5fd;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.gate-btn-primary:hover { filter: brightness(1.08); }

.gate-divider {
    position: relative;
    text-align: center;
    margin: 2px 0;
}
.gate-divider::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: #2f3542;
}
.gate-divider span {
    position: relative;
    background: #1a1d24;
    padding: 0 10px;
    font-size: 10px;
    color: #6b7280;
    font-weight: 700;
}

.gate-trial-box { display: flex; flex-direction: column; gap: 6px; }
.gate-btn-trial {
    width: 100%;
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: 1px solid #92400e;
    border-top-color: #fde68a;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
}
.gate-btn-trial:hover:not(.disabled) { filter: brightness(1.08); }
.gate-btn-trial.disabled {
    background: #272b33;
    color: #6b7280;
    border-color: #374151;
    cursor: not-allowed;
}
.gate-trial-note {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.4;
}
.gate-trial-note.warn { color: #fca5a5; }

.gate-btn-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #ffffff;
    border: 1px solid #14532d;
    border-top-color: #86efac;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}
.gate-btn-wa:hover { filter: brightness(1.08); }

.gate-seo-info {
    width: 100%;
    background: rgba(18, 21, 27, 0.85);
    border: 1px solid #2b313d;
    border-radius: 12px;
    padding: 16px 18px;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.6;
}
.gate-seo-info h2 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #f3f4f6;
}
.gate-seo-info p {
    margin: 0 0 10px;
}
.gate-seo-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gate-seo-list strong {
    color: #e5e7eb;
}

/* =========================================================================
   HALAMAN PANEL ADMIN (admin.php)
   ========================================================================= */
body.admin-page {
    display: block;
    padding: 24px 16px;
}
.admin-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.admin-login-box {
    max-width: 380px;
    margin: 60px auto;
    background: linear-gradient(180deg, #22262e 0%, #14171c 100%);
    border: 1px solid #343a46;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-login-box h2 { margin: 0; font-size: 20px; text-align: center; }
.admin-login-box input, .admin-form-grid input {
    background: #0d0f13;
    color: #f8fafc;
    border: 1px solid #3f4654;
    border-radius: 6px;
    padding: 9px 11px;
    font-size: 13px;
    width: 100%;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #181b21;
    border: 1px solid #2e3440;
    border-radius: 10px;
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.admin-card {
    background: #181b21;
    border: 1px solid #2e3440;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-card h3 { margin: 0; font-size: 14px; color: #fbbf24; }
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 10px;
    align-items: center;
}
@media (max-width: 640px) {
    .admin-form-grid { grid-template-columns: 1fr; }
}
.pin-created-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    color: #bbf7d0;
    padding: 10px 14px;
    border-radius: 7px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}
.pin-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.btn-copy-pin {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: 1px solid #1e3a8a;
    border-top-color: #93c5fd;
    border-radius: 5px;
    padding: 5px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.btn-copy-pin:hover { filter: brightness(1.08); }
.btn-copy-pin.copied {
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    border-color: #14532d;
    border-top-color: #86efac;
}
.btn-wa-send {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    color: #ffffff;
    border: 1px solid #14532d;
    border-top-color: #86efac;
    border-radius: 5px;
    padding: 5px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.btn-wa-send:hover { filter: brightness(1.08); }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.admin-table th, .admin-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #282e39;
    text-align: left;
}
.admin-table th { color: #94a3b8; font-size: 11px; text-transform: uppercase; }

/* Edit Masa Berlaku Klik 2x */
.exp-editable-cell {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}
.exp-editable-cell:hover {
    background: rgba(56, 189, 248, 0.14);
}
.exp-display-val {
    font-family: 'Courier New', monospace;
    color: #e2e8f0;
    font-weight: 700;
}
.exp-edit-hint {
    display: block;
    font-size: 9.5px;
    color: #64748b;
    margin-top: 2px;
}
.exp-inline-editor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}
.exp-datetime-input {
    background: #0b0d11;
    color: #fef08a;
    border: 1px solid #38bdf8;
    border-radius: 4px;
    padding: 4px 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    outline: none;
}
.btn-exp-save {
    background: #16a34a;
    color: #ffffff;
    border: 1px solid #4ade80;
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.btn-exp-cancel {
    background: #374151;
    color: #e5e7eb;
    border: 1px solid #6b7280;
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.action-cell {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.badge-status {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 800;
}
.badge-status.active { background: #052e16; color: #4ade80; border: 1px solid #16a34a; }
.badge-status.used   { background: #1e293b; color: #94a3b8; border: 1px solid #475569; }
.badge-status.exp    { background: #450a0a; color: #fca5a5; border: 1px solid #dc2626; }
.btn-del-sm {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #dc2626;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}