@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@600;700;800&display=swap');

/* ------------------------------------------------------------------ tokens */

:root {
  --accent: #e8541e;
  --accent-hi: #ff7a45;
  --accent-lo: #c33f10;
  --accent-glow: rgba(232, 84, 30, 0.35);

  --bg: #08090a;
  --bg-2: #0d0f11;
  --surface: #121417;
  --surface-2: #171a1e;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  --text: #f2f4f6;
  --muted: #9aa3ad;
  --faint: #6b7480;
  --danger: #ff5f56;
  --ok: #35c77d;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Sora', var(--sans);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient warmth behind everything — the "premium" glow. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(232, 84, 30, 0.16), transparent 62%),
    radial-gradient(760px 460px at 92% 4%, rgba(232, 84, 30, 0.09), transparent 60%),
    radial-gradient(1000px 700px at 50% 108%, rgba(232, 84, 30, 0.06), transparent 65%);
}

/* Fine grain so the flat black doesn't band on big screens. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent); color: #fff; }

/* --------------------------------------------------------------- wordmark */

.brand {
  display: inline-flex;
  align-items: center;
  /* No gap: SENSE and OSINT must sit flush against each other. The mark keeps
     its breathing room with a margin instead. */
  gap: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent-hi), var(--accent-lo));
  box-shadow: 0 5px 18px -4px var(--accent-glow);
  flex: none;
  margin-right: 10px;
}
.brand .mark svg { width: 17px; height: 17px; display: block; }
.brand b { font-weight: 800; }
.brand .dim { color: var(--muted); font-weight: 700; }

/* ----------------------------------------------------------------- layout */

.shell { max-width: 940px; margin: 0 auto; padding: 0 22px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--muted); }
.topbar .who .email { color: var(--text); font-weight: 500; }

/* ------------------------------------------------------------------ auth */

.auth-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 46px 22px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 38px 34px 32px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 30px 70px -30px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px);
}

.auth-card .brand { margin-bottom: 26px; font-size: 19px; }

.auth-card h1 {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 7px;
}
.auth-card .lede { color: var(--muted); font-size: 14px; margin: 0 0 26px; }

.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 7px;
}

input[type='text'],
input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
input::placeholder { color: #5d666f; }
input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3.5px rgba(232, 84, 30, 0.16);
}
input:disabled { opacity: 0.55; cursor: not-allowed; }

/* password strength meter */
.meter { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 0.3s var(--ease), background 0.3s; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 7px; }
.hint.bad { color: var(--danger); }
.hint.good { color: var(--ok); }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 20px;
  cursor: pointer;
  line-height: 1.5;
}
.check input {
  appearance: none;
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: 0.16s var(--ease);
}
.check input:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}
.check input:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* --------------------------------------------------------------- buttons */

.btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12.5px 20px;
  border: 0;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), filter 0.16s, background 0.16s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: #fff;
  box-shadow: 0 8px 22px -8px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.22) inset;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 13px 28px -9px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.28) inset; }
.btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(0.95); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-2);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* A button parked in a maintenance state: dimmed, but still legible. */
.btn-ghost:disabled {
  opacity: 1;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
}
.btn-ghost:disabled svg { opacity: 0.4; filter: grayscale(1); }

.pill {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-hi);
  background: rgba(232, 84, 30, 0.14);
  border: 1px solid rgba(232, 84, 30, 0.3);
  white-space: nowrap;
}

.btn-link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover { color: var(--accent-hi); }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.swap { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }

/* --------------------------------------------------------------- notices */

