:root,
html[data-theme="light"] {
  color-scheme: light;
  --brand: #7c3aed;
  --brand-2: #8b5cf6;
  --brand-dark: #6d28d9;
  --brand-deep: #5b21b6;
  --bg: #f7f5ff;
  --body-bg: #f7f5ff;
  --ink: #1f1235;
  --muted: #6d5f86;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --input-bg: #ffffff;
  --line: rgba(109, 40, 217, 0.14);
  --accent: var(--brand);
  --accent-2: var(--brand-2);
  --accent-soft: rgba(124, 58, 237, 0.1);
  --login-shell-bg: #f4efff;
  --login-purple: var(--brand);
  --login-purple-dark: var(--brand-dark);
  --login-panel-bg: #ffffff;
  --login-panel-ink: #24113d;
  --login-panel-muted: #6d5f86;
  --login-field-bg: #faf8ff;
  --login-layout-border: rgba(109, 40, 217, 0.08);
  --login-layout-shadow: none;
  --sidebar-bg: #1a1030;
  --sidebar-ink: #f7f3ff;
  --sidebar-muted: #b7a8d6;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(124, 58, 237, 0.18);
  --feed-bg: rgba(124, 58, 237, 0.05);
  --feed-hover: rgba(124, 58, 237, 0.08);
  --table-head-bg: rgba(124, 58, 237, 0.04);
  --table-hover: rgba(124, 58, 237, 0.05);
  --dialog-bg: #ffffff;
  --dialog-backdrop: rgba(36, 17, 61, 0.45);
  --toast-bg: #24113d;
  --toast-ink: #f7f3ff;
  --toast-border: rgba(196, 181, 253, 0.28);
  --btn-ink: #ffffff;
  --topbar-bg: transparent;
  --ok: #6d28d9;
  --bad: #b4234a;
  --warn: #a16207;
  --shadow: 0 1px 3px rgba(91, 33, 182, 0.08), 0 8px 24px rgba(91, 33, 182, 0.06);
  --radius: 12px;
  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --display: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --brand: #7c3aed;
  --brand-2: #8b5cf6;
  --brand-dark: #6d28d9;
  --brand-deep: #5b21b6;
  --bg: #101114;
  --body-bg: #101114;
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --panel: #181a1f;
  --panel-solid: #181a1f;
  --input-bg: #22252b;
  --line: rgba(255, 255, 255, 0.1);
  --accent: var(--brand-2);
  --accent-2: #a78bfa;
  --accent-soft: rgba(124, 58, 237, 0.16);
  --login-shell-bg: #0f0a18;
  --login-panel-bg: #1a1428;
  --login-panel-ink: #f4efff;
  --login-panel-muted: #b7a8d6;
  --login-field-bg: #221a34;
  --login-layout-border: rgba(255, 255, 255, 0.06);
  --login-layout-shadow: none;
  --login-purple: var(--brand-2);
  --login-purple-dark: var(--brand-dark);
  --sidebar-bg: #14161a;
  --sidebar-ink: #f3f4f6;
  --sidebar-muted: #9ca3af;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(124, 58, 237, 0.22);
  --feed-bg: rgba(255, 255, 255, 0.04);
  --feed-hover: rgba(255, 255, 255, 0.07);
  --table-head-bg: rgba(255, 255, 255, 0.04);
  --table-hover: rgba(255, 255, 255, 0.05);
  --dialog-bg: #181a1f;
  --dialog-backdrop: rgba(0, 0, 0, 0.65);
  --toast-bg: #1a1230;
  --toast-ink: #f4efff;
  --toast-border: rgba(168, 85, 247, 0.35);
  --ok: #a78bfa;
  --bad: #f87171;
  --warn: #fbbf24;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 500;
  color: var(--ink);
  background: var(--body-bg);
  overflow-x: hidden;
}

/* Prevent display:grid from overriding the hidden attribute */
[hidden],
.is-hidden {
  display: none !important;
}

body.login-page {
  background: var(--login-shell-bg);
  color: var(--ink);
}

.login-ambient { display: none; }

.login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-layout {
  width: min(1080px, 100%);
  min-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--login-layout-border);
  box-shadow: var(--login-layout-shadow);
}

.login-showcase {
  padding: 48px 42px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 45%, var(--brand-deep) 100%);
  display: grid;
  align-items: center;
}

.login-showcase-inner { display: grid; gap: 14px; }

.login-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
}

.login-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand-name {
  margin: 14px 0 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
}

