:root {
  --bg: #060706;
  --panel: rgba(16, 18, 17, 0.94);
  --panel-2: rgba(22, 25, 23, 0.9);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(185, 255, 102, 0.24);
  --text: #f3f7f1;
  --muted: #8f9b91;
  --soft: #c8d6ca;
  --accent: #b9ff66;
  --accent-2: #4ad8ff;
  --accent-3: #ffd86b;
  --danger: #ff7a90;
  --ok: #7dffb2;
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-main: "Noto Sans", system-ui, sans-serif;
  --font-ar: "Noto Kufi Arabic", "Noto Sans", sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Noto Kufi Arabic", serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(860px 520px at 86% -10%, rgba(185, 255, 102, 0.11), transparent 62%),
    radial-gradient(680px 420px at 6% 20%, rgba(74, 216, 255, 0.08), transparent 58%),
    linear-gradient(180deg, #070907, #050605 52%, #070807);
  color: var(--text);
  font-family: var(--font-main);
  letter-spacing: 0;
}

j-layout, j-page, j-card, j-card-section, j-header, j-footer, j-drawer, j-list, j-list-item,
j-table, j-tr, j-th, j-td, j-chip, j-badge, j-form, j-field { display: block; }
j-icon, .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ── Shared OpenVEE notary header strip (glyph monogram + dashed lime divider) ──
   The same stamped-document language as the marketing site. Reused on every
   panel-card so admin/portal read as one product surface, not window chrome. */
.notary-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px dashed rgba(185, 255, 102, 0.18);
  font-family: var(--font-main);
  font-size: 0.72rem;
}
.notary-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}
.notary-glyph {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px 2px 7px 2px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #06110a;
  font-weight: 900;
  font-size: 0.82rem;
  line-height: 1;
  box-shadow: 0 0 14px rgba(185, 255, 102, 0.4);
}
.notary-label {
  color: var(--muted);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Shell ── */
.ops-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(420px 300px at 20% 0%, rgba(185, 255, 102, 0.06), transparent 70%),
    rgba(5, 7, 6, 0.9);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-height: 48px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.brand__chip {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  /* notched seal corner, echoing the notary glyph */
  border-radius: 12px 3px 12px 3px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(140deg, rgba(185, 255, 102, 0.2), rgba(74, 216, 255, 0.08));
  color: var(--accent);
  box-shadow: inset 0 0 14px rgba(185, 255, 102, 0.16), 0 0 18px rgba(185, 255, 102, 0.12);
}
.brand__copy { display: grid; gap: 0.12rem; }
.brand__copy strong { font-size: 0.98rem; letter-spacing: 0.2px; }
.brand__copy small {
  color: var(--accent-2);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}
.side-nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.2rem;
}
/* section label above the nav */
.side-nav::before {
  content: "MENU";
  padding: 0 0.8rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}
.side-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.18s, color 0.18s;
}
.side-nav__link j-icon { color: var(--accent-2); transition: color 0.18s; }
.side-nav__link:hover { background: rgba(185, 255, 102, 0.06); color: var(--text); }
/* active route (runtime adds j-router-link--active / aria-current) */
.side-nav__link.j-router-link--active,
.side-nav__link[aria-current="page"] {
  background: rgba(185, 255, 102, 0.1);
  color: var(--accent);
}
.side-nav__link.j-router-link--active::before,
.side-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.side-nav__link.j-router-link--active j-icon,
.side-nav__link[aria-current="page"] j-icon { color: var(--accent); }

/* role / meta badge */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.data-table--users j-tr { grid-template-columns: 1.6fr 0.8fr 0.9fr 0.7fr; }
.sidebar-foot {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.8rem;
}
.language-select select {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0 0.8rem;
  font: inherit;
}
.language-select select option { background: #0c0f0d; }
.shell-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 7, 6, 0.82);
  backdrop-filter: blur(16px);
}
.topbar__title { display: grid; gap: 0.12rem; }
.topbar__title strong { font-size: 0.98rem; }
.topbar__title span { color: var(--muted); font-size: 0.78rem; }
.topbar__actions { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }

/* ── Status chips ── */
.status-chip,
j-chip.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 30px;
  width: max-content;
  padding: 0.28rem 0.6rem 0.28rem 0.5rem;
  border: 1px solid rgba(185, 255, 102, 0.22);
  border-radius: 999px;
  background: rgba(185, 255, 102, 0.08);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}