.notice {
  display: none;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.notice.show { display: block; }
.notice.error { background: rgba(255, 95, 86, 0.1); border-color: rgba(255, 95, 86, 0.32); color: #ff8f88; }
.notice.ok { background: rgba(53, 199, 125, 0.1); border-color: rgba(53, 199, 125, 0.32); color: #6ce0a5; }
.notice.info { background: rgba(232, 84, 30, 0.1); border-color: rgba(232, 84, 30, 0.32); color: var(--accent-hi); }

/* ------------------------------------------------------------ search page */

.hero { margin-bottom: 26px; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); margin: 0; font-size: 15px; }

.searchbar { display: flex; gap: 11px; margin-bottom: 12px; }
.searchbar .grow { flex: 1; min-width: 0; }
.searchbar .btn { width: auto; padding-inline: 30px; }

.searchbar input {
  padding: 15px 17px;
  font-size: 16px;
  border-radius: var(--r);
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* cooldown countdown */
.cooldown {
  display: none;
  align-items: center;
  gap: 15px;
  padding: 15px 18px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, rgba(232, 84, 30, 0.12), rgba(232, 84, 30, 0.05));
  border: 1px solid rgba(232, 84, 30, 0.3);
  border-radius: var(--r);
}
.cooldown.show { display: flex; }
.cooldown .ring { position: relative; width: 52px; height: 52px; flex: none; }
.cooldown .ring svg { transform: rotate(-90deg); width: 52px; height: 52px; }
.cooldown .ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.cooldown .ring .track { stroke: rgba(255, 255, 255, 0.1); }
.cooldown .ring .bar { stroke: var(--accent); transition: stroke-dashoffset 0.95s linear; }
.cooldown .ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-hi);
}
.cooldown .txt strong { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.cooldown .txt span { font-size: 13px; color: var(--muted); }

/* results */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 12px;
  animation: rise 0.4s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.card h2 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 13px;
}
.row { display: flex; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row:first-of-type { border-top: 0; padding-top: 0; }
.row .k { flex: 0 0 32%; color: var(--faint); word-break: break-word; }
.row .v { flex: 1; word-break: break-word; white-space: pre-wrap; }

.empty { text-align: center; padding: 52px 20px; color: var(--faint); }
.empty svg { width: 42px; height: 42px; opacity: 0.32; margin-bottom: 14px; }

details { margin-top: 20px; }
summary { color: var(--faint); font-size: 13px; cursor: pointer; user-select: none; }
summary:hover { color: var(--muted); }
pre {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 15px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  margin-top: 10px;
}

/* spinner */
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  margin: 54px 0 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.65;
}

@media (max-width: 560px) {
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
  .row { flex-direction: column; gap: 3px; }
  .row .k { flex: none; }
  .auth-card { padding: 30px 22px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   App shell: fixed left sidebar + content column
   ========================================================================== */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 262px;
  flex: none;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.008));
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand { font-size: 18px; padding: 0 6px; }
.sidebar nav { display: flex; flex-direction: column; gap: 22px; flex: 1; }

.navsection { display: flex; flex-direction: column; gap: 3px; }
.navtitle {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 10px 7px;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.navlink:hover { background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none; }
.navlink svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.navlink.active {
  background: linear-gradient(90deg, rgba(232,84,30,0.18), rgba(232,84,30,0.05));
  border-color: rgba(232,84,30,0.32);
  color: var(--text);
}
.navlink.active svg { color: var(--accent); opacity: 1; }
.navlink .lock {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px 7px;
}

.sidefoot { display: flex; flex-direction: column; gap: 13px; }
.rolecard {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 13px;
  background: rgba(0,0,0,0.28);
}
.rolecard p { margin: 8px 0 0; font-size: 12px; color: var(--faint); line-height: 1.5; }

.rolebadge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
}
.rolebadge.free             { color: var(--faint);   border-color: var(--line-2);            background: rgba(255,255,255,0.04); }
.rolebadge.premium          { color: var(--accent-hi); border-color: rgba(232,84,30,0.4);    background: rgba(232,84,30,0.14); }
.rolebadge.priority_premium { color: #ffd08a;        border-color: rgba(255,190,90,0.45);    background: rgba(255,190,90,0.14); }
.rolebadge.super_admin      { color: #7ee2a8;        border-color: rgba(53,199,125,0.45);    background: rgba(53,199,125,0.14); }

.sideuser { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--faint); }
.sideuser span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { flex: 1; min-width: 0; padding: 30px 34px 60px; }
.content .inner { max-width: 820px; }

.pagehead { margin-bottom: 26px; }
.pagehead h1 {
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 7px;
}
.pagehead h1 em { font-style: normal; color: var(--accent); }
.pagehead p { color: var(--muted); margin: 0; }

.menubtn {
  display: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  margin-bottom: 18px;
}
.menubtn svg { width: 20px; height: 20px; display: block; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px 17px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
}
.stat .lbl { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.stat .val { font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.stat .val small { font-size: 14px; color: var(--faint); font-weight: 600; }

/* locked / upsell panel */
.locked-panel {
  border: 1px dashed rgba(232,84,30,0.35);
  background: linear-gradient(180deg, rgba(232,84,30,0.09), rgba(232,84,30,0.03));
  border-radius: var(--r);
  padding: 30px 26px;
  text-align: center;
}
.locked-panel svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 12px; }
.locked-panel h2 { font-family: var(--display); font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.locked-panel p { color: var(--muted); margin: 0 auto; max-width: 430px; font-size: 14px; }

/* tables */
.tablewrap { border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
thead th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
tbody td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
td .sub { color: var(--faint); font-size: 12px; }

select {
  padding: 7px 10px;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,84,30,0.15); }
select:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm { width: auto; padding: 7px 14px; font-size: 13px; }

@media (max-width: 900px) {
  .menubtn { display: block; }
  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: 0 0 60px rgba(0,0,0,0.7);
    background: var(--bg-2);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 40;
  }
  .content { padding: 20px 18px 50px; }
}

/* ==========================================================================
   Lookup results
   ========================================================================== */

.res-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 13.5px;
  color: var(--muted);
}
.res-summary .count {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.res-summary .qchip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--accent-hi);
  background: rgba(232, 84, 30, 0.12);
  border: 1px solid rgba(232, 84, 30, 0.28);
  border-radius: 999px;
  padding: 3px 11px;
}