.login-lead {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 28ch;
}

.login-features {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding-inline-end: 4px;
}

.login-features li {
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.98rem;
}

.login-panel {
  background: var(--login-panel-bg);
  display: grid;
  align-items: center;
  padding: 42px 38px;
}

.login-panel-inner { width: min(380px, 100%); margin: 0 auto; }

.login-panel-head { margin-bottom: 28px; }

.login-panel-kicker {
  margin: 0 0 8px;
  color: var(--login-purple);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-panel-head h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--login-panel-ink);
}

.login-panel-sub {
  margin: 0;
  color: var(--login-panel-muted);
  font-size: 1rem;
}

.login-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.96rem;
  color: var(--login-panel-muted);
}

.login-field input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--login-field-bg);
  border-radius: 16px;
  padding: 15px 16px;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-submit {
  width: 100%;
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 55%, var(--brand-dark) 100%);
  color: var(--btn-ink, #ffffff);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.2);
}

.login-submit:hover { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); }

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--muted);
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.login-discord {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border-radius: 16px;
  padding: 15px 18px;
  background: #5865f2;
  color: #fff;
  font-weight: 700;
}

.login-discord.is-disabled { opacity: 0.72; cursor: not-allowed; }

.login-discord-hint {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.login-error {
  margin: 14px 0 0;
  text-align: center;
  color: var(--ink);
  font-size: 0.92rem;
}

.bg-grid, .bg-glow { display: none; }

@media (max-width: 900px) {
  .login-shell {
    padding: 16px;
    place-items: start;
    min-height: 100dvh;
  }

  .login-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    width: 100%;
    border-radius: 20px;
  }

  .login-showcase {
    padding: 28px 22px;
  }

  .login-logo-wrap {
    width: 84px;
    height: 84px;
    border-radius: 22px;
  }

  .login-brand-name {
    font-size: 1.45rem;
  }

  .login-lead {
    max-width: none;
    font-size: 1.05rem;
  }

  .login-features {
    display: grid;
    max-height: none;
    overflow: visible;
  }

  .login-features li {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .login-panel {
    padding: 28px 22px 32px;
  }

  .login-panel-inner {
    width: 100%;
  }

  .login-panel-head h2 {
    font-size: 1.65rem;
  }
}

@media (max-width: 480px) {
  .login-shell {
    padding: 12px;
  }

  .login-layout {
    border-radius: 16px;
  }

  .login-showcase {
    padding: 22px 18px;
  }

  .login-panel {
    padding: 22px 18px 26px;
  }

  .login-panel-head {
    margin-bottom: 22px;
  }

  .login-panel-head h2 {
    font-size: 1.45rem;
  }

  .login-field input {
    padding: 13px 14px;
  }

  .login-submit,
  .login-discord {
    padding: 13px 16px;
  }
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.7rem;
  margin: 0 0 8px;
  color: var(--accent);
}

.sub, .hint { color: var(--muted); font-size: 0.92rem; margin: 0 0 22px; }
.form-hint { margin: -4px 0 14px; line-height: 1.55; }
label {
  display: grid; gap: 8px; margin-bottom: 14px; font-size: 0.9rem; color: var(--muted);
}
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 500;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
button {
  border: 1px solid var(--line);
  background: var(--panel-solid);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--feed-hover); }
button.primary {
  background: var(--accent);
  color: var(--btn-ink, #ffffff);
  border-color: transparent;
}
.error { color: var(--ink); margin-top: 12px; }

.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 20px 14px;
  border-left: 1px solid var(--sidebar-line);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--sidebar-line);
}
.side-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--sidebar-line);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
}
.side-logo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.side-brand-text { display: grid; gap: 4px; min-width: 0; }
.side-brand strong {
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--sidebar-ink);
}
.side-brand small {
  color: var(--sidebar-muted);
  font-size: 0.78rem;
}
.side-nav { display: grid; gap: 6px; padding: 4px 2px; }
.nav-btn {
  text-align: right;
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--sidebar-muted);
  font-weight: 600;
  font-size: 0.88rem;
}
.nav-btn.active {
  background: var(--sidebar-active);
  color: var(--sidebar-ink);
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-ink);
}
.side-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 6px;
  border-top: 1px solid var(--sidebar-line);
  font-size: 0.84rem;
}
.side-foot span {
  color: var(--sidebar-ink);
  font-weight: 600;
}
#logout-btn {
  padding: 7px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sidebar-line);
  color: var(--sidebar-ink);
}
.main {
  padding: 28px 34px 48px;
  max-width: 1440px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 20px;
  padding: 16px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg, transparent);
  border-radius: 12px;
}
.topbar-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
}
.topbar p { margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; }
.tab { display: none; }
.tab.active { display: block; }

