/* Visa Bot admin console — macaron dark glass theme. */

[v-cloak] {
  display: none;
}

:root {
  color-scheme: dark;

  /* Macaron palette: sakura pink leads, lilac supports, mint and butter
     carry the success and warning accents. */
  --jk-pink: #ff9ecb;
  --jk-lilac: #b9a3ff;
  --jk-bg-start: #140a1e;
  --jk-bg-end: #1d1029;
  --jk-glow-1: #ff9ecb26;
  --jk-glow-2: #b9a3ff1f;
  --jk-grid-line: #ff9ecb12;
  --jk-scanline: #ffffff05;
  --jk-panel: #241a31b8;
  --jk-panel-border: #ff9ecb2e;
  --jk-panel-border-strong: #ff9ecb59;
  --jk-panel-shadow: 0 18px 45px #1a0a2259;
  --jk-panel-inset: inset 0 1px 0 #ffffff14;
  --jk-menu-active-bg: #ff9ecb1a;

  --jk-danger: #ff7fa8;
  --jk-success: #7ee0c2;
  --jk-warning: #ffd18a;

  --jk-text-primary: #fdf1f8;
  --jk-text-regular: #dcc8e0;
  --jk-text-secondary: #a390b5;

  /* Translucent surfaces that adapt to the active theme. */
  --jk-soft: #ffffff0a;
  --jk-soft-strong: #ffffff0f;
  --jk-soft-faint: #ffffff08;
  --jk-input-bg: #1b1127cc;
  --jk-inset-bg: #1b112780;
  --jk-canvas: #140a1e;
  --jk-scroll-thumb: #ff9ecb33;

  /* ui-rounded and the rounded CJK faces give the console its soft look on
     Apple platforms; everything else falls back to plain system sans. */
  --jk-font: ui-rounded, "SF Pro Rounded", "Yuanti SC", "Hiragino Maru Gothic ProN", Nunito, Quicksand, Inter, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --jk-font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;
}

/* Day theme: same layout, a soft cream-and-pink palette. */
html.light {
  color-scheme: light;

  --jk-pink: #e0568f;
  --jk-lilac: #8b6cf0;
  --jk-bg-start: #fff6fb;
  --jk-bg-end: #f3ecff;
  --jk-glow-1: #ff9ecb33;
  --jk-glow-2: #b9a3ff2e;
  --jk-grid-line: #e0568f14;
  --jk-scanline: #2b133005;
  --jk-panel: #ffffffd9;
  --jk-panel-border: #e0568f33;
  --jk-panel-border-strong: #e0568f59;
  --jk-panel-shadow: 0 18px 40px #4a2a501f;
  --jk-panel-inset: inset 0 1px 0 #ffffffcc;
  --jk-menu-active-bg: #e0568f1a;

  --jk-danger: #d81b60;
  --jk-success: #0f9a7d;
  --jk-warning: #c98a1f;

  --jk-text-primary: #33153f;
  --jk-text-regular: #5c4568;
  --jk-text-secondary: #8a7695;

  --jk-soft: #33153f0f;
  --jk-soft-strong: #33153f14;
  --jk-soft-faint: #33153f0a;
  --jk-input-bg: #ffffff;
  --jk-inset-bg: #faf3fdcc;
  --jk-canvas: #f7eefb;
  --jk-scroll-thumb: #e0568f33;
}

html.light .stat-card__value {
  text-shadow: none;
}

html.light .status.paid {
  color: #0f9a7d;
}

html.light .status.pending {
  color: #b57d1a;
}

html.light .status.expired {
  color: #c2185b;
}

html.light .status.issued {
  color: #0f9a7d;
}

html.light .status.rejected {
  color: #c2185b;
}

html.light .status.active {
  color: #0f9a7d;
}

html.light .status.frozen {
  color: #b57d1a;
}

html.light .status.deleted {
  color: #c2185b;
}

html.light .amount-credit {
  color: #0f9a7d;
}

html.light .amount-debit {
  color: #c2185b;
}

html.light button.danger {
  color: #b3620a;
  background: #ffb06626;
  box-shadow: inset 0 0 0 1px #e0862e66;
}

html.light .login-error {
  color: #c2185b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
}

