/* ============================================================
   PPAY GATEWAY - Core Stylesheet
   ============================================================ */
:root {
    --bg:          #050b14;
    --bg-2:        #071120;
    --surface:     rgba(15, 25, 42, 0.72);
    --surface-2:   rgba(22, 34, 54, 0.55);
    --surface-3:   rgba(30, 44, 66, 0.55);
    --primary:     #10b981;
    --primary-soft:#34d399;
    --primary-glow:rgba(16, 185, 129, 0.45);
    --cyan:        #22d3ee;
    --cyan-soft:   #67e8f9;
    --gold:        #f5c451;
    --violet:      #a78bfa;
    --text:        #eef4ff;
    --muted:       #93a4c0;
    --muted-2:     #6b7b96;
    --border:      rgba(120, 150, 190, 0.16);
    --border-2:    rgba(120, 150, 190, 0.28);
    --danger:      #f87171;
    --success:     #34d399;
    --warning:     #fbbf24;
    --radius:      18px;
    --radius-sm:   12px;
    --radius-lg:   26px;
    --shadow-soft: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-deep: 0 24px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255,255,255,0.02) inset;
    --ease:        cubic-bezier(.22,.61,.36,1);
    --transition:  0.25s var(--ease);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 0.4em;
    color: var(--text);
}

a { color: var(--primary-soft); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--cyan-soft); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Background Ornaments ---------- */
.bg-ornament {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.orb {
    position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55;
    will-change: transform;
}
.orb-a {
    width: 480px; height: 480px; top: -160px; left: -120px;
    background: radial-gradient(circle, rgba(16,185,129,0.55), transparent 70%);
    animation: floatA 22s ease-in-out infinite;
}
.orb-b {
    width: 520px; height: 520px; bottom: -180px; right: -160px;
    background: radial-gradient(circle, rgba(34,211,238,0.42), transparent 70%);
    animation: floatB 26s ease-in-out infinite;
}
.orb-c {
    width: 360px; height: 360px; top: 40%; left: 55%;
    background: radial-gradient(circle, rgba(167,139,250,0.32), transparent 70%);
    animation: floatA 32s ease-in-out infinite reverse;
}
.grid-fade {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(120,150,190,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120,150,190,0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 85%);
}
@keyframes floatA {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(40px, 30px, 0) scale(1.08); }
}
@keyframes floatB {
    0%,100% { transform: translate3d(0,0,0) scale(1); }
    50%     { transform: translate3d(-50px, -40px, 0) scale(1.1); }
}

/* ---------- Glass ---------- */
.glass {
    background: linear-gradient(155deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-deep);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    position: relative;
    overflow: hidden;
}
.glass::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(155deg, rgba(255,255,255,0.08), transparent 40%);
    pointer-events: none;
    border-radius: inherit;
}
@supports not (backdrop-filter: blur(1px)) {
    .glass { background: linear-gradient(155deg, rgba(22,34,54,0.95), rgba(15,25,42,0.95)); }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
    position: relative; overflow: hidden;
    min-height: 46px;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #041510;
    box-shadow: 0 10px 26px -10px var(--primary-glow), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.btn-primary:hover { box-shadow: 0 14px 32px -10px var(--primary-glow), 0 0 0 1px rgba(255,255,255,0.1) inset; }

.btn-ghost {
    background: rgba(255,255,255,0.03);
    border-color: var(--border-2);
    color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--border-2); }

.btn-block { width: 100%; }

