/* ==================== EXLITRACLIENT ADMIN PANEL DESIGN SYSTEM (GREEN & WHITE) ==================== */

body.admin-body {
  --bg-base: #070b09;
  --bg-surface: #0d1310;
  --bg-elevated: #121a16;
  --bg-hover: #17221c;
  --border-subtle: #1c2b22;
  --border-strong: #25382d;
  --border-focus: #00dd58;
  --text-primary: #ffffff;
  --text-secondary: #b8ccc0;
  --text-muted: #7a9484;
  --accent: #00dd58;
  --accent-fg: #04140a;
  --st-ok: #00dd58;
  --st-ok-bg: rgba(0, 221, 88, 0.10);
  --st-ok-bd: rgba(0, 221, 88, 0.30);
  --st-warn: #f59e0b;
  --st-warn-bg: rgba(245, 158, 11, 0.08);
  --st-warn-bd: rgba(245, 158, 11, 0.24);
  --st-err: #ef4444;
  --st-err-bg: rgba(239, 68, 68, 0.08);
  --st-err-bd: rgba(239, 68, 68, 0.24);
  --st-info: #38bdf8;
  --st-info-bg: rgba(56, 189, 248, 0.08);
  --st-info-bd: rgba(56, 189, 248, 0.24);
  --sidebar-w: 232px;

  /* Map legacy CSS vars so nothing leaks violet */
  --bg: var(--bg-base);
  --panel: var(--bg-surface);
  --panel2: var(--bg-elevated);
  --ink: var(--text-primary);
  --text: var(--text-primary);
  --line: var(--border-subtle);
  --muted: var(--text-muted);
  --surface: var(--bg-surface);
  --purple: #00dd58;
  --light: #86efac;
  --good: #00dd58;
  --bad: #f87171;
  --warn: #fbbf24;
  --heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cut: none;

  margin: 0;
  padding: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.admin-body .ambient {
  display: none !important;
}

body.admin-body *,
body.admin-body *::before,
body.admin-body *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body.admin-body h1,
body.admin-body h2,
body.admin-body h3 {
  font-family: var(--heading);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

body.admin-body .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

body.admin-body .eyebrow::before {
  display: none;
}

/* ==================== SHELL LAYOUT ==================== */
.tv-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.tv-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-base);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  padding: 14px 10px;
  user-select: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg-base);
}

.tv-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.tv-guest-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.tv-content {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  flex: 1;
}

.tv-topbar {
  height: 52px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.tv-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tv-breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-breadcrumb strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tv-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tv-footer {
  padding: 14px 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ==================== SIDEBAR ==================== */
.tv-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.tv-brand-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.tv-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}

.tv-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tv-brand-logo {
  height: 24px;
  width: auto;
  max-width: 142px;
  object-fit: contain;
  display: block;
}

.tv-brand-tag {
  font-size: 9.5px;
  font-family: var(--mono);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tv-credit-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 2px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tv-credit-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tv-credit-lbl {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tv-credit-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-credit-pill {
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tv-nav-group {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}

.tv-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tv-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7.5px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tv-nav-item i {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.12s ease;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.tv-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.tv-nav-item:hover i {
  color: var(--text-secondary);
}

.tv-nav-item.active {
  color: #ffffff;
  background: rgba(0, 221, 88, 0.10);
  border-color: rgba(0, 221, 88, 0.34);
  font-weight: 600;
}

.tv-nav-item.active i {
  color: #00dd58;
}

.tv-sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 4px;
  padding-right: 4px;
}

.tv-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tv-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.tv-user-info {
  min-width: 0;
}

.tv-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.tv-user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ==================== MOBILE TOP, DRAWER & BOTTOM BARS ==================== */
.tv-mobile-top {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.tv-mobile-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-credit-chip-mob {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tv-credit-chip-mob i {
  color: #4ade80;
  font-size: 12px;
}

.tv-credit-chip-lbl {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--body);
  font-weight: 600;
  text-transform: uppercase;
}

.tv-credit-chip-mob strong {
  color: #4ade80;
  font-weight: 700;
}

.tv-balance-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tv-balance-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tv-balance-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #4ade80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.tv-balance-banner-val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: #4ade80;
  white-space: nowrap;
}

.tv-modal-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.tv-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  z-index: 1025;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
}

.tv-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
}

.tv-bnav-item i {
  font-size: 16px;
}

.tv-bnav-item.active {
  color: #00dd58;
  font-weight: 600;
}

.tv-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1028;
  border: 0;
}

/* ==================== PAGE HEADERS & ACTIONS ==================== */
.tv-page-head,
body.admin-body .page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.tv-page-title,
body.admin-body .page-heading h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
}