/* leading status dot for at-a-glance scanning */
.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-chip--warn { border-color: rgba(255, 216, 107, 0.3); background: rgba(255, 216, 107, 0.09); color: var(--accent-3); }
.status-chip--danger { border-color: rgba(255, 122, 144, 0.3); background: rgba(255, 122, 144, 0.09); color: var(--danger); }
.status-chip--info { border-color: rgba(74, 216, 255, 0.3); background: rgba(74, 216, 255, 0.09); color: var(--accent-2); }
.status-chip--muted { border-color: var(--line); background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.status-chip--muted::before { box-shadow: none; opacity: 0.6; }

/* ── Dashboard ── */
.dashboard { padding: 1.5rem; }
.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.1rem;
  padding: 1.4rem;
  overflow: hidden;
  /* asymmetric notch → stamped receipt, not a plain rectangle */
  border: 1px solid var(--line-strong);
  border-radius: 16px 6px 16px 6px;
  background:
    radial-gradient(rgba(185, 255, 102, 0.06) 1px, transparent 1px) 0 0 / 16px 16px,
    radial-gradient(130% 100% at 100% 0%, rgba(74, 216, 255, 0.1), transparent 55%),
    linear-gradient(135deg, rgba(185, 255, 102, 0.1), rgba(74, 216, 255, 0.03) 60%),
    var(--panel);
}
/* travelling signing light along the hero top edge */
.hero-panel::before {
  content: "";
  position: absolute;
  top: 0; left: -30%;
  width: 30%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  animation: sealScan 4.2s var(--ease) infinite;
}
@keyframes sealScan {
  0% { left: -30%; opacity: 0; }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.05;
}
.lead {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.65;
}
.hero-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.grid { display: grid; gap: 1rem; }
.metrics-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.content-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); align-items: start; }
.split-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ── Cards ── */
.metric-card,
.panel-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(24, 27, 24, 0.7), var(--panel));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.metric-card:hover,
.panel-card:hover { border-color: var(--line-strong); }
.metric-card j-card-section,
.panel-card j-card-section { padding: 1rem; }
.metric-card {
  min-height: 126px;
  border-radius: 12px 4px 12px 4px;
}
/* accent hairline down the leading edge of every metric card */
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent 70%);
  opacity: 0.55;
}
.metric-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.metric-card j-icon { color: var(--accent-2); }
.metric-card strong {
  display: block;
  margin: 0.9rem 0 0.22rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, var(--text), var(--accent) 140%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.metric-card span { color: var(--muted); font-size: 0.78rem; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.section-head h2 { margin: 0; font-size: 1rem; }
.muted { color: var(--muted); }

/* ── Data table ── */
j-table.data-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.data-table j-tr {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.data-table j-tr:last-child { border-bottom: none; }
.data-table j-tr:not(:first-child):hover { background: rgba(185, 255, 102, 0.035); }
.data-table j-th,
.data-table j-td {
  min-width: 0;
  padding: 0.72rem 0.85rem;
  color: var(--soft);
  font-size: 0.82rem;
}
.data-table j-th {
  color: var(--muted);
  background: linear-gradient(180deg, rgba(185, 255, 102, 0.05), rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.data-table strong { color: var(--text); }

/* ── Event lists ── */
.event-list { display: grid; gap: 0.7rem; }
.event-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  transition: border-color 0.2s, background 0.2s;
}
.event-row:hover { border-color: var(--line-strong); background: rgba(185, 255, 102, 0.04); }
.event-row j-icon { color: var(--accent); }
.event-row strong { display: block; font-size: 0.86rem; }
.event-row span { color: var(--muted); font-size: 0.76rem; }

/* ── Progress ── */
.progress-row { display: grid; gap: 0.45rem; margin-bottom: 0.8rem; }
.progress-row:last-child { margin-bottom: 0; }
.progress-row__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--soft);
  font-size: 0.82rem;
}
j-linear-progress {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
j-linear-progress::before {
  content: "";
  display: block;
  width: var(--progress, 50%);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ── Footer ── */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

/* ── Buttons (fill in Javelle button variants) ── */
j-button {
  --jb-radius: 8px;
  cursor: pointer;
}
j-button[variant="filled"] {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #d4ff99, var(--accent));
  color: #08130a;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(185, 255, 102, 0.18);
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
}
j-button[variant="filled"]:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(185, 255, 102, 0.28); }
j-button[variant="outlined"] {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(185, 255, 102, 0.05);
  color: var(--accent);
  font-weight: 700;
  transition: border-color 0.18s, background 0.18s;
}
j-button[variant="outlined"]:hover { border-color: var(--accent); background: rgba(185, 255, 102, 0.1); }
j-button[variant="text"] {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: var(--soft);
  font-weight: 700;
  background: transparent;
}
j-button[disabled] { opacity: 0.55; pointer-events: none; }

/* ── Dialogs (canonical runtime-driven j-dialog) ── */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(4, 6, 5, 0.72);
  backdrop-filter: blur(6px);
  animation: modalFade 0.2s var(--ease) both;
}
@keyframes modalFade { from { opacity: 0; } }
j-dialog-panel.modal__panel {
  display: block;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 1px;
  border-radius: 18px 6px 18px 6px;
  background: linear-gradient(150deg, rgba(185, 255, 102, 0.5), rgba(74, 216, 255, 0.24) 45%, rgba(185, 255, 102, 0.06) 75%, rgba(185, 255, 102, 0.4));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  animation: modalRise 0.3s var(--ease) both;
}
.modal__panel--wide { width: min(680px, 100%); }
@keyframes modalRise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
j-dialog-header.modal__header,
j-dialog-content,
j-dialog-footer.modal__actions {
  display: block;
  background: linear-gradient(165deg, rgba(15, 18, 15, 0.98), rgba(6, 7, 6, 0.99));
}
j-dialog-header.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem 0.9rem;
  border-bottom: 1px dashed rgba(185, 255, 102, 0.18);
  border-radius: 18px 6px 0 0;
}
.modal__header span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal__header h2 { margin: 0.4rem 0 0; font-size: 1.2rem; }
j-icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
j-icon-button:hover { border-color: var(--danger); color: var(--danger); }
j-dialog-content { padding: 1.25rem 1.35rem; }
.modal-form { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.35rem; }
.field label { color: var(--soft); font-size: 0.8rem; font-weight: 700; }
.field j-input,
.field j-select,
.field j-textarea { display: block; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 255, 102, 0.14);
}
.field select option { background: #0c0f0d; }
.field[data-invalid="true"] input,
.field[data-invalid="true"] select,
.field[data-invalid="true"] textarea { border-color: var(--danger); }
.field small { color: var(--danger); font-size: 0.74rem; min-height: 0.9rem; }
.success-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2rem 1.35rem;
}
.success-panel j-icon { font-size: 42px; color: var(--ok); }
.success-panel h3 { margin: 0; font-size: 1.15rem; }
.success-panel p { margin: 0; color: var(--muted); }
j-dialog-footer.modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 1rem 1.35rem 1.2rem;
  border-top: 1px dashed rgba(185, 255, 102, 0.18);
  border-radius: 0 0 18px 6px;
}
.modal__actions .dialog-switch-action { color: var(--muted); font-weight: 700; }