.record {
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.032), rgba(255,255,255,0.008));
  animation: rise 0.4s var(--ease) both;
}

.record-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.022);
}
.record-head .idx {
  flex: none;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--accent-hi), var(--accent-lo));
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--display);
}
.record-head .title {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-head .srcpill {
  margin-left: auto;
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 9px;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-body { padding: 4px 16px 12px; }

.pair {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.045);
}
.pair:last-child { border-bottom: 0; }

.pair .pk {
  flex: 0 0 33%;
  max-width: 33%;
  font-size: 12px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--faint);
  padding-top: 2px;
  word-break: break-word;
}
.pair .pv {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.pair .pv .txt { flex: 1; min-width: 0; }
.pair .pv.mono .txt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.pair .pv .empty-val { color: var(--faint); }

.copybtn, .revealbtn {
  flex: none;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--faint);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s, border-color 0.15s;
}
.pair:hover .copybtn, .pair:focus-within .copybtn { opacity: 1; }
.revealbtn { opacity: 1; }
.copybtn:hover, .revealbtn:hover { color: var(--accent-hi); border-color: rgba(232,84,30,0.45); }
.copybtn.done { color: var(--ok); border-color: rgba(53,199,125,0.45); opacity: 1; }

.masked { letter-spacing: 0.18em; color: var(--faint); }

/* nested objects / arrays inside a value */
.subblock {
  border-left: 2px solid var(--line-2);
  padding-left: 12px;
  margin-top: 4px;
}
.subblock .pair { padding: 6px 0; }
.subblock .pair .pk { flex-basis: 40%; max-width: 40%; font-size: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  background: rgba(255,255,255,0.055);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 2px 10px;
}

@media (max-width: 620px) {
  .pair { flex-direction: column; gap: 3px; }
  .pair .pk { flex: none; max-width: 100%; }
  .record-head .srcpill { display: none; }
}

/* result groups: one section per source database */

.group { display: block; margin-bottom: 20px; animation: rise 0.4s var(--ease) both; }

.group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 2px 9px;
  margin-bottom: 2px;
}
.group-head .dbdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 84, 30, 0.16);
  flex: none;
}
.group-head .dbname {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-head .gcount {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

.res-summary .across { color: var(--faint); }

/* history table */
.hist-query { font-weight: 500; word-break: break-word; }
.pill-ok   { color: var(--ok);     border-color: rgba(53,199,125,0.4);  background: rgba(53,199,125,0.12); }
.pill-warn { color: var(--accent-hi); border-color: rgba(232,84,30,0.4); background: rgba(232,84,30,0.12); }
.pill-bad  { color: var(--danger); border-color: rgba(255,95,86,0.4);   background: rgba(255,95,86,0.12); }
.spill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--faint);
  white-space: nowrap;
}

/* clickable history rows */
tr.histrow { cursor: pointer; transition: background 0.14s var(--ease); }
tr.histrow:hover { background: rgba(232, 84, 30, 0.07); }
tr.histrow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
td.hist-open { text-align: right; white-space: nowrap; }
.viewlink { color: var(--accent-hi); font-size: 12.5px; font-weight: 600; opacity: 0; transition: opacity 0.14s var(--ease); }
tr.histrow:hover .viewlink, tr.histrow:focus-visible .viewlink { opacity: 1; }
@media (max-width: 620px) { .viewlink { opacity: 1; } }

