/* DARKSIDE Panel — colors matched to desktop ticket workspace */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;700&display=swap");

:root {
  --bg: #06152b;
  --bg-2: #071d38;
  --bg-3: #082447;
  --panel: #071d38;
  --line: #1a5a93;
  --line-strong: #0a84ff;
  --line-soft: #123d68;
  --text: #eaf6ff;
  --text-dim: #9ec9ff;
  --text-mute: #6a8bb0;
  --cyan: #35d7ff;
  --blue: #0a84ff;
  --blue-deep: #0d47a1;
  --blue-hover: #1565c0;
  --orange: #ff8c00;
  --green: #38e6a5;
  --green-deep: #1b5e20;
  --danger: #ef5350;
  --danger-bg: #3b0a0a;
  --ok: #38e6a5;
  --radius: 8px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --accent: var(--blue);
  --accent-soft: rgba(10, 132, 255, 0.16);
}

body.theme-super_master { --accent: #35d7ff; --accent-soft: rgba(53, 215, 255, 0.14); }
body.theme-master { --accent: #0a84ff; --accent-soft: rgba(10, 132, 255, 0.16); }
body.theme-admin { --accent: #20b8ff; --accent-soft: rgba(32, 184, 255, 0.14); }
body.theme-super_seller { --accent: #ff8c00; --accent-soft: rgba(255, 140, 0, 0.14); }
body.theme-seller { --accent: #38e6a5; --accent-soft: rgba(56, 230, 165, 0.14); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 8% -12%, rgba(10, 132, 255, 0.14), transparent 55%),
    radial-gradient(700px 400px at 100% 0%, rgba(53, 215, 255, 0.06), transparent 50%),
    linear-gradient(180deg, #040b18 0%, #06152b 45%, #051022 100%);
  min-height: 100%;
  position: relative;
}

/* Cyber Grid canvas — behind all UI, pointer-events none */
.cyber-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
}
.due-cell { color: var(--orange); font-weight: 700; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* —— Login (centered brand · navy / electric blue) —— */
body.login-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(780px 420px at 50% -8%, rgba(10, 132, 255, 0.22), transparent 58%),
    radial-gradient(520px 320px at 80% 90%, rgba(53, 215, 255, 0.08), transparent 55%),
    linear-gradient(180deg, #040b18 0%, #06152b 42%, #051022 100%);
}
.login-center {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 56px;
  gap: 26px;
  text-align: center;
}
.login-brand {
  text-align: center;
  margin: 0 auto;
}
.login-brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(53, 215, 255, 0.35), transparent 55%),
    linear-gradient(160deg, #0a84ff, #06152b 70%);
  border: 1px solid rgba(53, 215, 255, 0.45);
  box-shadow: 0 0 40px rgba(10, 132, 255, 0.28);
}
.login-brand-name {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 0 28px rgba(10, 132, 255, 0.35);
}
.login-brand-tag {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}
.login-card,
.login-card.login-card-centered {
  width: min(400px, 100%);
  margin: 0 auto;
  text-align: left;
  background: rgba(7, 29, 56, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 28px 26px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.login-card-centered .login-form { margin-bottom: 14px; }
.btn-login {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
a.btn-download,
button.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 11px 16px;
  border-radius: 6px;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan) !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
a.btn-download:hover {
  background: rgba(53, 215, 255, 0.12);
  color: #fff !important;
}
button.btn-download:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--line);
  color: var(--text-mute) !important;
}
/* legacy two-column login helpers (unused) */
.login-shell { position: relative; z-index: 1; min-height: 100vh; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-3);
  border-radius: 6px;
  padding: 11px 12px;
  outline: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25);
}
.field input::placeholder { color: var(--text-mute); }

.btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 6px;
  padding: 11px 16px;
  font-weight: 800;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary {
  background: var(--blue-deep);
  color: #fff;
  border-color: #1976d2;
  width: 100%;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-ghost {
  background: var(--bg-3);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--blue); color: #fff; }
.btn-danger {
  background: var(--danger-bg);
  color: #ff8a80;
  border-color: #c62828;
}
.btn-danger:hover { background: #c62828; color: #fff; }
.btn-back {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--cyan);
  font-weight: 800;
  padding: 8px 14px;
}
.btn-back:hover { border-color: var(--cyan); background: var(--bg-3); }
.btn-sm { padding: 7px 10px; font-size: 0.8rem; }
a.btn { display: inline-flex; align-items: center; justify-content: center; }

.alert {
  border-radius: 6px;
  padding: 11px 13px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 700;
}
.alert-error {
  background: var(--danger-bg);
  color: #ff8a80;
  border: 1px solid #c62828;
}
.alert-ok {
  background: rgba(27, 94, 32, 0.35);
  color: var(--green);
  border: 1px solid #43a047;
}

.demo-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-soft);
  font-size: 0.8rem;
  color: var(--text-mute);
  line-height: 1.55;
  font-weight: 600;
}
.demo-hint code {
  font-family: var(--mono);
  font-size: 0.74rem;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

/* —— App shell —— */
.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 5; }
}

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line-soft);
  color: var(--text);
  padding: 24px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand { padding: 0 8px; }