/* ── Console extras: filter bar, tables, ticket thread, tokens ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.filter-chip {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}
.filter-chip { text-decoration: none; }
.filter-chip:hover { border-color: var(--accent); background: rgba(185, 255, 102, 0.1); color: var(--accent); }
.filter-showing { margin-left: auto; align-self: center; color: var(--muted); font-size: 0.8rem; }
.filter-showing strong { color: var(--accent); }
.data-table--tickets j-tr { grid-template-columns: 2fr 1fr 0.8fr 0.9fr 0.8fr; }
.data-table--tokens j-tr { grid-template-columns: 1.4fr 1.2fr 0.9fr 0.7fr; }
.cell-action { display: flex; align-items: center; justify-content: flex-end; }
.cell-action j-button { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
/* destructive action buttons */
j-button.btn-danger[variant="outlined"] {
  border-color: rgba(255, 122, 144, 0.3);
  background: rgba(255, 122, 144, 0.06);
  color: var(--danger);
}
j-button.btn-danger[variant="outlined"]:hover {
  border-color: var(--danger);
  background: rgba(255, 122, 144, 0.12);
}
j-button.btn-danger[variant="filled"] {
  background: linear-gradient(135deg, #ff9aac, var(--danger));
  color: #2a0810;
  box-shadow: 0 10px 26px rgba(255, 122, 144, 0.18);
}
.empty-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.85rem; text-align: center; }
.tag--danger { border-color: rgba(255, 122, 144, 0.3); background: rgba(255, 122, 144, 0.08); color: var(--danger); }