html {
  font-family: var(--jk-font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  color: var(--jk-text-primary);
  background:
    radial-gradient(1200px 600px at 12% -10%, var(--jk-glow-1), transparent 60%),
    radial-gradient(1000px 520px at 100% 0%, var(--jk-glow-2), transparent 55%),
    linear-gradient(160deg, var(--jk-bg-start) 0%, var(--jk-bg-end) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--jk-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--jk-grid-line) 1px, transparent 1px),
    repeating-linear-gradient(180deg, var(--jk-scanline) 0px, var(--jk-scanline) 1px, transparent 1px, transparent 3px);
  background-size: 42px 42px, 42px 42px, 100% 3px;
  mask-image: radial-gradient(120% 120% at 50% 0, #000 40%, #00000059 100%);
  -webkit-mask-image: radial-gradient(120% 120% at 50% 0, #000 40%, #00000059 100%);
}

/* ---------------------------------------------------------------- shell */

.glass-panel {
  background: var(--jk-panel);
  border: 1px solid var(--jk-panel-border);
  border-radius: 20px;
  box-shadow: var(--jk-panel-shadow), var(--jk-panel-inset);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.layout {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  height: 100vh;
  /* Dynamic viewport units keep the shell from being clipped by the
     mobile browser's address bar; ignored by browsers that lack support. */
  height: 100dvh;
  padding: 18px;
  overflow: hidden;
}

.layout__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.layout__main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
}

.layout__main::-webkit-scrollbar {
  width: 8px;
}

.layout__main::-webkit-scrollbar-thumb {
  background: var(--jk-scroll-thumb);
  border-radius: 8px;
}

/* -------------------------------------------------------------- sidebar */

.sidebar {
  flex: 0 0 236px;
  width: 236px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 12px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--jk-panel-border);
}

.sidebar__logo {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: block;
  box-shadow: 0 0 18px #ff9ecb4d;
}

.login-logo {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 0 12px;
  border-radius: 16px;
  box-shadow: 0 0 24px #ff9ecb4d;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar__brand-text strong {
  font-size: 13.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__brand-text small {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jk-text-secondary);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--jk-text-regular);
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-item:hover {
  background: var(--jk-soft);
  color: var(--jk-text-primary);
}

.nav-item.active {
  color: var(--jk-text-primary);
  background: linear-gradient(90deg, var(--jk-menu-active-bg), #b9a3ff29);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border-strong);
}

.nav-item__label {
  font-size: 13.5px;
  font-weight: 600;
}

.nav-item__desc {
  font-size: 11px;
  color: var(--jk-text-secondary);
}

/* --------------------------------------------------------------- header */

.app-header {
  flex: 0 0 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--jk-text-regular);
  background: var(--jk-soft);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jk-success);
  box-shadow: 0 0 10px var(--jk-success);
  animation: jk-pulse 2s ease-in-out infinite;
}

@keyframes jk-pulse {
  50% {
    opacity: 0.4;
  }
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* -------------------------------------------------------------- controls */

button {
  font-family: inherit;
  border: 0;
  border-radius: 14px;
  padding: 9px 15px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.primary {
  color: #2b1330;
  font-weight: 700;
  background: linear-gradient(140deg, var(--jk-pink), var(--jk-lilac));
  box-shadow: 0 8px 22px #ff9ecb33;
}

button.primary:hover:not(:disabled) {
  box-shadow: 0 10px 28px #ff9ecb52;
}

button.secondary {
  color: var(--jk-text-regular);
  background: var(--jk-soft-strong);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

button.secondary:hover:not(:disabled) {
  color: var(--jk-text-primary);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border-strong);
}

/* Destructive actions use an amber warning tone rather than the brand magenta,
   which read as red. */
button.danger {
  color: #ffb066;
  background: #ffb0661f;
  box-shadow: inset 0 0 0 1px #ffb06647;
}

button.danger:hover:not(:disabled) {
  color: #ffe6c7;
  background: #ffb0662e;
  box-shadow: inset 0 0 0 1px #ffb0666b;
}

.lang-switch,
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 14px;
  background: var(--jk-soft);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.lang-switch button,
.seg button {
  padding: 6px 12px;
  border-radius: 11px;
  font-size: 12px;
  color: var(--jk-text-secondary);
  background: transparent;
}

.lang-switch button.active,
.seg button.active {
  color: #2b1330;
  font-weight: 600;
  background: linear-gradient(140deg, var(--jk-pink), var(--jk-lilac));
}

/* --------------------------------------------------------- sub tabs */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 18px;
  background: var(--jk-soft);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.tabs button {
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--jk-text-secondary);
  background: transparent;
}

.tabs button.active {
  color: #2b1330;
  font-weight: 600;
  background: linear-gradient(140deg, var(--jk-pink), var(--jk-lilac));
}

/* Save bar at the foot of each configuration group. */

.config-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--jk-panel-border);
}