/* ==========================================================================
   Modal (history result popup)
   ========================================================================== */

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 20px;
  overflow-y: auto;
  animation: fade 0.18s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 760px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
  animation: pop 0.24s var(--ease) both;
  margin: auto 0;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(232,84,30,0.10), rgba(255,255,255,0.02));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  backdrop-filter: blur(10px);
}
.modal-head h2 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 3px;
  word-break: break-word;
}
.modal-sub { font-size: 12.5px; color: var(--faint); }

.modal-x {
  margin-left: auto;
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: 0.15s var(--ease);
}
.modal-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.11); }
.modal-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.modal-body { padding: 18px 22px 24px; }
.modal-body .record:last-of-type { margin-bottom: 0; }

@media (max-width: 620px) {
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; border: 0; }
  .modal-head { border-radius: 0; }
}

.res-hint { color: var(--faint); font-size: 13.5px; padding: 8px 2px; display: flex; align-items: center; gap: 9px; }

/* admin: view-log button + wide modal */
.btn-log {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s, border-color 0.15s;
}
.btn-log:hover { background: rgba(232,84,30,0.12); color: var(--accent-hi); border-color: rgba(232,84,30,0.4); }
.modal-wide { max-width: 860px !important; width: 92% !important; }

/* A tool parked in maintenance: distinct from the grey "Locked" plan chip. */
.navlink .lock.soon {
  color: var(--accent-hi);
  border-color: rgba(232, 84, 30, 0.35);
  background: rgba(232, 84, 30, 0.12);
}

/* NIK To FOTO result */
.photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 0 4px; }
.photo-img {
  max-width: 260px;
  width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.35);
  display: block;
}
.photo-actions { display: flex; gap: 10px; }
.photo-actions .btn { width: auto; }

/* Demo-mode banner: must be impossible to miss. */
.demo-banner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 15px;
  margin-bottom: 16px;
  border-radius: var(--r-sm);
  background: rgba(232, 179, 30, 0.12);
  border: 1px solid rgba(232, 179, 30, 0.42);
}
.demo-banner strong { color: #e8b31e; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.demo-banner span { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Language switcher */
.topbar-right { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.langsel {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}
.langbtn {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--faint);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 11px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.langbtn:hover { color: var(--text); }
.langbtn.active { background: var(--accent); color: #fff; }
.langbtn:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* On auth screens the switcher sits above the card. */
.auth-lang { display: flex; justify-content: center; margin-bottom: 16px; }

/* Flags inside the language switcher */
.langbtn { display: inline-flex; align-items: center; gap: 6px; }
.langbtn .flag {
  width: 18px; height: 12px; flex: none; border-radius: 2px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18); display: block;
}
.langbtn .flag svg { width: 100%; height: 100%; display: block; }
.langbtn .lbl { line-height: 1; }

/* Username editor + support */
.username-block { margin-bottom: 4px; }
.username-hint { color: var(--faint); font-size: 13px; margin: 0 0 10px; line-height: 1.55; }
.username-form { display: flex; gap: 9px; align-items: center; }
.username-form input {
  flex: 1; min-width: 0; max-width: 320px;
  padding: 9px 12px; font-size: 14px;
  background: rgba(0,0,0,0.42); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); color: var(--text); font-family: inherit;
}
.username-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,84,30,0.15); }
.username-form .btn { width: auto; flex: none; }
.username-block .notice { margin-top: 10px; margin-bottom: 0; }
.support-btn { width: auto; display: inline-flex; }