.brand .eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 6px;
  font-weight: 800;
}
.brand h1 {
  font-size: 1.35rem;
  margin: 0;
  color: var(--cyan);
  font-weight: 900;
  letter-spacing: -0.01em;
}
.brand .role-chip {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--orange);
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav .nav-section {
  margin: 10px 8px 4px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 800;
}
.nav a {
  padding: 10px 12px;
  border-radius: 6px;
  color: #bfe9ff;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.nav a:hover {
  background: var(--bg-3);
  border-color: var(--line-strong);
  color: #fff;
}
.nav a.active {
  background: var(--blue);
  border-color: var(--cyan);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.84rem;
  color: var(--text-mute);
  font-weight: 600;
}
.sidebar-foot strong { color: #fff; display: block; margin-bottom: 2px; font-weight: 800; }
.sidebar-foot a { color: var(--cyan); font-weight: 800; }

.main {
  padding: 24px 26px 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.topbar h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  margin: 0;
  font-weight: 900;
  color: #fff;
}
.topbar p { margin: 6px 0 0; color: var(--text-mute); font-weight: 600; font-size: 0.9rem; }

.context-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.context-bar .ctx-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  font-weight: 800;
  margin-right: 4px;
}
.context-bar .ctx-node {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 800;
}
.context-bar .ctx-node.current {
  border-color: var(--cyan);
  color: var(--cyan);
}
.context-bar .ctx-sep { color: var(--text-mute); font-weight: 800; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .grid-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-stats { grid-template-columns: 1fr; } }

.stat {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 14px;
}
.stat .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 800;
}
.stat .value {
  font-size: 1.85rem;
  margin-top: 4px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}
.panel-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--cyan);
}

.hierarchy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-mute);
  font-weight: 700;
}
.hierarchy .node {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  padding: 5px 9px;
  border-radius: 5px;
  font-weight: 800;
}
.hierarchy .node.me {
  background: var(--blue);
  border-color: var(--cyan);
  color: #fff;
}
.hierarchy .arrow { opacity: 0.5; }

/* Hierarchy clickable boxes */
.h-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.h-card {
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 18px 16px;
  transition: background .15s, border-color .15s, transform .12s;
  cursor: pointer;
  min-height: 110px;
}
.h-card:hover {
  background: #0a2f5c;
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.h-card .h-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  font-weight: 900;
  margin-bottom: 8px;
}
.h-card .h-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 4px;
}
.h-card .h-sub {
  font-size: 0.82rem;
  color: var(--text-mute);
  font-weight: 600;
  margin: 0;
}
.h-card .h-count {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--cyan);
  font-weight: 700;
}
.h-card.entry {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--bg-3), rgba(10, 132, 255, 0.12));
}
.h-card.user-card .h-title {
  font-size: 1.05rem;
  color: var(--cyan);
}
.h-card.user-card .h-sub { color: var(--text-dim); }

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-row .focus-title {
  font-weight: 900;
  color: #fff;
  font-size: 1.1rem;
}
.toolbar-row .focus-meta {
  color: var(--text-mute);
  font-size: 0.85rem;
  font-weight: 600;
}

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 11px 9px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.data th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: rgba(227, 242, 253, 0.04);
  font-weight: 800;
}
table.data a.user-link {
  color: var(--cyan);
  font-weight: 800;
}
table.data a.user-link:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-active { background: rgba(56, 230, 165, 0.15); color: var(--green); border: 1px solid #43a047; }
.badge-disabled, .badge-revoked { background: var(--danger-bg); color: #ff8a80; border: 1px solid #c62828; }
.badge-expired { background: var(--bg-2); color: var(--text-mute); border: 1px solid var(--line-soft); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions .btn-primary { width: auto; min-width: 150px; }

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-mute);
  font-weight: 700;
}

.perm-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
  color: var(--text-mute);
  font-weight: 600;
}
.perm-list strong { color: #fff; }

/* Dashboard menu boxes */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.menu-card {
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px 14px;
  min-height: 118px;
  transition: background .15s, border-color .15s, transform .12s;
}
.menu-card:hover {
  background: #0a2f5c;
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.menu-idx {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--orange);
  font-weight: 800;
  margin-bottom: 8px;
}
.menu-title {
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.25;
}
.menu-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-mute);
  font-weight: 600;
  line-height: 1.4;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-nav-title {
  font-weight: 800;
  color: var(--cyan);
  font-size: 0.92rem;
  margin-left: 4px;
}