/* --------------------------------------------------------- page header */

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-header__mark {
  flex: 0 0 4px;
  width: 4px;
  height: 34px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--jk-pink), var(--jk-lilac));
  box-shadow: 0 0 14px #ff9ecb8c;
}

.page-header__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.page-header__text h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.page-header__text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--jk-text-secondary);
}

.page-header__actions {
  margin-left: auto;
}

/* ------------------------------------------------------------ surfaces */

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.card__subtitle {
  margin: 6px 0 -4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--jk-text-secondary);
  letter-spacing: 0.02em;
}

.hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--jk-text-secondary);
}

/* ---------------------------------------------------------- stat cards */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 18px;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--jk-pink), var(--jk-lilac));
}

.stat-card__label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jk-text-secondary);
}

.stat-card__value {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--jk-text-primary);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px #ff9ecb47;
}

.stat-card--violet::after {
  background: linear-gradient(90deg, var(--jk-lilac), var(--jk-pink));
}

.stat-card--violet .stat-card__value {
  text-shadow: 0 0 18px #b9a3ff47;
}

.stat-card--success::after {
  background: linear-gradient(90deg, var(--jk-success), var(--jk-pink));
}

.stat-card--success .stat-card__value {
  text-shadow: 0 0 18px #7ee0c247;
}

.stat-card--warning::after {
  background: linear-gradient(90deg, var(--jk-warning), var(--jk-lilac));
}

.stat-card--warning .stat-card__value {
  text-shadow: 0 0 18px #ffd18a47;
}

.stat-card--danger::after {
  background: linear-gradient(90deg, var(--jk-danger), var(--jk-lilac));
}

.stat-card--danger .stat-card__value {
  text-shadow: 0 0 18px #ff7fa847;
}

/* ------------------------------------------------------------ charts */

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chart-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.chart-head p {
  margin: 0;
  font-size: 12px;
  color: var(--jk-text-secondary);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--jk-text-secondary);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-dot.cyan {
  background: var(--jk-pink);
  box-shadow: 0 0 8px #ff9ecb8c;
}

.legend-dot.green {
  background: var(--jk-success);
  box-shadow: 0 0 8px #7ee0c28c;
}

.legend-dot.amber {
  background: var(--jk-warning);
  box-shadow: 0 0 8px #ffd18a8c;
}

.chart-svg {
  width: 100%;
  height: 240px;
  display: block;
}

.axis-line {
  stroke: #ff9ecb2e;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.cyan {
  stroke: var(--jk-pink);
}

.chart-line.green {
  stroke: var(--jk-success);
}

.chart-line.amber {
  stroke: var(--jk-warning);
}

.chart-dot {
  stroke: var(--jk-canvas);
  stroke-width: 2;
}

.chart-dot.cyan {
  fill: var(--jk-pink);
}

.chart-dot.green {
  fill: var(--jk-success);
}

.chart-dot.amber {
  fill: var(--jk-warning);
}

.chart-bar {
  fill: url(#barGrad);
}

.chart-label {
  fill: var(--jk-text-secondary);
  font-size: 11px;
}

.chart-value {
  fill: var(--jk-text-primary);
  font-size: 11px;
}

/* ------------------------------------------------------------ tables */

/* Query bar above a table: a username / TGID box plus query and reset. */
.table-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.table-filter input {
  flex: 1 1 200px;
  max-width: 320px;
}

.table-filter button {
  flex: 0 0 auto;
}

.table-filter__status {
  flex: 0 0 auto;
}

.table-filter__status select {
  width: auto;
}

/* Pager below a table: row range, page size picker and prev / next. */
.table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.table-pager__info,
.table-pager__page {
  color: var(--jk-text-secondary);
  font-size: 13px;
}

.table-pager__size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--jk-text-secondary);
  font-size: 13px;
}

.table-pager__size select {
  width: auto;
}

.table-pager__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-pager__nav button {
  flex: 0 0 auto;
}

.table-wrap {
  overflow: auto;
}

.table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.table th {
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jk-text-secondary);
  border-bottom: 1px solid var(--jk-panel-border);
}

.table td {
  padding: 12px;
  font-size: 13px;
  color: var(--jk-text-regular);
  border-bottom: 1px solid var(--jk-soft);
}