.btn-spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.25);
    border-top-color: currentColor;
    animation: spin 0.75s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label {
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.input-wrap {
    position: relative; display: flex; align-items: center;
    background: rgba(10, 18, 32, 0.7);
    border: 1px solid var(--border);
    border-radius: 13px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    overflow: hidden;
}
.input-wrap:focus-within {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
    background: rgba(10, 18, 32, 0.9);
}
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
    flex: 1; width: 100%;
    background: transparent; border: none; outline: none;
    color: var(--text); font-size: 15px;
    padding: 13px 14px;
    min-width: 0;
}
.input-wrap textarea { resize: vertical; min-height: 84px; }
.input-wrap select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.input-wrap select option { background: #0a1424; color: var(--text); }

.input-icon {
    display: inline-flex; align-items: center; justify-content: center;
    padding-left: 13px; color: var(--muted);
}
.input-icon svg { width: 18px; height: 18px; }

.toggle-pw {
    background: transparent; border: none; color: var(--muted);
    padding: 0 14px; height: 100%;
    display: inline-flex; align-items: center;
    transition: color var(--transition);
}
.toggle-pw:hover { color: var(--primary-soft); }
.toggle-pw svg { width: 18px; height: 18px; }

.field-error {
    color: var(--danger); font-size: 12.5px; min-height: 15px;
}

/* ---------- Utility ---------- */
.link-muted {
    color: var(--muted); font-size: 13.5px; background: none; border: none; padding: 0;
    transition: color var(--transition);
}
.link-muted:hover { color: var(--primary-soft); }

.row-between {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin: 4px 0 12px; flex-wrap: wrap;
}
.check {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none;
}
.check input { display: none; }
.check-box {
    width: 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid var(--border-2);
    background: rgba(10,18,32,0.6);
    display: inline-block; position: relative;
    transition: all var(--transition);
}
.check input:checked + .check-box {
    background: linear-gradient(135deg, var(--primary), #059669);
    border-color: var(--primary);
}
.check input:checked + .check-box::after {
    content: ''; position: absolute; left: 4.5px; top: 1px;
    width: 5px; height: 9px; border: solid #041510;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.divider {
    display: flex; align-items: center; gap: 10px;
    margin: 20px 0 14px; color: var(--muted-2); font-size: 12.5px;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.alert {
    border-radius: 13px; padding: 12px 14px; font-size: 13.5px;
    border: 1px solid var(--border-2);
    background: rgba(255,255,255,0.02);
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 14px;
}
.alert-warn { border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.06); color: #fde68a; }
.alert-info { border-color: rgba(34,211,238,0.3); background: rgba(34,211,238,0.05); color: var(--cyan-soft); }
.alert.small { font-size: 12.5px; padding: 10px 12px; }
.alert code { background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

.badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    border: 1px solid var(--border-2);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
}
.badge-completed, .badge-active { background: rgba(52,211,153,0.12); color: #6ee7b7; border-color: rgba(52,211,153,0.35); }
.badge-pending, .badge-processing, .badge-open { background: rgba(251,191,36,0.12); color: #fcd34d; border-color: rgba(251,191,36,0.35); }
.badge-failed, .badge-rejected, .badge-suspended { background: rgba(248,113,113,0.12); color: #fca5a5; border-color: rgba(248,113,113,0.35); }
.badge-resolved { background: rgba(34,211,238,0.12); color: var(--cyan-soft); border-color: rgba(34,211,238,0.35); }

.pos { color: var(--success); }
.neg { color: var(--danger); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ---------- Toasts ---------- */
.toast-stack {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: 13px 15px; border-radius: 14px;
    background: linear-gradient(155deg, rgba(22,34,54,0.96), rgba(15,25,42,0.96));
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-deep);
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13.5px; color: var(--text);
    animation: toastIn .35s var(--ease) both;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.toast.leaving { animation: toastOut .25s var(--ease) both; }
.toast.success { border-color: rgba(52,211,153,0.45); }
.toast.error   { border-color: rgba(248,113,113,0.45); }
.toast.info    { border-color: rgba(34,211,238,0.45); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.toast.success .toast-dot { background: var(--success); box-shadow: 0 0 12px var(--success); }
.toast.error   .toast-dot { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.toast.info    .toast-dot { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

@keyframes toastIn {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
    to { transform: translateY(-8px); opacity: 0; }
}

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(2,6,14,0.72);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn .2s var(--ease);
}
.modal-backdrop[hidden] { display: none; }
.modal {
    width: 100%; max-width: 460px;
    background: linear-gradient(155deg, rgba(22,34,54,0.98), rgba(15,25,42,0.98));
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-deep);
    overflow: hidden;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Skeleton ---------- */
.skeleton-row {
    height: 60px; border-radius: 12px;
    background: linear-gradient(90deg, rgba(120,150,190,0.06), rgba(120,150,190,0.14), rgba(120,150,190,0.06));
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    list-style: none;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- App Shell ---------- */
.app-body { background: var(--bg); }

.app-shell {
    display: flex; min-height: 100vh; position: relative; z-index: 1;
}
.app-main {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 250px; flex-shrink: 0;
    display: flex; flex-direction: column;
    padding: 22px 16px;
    background: linear-gradient(180deg, rgba(9,16,28,0.85), rgba(6,12,22,0.85));
    border-right: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px 22px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800; letter-spacing: 0.12em; font-size: 15px;
    color: var(--text);
}
.brand-sub {
    font-size: 9.5px; letter-spacing: 0.32em; color: var(--primary-soft);
    font-weight: 700; margin-top: 3px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 12px;
    color: var(--muted); font-size: 14px; font-weight: 500;
    transition: all var(--transition);
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(16,185,129,0.14), rgba(34,211,238,0.08));
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(16,185,129,0.25) inset;
}
.nav-item.active .nav-glow {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--primary), var(--cyan));
    box-shadow: 0 0 12px var(--primary-glow);
}
.nav-icon { display: inline-flex; }
.nav-icon svg { width: 18px; height: 18px; }
.sidebar-footer { padding-top: 12px; border-top: 1px solid var(--border); }
.nav-item.logout:hover { color: var(--danger); }

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(7,14,24,0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky; top: 0; z-index: 40;
}
.topbar-brand {
    display: flex; align-items: center; gap: 8px;
    color: var(--text); font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.04em; font-size: 14px;
}
.topbar-brand em {
    font-style: normal; color: var(--primary-soft);
    font-weight: 600; font-size: 11px; letter-spacing: 0.24em;
    margin-left: 4px;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); background: rgba(255,255,255,0.06); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
    position: absolute; top: 9px; right: 10px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px rgba(7,14,24,0.9), 0 0 10px var(--primary-glow);
}

.avatar {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), #0e7490);
    color: #041510; font-weight: 700; font-size: 15px;
    text-decoration: none;
    box-shadow: 0 8px 20px -8px var(--primary-glow), 0 0 0 1px rgba(255,255,255,0.06) inset;
}

.menu-toggle { display: none; }

/* ---------- Page ---------- */
.page {
    padding: 20px 18px 90px;
    display: flex; flex-direction: column; gap: 18px;
    max-width: 1200px; width: 100%;
    margin: 0 auto;
}

/* ---------- Bottom Nav (mobile) ---------- */
.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 50;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(7,14,24,0.85), rgba(5,10,18,0.98));
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    justify-content: space-around; align-items: center;
    gap: 4px;
}
.bn-item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 4px; border-radius: 12px;
    color: var(--muted-2); font-size: 10.5px; font-weight: 600;
    text-decoration: none; position: relative;
    transition: color var(--transition);
}
.bn-item svg { width: 20px; height: 20px; }
.bn-item.active { color: var(--primary-soft); }
.bn-item.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3px; border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
    box-shadow: 0 0 12px var(--primary-glow);
}