/* ticket detail */
.ticket-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.thread { display: grid; gap: 0.7rem; margin-bottom: 1.1rem; }
.thread__msg {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.thread__msg--out {
  border-color: var(--line-strong);
  background: rgba(185, 255, 102, 0.06);
  margin-left: 1.5rem;
}
.thread__msg--in { margin-right: 1.5rem; }
.thread__who { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.thread__who strong { font-size: 0.82rem; }
.thread__who span { font-size: 0.72rem; }
.thread__msg p { margin: 0; color: var(--soft); font-size: 0.86rem; line-height: 1.55; }
.reply-sent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(125, 255, 178, 0.06);
  color: var(--ok);
  font-weight: 700;
}
.reply-sent j-icon { color: var(--ok); }

/* API token reveal box */
.token-reveal {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(185, 255, 102, 0.05);
}
.token-reveal__code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #060706;
  color: var(--accent);
  font-family: var(--font-main);
  font-size: 0.86rem;
  word-break: break-all;
}
.token-reveal__code span { user-select: all; cursor: text; }
.token-reveal__code j-button { flex: none; padding: 0.4rem 0.7rem; font-size: 0.78rem; }
.token-reveal__hint { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--accent-3); font-size: 0.78rem; }
.token-reveal__hint j-icon { color: var(--accent-3); font-size: 16px; }

[dir="rtl"] .thread__msg--out { margin-left: 0; margin-right: 1.5rem; }
[dir="rtl"] .thread__msg--in { margin-right: 0; margin-left: 1.5rem; }

/* ── 404 ── */
.nf { min-height: 60vh; display: grid; place-items: center; padding: 2rem; }
.nf j-card {
  width: min(520px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px 6px 16px 6px;
  background: var(--panel);
}
.nf j-card-section { padding: 1.4rem; }

/* ── Locale fonts + RTL ── */
[lang="ar"], [lang="ar"] :where(:not(j-icon):not(.material-symbols-rounded)) { font-family: var(--font-ar); }
[lang="ur"], [lang="ur"] :where(:not(j-icon):not(.material-symbols-rounded)) { font-family: var(--font-ur); }
[lang="hi"], [lang="hi"] :where(:not(j-icon):not(.material-symbols-rounded)) { font-family: "Noto Sans Devanagari", var(--font-main); }
[lang="zh"], [lang="zh"] :where(:not(j-icon):not(.material-symbols-rounded)) { font-family: "Noto Sans SC", var(--font-main); }
[lang="ja"], [lang="ja"] :where(:not(j-icon):not(.material-symbols-rounded)) { font-family: "Noto Sans JP", var(--font-main); }
[lang="ko"], [lang="ko"] :where(:not(j-icon):not(.material-symbols-rounded)) { font-family: "Noto Sans KR", var(--font-main); }
[dir="rtl"] .app-sidebar { border-right: none; border-left: 1px solid var(--line); }
[dir="rtl"] .side-nav__link.j-router-link--active::before,
[dir="rtl"] .side-nav__link[aria-current="page"]::before { left: auto; right: 0; border-radius: 3px 0 0 3px; }
[dir="rtl"] .hero-actions { justify-content: flex-start; }
[dir="rtl"] .metric-card::before { inset: 0 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .hero-panel::before { animation: none; }
}

@media (max-width: 1180px) {
  .ops-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: static; height: auto; }
  .sidebar-foot { position: static; margin-top: 1rem; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar, .hero-panel, .footer { display: grid; }
  .dashboard { padding: 1rem; }
  .metrics-grid, .split-grid { grid-template-columns: 1fr; }
  .data-table j-tr { grid-template-columns: 1fr; }
  .data-table j-th { display: none; }
  .data-table j-td { border-bottom: 1px solid var(--line); }
}

/* ─── FUTURE LAYER (console edition) ───────────────────────────────────────
   Same CSS-only forward-tech pass as the marketing site's app.css, adapted
   to the ops-shell console: scroll charge beam, holographic aurora, film
   grain, scroll-driven card reveals, @property orbit ring on the brand seal,
   HUD hover brackets, branded selection. No JS, no template changes.
   NOTE: admin + portal app.css are identical twins — edit both together. */

/* 1 ▸ SCROLL CHARGE BEAM — reading progress as an energy line across the
   viewport top. Above the sticky topbar (10), below dialogs (60). */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 55;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent) 55%, var(--accent-2));
  box-shadow: 0 0 10px rgba(185, 255, 102, 0.55), 0 0 22px rgba(74, 216, 255, 0.25);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