.table tbody tr:hover td {
  background: var(--jk-soft-faint);
  color: var(--jk-text-primary);
}

.empty {
  margin: 0;
  padding: 22px 0;
  text-align: center;
  color: var(--jk-text-secondary);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--jk-text-regular);
  background: var(--jk-soft-strong);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.status.paid {
  color: #8febd0;
  background: #7ee0c21f;
  box-shadow: inset 0 0 0 1px #7ee0c247;
}

.status.pending {
  color: #ffd98e;
  background: #ffd18a1f;
  box-shadow: inset 0 0 0 1px #ffd18a47;
}

.status.issued {
  color: #8febd0;
  background: #7ee0c21f;
  box-shadow: inset 0 0 0 1px #7ee0c247;
}

.status.rejected {
  color: #ffb0c6;
  background: #ff7fa81f;
  box-shadow: inset 0 0 0 1px #ff7fa847;
}

.status.expired {
  color: #ffb0c6;
  background: #ff7fa81f;
  box-shadow: inset 0 0 0 1px #ff7fa847;
}

.status.active {
  color: #8febd0;
  background: #7ee0c21f;
  box-shadow: inset 0 0 0 1px #7ee0c247;
}

.status.frozen {
  color: #ffd98e;
  background: #ffd18a1f;
  box-shadow: inset 0 0 0 1px #ffd18a47;
}

.status.deleted {
  color: #ffb0c6;
  background: #ff7fa81f;
  box-shadow: inset 0 0 0 1px #ff7fa847;
}

.status.draft {
  color: var(--jk-text-regular);
  background: var(--jk-soft-strong);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.status.sending {
  color: #ffd98e;
  background: #ffd18a1f;
  box-shadow: inset 0 0 0 1px #ffd18a47;
}

.status.sent {
  color: #8febd0;
  background: #7ee0c21f;
  box-shadow: inset 0 0 0 1px #7ee0c247;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.amount-credit {
  color: #8febd0;
  font-variant-numeric: tabular-nums;
}

.amount-debit {
  color: #ffb0c6;
  font-variant-numeric: tabular-nums;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.row-actions button {
  padding: 6px 11px;
  font-size: 12px;
  white-space: nowrap;
}

/* ------------------------------------------------------------- forms */

.grid {
  display: grid;
  gap: 14px;
}

.grid.one {
  grid-template-columns: 1fr;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label span {
  font-size: 12.5px;
  color: var(--jk-text-secondary);
}

input,
textarea,
select,
code {
  font-family: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--jk-panel-border);
  border-radius: 14px;
  font-size: 13px;
  color: var(--jk-text-primary);
  background: var(--jk-input-bg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--jk-pink);
  box-shadow: 0 0 0 3px #ff9ecb26;
}

.grid .full {
  grid-column: 1 / -1;
}

textarea {
  resize: vertical;
  line-height: 1.5;
  font-family: var(--jk-font-mono);
}

input[type="file"] {
  padding: 8px 10px;
  font-size: 12px;
}

/* ------------------------------------------------------------ banners */

.banner-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--jk-inset-bg);
  border: 1px solid var(--jk-panel-border);
}

.banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.banner-head strong {
  font-size: 13px;
}

.banner-head code {
  font-family: var(--jk-font-mono);
  font-size: 11px;
  color: var(--jk-pink);
}

.banner-preview {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--jk-panel-border);
  background: var(--jk-canvas);
}

/* ---------------------------------------------------------------- ads */

.ad-compose {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.ad-compose > .primary {
  margin-left: auto;
}

.ad-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ad-preview img,
.ad-preview-img {
  max-width: 240px;
  max-height: 140px;
  border-radius: 14px;
  border: 1px solid var(--jk-panel-border);
  background: var(--jk-canvas);
  object-fit: cover;
}

.ad-thumb {
  width: 64px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--jk-panel-border);
  object-fit: cover;
  vertical-align: middle;
}

.ad-body {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--jk-text-primary);
  background: var(--jk-soft-faint);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

/* Bulk action bar, shown once at least one ad row is ticked. */

.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--jk-soft-faint);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.bulkbar__count {
  margin-right: auto;
  font-size: 13px;
  color: var(--jk-text-regular);
}

/* Compact list of rows inside a confirmation dialog. */

.modal__list {
  max-height: 200px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border-radius: 14px;
  background: var(--jk-soft-faint);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.modal__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 11px;
  font-size: 13px;
  color: var(--jk-text-primary);
}