.stat-row,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.stat-label,
.stat span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.stat strong {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}
.stat.ok strong { color: var(--ok); }
.stat.bad strong,
.stat.warn strong { color: var(--ink); }
.stat small { font-size: 0.72rem; color: var(--muted); }

.split,
.overview-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.panel, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.panel-tag.warn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
.panel-tag.free {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

html[data-theme="dark"] .panel-tag.warn {
  background: rgba(255, 255, 255, 0.08);
}

.panel-feed .feed { min-height: 280px; }

.feed {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.feed-item {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--feed-bg);
  border: 1px solid var(--line);
}

.feed-item:hover {
  background: var(--feed-hover);
}

.feed-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.feed-item strong {
  font-size: 1rem;
  font-weight: 700;
}

.side-logo-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.event-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.event-badge.info { background: var(--accent-soft); color: var(--accent); }
.event-badge.warn,
.event-badge.bad {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.blacklist-layout {
  display: grid;
  gap: 16px;
}
.blacklist-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  align-items: end;
}
.blacklist-field {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.blacklist-field-wide {
  grid-column: span 1;
}
.blacklist-field input {
  width: 100%;
  margin: 0;
}
.blacklist-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}
.blacklist-list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.blacklist-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.danger-panel {
  margin-top: 16px;
  border-color: var(--line);
}
.danger-panel h3 { color: var(--ink); }
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
.products-table {
  table-layout: fixed;
  min-width: 860px;
}
.products-table tbody tr {
  height: auto;
}
.products-table .name-line {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}
.products-table .name-line strong {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 42%;
}
.products-table .name-line .slug {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.products-table .cell-name,
.products-table .cell-link,
.products-table .cell-compact,
.products-table .cell-badge,
.products-table .cell-status,
.products-table .cell-hwid,
.products-table .cell-key,
.products-table .cell-detail,
.products-table .cell-reason,
.products-table .cell-actions {
  white-space: nowrap;
  vertical-align: middle;
}
.products-table td strong {
  display: inline;
  line-height: inherit;
}
.products-table td .mono {
  display: inline;
  margin-top: 0;
  word-break: normal;
  white-space: nowrap;
}
.products-table .cell-compact {
  white-space: nowrap;
  color: var(--muted);
}
.products-table .cell-badge,
.products-table .cell-status {
  white-space: nowrap;
}
.products-table .cell-badge .hash {
  display: none;
}
.products-table .cell-actions {
  vertical-align: middle;
}
.products-table .cell-line {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  vertical-align: middle;
}
.products-table .cell-line .mono-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.products-table .cell-line .badge,
.products-table .cell-line button {
  flex: 0 0 auto;
}
.products-table .cell-actions .row-actions,
.products-table .cell-line.row-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  vertical-align: middle;
}
.products-table .col-name { width: 20%; }
.products-table .col-type { width: 9%; }
.products-table .col-files { width: 7%; }
.products-table .col-encrypt { width: 15%; }
.products-table .col-dist { width: 10%; }
.products-table .col-status { width: 12%; }
.products-table .col-actions { width: 27%; }
.products-table tbody td {
  vertical-align: middle;
  padding-top: 10px;
  padding-bottom: 10px;
}
.free-products-table .col-name { width: 16%; }
.free-products-table .col-type { width: 9%; }
.free-products-table .col-encrypt { width: 13%; }
.free-products-table .col-licenses { width: 10%; }
.free-products-table .col-link { width: 22%; }
.free-products-table .col-actions { width: 30%; }
.free-products-table .cell-actions .row-actions,
.boost-products-table .cell-actions .row-actions {
  flex-wrap: wrap;
  overflow-x: visible;
  max-width: none;
}
.boost-products-table .col-name { width: 22%; }
.boost-products-table .col-type { width: 10%; }
.boost-products-table .col-encrypt { width: 14%; }
.boost-products-table .col-licenses { width: 12%; }
.boost-products-table .col-note { width: 18%; }
.boost-products-table .col-actions { width: 24%; }
.badge.boost {
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.45);
}
.free-products-table .cell-link .link-text {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.76rem;
}
.blacklist-table .col-time { width: 14%; }
.blacklist-table .col-hwid { width: 24%; }
.blacklist-table .col-reason { width: 20%; }
.blacklist-table .col-source { width: 10%; }
.blacklist-table .col-license { width: 16%; }
.blacklist-table .col-actions { width: 16%; }
.blacklist-table td.cell-hwid {
  display: table-cell;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  min-width: 100%;
}
.blacklist-table .cell-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tampers-table {
  min-width: 980px;
}
.tampers-table .col-time { width: 12%; }
.tampers-table .col-reason { width: 16%; }
.tampers-table .col-key { width: 24%; }
.tampers-table .col-hwid { width: 22%; }
.tampers-table .col-action { width: 18%; }
.tampers-table .col-actions { width: 10%; }
.tampers-table td.cell-hwid {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  min-width: 100%;
}
.tampers-table .cell-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.licenses-table {
  min-width: 1080px;
}
.licenses-table .col-key { width: 22%; }
.licenses-table .col-customer { width: 14%; }
.licenses-table .col-product { width: 10%; }
.licenses-table .col-status { width: 8%; }
.licenses-table .col-hwid { width: 22%; }
.licenses-table .col-expires { width: 10%; }
.licenses-table .col-actions { width: 14%; }
.licenses-table td.cell-key,
.tampers-table td.cell-key {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  min-width: 100%;
}
.audit-table td.cell-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  min-width: 100%;
}
.sessions-table {
  min-width: 980px;
}
.sessions-table .col-customer { width: 10%; }
.sessions-table .col-product { width: 16%; }
.sessions-table .col-device { width: 24%; }
.sessions-table .col-time { width: 12%; }
.sessions-table .col-ip { width: 10%; }
.sessions-table .col-status { width: 12%; }
.sessions-table .col-actions { width: 16%; }
.sessions-table .cell-badge {
  white-space: nowrap;
}
.audit-table {
  min-width: 920px;
}
.audit-table .col-time { width: 12%; }
.audit-table .col-event { width: 14%; }
.audit-table .col-severity { width: 8%; }
.audit-table .col-detail { width: 58%; }
.audit-table .col-actions { width: 8%; }
.customers-table {
  min-width: 980px;
}
.customers-table .col-name { width: 12%; }
.customers-table .col-email { width: 14%; }
.customers-table .col-products { width: 34%; }
.customers-table .col-licenses { width: 8%; }
.customers-table .col-portal { width: 14%; }
.customers-table .col-actions { width: 18%; }
.customers-table .cell-badge .badge {
  margin-inline-end: 6px;
}
.products-table td.cell-hwid {
  vertical-align: middle;
}
@media (max-width: 860px) {
  .blacklist-form {
    grid-template-columns: 1fr;
  }
}
.muted-dash {
  color: var(--muted);
  font-size: 0.82rem;
}
th, td {
  text-align: right;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.92rem;
}
tbody tr:hover {
  background: var(--table-hover);
}
tbody tr:last-child td {
  border-bottom: none;
}
th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: var(--table-head-bg);
  white-space: nowrap;
}
.products-table td.mono,
.products-table .cell-key,
.products-table .mono.slug,
.products-table .mono-line,
.products-table .cell-detail {
  word-break: normal;
  overflow-wrap: normal;
  margin-top: 0;
}
td strong {
  display: block;
  font-weight: 700;
  line-height: 1.4;
}
.products-table td strong {
  display: inline;
  line-height: inherit;
}
td .mono {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
  word-break: break-all;
}
.products-table td .mono {
  display: inline;
  margin-top: 0;
  word-break: normal;
  white-space: nowrap;
}
td.mono, .mono { font-family: var(--mono); font-size: 0.8rem; }
.badge {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.active { background: rgba(124, 58, 237, 0.14); color: var(--accent); }
.badge.encrypted { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.badge.waiting,
.badge.pending,
.badge.revoked {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}
.badge.free { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.badge.paid { background: rgba(124, 58, 237, 0.14); color: var(--accent); }
.toolbar {
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .primary {
  min-width: 132px;
}
.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  max-width: 100%;
}
.row-actions button {
  padding: 8px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.row-actions a.btn-like {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--btn-ink, #ffffff);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.row-actions a.btn-like:hover { filter: brightness(1.05); }
.row-actions button.danger { color: var(--ink); }
button.danger {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}
button.danger:hover { background: rgba(255, 255, 255, 0.08); }
button:disabled { cursor: not-allowed; opacity: 0.58; transform: none; }

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  width: min(460px, calc(100vw - 24px));
  background: var(--dialog-bg);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: var(--dialog-backdrop); backdrop-filter: blur(4px); }
.dlg-form { padding: 0; }
.dlg-panel .dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--feed-bg);
}
.dlg-head-copy { min-width: 0; flex: 1; }
.dlg-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dlg-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.25;
}
.dlg-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}
.dlg-body {
  padding: 20px 24px 4px;
}
.dlg-body .hint,
.dlg-body .form-hint {
  margin-bottom: 14px;
}
.dlg-body label:last-child {
  margin-bottom: 0;
}
.dlg-panel .dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-solid);
}
.dlg-panel .dlg-actions .primary { width: auto; }
.dlg-form:not(.dlg-panel) { padding: 24px; }
.dlg-form:not(.dlg-panel) h3 { margin: 0 0 16px; font-family: var(--display); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dlg-actions .primary { width: auto; }
.license-done-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}
.license-done-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.license-done-link:hover { border-color: var(--accent); color: var(--accent); }
#dlg-details { width: min(760px, calc(100vw - 24px)); }
#dlg-confirm { width: min(500px, calc(100vw - 24px)); }
.details-box, .confirm-box { width: 100%; min-width: 0; }
.details-grid { display: grid; gap: 12px; max-height: min(62vh, 620px); overflow: auto; padding-inline-end: 3px; }
.detail-section {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--feed-bg);
}
.detail-section h4 { margin: 0; font-size: 0.95rem; font-family: var(--display); }
.detail-rows { display: grid; grid-template-columns: minmax(120px, 0.36fr) minmax(0, 1fr); gap: 8px 14px; }
.detail-label { color: var(--muted); font-size: 0.86rem; }
.detail-value { overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-json {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  direction: ltr;
  text-align: left;
  background: var(--feed-bg);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: pre-wrap;
  overflow: auto;
}
.detail-list { display: grid; gap: 8px; }
.detail-list-item {
  padding: 10px;
  border-radius: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.detail-list-item strong { display: block; margin-bottom: 5px; }
.detail-list-item small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.confirm-box .hint { line-height: 1.8; margin-bottom: 14px; }
.expiring-panel { margin-top: 16px; }
.expiring-panel .feed { max-height: 280px; }

.toast {
  position: fixed;
  z-index: 9999;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--toast-ink);
  border: 1px solid var(--toast-border, transparent);
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: min(92vw, 520px);
  text-align: center;
  animation: rise .25s ease both;
}
.toast.is-warn {
  border-color: rgba(251, 191, 36, 0.45);
}
.toast.is-bad {
  border-color: rgba(248, 113, 113, 0.45);
}
.toast.is-ok {
  border-color: rgba(167, 139, 250, 0.45);
}

.license-dm-status {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.7;
}
.license-dm-status.is-ok {
  border-color: rgba(167, 139, 250, 0.35);
}
.license-dm-status.is-warn {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.empty {
  color: var(--muted);
  padding: 32px 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--feed-bg);
  font-size: 0.9rem;
  line-height: 1.6;
}

.progress-wrap {
  margin: 8px 0 14px;
  display: grid;
  gap: 6px;
}
.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .2s ease;
}
.progress-wrap small { color: var(--muted); font-family: var(--mono); }

.guide-box .steps,
.guide-panel .steps {
  margin: 0;
  padding-inline-start: 1.2rem;
  display: grid;
  gap: 10px;
  color: var(--ink);
  line-height: 1.7;
}
.code {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--feed-bg);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
}
.guide-panel { padding: 22px; }
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.guide-grid article {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--feed-bg);
}
.guide-grid h4 {
  margin: 0 0 10px;
  font-family: var(--display);
}

@media (max-width: 1200px) {
  .stat-row,
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    min-height: auto;
    border-left: none;
    border-bottom: 1px solid var(--line);
  }
  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-row, .stats-grid, .split, .overview-split, .guide-grid { grid-template-columns: 1fr 1fr; }
  .main { padding: 20px 18px 40px; max-width: none; }
}
@media (max-width: 640px) {
  .stat-row, .stats-grid, .split, .overview-split, .guide-grid { grid-template-columns: 1fr; }
  .side-nav { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 40px; }
  .details-box, .confirm-box { min-width: 0; }
  .detail-rows { grid-template-columns: 1fr; gap: 3px; }
  .topbar { flex-direction: column; align-items: stretch; }
}
