/* ============================================================
   ClearMint Essentials — Control Center "lux" layer
   A premium, Apple/Stripe-grade finish for the admin console.
   Loaded AFTER lite.css, hub.css, hub-cc.css so these win.

   Rules of the house:
   - Only existing design tokens (see lite.css :root) are used.
   - Emerald + graphite + light content surfaces, dark sidebar.
   - Soft gold (--gold) is a *rare* accent, never wallpaper.
   - Calm micro-interactions: 150–200ms eased transitions.
   - Every selector is scoped to the hub shell (.uj / .uj-content).
   ============================================================ */

/* ---- easing + focus tokens (scoped, no global :root overrides) ---- */
.uj-shell,
.uj-content,
.uj-side {
  --lux-ease: cubic-bezier(.2, .7, .3, 1);
  --lux-t: 170ms;
  --lux-focus: 0 0 0 3px var(--mint-100);
}

/* ============================================================
   SIDEBAR — refined dark emerald rail
   ============================================================ */
.uj-side {
  background: var(--ink-900);
  border-right: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .02);
}

/* subtle brand area up top */
.uj-side-hd {
  padding: 18px 16px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 90%);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.uj-side-hd h1 {
  letter-spacing: -.012em;
}

/* section labels: airier tracking, calmer tone */
.uj-sec-label {
  color: rgba(255, 255, 255, .30);
  font-size: 10px;
  letter-spacing: .12em;
  padding: 18px 10px 7px;
}

/* nav items: smooth hover, crisper resting state */
.uj-item {
  color: #a7b6aa;
  border-radius: 10px;
  padding: 8px 11px;
  transition:
    background var(--lux-t) var(--lux-ease),
    color var(--lux-t) var(--lux-ease),
    box-shadow var(--lux-t) var(--lux-ease),
    transform var(--lux-t) var(--lux-ease);
}
.uj-item:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}
.uj-item:active {
  transform: translateY(.5px);
}

/* active item: mint with a soft inset glow + hairline lift */
.uj-item.active {
  background: linear-gradient(180deg, var(--mint-400), var(--mint-500));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    0 6px 16px -8px rgba(15, 31, 46, .8);
}
.uj-item.active:hover {
  background: linear-gradient(180deg, var(--mint-400), var(--mint-500));
}
.uj-item.active .ct {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

/* count chips settle into the dark rail */
.uj-item .ct {
  font-variant-numeric: tabular-nums;
  transition: background var(--lux-t) var(--lux-ease);
}

.uj-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(93, 197, 154, .55);
}

/* ============================================================
   TOP BAR — quiet, serif title, hairline base
   ============================================================ */
.uj-top {
  min-height: 62px;
  box-shadow: 0 1px 0 rgba(15, 31, 46, .04);
}
.uj-top h2 {
  font-family: var(--font-serif);
  letter-spacing: -.015em;
}

/* ============================================================
   CONTENT RHYTHM
   ============================================================ */
.uj-content {
  padding: 24px 26px 64px;
}
.uj-content .kpis {
  gap: 16px;
  margin-bottom: 24px;
}
/* consistent vertical rhythm between stacked panels */
.uj-content .panel + .panel,
.uj-content .kpis + .panel {
  margin-top: 20px;
}

/* ============================================================
   KPI CARDS — crisp hierarchy, hairline accent, hover lift
   ============================================================ */
.uj-content .kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px 17px;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--lux-t) var(--lux-ease),
    box-shadow var(--lux-t) var(--lux-ease),
    border-color var(--lux-t) var(--lux-ease);
}
.uj-content .kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--mint-200);
}

/* hairline top accent — thin, mint, calm */
.uj-content .kpi::before {
  height: 2px;
  background: var(--mint-300);
  opacity: .85;
}

/* label: small, uppercase, quietly tracked */
.uj-content .kpi .lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-500);
}

/* value: the hero — tabular mono, tight leading */
.uj-content .kpi .val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.02;
  color: var(--ink-900);
  margin-top: 9px;
}

/* sub: muted footnote */
.uj-content .kpi .sub {
  font-size: 11.5px;
  color: var(--ink-500);
  margin-top: 6px;
}

/* ---- the premium accent card ---- */
.uj-content .kpi.accent {
  background: linear-gradient(155deg, var(--mint-600), var(--mint-700));
  border-color: transparent;
  color: #fff;
  box-shadow:
    0 10px 26px -12px var(--mint-700),
    0 2px 10px -4px rgba(212, 169, 93, .28),   /* rare gold-tinted lift */
    inset 0 1px 0 rgba(255, 255, 255, .16);    /* soft inner highlight */
}
.uj-content .kpi.accent:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 34px -14px var(--mint-700),
    0 3px 12px -4px rgba(212, 169, 93, .34),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  border-color: transparent;
}
.uj-content .kpi.accent::before {
  height: 2px;
  background: var(--gold-soft);
  opacity: .9;
}
/* soft top-corner sheen */
.uj-content .kpi.accent::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 100% 0, rgba(255, 255, 255, .16), transparent 58%);
  pointer-events: none;
}
.uj-content .kpi.accent .lbl,
.uj-content .kpi.accent .sub {
  color: rgba(255, 255, 255, .86);
}
.uj-content .kpi.accent .val {
  color: #fff;
}