.sidebar-toggle {
  display: none;
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 860px) {
  .sidebar-toggle { display: block; }
  body.sidebar-collapsed .nav,
  body.sidebar-collapsed .sidebar-foot,
  body.sidebar-collapsed .brand h1,
  body.sidebar-collapsed .role-chip {
    display: none;
  }
}

/* Desktop collapsible sidebar */
@media (min-width: 861px) {
  .sidebar-toggle { display: block; }
  body.sidebar-collapsed .shell {
    grid-template-columns: 64px 1fr;
  }
  body.sidebar-collapsed .brand .eyebrow { font-size: 0.55rem; }
  body.sidebar-collapsed .brand h1,
  body.sidebar-collapsed .role-chip,
  body.sidebar-collapsed .nav-section,
  body.sidebar-collapsed .sidebar-foot,
  body.sidebar-collapsed .nav a {
    display: none;
  }
  body.sidebar-collapsed .sidebar {
    padding: 16px 8px;
    align-items: center;
  }
  body.sidebar-collapsed .sidebar-toggle {
    writing-mode: horizontal-tb;
    padding: 10px 4px;
    font-size: 0.75rem;
  }
}

.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-3);
  border-radius: 6px;
  padding: 11px 12px;
  outline: none;
  color: var(--text);
  resize: vertical;
  min-height: 90px;
}
.field textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25);
}

/* —— No-sidebar professional chrome —— */
body.no-sidebar .shell { display: block; }
.top-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-brand { display: flex; align-items: baseline; gap: 10px; }
.top-mark { color: var(--cyan); font-weight: 900; letter-spacing: 0.04em; font-size: 0.95rem; }
.top-role {
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  background: var(--orange);
  padding: 2px 8px;
  border-radius: 4px;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-user { color: var(--text-mute); font-size: 0.8rem; font-weight: 700; }
.main-wide { padding: 16px 18px 28px; max-width: 1280px; margin: 0 auto; }

.dash-head { margin-bottom: 12px; }
.dash-head.tight { margin-bottom: 10px; }
.dash-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
}
.dash-head p {
  margin: 4px 0 0;
  color: var(--text-mute);
  font-size: 0.78rem;
  font-weight: 600;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 1100px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
.stat-mini {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-mini .k {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 800;
}
.stat-mini .v {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  font-family: var(--mono);
}

.menu-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.menu-card.compact {
  min-height: 72px;
  padding: 10px 10px;
  border-radius: 7px;
}
.menu-card.compact .menu-title {
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.menu-card.compact .menu-desc {
  font-size: 0.68rem;
  line-height: 1.3;
}

.panel-card.compact { padding: 12px 14px; margin-bottom: 12px; }
.panel-card.compact h3 { font-size: 0.88rem; margin-bottom: 10px; }
.form-grid.tight { gap: 8px 10px; }
.form-grid.tight .field label { font-size: 0.65rem; margin-bottom: 4px; }
.form-grid.tight .field input,
.form-grid.tight .field select { padding: 8px 10px; border-radius: 5px; font-size: 0.85rem; }

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}
.table-toolbar input,
.table-toolbar select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.82rem;
  min-width: 160px;
}

table.data.compact-table { font-size: 0.8rem; }
table.data.compact-table th,
table.data.compact-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(18, 61, 104, 0.85);
}
table.data.compact-table th {
  font-size: 0.62rem;
  background: rgba(10, 132, 255, 0.08);
}
.row-sub { color: var(--text-mute); font-size: 0.7rem; font-weight: 600; margin-top: 1px; }
.actions { white-space: nowrap; }
.actions .inline { display: inline; }
.btn-xs {
  padding: 3px 7px;
  font-size: 0.68rem;
  border-radius: 4px;
  font-weight: 800;
  margin: 1px;
}
.badge-deleted, .badge-inactive { background: var(--bg-2); color: var(--text-mute); border: 1px solid var(--line-soft); }
.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-mute);
  font-weight: 700;
}
.pager a { color: var(--cyan); }