/* Sidebar: clickable name + support link */
.sideuser-name {
  color: var(--muted); text-decoration: none; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; border-radius: 5px;
}
.sideuser-name:hover { color: var(--accent-hi); text-decoration: none; }
.support-link {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 10px;
  font-size: 12.5px; color: var(--faint);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  text-decoration: none; transition: color .15s var(--ease), border-color .15s var(--ease);
}
.support-link:hover { color: #25D366; border-color: rgba(37,211,102,0.4); text-decoration: none; }
.support-link svg { width: 15px; height: 15px; flex: none; }

/* Destructive action */
.btn-danger {
  background: linear-gradient(180deg, #ff6b62, var(--danger));
  color: #fff;
  box-shadow: 0 8px 22px -10px rgba(255,95,86,0.5), 0 1px 0 rgba(255,255,255,0.2) inset;
}
.btn-danger:hover:not(:disabled) { transform: translateY(-1px); }
.btn-del {
  background: transparent; border: 1px solid rgba(255,95,86,0.32);
  color: #ff8f88; font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 7px; cursor: pointer; margin-left: 7px;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.btn-del:hover { background: rgba(255,95,86,0.12); border-color: rgba(255,95,86,0.55); }
.modal-narrow { max-width: 440px; }
.modal-narrow #delConfirm {
  width: 100%; padding: 10px 12px; margin-top: 4px;
  background: rgba(0,0,0,0.45); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); color: var(--text); font-family: inherit; font-size: 14px;
}
.modal-narrow #delConfirm:focus { outline: none; border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,95,86,0.15); }

/* Username, once set: shown as fixed text rather than an editable field */
.username-set { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.username-value {
  font-family: var(--display); font-weight: 700; font-size: 17px;
  letter-spacing: -0.01em; color: var(--text);
}
.username-lock {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 2px 8px; cursor: help;
}
.username-warn {
  margin: 0 0 10px; font-size: 12.5px; line-height: 1.5;
  color: #e8b31e;
}

/* ==========================================================================
   Plans & pricing
   ========================================================================== */

.inner-wide { max-width: 1040px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }

.plan {
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.032), rgba(255,255,255,0.008));
}
.plan.popular {
  border-color: rgba(232,84,30,0.45);
  box-shadow: 0 0 0 1px rgba(232,84,30,0.16), 0 18px 46px -26px var(--accent-glow);
}
.plan.current { border-color: rgba(53,199,125,0.4); }

.plan-tag {
  position: absolute; top: -10px; right: 18px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  padding: 3px 10px; border-radius: 999px;
}
.plan-name { margin-bottom: 14px; }

.plan-price {
  font-family: var(--display); font-weight: 800;
  font-size: 26px; letter-spacing: -0.03em; line-height: 1.15;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.plan-price .cur { font-size: 13px; font-weight: 700; color: var(--faint); letter-spacing: 0.04em; }
.plan-price .per { font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 0; }

/* The per-day line is the selling point — give it the accent. */
.plan-daily {
  margin-top: 6px; margin-bottom: 16px;
  font-size: 13.5px; font-weight: 600; color: var(--accent-hi);
}

.plan-features { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.plan-features li {
  position: relative; padding: 5px 0 5px 22px;
  font-size: 13.5px; color: var(--muted); line-height: 1.5;
}
.plan-features li::before {
  position: absolute; left: 0; top: 5px; font-weight: 700;
}
.plan-features li.yes::before { content: '✓'; color: var(--ok); }
.plan-features li.lim { color: var(--faint); }
.plan-features li.lim::before { content: '•'; color: var(--faint); }

.plan-cta { width: 100%; }
.plan-current {
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--ok); padding: 10px; border: 1px dashed rgba(53,199,125,0.35);
  border-radius: var(--r-sm);
}
.plan-current.plan-muted { color: var(--faint); border-color: var(--line-2); }

.bill-note {
  margin-top: 22px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: rgba(0,0,0,0.25);
}
.bill-note p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.bill-note .btn { width: auto; }

/* Format guidance under the lookup box */
.phone-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.5;
}

/* ---------------------------------------------------- billing: checkout --- */