.modal__list li:hover {
  background: var(--jk-soft-strong);
}

.modal__list-id {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--jk-text-secondary);
}

.modal__list-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recipient picker of the send dialog. It reuses label and input, so both are
   reset back to an inline flow inside a row. */

.audience {
  margin-top: 14px;
}

.audience input[type="checkbox"],
.table__check input[type="checkbox"] {
  flex: none;
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--jk-pink);
}

.table__check {
  width: 38px;
  text-align: center;
}

.audience__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audience__all,
.audience__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.audience__all span {
  font-size: 13px;
  color: var(--jk-text-regular);
}

.audience__search {
  margin-top: 10px;
}

.audience__search:disabled {
  opacity: 0.5;
}

.audience__list {
  max-height: 220px;
  margin-top: 8px;
  padding: 6px;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--jk-soft-faint);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.audience__item {
  padding: 6px 8px;
  border-radius: 11px;
}

.audience__item:hover {
  background: var(--jk-soft-strong);
}

.audience__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--jk-text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience__id {
  flex: none;
  font-size: 12px;
  color: var(--jk-text-secondary);
  font-variant-numeric: tabular-nums;
}

.audience__count {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--jk-text-secondary);
}

/* -------------------------------------------------------------- modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #2b1330b8;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal__panel {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.modal__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal__panel--narrow {
  max-width: 460px;
}

.modal__badge {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffb0c6;
  background: #ff7fa81f;
  box-shadow: inset 0 0 0 1px #ff7fa847;
}

html.light .modal__badge {
  color: #c2185b;
}

.modal__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 0;
}

.modal__facts > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 14px;
  background: var(--jk-soft-faint);
  box-shadow: inset 0 0 0 1px var(--jk-panel-border);
}

.modal__facts dt {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--jk-text-secondary);
}

.modal__facts dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--jk-text-primary);
  overflow-wrap: anywhere;
}

.note-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal__notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #ffb0c6;
  background: #ff7fa814;
  box-shadow: inset 0 0 0 1px #ff7fa833;
}

html.light .modal__notice {
  color: #c2185b;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* -------------------------------------------------------------- toast */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  color: #2b1330;
  font-weight: 600;
  background: linear-gradient(140deg, var(--jk-pink), var(--jk-lilac));
  box-shadow: 0 14px 36px #2b133066;
}

.toast.error {
  color: var(--jk-text-primary);
  background: linear-gradient(140deg, var(--jk-danger), var(--jk-lilac));
}

/* -------------------------------------------------------------- login */

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.login-glow {
  position: fixed;
  z-index: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.login-glow--a {
  top: -80px;
  left: -60px;
  width: 380px;
  height: 380px;
  background: #ff9ecb66;
  animation: jk-float-a 12s ease-in-out infinite;
}

.login-glow--b {
  right: -80px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  background: #b9a3ff66;
  animation: jk-float-b 15s ease-in-out infinite;
}

@keyframes jk-float-a {
  50% {
    transform: translate(60px, 40px) scale(1.08);
  }
}

@keyframes jk-float-b {
  50% {
    transform: translate(-50px, -40px) scale(1.06);
  }
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 16px;
  padding: 30px;
  border-radius: 24px;
}

.login-head h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.login-switches {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.login-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--jk-text-secondary);
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: center;
}

.captcha-image {
  width: 132px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--jk-panel-border);
  background: var(--jk-canvas);
  cursor: pointer;
  user-select: none;
}

.login-error {
  margin: 0;
  min-height: 18px;
  font-size: 12.5px;
  color: #ffb0c6;
}