body.admin-body .page-heading p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.tv-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== CARDS & STATS ==================== */
.tv-card,
body.admin-body .card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: none;
  clip-path: none;
}

body.admin-body .card.cut {
  clip-path: none;
}

.tv-card-flush {
  padding: 0 !important;
  overflow: hidden;
}

.tv-card-head,
body.admin-body .card-top {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

body.admin-body .card > .card-top {
  margin: -18px -18px 16px -18px;
}

.tv-card-title,
body.admin-body .card h2,
body.admin-body .card h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
}

.tv-card-body {
  padding: 18px;
}

.tv-stats-grid,
body.admin-body .metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.tv-stat-card,
body.admin-body .metric {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 14px 16px;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease;
}

.tv-stat-card:hover,
body.admin-body .metric:hover {
  border-color: var(--border-strong);
}

.tv-stat-top,
body.admin-body .metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tv-stat-val,
body.admin-body .metric-number {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-top: 4px;
}

.tv-stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

body.admin-body .admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  margin-bottom: 18px;
}

body.admin-body .details {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 12.5px;
}

body.admin-body .details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

body.admin-body .details > div:last-child {
  border-bottom: 0;
}

body.admin-body .details dt {
  color: var(--text-muted);
}

body.admin-body .details dd {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

/* ==================== STATUS BADGES ==================== */
.tv-badge,
body.admin-body .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
  line-height: 1.35;
  font-family: var(--mono);
  letter-spacing: 0;
}

.tv-dot,
body.admin-body .badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.tv-badge-active,
body.admin-body .badge.good {
  background: var(--st-ok-bg);
  color: #00dd58;
  border-color: var(--st-ok-bd);
}

.tv-badge-unused {
  background: var(--st-info-bg);
  color: #7dd3fc;
  border-color: var(--st-info-bd);
}

.tv-badge-expired,
body.admin-body .badge.warn {
  background: var(--st-warn-bg);
  color: #fbbf24;
  border-color: var(--st-warn-bd);
}

.tv-badge-disabled,
body.admin-body .badge.bad {
  background: var(--st-err-bg);
  color: #f87171;
  border-color: var(--st-err-bd);
}

.tv-badge-neutral {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.tv-badge-online {
  background: rgba(0, 221, 88, 0.14);
  color: #00dd58;
  border-color: rgba(0, 221, 88, 0.38);
}

.tv-badge-online .tv-dot {
  box-shadow: 0 0 6px #00dd58;
}

/* ==================== FORMS & BUTTONS ==================== */
.tv-label,
body.admin-body label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 12px 0 6px;
}

.tv-label:first-child {
  margin-top: 0;
}

.tv-mono {
  font-family: var(--mono) !important;
}

body.admin-body input:not([type=checkbox]),
body.admin-body select,
body.admin-body textarea,
.tv-input {
  display: block;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--body);
  font-size: 12.5px;
  border-radius: 6px;
  padding: 7px 11px;
  min-height: 36px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
}

body.admin-body input::placeholder,
body.admin-body textarea::placeholder {
  color: var(--text-muted);
}

body.admin-body input:focus,
body.admin-body select:focus,
body.admin-body textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(0, 221, 88, 0.16);
  outline: none;
}

body.admin-body input[type=checkbox] {
  accent-color: #00dd58;
}

.tv-btn,
body.admin-body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  text-decoration: none;
  min-height: 33px;
  height: auto;
  clip-path: none;
  box-shadow: none;
  white-space: nowrap;
}

.tv-btn:hover:not(:disabled),
body.admin-body .btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
  filter: none;
}

.tv-btn-primary,
body.admin-body .btn.primary {
  background: #00dd58 !important;
  color: #04140a !important;
  border-color: #00dd58 !important;
  font-weight: 700 !important;
}