@supports (animation-timeline: scroll()) {
  body::after {
    animation: futureCharge linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes futureCharge {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
:root:has([dir="rtl"]) body::after { transform-origin: 100% 50%; }

/* 2 ▸ HOLOGRAPHIC AURORA — a fixed, hue-drifting light field behind the
   console content (z-index -1 keeps it above body bg, below everything). */
.ops-shell::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 70vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 16% 4%, rgba(185, 255, 102, 0.07), transparent 62%),
    radial-gradient(ellipse 48% 42% at 86% 8%, rgba(74, 216, 255, 0.07), transparent 62%),
    conic-gradient(from 210deg at 55% -14%,
      transparent 42%, rgba(185, 255, 102, 0.04) 48%,
      rgba(74, 216, 255, 0.05) 53%, transparent 61%);
  filter: blur(34px);
  mix-blend-mode: screen;
  animation: futureAurora 26s ease-in-out infinite alternate;
}
@keyframes futureAurora {
  from { transform: translateX(-2%) skewX(-2deg); filter: blur(34px) hue-rotate(0deg); }
  to   { transform: translateX(2%) skewX(2deg);  filter: blur(40px) hue-rotate(-22deg); }
}

/* 3 ▸ FILM GRAIN — barely-there animated lens grain above everything;
   removes flat-black banding, adds physical texture to the dark panels. */
body::before {
  content: "";
  position: fixed;
  inset: -60%;
  z-index: 300;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240"><filter id="g"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="240" height="240" filter="url(%23g)"/></svg>');
  background-size: 220px 220px;
  opacity: 0.035;
  mix-blend-mode: overlay;
  animation: futureGrain 1.4s steps(7) infinite;
}
@keyframes futureGrain {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(6%, -4%); }
  100% { transform: translate(-5%, 5%); }
}

/* 4 ▸ SCROLL-DRIVEN REVEALS — cards and event rows rise into place as they
   enter the viewport, scrubbed by scroll itself. Only a `from` keyframe, so
   the resting state stays each element's own computed style. */
@supports (animation-timeline: view()) {
  .metric-card,
  .panel-card,
  .event-row {
    animation: futureRise linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 45%;
  }
}
@keyframes futureRise {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
}

/* 5 ▸ ORBIT RING — a comet of light circling the sidebar brand seal via a
   registered @property angle; static gradient ring without support. */
@property --jv-orbit {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.brand__chip::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 13px 4px 13px 4px;
  padding: 1px;
  background: conic-gradient(from var(--jv-orbit),
    transparent 0deg, rgba(185, 255, 102, 0.95) 50deg,
    rgba(74, 216, 255, 0.9) 100deg, transparent 150deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: futureOrbit 7s linear infinite;
  pointer-events: none;
}
@keyframes futureOrbit {
  to { --jv-orbit: 360deg; }
}

/* 6 ▸ HUD BRACKETS — panels acquire targeting brackets on hover (both
   corners); metric cards get a single trailing-corner bracket (their leading
   edge already carries the accent hairline ::before). */
.panel-card::before,
.panel-card::after,
.metric-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s, transform 0.3s var(--ease);
  pointer-events: none;
}
.panel-card::before {
  top: 8px;
  inset-inline-start: 8px;
  border-top: 1px solid var(--accent);
  border-inline-start: 1px solid var(--accent);
}
.panel-card::after,
.metric-card::after {
  bottom: 8px;
  inset-inline-end: 8px;
  border-bottom: 1px solid var(--accent-2);
  border-inline-end: 1px solid var(--accent-2);
}
.metric-card::after { bottom: auto; top: 8px; border-bottom: none; border-top: 1px solid var(--accent-2); }
.panel-card:hover::before,
.panel-card:hover::after,
.metric-card:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* 7 ▸ BRANDED SELECTION + BALANCED HEADLINES */
::selection {
  background: rgba(185, 255, 102, 0.9);
  color: #06110a;
  text-shadow: none;
}
h1, h2, .lead { text-wrap: balance; }

/* respect reduced motion across the future layer */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .ops-shell::before,
  .brand__chip::before { animation: none; }
  .metric-card, .panel-card, .event-row { animation: none; }
}