.substrip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.substrip-k {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); font-weight: 700;
}
.substrip-v { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.substrip-when { font-size: 13px; color: var(--muted); }

.durwrap {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.dur-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); font-weight: 700;
}
.dursel {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.durbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.durbtn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.durbtn.active {
  color: #fff; background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  box-shadow: 0 6px 16px -8px var(--accent-glow);
}
.dur-save {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 999px;
  color: var(--ok); background: rgba(53, 199, 125, 0.14);
  border: 1px solid rgba(53, 199, 125, 0.34);
}
.durbtn.active .dur-save {
  color: #fff; background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.3);
}

.plan-tag-save {
  right: auto; left: 14px;
  color: var(--ok); background: rgba(53, 199, 125, 0.14);
  border-color: rgba(53, 199, 125, 0.34);
}
.plan-total {
  font-size: 12.5px; color: var(--muted); margin: -6px 0 14px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.plan-total strong { color: var(--text); font-weight: 700; }

.orders-h {
  font-family: var(--display); font-size: 17px; font-weight: 700;
  margin: 30px 0 12px;
}
.ordernote { font-size: 12px; color: var(--faint); margin-top: 4px; }

/* --- the checkout dialog --- */

.checkout { display: grid; gap: 18px; }

.pay-amount {
  padding: 16px 18px; border-radius: var(--r);
  border: 1px solid rgba(232, 84, 30, 0.34);
  background: rgba(232, 84, 30, 0.08);
}
.pay-amount-k {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-hi); font-weight: 700; margin-bottom: 6px;
}
.pay-amount-v {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-family: var(--display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}
.pay-amount-v .cur { font-size: 14px; font-weight: 700; color: var(--faint); }
.pay-why { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.pay-qr {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
}
.qris-link { flex: none; display: block; border-radius: var(--r-sm); }
.qris-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The bank exports a full printed poster, so the code itself is only a third
   of the image — it needs real width to stay scannable. */
.qris-img {
  width: 300px; max-width: 100%; border-radius: var(--r-sm);
  background: #fff; padding: 8px; display: block;
}
.qris-save { width: auto !important; margin-top: 2px; }
.pay-merchant { display: grid; gap: 10px; min-width: 190px; flex: 1; align-content: start; }
.pay-merchant .k {
  display: block; font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); font-weight: 700;
}
.pay-merchant .v { font-size: 14px; font-weight: 600; color: var(--text); }

.pay-steps { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.pay-steps li { font-size: 13px; color: var(--muted); line-height: 1.55; }

.pay-expiry {
  font-size: 13px; font-weight: 600; color: var(--accent-hi);
  padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid rgba(232, 84, 30, 0.3); background: rgba(232, 84, 30, 0.07);
}
.pay-expiry.gone {
  color: var(--danger); border-color: rgba(255, 95, 86, 0.34);
  background: rgba(255, 95, 86, 0.08);
}

.pay-form { display: grid; gap: 8px; }
.pay-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); font-weight: 700; margin-top: 4px;
}
.pay-form input[type='text'],
.pay-form input[type='file'] {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 14px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.pay-form input[type='text']:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 84, 30, 0.15);
}
.pay-form input[type='file'] { padding: 9px 12px; color: var(--muted); font-size: 13px; }
.pay-form input[type='file']::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  margin-right: 12px; padding: 6px 12px; border-radius: 999px;
  color: var(--text); background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-2);
}
.pay-hint { margin: 0; font-size: 12px; color: var(--faint); line-height: 1.5; }
.pay-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.pay-actions .btn { width: auto; }

/* --- admin: payment review --- */

.paycard {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.paycard.open { border-color: rgba(232, 84, 30, 0.36); background: rgba(232, 84, 30, 0.05); }
.paycard-main { flex: 1; min-width: 210px; display: grid; gap: 4px; }
.paycard-who { font-size: 14px; font-weight: 600; color: var(--text); }
.paycard-meta { font-size: 12px; color: var(--faint); }
.paycard-amt {
  font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.paycard-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.paycard-actions .btn { width: auto; }
.proof-img { max-width: 100%; border-radius: var(--r-sm); display: block; }

@media (max-width: 620px) {
  .pay-qr { justify-content: center; text-align: center; }
  .qris-img { width: 260px; }
  .pay-merchant { text-align: center; }
  .pay-amount-v { font-size: 25px; }
}

/* ------------------------------------------------------------- CEKPOS --- */

.cekpos-form { display: grid; gap: 8px; margin-bottom: 8px; }
.cekpos-form input[type='tel'] {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 15px;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
}
.cekpos-form input[type='tel']:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 84, 30, 0.15);
}
.cekpos-form .pay-label:first-of-type { margin-top: 0; }
.cekpos-form .btn { margin-top: 10px; }

.cekpos-price {
  font-family: var(--display); font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}

/* Phone numbers read far better when the digits line up. */
.mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Orders waiting on the operator, shown beside the admin link. */
.navcount {
  margin-left: auto; min-width: 20px; padding: 2px 7px;
  border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 800; line-height: 1.5;
  color: #fff; background: var(--accent);
  box-shadow: 0 4px 10px -4px var(--accent-glow);
}

/* The provider lays its report out with aligned columns and rule characters;
   a proportional font destroys both. */