.tv-btn-primary:hover:not(:disabled),
body.admin-body .btn.primary:hover:not(:disabled) {
  background: #1af06d !important;
  border-color: #1af06d !important;
}

body.admin-body .btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

body.admin-body .btn.secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.tv-btn-danger,
body.admin-body .btn.danger {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.tv-btn-danger:hover:not(:disabled),
body.admin-body .btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22) !important;
}

.tv-btn-sm,
body.admin-body .btn.small {
  padding: 4px 9px;
  font-size: 11px;
  min-height: 27px;
}

.tv-icon-btn,
body.admin-body .icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
  clip-path: none;
}

.tv-icon-btn:hover,
body.admin-body .icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

body.admin-body .btn .icon,
body.admin-body .icon-btn .icon {
  width: 14px;
  height: 14px;
}

body.admin-body .text-link {
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.admin-body .text-link:hover {
  color: #d4d4d8;
}

/* ==================== LANG SWITCHER & HEADER LINKS ==================== */
body.admin-body .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 2px 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  clip-path: none;
}

body.admin-body .lang-switch .lang-globe {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
  margin: 0 3px;
}

body.admin-body .lang-switch .lang-opt {
  min-height: 22px;
  height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font: 600 10px/1 var(--mono);
  cursor: pointer;
  clip-path: none;
}

body.admin-body .lang-switch .lang-opt:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

body.admin-body .lang-switch .lang-opt.active {
  background: #00dd58;
  color: #04140a;
}

body.admin-body .header-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
}

body.admin-body .header-link:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-elevated);
}

/* ==================== CHIPS, PRESETS & BOX SELECTORS ==================== */
.tv-box-select {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.tv-box-opt {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  text-align: center;
  color: var(--text-primary);
}

.tv-box-opt:hover {
  border-color: var(--border-focus);
}

.tv-box-opt.active {
  background: #00dd58;
  color: #04140a;
  border-color: #00dd58;
  font-weight: 700;
}

.tv-box-opt-title {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
}

.tv-box-opt-sub {
  font-size: 10px;
  opacity: 0.7;
}

.tv-box-opt-price {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #00dd58;
}

.tv-box-opt.active .tv-box-opt-price {
  color: #04140a;
  opacity: 0.9;
}

.admin-body .preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 12px;
}

.admin-body .chip-btn {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 5px 10px;
  font: 600 11px var(--mono);
  cursor: pointer;
  transition: all 0.12s ease;
}

.admin-body .chip-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.admin-body .chip-btn.active {
  background: #00dd58;
  border-color: #00dd58;
  color: #04140a;
  font-weight: 700;
}

/* ==================== TABLES & TOOLBARS ==================== */
body.admin-body .table-card {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 10px;
}

body.admin-body .table-toolbar {
  background: var(--bg-surface);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.admin-body .table-toolbar .search-field {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

body.admin-body .table-toolbar input,
body.admin-body .table-toolbar select {
  min-height: 33px;
  height: 33px;
  padding: 5px 10px;
  font-size: 12px;
}

body.admin-body .table-toolbar select {
  width: auto;
  min-width: 130px;
  max-width: 220px;
}

body.admin-body .table-toolbar .btn {
  min-height: 33px;
}

.tv-table-wrap,
body.admin-body .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg-surface);
}

.tv-table,
body.admin-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 12px;
}

.tv-table thead th,
body.admin-body th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  white-space: nowrap;
  text-align: left;
}

.tv-table tbody td,
body.admin-body td {
  padding: 11px 14px;
  border-top: 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  vertical-align: middle;
}

.tv-table tbody tr:last-child td,
body.admin-body tbody tr:last-child td {
  border-bottom: none;
}

.tv-table tbody tr:hover td,
body.admin-body tbody tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

body.admin-body td strong {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

body.admin-body td small {
  font-size: 10.5px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

body.admin-body .table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

body.admin-body .table-actions .icon-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  opacity: 1;
}

body.admin-body .table-footer {
  padding: 11px 16px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--mono);
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

body.admin-body .empty-cell {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ==================== API DOCS, ENDPOINTS & CODE ==================== */
.tv-api-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.24);
  color: #fbbf24;
  font-size: 12px;
  margin-bottom: 14px;
}