/* ============================================================
   PANELS — layered shadow, marked header, generous body
   ============================================================ */
.uj-content .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow:
    0 1px 2px rgba(15, 31, 46, .04),
    0 8px 24px -16px rgba(15, 31, 46, .18);
  overflow: hidden;
  transition:
    box-shadow var(--lux-t) var(--lux-ease),
    border-color var(--lux-t) var(--lux-ease);
}
.uj-content .panel:hover {
  box-shadow:
    0 1px 2px rgba(15, 31, 46, .05),
    0 14px 34px -18px rgba(15, 31, 46, .24);
  border-color: var(--line-strong);
}

/* header: hairline base + a small emerald marker before the title */
.uj-content .panel .head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.uj-content .panel .head h3 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.012em;
  color: var(--ink-900);
}
.uj-content .panel .head h3::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--mint-400), var(--mint-600));
}
/* rare gold marker on the accented / primary panel, if flagged */
.uj-content .panel.accent .head h3::before,
.uj-content .panel.gold .head h3::before {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
}

.uj-content .panel .body {
  padding: 20px;
}

/* thin gold divider utility (rare, opt-in) */
.uj-content .panel .body hr.gold,
.uj-content .lux-divider {
  height: 1px;
  border: 0;
  margin: 16px 0;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  opacity: .7;
}

/* ============================================================
   TABLES — airy rows, refined header, right-aligned numerics
   ============================================================ */
.uj-content .uj-table {
  width: 100%;
  border-collapse: collapse;
}
.uj-content .uj-table th {
  color: var(--ink-500);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.uj-content .uj-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-700);
  transition: background var(--lux-t) var(--lux-ease);
}
.uj-content .uj-table tbody tr {
  transition: background var(--lux-t) var(--lux-ease);
}
.uj-content .uj-table tbody tr:hover td {
  background: var(--surface-2);
}
.uj-content .uj-table tbody tr:last-child td {
  border-bottom: 0;
}
/* numerics: right-aligned tabular mono */
.uj-content .uj-table td.num,
.uj-content .uj-table th.num,
.uj-content .uj-table td.amount,
.uj-content .uj-table th.amount {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* ============================================================
   PILLS — keep app language, tighten the type
   ============================================================ */
.uj-content .pill {
  font-weight: 600;
  letter-spacing: .01em;
}

/* ============================================================
   BUTTONS / SEARCH — soft focus ring, gentle press
   ============================================================ */
.uj-btn {
  transition:
    background var(--lux-t) var(--lux-ease),
    border-color var(--lux-t) var(--lux-ease),
    box-shadow var(--lux-t) var(--lux-ease),
    transform var(--lux-t) var(--lux-ease);
}
.uj-btn:active {
  transform: translateY(.5px);
}
.uj-btn:focus-visible,
.uj-search:focus-within,
.uj-search input:focus,
.uj-content .uj-table select:focus {
  outline: none;
  box-shadow: var(--lux-focus);
  border-color: var(--mint-400);
}
.uj-btn.dark:focus-visible {
  box-shadow: 0 0 0 3px var(--mint-100);
}

/* filter chips: eased transitions to match the rest */
.uj-chip {
  transition:
    background var(--lux-t) var(--lux-ease),
    border-color var(--lux-t) var(--lux-ease),
    color var(--lux-t) var(--lux-ease);
}
.uj-chip:focus-visible {
  outline: none;
  box-shadow: var(--lux-focus);
}

/* ============================================================
   EMPTY STATES — intentional, calm, icon bubble + muted copy
   ============================================================ */
.uj-content .uj-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-500);
}
.uj-content .uj-empty svg,
.uj-content .uj-empty .ic {
  width: 22px;
  height: 22px;
  color: var(--mint-500);
}
/* icon bubble: soft mint disc behind the glyph */
.uj-content .uj-empty svg,
.uj-content .uj-empty .ico,
.uj-content .uj-empty .ic {
  box-sizing: content-box;
}
.uj-content .uj-empty > svg:first-child,
.uj-content .uj-empty > .ic:first-child {
  padding: 12px;
  border-radius: 999px;
  background: var(--tint);
  border: 1px solid var(--mint-100);
}
.uj-content .uj-empty .t,
.uj-content .uj-empty strong {
  color: var(--ink-700);
  font-weight: 600;
  font-size: 14px;
}
.uj-content .uj-empty .sub,
.uj-content .uj-empty p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-500);
  max-width: 340px;
}

/* ============================================================
   MOTION HYGIENE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .uj-item,
  .uj-btn,
  .uj-chip,
  .uj-content .kpi,
  .uj-content .panel,
  .uj-content .uj-table td,
  .uj-content .uj-table tbody tr {
    transition: none;
  }
  .uj-content .kpi:hover,
  .uj-content .kpi.accent:hover,
  .uj-btn:active,
  .uj-item:active {
    transform: none;
  }
}