.login-submit {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  letter-spacing: 2px;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .charts-grid,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    padding: 12px;
  }

  .sidebar {
    flex: none;
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar__brand {
    flex: 0 0 auto;
    padding: 0 14px 0 6px;
    border-right: 1px solid var(--jk-panel-border);
    border-bottom: 0;
  }

  .sidebar__nav {
    flex-direction: row;
    gap: 8px;
  }

  .nav-item {
    width: auto;
    min-height: 44px;
    padding: 10px 14px;
    white-space: nowrap;
    justify-content: center;
  }

  .nav-item__desc {
    display: none;
  }

  /* The header keeps a single compact row; the action cluster scrolls
     horizontally instead of stacking into a tall block. */
  .app-header {
    flex: none;
    height: auto;
    min-height: 54px;
    padding: 8px 12px;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .app-header__left {
    flex: 0 0 auto;
  }

  .app-header__right {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .actions button,
  .seg button,
  .tabs button,
  .page-header__actions button {
    min-height: 40px;
  }

  .seg button {
    padding: 8px 12px;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-height: 42px;
  }

  .config-actions button {
    min-height: 40px;
  }

  .layout__main {
    overflow: visible;
  }

  .page-header {
    flex-wrap: wrap;
  }
}

/* ---------------------------------------------------------- phone layout */
/* Below 600px the data tables collapse into stacked cards: every row becomes
   a card, each cell shows its column name (from data-label) above the value,
   and the action buttons sit in a full-width row. */
@media (max-width: 600px) {
  .layout {
    gap: 12px;
    padding: 10px;
  }

  .layout__body {
    gap: 12px;
  }

  .layout__main {
    gap: 12px;
    padding-right: 0;
  }

  .sidebar__brand-text small {
    display: none;
  }

  /* The "system online" badge is decorative; dropping it on phones keeps the
     header a single row and leaves room for the action buttons without a
     long horizontal scroll. */
  .app-header__left {
    display: none;
  }

  .actions {
    gap: 8px;
  }

  /* Every tappable control gets a finger-sized hit area on phones. */
  button {
    min-height: 40px;
  }

  /* The note column stops truncating in card mode: the full text wraps. */
  .table td.note-cell {
    max-width: none;
    white-space: normal;
  }

  .card {
    padding: 12px;
  }

  .table {
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tbody tr {
    position: relative;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--jk-panel-border);
    border-radius: 16px;
    background: var(--jk-inset-bg);
  }

  .table tbody tr:hover td {
    background: transparent;
  }

  .table td {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--jk-soft);
    overflow-wrap: anywhere;
  }

  .table td:last-child {
    border-bottom: 0;
  }

  .table td::before {
    content: attr(data-label);
    flex: 0 0 36%;
    max-width: 42%;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--jk-text-secondary);
  }

  /* The checkbox lives in the card's top-right corner. */
  .table td.table__check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .table td.table__check::before {
    content: none;
  }

  .table td.table__check input {
    width: 20px;
    height: 20px;
  }

  /* Action row: label on the left, buttons wrapping underneath. */
  .table td.table__actions {
    display: block;
    padding-top: 10px;
  }

  .table td.table__actions::before {
    content: none;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .row-actions button {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 10px 12px;
    font-size: 12.5px;
  }

  /* The empty-state row is a message, not a record card. */
  .table tr td.empty {
    display: block;
    padding: 18px 0;
    text-align: center;
    border: 0;
  }

  .table tr td.empty::before {
    content: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabs button {
    flex: 0 0 auto;
  }

  .config-actions {
    justify-content: stretch;
  }

  .config-actions button {
    width: 100%;
    min-height: 44px;
  }

  .page-header {
    align-items: flex-start;
  }

  .modal {
    padding: 12px;
  }

  .modal__panel {
    padding: 16px;
    max-height: 88vh;
    max-height: 88dvh;
  }

  .modal__actions {
    flex-wrap: wrap;
  }

  .modal__facts {
    grid-template-columns: 1fr;
  }

  .modal__actions button {
    flex: 1 1 auto;
    min-height: 44px;
  }

  /* A 16px control font stops iOS Safari from zooming in on focus. */
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
    text-align: center;
  }

  .login-body {
    padding: 16px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
  }

  .login-card {
    padding: 20px;
  }

  .captcha-row {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .captcha-image {
    width: 112px;
  }

  .login-submit {
    min-height: 48px;
  }
}

/* ---------------------------------------------------------------- splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--jk-bg-start);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash--out {
  opacity: 0;
  visibility: hidden;
}

.splash__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--jk-glow-1), transparent 62%);
  filter: blur(26px);
  animation: splash-pulse 0.8s ease-in-out infinite;
}

.splash__logo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  box-shadow: 0 0 46px #ff9ecb66;
  animation: splash-logo 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash__name {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--jk-text-primary);
  animation: splash-name 0.6s ease 0.1s both;
}

.splash__bar {
  position: relative;
  width: 168px;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--jk-soft-strong);
}

.splash__bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--jk-pink), var(--jk-lilac));
  animation: splash-bar 0.85s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes splash-logo {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.82);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes splash-name {
  from {
    opacity: 0;
    letter-spacing: 0.5em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.22em;
  }
}

@keyframes splash-bar {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes splash-pulse {
  0%,
  100% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.06);
  }
}