.tv-endpoint-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
}

.tv-endpoint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.tv-endpoint-row:last-child {
  border-bottom: none;
}

.tv-endpoint-path {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.tv-method {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  min-width: 48px;
  text-align: center;
}

.tv-method.is-get {
  background: var(--st-info-bg);
  color: var(--st-info);
  border: 1px solid var(--st-info-bd);
}

.tv-method.is-post {
  background: var(--st-ok-bg);
  color: #4ade80;
  border: 1px solid var(--st-ok-bd);
}

.tv-code-pre {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: #e4e4e7;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

/* ==================== MISC COMPONENTS ==================== */
.admin-body .checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.admin-body .checkbox-row input[type=checkbox] {
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
}

.admin-body .live-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px 16px;
  margin-bottom: 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.admin-body .key-acc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.admin-body .key-acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font: 10px var(--mono);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.admin-body .sub-list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.admin-body .sub-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.admin-body .sub-list-row strong {
  font-size: 12.5px;
  color: var(--text-primary);
}

.admin-body .sub-list-row small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.admin-body .inline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-body .inline-controls input {
  width: 150px;
  min-height: 33px;
  padding: 5px 10px;
}

.admin-body .notice {
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 11px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.admin-body .notice strong {
  color: var(--text-primary);
}

.admin-body .notice.warn,
.admin-body .maintenance-banner {
  border-radius: 8px;
  border: 1px solid var(--st-warn-bd);
  background: var(--st-warn-bg);
  color: #fbbf24;
  padding: 10px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-body .maintenance-banner {
  margin: 14px 28px 0;
}

.admin-body .settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-body .settings-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-body .settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.admin-body .settings-card p {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 4px;
}

.admin-body .field-hint {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 6px;
}

.admin-body .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.admin-body .form-grid .wide {
  grid-column: 1 / -1;
}

.admin-body .feature-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-body .feature-admin-stats,
.admin-body .feature-admin-quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-body .feature-admin-list {
  display: grid;
  gap: 10px;
}

.admin-body .feature-admin-row {
  padding: 16px 18px;
}

.admin-body .feature-admin-row.is-hidden {
  opacity: 0.72;
}

.admin-body .feature-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-body .feature-admin-id {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-body .feature-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font: 11px var(--mono);
  color: var(--text-secondary);
}

.admin-body .telegram-settings-card {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.admin-body .telegram-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-body .telegram-settings-head p code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
}

.admin-body .telegram-form-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-body .telegram-url-field {
  flex: 1 1 260px;
  min-width: 0;
}

.admin-body .telegram-switch-toggle {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
}

.admin-body .switch > span {
  background: #27272a;
  border-radius: 999px;
  clip-path: none;
}

.admin-body .switch > span:after {
  background: #a1a1aa;
  border-radius: 50%;
}

.admin-body .switch input:checked + span {
  background: #00dd58;
}

.admin-body .switch input:checked + span:after {
  background: #ffffff;
}

.admin-body .bulk-key-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  clip-path: none;
}

.admin-body .bulk-key-bar.is-visible {
  display: flex;
}

.admin-body .bulk-key-info strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-primary);
}

.admin-body .bulk-key-info small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.admin-body .key-chk {
  width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  margin: 0;
  accent-color: #00dd58;
  cursor: pointer;
}

.admin-body .empty-state {
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-surface);
  min-height: 180px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.admin-body .empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  clip-path: none;
}