.report {
  margin: 4px 0 12px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Max sits above Priority Premium, so it gets the brightest badge. */
.rolebadge.max {
  color: #c9b8ff;
  border-color: rgba(160, 130, 255, 0.5);
  background: rgba(160, 130, 255, 0.16);
}

/* Which tool a history row came from. */
.toolchip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.toolchip.lookup  { color: var(--accent-hi); border-color: rgba(232,84,30,0.34); background: rgba(232,84,30,0.10); }
.toolchip.ceknik  { color: #7ee2a8;        border-color: rgba(53,199,125,0.34);  background: rgba(53,199,125,0.10); }
.toolchip.nikfoto { color: #c9b8ff;        border-color: rgba(160,130,255,0.4);  background: rgba(160,130,255,0.12); }
.toolchip.nik,
.toolchip.plate   { color: var(--muted); }
/* Inferred from the stored result rather than recorded at the time. */
.toolchip.inferred { border-style: dashed; opacity: 0.8; }
.toolchip.unknown { color: var(--faint); border-color: var(--line); background: none; }

/* ------------------------------------------------------------ scrollbars --- */

/* The sidebar overflows 100vh once enough tools are in the menu, and Chrome
   draws its default light scrollbar over a dark panel. Keep it scrollable —
   short windows still need to reach Sign out — but stop painting the bar. */
.sidebar {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge */
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }

/* Everywhere else a scrollbar is genuinely useful, so theme it rather than
   hide it: a light native bar on a dark panel is the jarring part. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* The menu grew past a full screen once CEKPOS joined it — twelve links plus
   the role card no longer fit a 700px window. Tighten the vertical rhythm so
   it fits an ordinary laptop without scrolling; the hidden scrollbar above
   stays as the fallback for genuinely short windows. */
.sidebar { padding: 16px 14px 14px; gap: 16px; }
.sidebar nav { gap: 15px; }
.navtitle { padding: 0 10px 5px; }
.navlink { padding: 7px 11px; }
.navsection { gap: 2px; }
.sidefoot { gap: 10px; }
.rolecard { padding: 10px 12px; }
.rolecard p { margin: 6px 0 0; }

/* ============================================================ growth pack ==
   The plan running out, the operator's alert feed, revenue, shared accounts,
   and the export buttons.
   ========================================================================== */

/* ---- a plan about to lapse, on every page ---- */
.expirybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid rgba(232, 84, 30, 0.34);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(232, 84, 30, 0.13), rgba(232, 84, 30, 0.03));
}
.expirybar.urgent {
  border-color: rgba(255, 95, 86, 0.4);
  border-left-color: var(--danger);
  background: linear-gradient(90deg, rgba(255, 95, 86, 0.14), rgba(255, 95, 86, 0.03));
}
.expirytext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.expirytext strong { font-size: 14px; letter-spacing: -0.01em; }
.expirytext span { color: var(--muted); font-size: 12.5px; }
.expiryactions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* ---- the alert feed ---- */
.alertbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.alertcount { font-size: 13px; color: var(--muted); }
.alertcount.has { color: var(--accent-hi); font-weight: 600; }

.channel-line { margin: 0 0 14px; font-size: 12.5px; }
.channel-line.off { color: var(--faint); }
.channel-line.on { color: var(--muted); }

.alertlist { display: flex; flex-direction: column; gap: 10px; }

.alertcard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 13px 15px;
}
/* Unread is the only thing worth a colour here; everything else is history. */
.alertcard.unread {
  border-color: rgba(232, 84, 30, 0.3);
  background: linear-gradient(180deg, rgba(232, 84, 30, 0.06), transparent 60%), var(--surface);
}
.alerthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 7px;
}
.alerthead time { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.alertcard strong { display: block; font-size: 13.5px; line-height: 1.45; }
.alertcard p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.alertfoot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}
.alertfoot:empty { display: none; }

/* ---- revenue ---- */
.revtiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.revtile {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.revtile .k {
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.revtile .v { font-family: var(--display); font-size: 19px; font-weight: 600; }
.revtile.big {
  border-color: rgba(232, 84, 30, 0.28);
  background: linear-gradient(180deg, rgba(232, 84, 30, 0.08), transparent 70%), var(--surface);
}
.revtile.big .v { font-size: 24px; color: var(--accent-hi); }

/* ---- a migration that has not been run is a setup step, not an error ---- */
.migration-note {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--muted);
}

/* ---- export ---- */
.exportbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
}
.modal-actions { display: flex; align-items: center; gap: 10px; }

@media (max-width: 620px) {
  .expirybar { align-items: flex-start; }
  .expiryactions { width: 100%; justify-content: space-between; }
  .exportbar { justify-content: stretch; }
  .exportbar .btn { flex: 1; }
}

/* Printing a page directly, rather than through the export iframe. */
@media print {
  .sidebar, .topbar, #topbarSlot, .exportbar, .expirybar, .menubtn { display: none !important; }
  .content, .inner { margin: 0; padding: 0; }
}

