/* PayNexa Admin Panel — PayNexa ke rang */
:root {
  --bg: #f3f6fa; --card: #fff; --ink: #0d124a; --text: #3b4565; --muted: #6a7390;
  --line: #e2e8f1; --soft: #f5f8fc; --teal: #1b9a88; --teal-ink: #0d7d70; --blue: #1668e3;
  --navy: #0d124a; --navy-2: #1b2370; --good: #15803d; --warn: #b45309; --bad: #c2410c;
  --grad: linear-gradient(115deg, #8ac655 0%, #1b9a88 52%, #17a7d2 100%);
  --shadow: 0 1px 2px rgba(13,18,74,.05), 0 6px 18px -10px rgba(13,18,74,.18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #080c26; --card: #0f1538; --ink: #eef1fb; --text: #c6cce2; --muted: #98a1c0; --line: #232b5a; --soft: #131a42;
    --teal-ink: #4fd1bd; --blue: #5b9bff; --navy: #2b3aa8; --navy-2: #3446c0; --good: #4ade80; --warn: #fbbf24; --bad: #ff8a5c;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.5 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--blue); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: .82rem; }
.ink { color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .5rem 1rem; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { min-height: 34px; padding: .35rem .75rem; font-size: .83rem; border-radius: 9px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-line { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-line:hover:not(:disabled) { border-color: var(--teal); }
.btn-danger { background: var(--card); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 8%, var(--card)); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal-ink); font-weight: 700; cursor: pointer; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.input { width: 100%; min-height: 42px; padding: .55rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 15%, transparent); }
.fld { display: grid; gap: .3rem; }
.fld label { font-size: .83rem; font-weight: 700; color: var(--ink); }
.form { display: grid; gap: 14px; }
.phone { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.phone span { display: grid; place-items: center; padding: 0 .8rem; background: var(--soft); font-weight: 700; color: var(--ink); border-right: 1px solid var(--line); }
.phone input { flex: 1; min-width: 0; border: 0; background: none; padding: .55rem .8rem; min-height: 44px; outline: none; }
.otp-input { text-align: center; font-size: 1.35rem; letter-spacing: .5em; font-weight: 700; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 26px 22px; display: grid; gap: 18px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.auth-card h1 { font-size: 1.35rem; }
.sub { color: var(--muted); margin-top: .3rem; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand b { display: block; color: var(--ink); font-weight: 800; line-height: 1.1; }
.brand small { color: var(--teal-ink); font-weight: 700; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; }

/* Shell */
#app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.nav .brand { padding: 0 8px; }
#nav-links { display: grid; gap: 2px; }
.nav-group { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; }
.nav-link { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link.on { background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--ink); }
.count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.nav-foot { margin-top: auto; display: grid; gap: 8px; padding: 0 6px; }
.body { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar h1 { font-size: 1.15rem; flex: 1; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.view { padding: 20px 22px 60px; display: grid; gap: 16px; max-width: 1240px; width: 100%; }
.scrim { display: none; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8,12,38,.45); }
  .menu-btn { display: grid; }
  .bar { padding: 10px 12px; }
  .bar-right .muted-sm { display: none; }
  .view { padding: 14px 10px 50px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.pad { padding: 16px 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; display: grid; gap: 2px; text-decoration: none; }
.tile span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.tile b { font-size: 1.6rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile.warn b { color: var(--warn); } .tile.bad b { color: var(--bad); } .tile.good b { color: var(--good); }
a.tile:hover { border-color: var(--teal); }
.sec-title { font-size: 1rem; margin: 6px 0 -4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input { flex: 1; min-width: 200px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: .35rem .8rem; border-radius: 8px; font-weight: 700; font-size: .83rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th { text-align: left; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td b { color: var(--ink); }
td .sub2 { font-size: .76rem; color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: .72rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.neutral { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.pill.info { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .82rem; }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detail-head h2 { font-size: 1.3rem; flex: 1; }
.report { display: grid; gap: 10px; padding: 16px 18px; }
.quote { padding: 10px 12px; border-left: 3px solid var(--line); background: var(--soft); border-radius: 0 10px 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.quote img { display: block; max-width: 220px; border-radius: 8px; margin-top: 8px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(8,12,38,.55); }
.modal-card { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: 18px 20px 20px; }
.note { font-size: .84rem; color: var(--muted); padding: .6rem .8rem; border-radius: 10px; border: 1px dashed var(--line); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(16px); background: #0d124a; color: #fff; padding: .65rem 1rem; border-radius: 12px; font-weight: 600; font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