.admin-body .runtime-state {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-body .audit-entry {
  border-color: var(--border-subtle);
  padding: 11px 0;
}

.admin-body .audit-entry strong {
  font-size: 12px;
  color: var(--text-primary);
}

.admin-body .audit-entry small,
.admin-body .audit-entry time {
  color: var(--text-muted);
  font-size: 10.5px;
}

.admin-body .chart-column i {
  background: linear-gradient(#00dd58, #0f4725);
}

/* ==================== DIALOGS & TOAST ==================== */
body.admin-body dialog {
  width: min(560px, calc(100% - 28px));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
  padding: 0;
}

body.admin-body dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

body.admin-body .dialog-head {
  padding: 14px 18px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.admin-body .dialog-head h2 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: none;
  margin: 0;
}

body.admin-body .dialog-body {
  padding: 18px;
}

body.admin-body .dialog-body > p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

body.admin-body .generated-keys {
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: 12px;
  padding: 12px;
}

body.admin-body .toast {
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  font-size: 12px;
  padding: 10px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

body.admin-body .toast.is-error {
  background: #1c1012;
  border-color: var(--st-err-bd);
  color: #fca5a5;
}

body.admin-body .form-error {
  margin-top: 10px !important;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #fca5a5;
  background: var(--st-err-bg);
  border: 1px solid var(--st-err-bd);
}

/* ==================== AUTH PAGES ==================== */
.tv-auth-shell {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tv-auth-card {
  width: 100%;
  max-width: 390px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.tv-auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.tv-auth-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.tv-auth-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.tv-err-msg {
  font-size: 11.5px;
  color: #f87171;
  margin-top: 6px;
  display: block;
}

.tv-auth-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.tv-auth-foot a,
.tv-auth-foot button {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1180px) {
  .tv-stats-grid,
  body.admin-body .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-body .admin-grid,
  .admin-body .settings-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tv-shell {
    flex-direction: column !important;
    width: 100% !important;
  }

  .tv-sidebar {
    display: none;
    width: 256px;
    z-index: 1035;
  }

  .tv-sidebar.open {
    display: flex !important;
    box-shadow: 16px 0 60px rgba(0, 0, 0, 0.75);
  }

  .tv-topbar {
    display: none;
  }

  .tv-mobile-top {
    display: flex !important;
    width: 100% !important;
    flex-shrink: 0;
  }

  .tv-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 0 auto !important;
    min-height: 0 !important;
  }

  .tv-bottom-nav {
    display: flex !important;
    width: 100% !important;
  }

  .tv-bnav-item {
    flex: 1 1 0;
    min-width: 0;
    padding: 4px 2px;
  }

  .tv-content {
    padding: 14px 12px 86px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .tv-footer {
    padding: 12px 14px 86px;
  }

  .tv-page-head,
  body.admin-body .page-heading {
    gap: 10px;
    margin-bottom: 14px;
  }

  .tv-page-title,
  body.admin-body .page-heading h1 {
    font-size: 16px;
  }

  .tv-stats-grid,
  body.admin-body .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }

  .tv-stats-grid > .tv-stat-card:last-child:nth-child(odd),
  body.admin-body .metric-grid > .metric:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .tv-stat-card,
  body.admin-body .metric {
    padding: 11px;
    min-width: 0;
    overflow: hidden;
  }

  .tv-stat-top,
  body.admin-body .metric-top {
    font-size: 9.5px;
    letter-spacing: 0.02em;
    gap: 4px;
  }

  .tv-stat-val,
  body.admin-body .metric-number {
    font-size: 17px;
  }

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

  .admin-body .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-body .maintenance-banner {
    margin: 12px 12px 0;
  }

  .admin-body .table-toolbar {
    padding: 12px;
  }

  .admin-body .table-toolbar .search-field,
  .admin-body .table-toolbar select,
  .admin-body .table-toolbar .btn {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .admin-body .exlitra-card-table,
  .admin-body .exlitra-card-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .admin-body .exlitra-card-table thead {
    display: none;
  }

  .admin-body .exlitra-card-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .admin-body .exlitra-card-table tbody tr {
    display: block;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-elevated);
  }

  .admin-body .exlitra-card-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 4px 12px;
    min-height: 40px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: right;
  }

  .admin-body .exlitra-card-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font: 600 9.5px/1.4 var(--mono);
    text-align: left;
  }

  .admin-body .exlitra-card-table td:last-child {
    border-bottom: 0;
  }

  .admin-body .exlitra-card-table td > .badge,
  .admin-body .exlitra-card-table td > .tv-badge {
    justify-self: end;
  }

  .admin-body .exlitra-card-table .table-actions {
    margin-left: auto;
  }

  .admin-body .exlitra-card-table td.empty-cell {
    display: block;
    text-align: center;
    padding: 28px 14px;
  }

  .admin-body .exlitra-card-table td.empty-cell::before {
    display: none;
  }
}