/* ============================================================== loading ====
   Every navigation is a fresh document, so there is always a gap between the
   click and the content. These two make the gap legible instead of looking
   like the app fell over.
   ========================================================================== */

/* ---- the bar across the top ---- */
.pageprog {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2.5px;
  z-index: 9999;
  pointer-events: none;
}
.pageprog > i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-lo), var(--accent) 45%, var(--accent-hi));
  box-shadow: 0 0 12px var(--accent-glow), 0 0 4px rgba(255, 122, 69, 0.7);
  transition: transform 0.28s var(--ease);
  will-change: transform;
}
/* Snap to the end, then get out of the way. */
.pageprog.done > i {
  transition: transform 0.16s ease-out, opacity 0.32s ease 0.14s;
  opacity: 0;
}

/* ---- skeletons ---- */
.skel {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.055), transparent);
  transform: translateX(-100%);
  animation: skelsweep 1.4s var(--ease) infinite;
}
@keyframes skelsweep { to { transform: translateX(100%); } }

.skel-line { height: 11px; margin: 0 0 9px; }
.skel-line:last-child { margin-bottom: 0; }
.skel-line.w40 { width: 40%; }
.skel-line.w55 { width: 55%; }
.skel-line.w70 { width: 70%; }
.skel-line.w85 { width: 85%; }
.skel-line.tall { height: 20px; }

/* A stat tile, a card and a table row, at the size of the real thing — so
   nothing jumps when the content replaces them. */
.skel-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.skel-tile {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px;
}
.skel-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px;
  margin: 0 0 10px;
}
.skel-table {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.skel-tr {
  display: flex;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.skel-tr:last-child { border-bottom: 0; }
.skel-tr > span { flex: 1; height: 11px; border-radius: 5px; }
.skel-tr > span:first-child { flex: 2; }

/* The sidebar put back from the last page. Everything works except signing
   out, which needs the module — the click is remembered and honoured the
   moment it is wired up. */
.sidebar.restored { opacity: 0.96; }

@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; }
  .pageprog > i { transition: none; }
}

/* ---- a crossfade between pages, where the browser can do it ----
   Cross-document view transitions are opt-in and ignored entirely by browsers
   that do not have them, so this is a free upgrade rather than a dependency.
   Kept short: a transition you notice is a transition that is too slow. */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.17s;
  animation-timing-function: var(--ease);
}

/* The bar is the one thing that must NOT fade between pages -- it is the part
   telling you the next page is on its way. */
.pageprog { view-transition-name: pageprog; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---- the plan end date, editable in the users table ---- */
.expiryinput {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  padding: 5px 8px;
  width: 148px;
  /* The native picker icon is near-black on a dark field otherwise. */
  color-scheme: dark;
}
.expiryinput:hover { border-color: var(--line-2); }
.expiryinput:focus { outline: none; border-color: var(--accent); }
.expiryinput:disabled { opacity: 0.5; }
/* Running out is worth seeing at a glance, without reading every date. */
.expiryinput.near { border-color: rgba(232, 84, 30, 0.45); }
.expiryinput.soon { border-color: rgba(255, 95, 86, 0.55); }

.expiryleft {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--faint);
}
.expiryleft.lapsed { color: var(--danger); }

/* ============================================================ CEK REKENING ==
   A bank picker beside the number, and the one line the whole lookup is for.
   ========================================================================== */

.cekrek-bar { flex-wrap: wrap; }
.bankpick { flex: 0 0 auto; min-width: 190px; }
.bankpick select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  padding: 12px 13px;
  color-scheme: dark;
}
.bankpick select:focus { outline: none; border-color: var(--accent); }
.bankpick select:disabled { opacity: 0.5; }

.rekcard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 18px 20px;
  margin-top: 18px;
}
.rekhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.rekbank { font-weight: 600; font-size: 14px; }
.rekacct { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }

/* The answer. Everything else on the page exists to produce this line. */
.rekname {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
}
.rekname .k {
  color: var(--faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.rekname strong {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent-hi);
}
.rekcard .sub { margin: 10px 0 0; font-size: 12px; }
.rekcard.notfound .empty { padding: 18px 0 4px; }

@media (max-width: 620px) {
  .bankpick { flex: 1 1 100%; min-width: 0; }
}

/* ---- NIK To FOTO: the "processing, up to 10 min" card ---- */
.foto-progress-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
}
.foto-progress-body > div { display: flex; flex-direction: column; gap: 3px; }
.foto-progress-body strong { font-size: 14px; }
.foto-progress-body .sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