.dlg {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 16px;
  min-width: min(360px, 92vw);
}
.dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.dlg h3 { margin: 0 0 12px; font-size: 0.95rem; color: var(--cyan); }

.view-pop { display: inline-block; }
.view-pop summary { list-style: none; cursor: pointer; }
.view-pop summary::-webkit-details-marker { display: none; }
.view-box {
  position: absolute;
  z-index: 5;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.75rem;
  min-width: 200px;
  margin-top: 4px;
  line-height: 1.45;
}

.pw-mask { margin-right: 4px; }

button.user-link.hier-expand {
  background: none;
  border: 0;
  padding: 0;
  color: var(--cyan);
  font-weight: 800;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
button.user-link.hier-expand:hover { text-decoration: underline; }
button.user-link.hier-expand.expanded { color: var(--orange); }
tr.expand-row { background: rgba(10, 132, 255, 0.04); }

.validity-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.validity-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 6px 8px;
}
.validity-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
}
.hier-cell {
  font-size: 0.72rem;
  font-weight: 700;
  max-width: 360px;
  line-height: 1.45;
}
.hier-cell .ctx-sep { margin: 0 3px; color: var(--text-mute); }
tr.click-row { cursor: pointer; }
tr.click-row:hover { background: rgba(10, 132, 255, 0.07); }
a.ctx-node {
  text-decoration: none;
}
a.ctx-node:hover { border-color: var(--cyan); color: var(--cyan); }

/* —— Telegram License Selling —— */
.tg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.tg-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tg-card.wide { grid-column: 1 / -1; }
.tg-card h2 { margin: 0 0 10px; font-size: 1.02rem; color: var(--cyan); }
.tg-card-info { border-color: rgba(53, 215, 255, 0.35); }
.tg-steps { margin: 0; padding-left: 18px; color: var(--text-dim); line-height: 1.5; }
.tg-divider {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 8px 0 12px;
}
.form-stack { display: grid; gap: 8px; }
.form-stack label { display: grid; gap: 3px; font-size: 0.76rem; font-weight: 700; color: var(--text-dim); }
.form-stack input, .form-stack select, .form-stack textarea {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text);
}
.check-row { display: flex !important; align-items: center; gap: 8px; font-weight: 600; }
.hint { font-size: 0.74rem; color: var(--text-mute); margin: 0; line-height: 1.35; }
.filter-row { display: flex; gap: 8px; margin: 10px 0; align-items: center; flex-wrap: wrap; }
.filter-row select {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 6px 8px;
}
.tg-dash {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.tg-kpi {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.tg-kpi .k { font-size: 0.72rem; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.03em; }
.tg-kpi .v { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.tg-kpi.warn .v { color: var(--orange); }
.tg-kpi.ok .v { color: var(--green); }
.tg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.tg-filters select,
.tg-filters input[type="search"],
.tg-filters input[type="date"] {
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text);
  min-width: 0;
}
.tg-filters input[type="search"] { flex: 1 1 220px; }
.tg-today { margin: 0; font-size: 0.78rem; }
.tg-detail { margin-bottom: 12px; }
.tg-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tg-detail-head h2 { margin: 0; }
.tg-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 14px;
}
.tg-detail-grid .k {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.tg-detail-grid .v { font-size: 0.92rem; color: var(--text); }
.tg-sales-table .muted-sm { font-size: 0.72rem; color: var(--text-mute); }
.tg-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.tg-shot-preview {
  margin-top: 12px;
  max-width: 360px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-3);
}
.tg-shot-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
}
.tg-audit { margin-top: 14px; }
.tg-audit h3 { margin: 0 0 6px; font-size: 0.9rem; color: var(--cyan); }
.tg-audit ul {
  margin: 0;
  padding-left: 16px;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 160px;
  overflow: auto;
}
tr.is-active td { background: rgba(53, 215, 255, 0.08); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--bg-3);
  border: 1px solid var(--line-soft);
}
.tag-approved { color: var(--green); border-color: var(--green); }
.tag-submitted, .tag-under_review { color: var(--orange); border-color: var(--orange); }
.tag-rejected, .tag-cancelled, .tag-expired { color: var(--danger); border-color: var(--danger); }
.tag-unpaid { color: var(--text-dim); }
.row-actions { white-space: nowrap; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.page-head h1 { margin: 0 0 2px; font-size: 1.2rem; }
.page-head .muted { margin: 0; color: var(--text-mute); font-size: 0.82rem; }
@media (max-width: 900px) {
  .tg-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tg-dash { grid-template-columns: 1fr; }
  .tg-filters { padding: 8px; }
}
