:root {
  --bg: #07080a;
  --panel: #111316;
  --panel-2: #191c21;
  --text: #f4f6f8;
  --muted: #a4abb5;
  --cyan: #cbd5e1;
  --blue: #8b949e;
  --steel: #e5e7eb;
  --steel-dark: #6b7280;
  --danger: #ff3864;
  --warning: #ffc857;
  --line: rgba(209, 213, 219, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(75, 85, 99, .26), transparent 32%),
    radial-gradient(circle at 70% 20%, rgba(229, 231, 235, .1), transparent 28%),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(31, 34, 40, .92), rgba(8, 9, 11, .95));
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand strong { display: block; letter-spacing: 0; }
.brand small { color: var(--muted); }

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid rgba(229, 231, 235, .28);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .1), rgba(75, 85, 99, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 28px rgba(0, 0, 0, .32), 0 0 24px rgba(203, 213, 225, .13);
}

.pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 24px var(--cyan);
}

.nav-btn {
  width: 100%;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.nav-btn.active,
.nav-btn:hover {
  color: var(--text);
  border-color: var(--line);
  background: linear-gradient(90deg, rgba(229, 231, 235, .16), rgba(107, 114, 128, .1));
}

.workspace {
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; }
h3 { font-size: 16px; margin-bottom: 14px; }
p, small, span { color: var(--muted); }

.login-panel {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.login-box,
.tool-panel,
.data-panel,
.stats-grid article {
  border: 1px solid var(--line);
  background: rgba(17, 19, 22, .86);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

.login-box {
  width: min(420px, 100%);
  padding: 28px;
}

.login-box h2 { margin-bottom: 18px; }
.form-control {
  color: var(--text);
  background: #1b1e24;
  border: 1px solid rgba(209, 213, 219, .28);
  margin-bottom: 12px;
}

.form-control::placeholder {
  color: #aeb5bf;
  opacity: 1;
}

.form-control:focus {
  color: var(--text);
  background: #20242b;
  border-color: var(--cyan);
  box-shadow: 0 0 0 .2rem rgba(203, 213, 225, .14);
}

.field-label {
  display: block;
  color: #eef2f7;
  font-size: 13px;
  font-weight: 700;
  margin: 10px 0 6px;
}

.panel-divider {
  border-color: rgba(209, 213, 219, .16);
  margin: 18px 0;
}

.combo {
  position: relative;
  margin-bottom: 12px;
}

.combo-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  background: #1b1e24;
  border: 1px solid rgba(209, 213, 219, .28);
  border-radius: 6px;
  padding: 9px 12px;
  min-height: 38px;
}

.combo.open .combo-trigger,
.combo-trigger:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 .2rem rgba(203, 213, 225, .14);
  outline: 0;
}

.combo-arrow {
  color: var(--cyan);
}

.combo-menu {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid rgba(209, 213, 219, .38);
  border-radius: 8px;
  background: #111316;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .46);
  max-height: 230px;
  overflow: auto;
}

.combo.open .combo-menu {
  display: grid;
}

.combo-option {
  border: 0;
  color: #f4f6f8;
  background: transparent;
  text-align: left;
  padding: 11px 14px;
}

.combo-option:disabled {
  color: #7e94aa;
  cursor: not-allowed;
}

.combo-option:not(:disabled):hover,
.combo-option.active {
  color: #07080a;
  background: linear-gradient(90deg, #f8fafc, #8b949e);
}

.btn-outline-danger {
  border-color: rgba(255, 56, 100, .72);
  color: #ff8da4;
}

.btn-outline-danger:hover {
  border-color: #ff3864;
  background: #ff3864;
  color: #fff;
}

.btn-info {
  --bs-btn-color: #07080a;
  --bs-btn-bg: #d1d5db;
  --bs-btn-border-color: #d1d5db;
  --bs-btn-hover-color: #07080a;
  --bs-btn-hover-bg: #f8fafc;
  --bs-btn-hover-border-color: #f8fafc;
  --bs-btn-active-color: #07080a;
  --bs-btn-active-bg: #9ca3af;
  --bs-btn-active-border-color: #9ca3af;
  box-shadow: 0 10px 24px rgba(203, 213, 225, .12);
}

.btn-outline-info {
  --bs-btn-color: #d1d5db;
  --bs-btn-border-color: rgba(209, 213, 219, .58);
  --bs-btn-hover-color: #07080a;
  --bs-btn-hover-bg: #d1d5db;
  --bs-btn-hover-border-color: #d1d5db;
  --bs-btn-active-color: #07080a;
  --bs-btn-active-bg: #9ca3af;
  --bs-btn-active-border-color: #9ca3af;
}

.btn-outline-light {
  border-color: rgba(217, 244, 255, .55);
  color: #eef2f7;
}

.btn-outline-light:hover {
  border-color: var(--cyan);
  background: rgba(203, 213, 225, .16);
  color: #fff;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(560px, calc(100vw - 36px));
  transform: translateX(-50%);
  pointer-events: none;
}

.global-loader {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(3, 4, 6, .54);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.global-loader.d-none {
  display: none !important;
}

.global-loader-card {
  width: min(390px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(229, 231, 235, .24);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(25, 28, 33, .96), rgba(10, 11, 13, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .54), 0 0 42px rgba(203, 213, 225, .12);
  padding: 18px;
}

.global-loader-card img {
  grid-column: 1;
  grid-row: 1;
  z-index: 2;
  width: 52px;
  height: 52px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid rgba(229, 231, 235, .2);
  border-radius: 12px;
  background: #000;
  justify-self: center;
}

.global-loader-copy {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.global-loader-copy strong {
  color: var(--text);
  font-size: 15px;
}

.global-loader-copy span {
  color: var(--muted);
  font-size: 13px;
}

.global-loader-track {
  grid-column: 1;
  grid-row: 1;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(209, 213, 219, .1);
  box-shadow: inset 0 0 0 1px rgba(229, 231, 235, .12), 0 0 28px rgba(203, 213, 225, .12);
}

.global-loader-bar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#f8fafc var(--progress, 12%), #9ca3af calc(var(--progress, 12%) + 8%), rgba(75, 85, 99, .22) 0);
  box-shadow: 0 0 20px rgba(203, 213, 225, .28);
  transition: background .22s ease;
  animation: loaderSpin 1.4s linear infinite;
}

.global-loader-bar::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(25, 28, 33, .98), rgba(8, 9, 11, .98));
  box-shadow: inset 0 0 0 1px rgba(229, 231, 235, .1);
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

.toast-item {
  opacity: 0;
  transform: translateY(12px);
  border: 1px solid rgba(209, 213, 219, .32);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  color: var(--text);
  background: rgba(17, 19, 22, .96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
  padding: 14px 16px;
  transition: opacity .2s ease, transform .2s ease;
}

.toast-item.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-item.success { border-left-color: var(--cyan); }
.toast-item.warning { border-left-color: var(--warning); }
.toast-item.danger { border-left-color: var(--danger); }

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, .72);
}

.confirm-box {
  width: min(440px, calc(100vw - 36px));
  border: 1px solid rgba(209, 213, 219, .34);
  border-radius: 8px;
  background: #111316;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .58);
  padding: 22px;
}

.confirm-box h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.confirm-box p {
  margin-bottom: 18px;
}

.confirm-box .form-control {
  margin-bottom: 6px;
}

.form-error {
  display: block;
  min-height: 18px;
  color: #ff8da4;
  margin-bottom: 14px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.client-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.client-title h2 {
  margin-bottom: 4px;
}

.client-login {
  min-height: 64vh;
  display: grid;
  place-items: center;
}

.client-login-box {
  border-color: rgba(209, 213, 219, .28);
}

.client-login-box p {
  margin-bottom: 18px;
}

.client-panel {
  min-width: 0;
}

.client-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.client-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 22, .72);
  padding: 14px;
}

.client-summary span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.client-summary strong {
  display: block;
  color: var(--cyan);
  font-size: 26px;
  margin-top: 4px;
}

.client-license-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(140, 190, 220, .22);
  border-radius: 8px;
  background: rgba(25, 28, 33, .72);
  padding: 16px;
}

.client-license-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-license-main span,
.client-license-meta span,
.client-ip-inline label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.client-license-main strong {
  font-size: 20px;
}

.client-license-meta {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(190px, 1fr) minmax(210px, 1fr);
  gap: 12px;
}

.client-license-meta div {
  min-width: 0;
  border: 1px solid rgba(140, 190, 220, .14);
  border-radius: 8px;
  background: rgba(17, 19, 22, .42);
  padding: 11px;
}

.client-license-meta strong,
.client-license-meta code {
  display: block;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-license-meta code {
  color: #e5e7eb;
}

.client-ip-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.client-ip-inline label {
  grid-column: 1 / -1;
}

.client-ip-inline .form-control {
  margin-bottom: 0;
}

.current-ip-label {
  min-height: 38px;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
  color: #f4f6f8;
  background: rgba(25, 28, 33, .72);
  border: 1px solid rgba(209, 213, 219, .22);
  border-radius: 6px;
  padding: 8px 12px;
}

.client-reset-payment {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(255, 200, 87, .38);
  border-radius: 8px;
  background: rgba(25, 28, 33, .72);
  padding: 12px;
}

.client-reset-payment img {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  background: #fff;
}

.client-reset-payment strong {
  display: block;
  color: #eef2f7;
  margin-bottom: 8px;
}

.client-reset-payment textarea {
  min-height: 84px;
}

.pix-preview {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
  border: 1px solid rgba(209, 213, 219, .24);
  border-radius: 8px;
  background: rgba(25, 28, 33, .62);
  padding: 14px;
  margin-bottom: 16px;
}

.pix-preview img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
}

.pix-preview textarea {
  min-height: 90px;
  margin-top: 10px;
}

.payment-note {
  display: block;
  color: #d1d5db;
  font-size: 12px;
  margin-top: 6px;
}

.manual-payment-card {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.manual-payment-card strong {
  color: #eef2f7;
}

.manual-payment-card span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.obfuscator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.obf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.obf-options label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.obf-select {
  color: var(--text);
  background: #1b1e24;
  border: 1px solid rgba(209, 213, 219, .28);
  border-radius: 6px;
  padding: 4px 8px;
}

.code-area {
  width: 100%;
  min-height: 520px;
  resize: vertical;
  color: #f4f6f8;
  background: #0f1115;
  border: 1px solid rgba(209, 213, 219, .3);
  border-radius: 8px;
  padding: 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.code-area:focus {
  outline: 0;
  border-color: var(--cyan);
  box-shadow: 0 0 0 .2rem rgba(203, 213, 225, .14);
}

.obf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.obf-progress {
  border: 1px solid rgba(209, 213, 219, .24);
  border-radius: 8px;
  background: rgba(15, 17, 21, .82);
  padding: 12px;
  margin-top: 12px;
}

.obf-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.obf-progress-top span {
  color: #eef2f7;
  font-size: 13px;
  font-weight: 700;
}

.obf-progress-top strong {
  color: var(--cyan);
  font-size: 13px;
}

.obf-progress-track {
  position: relative;
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(140, 190, 220, .14);
}

.obf-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f8fafc, #9ca3af, #6b7280);
  box-shadow: 0 0 18px rgba(203, 213, 225, .34);
  transition: width .18s ease;
}

.obf-progress-bar.running {
  width: 46%;
  animation: progressSweep 1.1s ease-in-out infinite;
}

@keyframes progressSweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}

.file-hint {
  color: #d1d5db;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

@media (max-width: 760px) {
  .client-summary,
  .client-license-meta,
  .client-ip-inline,
  .obfuscator-grid {
    grid-template-columns: 1fr;
  }
}

.client-nav-link {
  display: block;
  text-decoration: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
}

.stats-grid article { padding: 18px; }
.stats-grid strong {
  display: block;
  font-size: 30px;
  color: var(--cyan);
  margin-top: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.metric-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 22, .72);
  padding: 18px;
  min-width: 0;
}

.metric-panel.wide {
  grid-column: span 2;
}

.status-bars,
.mini-grid,
.highlight-list {
  display: grid;
  gap: 10px;
}

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

.status-bars div,
.mini-grid div,
.highlight-list div,
.compact-list div {
  border: 1px solid rgba(209, 213, 219, .14);
  border-radius: 8px;
  background: rgba(25, 28, 33, .62);
  padding: 12px;
}

.status-bars span,
.mini-grid span,
.highlight-list span,
.compact-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status-bars strong,
.mini-grid strong,
.highlight-list strong {
  display: block;
  color: var(--cyan);
  font-size: 22px;
  margin-top: 4px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list strong {
  display: block;
  color: var(--text);
}

.muted-note {
  color: var(--muted);
  margin: 0;
}

.view { display: none; }
.view.active { display: block; }

/* Database Management Styles */
.db-container {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 180px);
}

.db-sidebar {
  width: 280px;
  min-width: 250px;
  background: #252730;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.db-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #333645;
}

.db-sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #eef2f7;
}

.db-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.db-database-name {
  padding: 0.75rem 1rem;
  background: #1e1f25;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.db-tables-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.75rem;
}

.db-table-item {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  color: #cbd5e1;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.db-table-item:hover {
  background: rgba(100, 116, 139, 0.2);
}

.db-table-item.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.15), rgba(38, 99, 235, 0.1));
  color: #f4f6f8;
}

.db-main {
  flex: 1;
  background: #252730;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #333645;
}

.db-header h4 {
  margin: 0;
  color: #eef2f7;
  font-size: 1.15rem;
}

.db-actions {
  display: flex;
  gap: 0.5rem;
}

.db-table-container {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

.db-table-container table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.db-table-container th {
  background: #1e1f25;
  padding: 0.75rem 1rem;
  text-align: left;
  color: #f4f6f8;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 2px solid #333645;
  position: sticky;
  top: 0;
  z-index: 10;
}

.db-table-container td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #333645;
  color: #cbd5e1;
  font-size: 0.9rem;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-table-container tr:hover td {
  background: rgba(0, 229, 255, 0.05);
}

.db-action-buttons {
  display: flex;
  gap: 0.5rem;
}

.db-action-buttons .btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.db-add-form {
  margin-top: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid #333645;
  background: #1e1f25;
}

.db-add-form h5 {
  margin: 0 0 1rem 0;
  color: #eef2f7;
}

.db-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.db-add-buttons {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

.db-add-grid .form-control {
  margin-bottom: 0;
}

.db-add-grid label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Empty State */
.db-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
}

.db-empty svg {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.panel-row {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tool-panel,
.data-panel {
  min-width: 0;
  padding: 18px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: 68vh;
}

table {
  color: var(--text) !important;
  min-width: 720px;
}
td, th { border-color: rgba(140, 163, 184, .16) !important; vertical-align: middle; }
th {
  color: #eef2f7;
  font-size: 13px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.empty-state {
  border: 1px dashed rgba(140, 190, 220, .28);
  border-radius: 8px;
  color: var(--muted);
  padding: 26px;
  text-align: center;
}

.license-list {
  display: grid;
  gap: 10px;
}

.license-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(150px, .9fr) minmax(210px, 1.1fr) 90px 190px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(140, 190, 220, .18);
  border-radius: 8px;
  background: rgba(16, 26, 49, .72);
}

.license-block {
  min-width: 0;
}

.license-block span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.license-block strong,
.license-block code,
.license-block small {
  display: block;
}

.license-block strong {
  color: var(--text);
  line-height: 1.35;
}

.license-block small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.script-name {
  color: #d1d5db !important;
}

.key-block code {
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-block .badge {
  width: fit-content;
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.badge-active {
  background: #18ff72;
  color: #03160b;
  box-shadow: 0 0 18px rgba(24, 255, 114, .34);
}

.badge-pending {
  background: #ffc857;
  color: #1d1300;
  box-shadow: 0 0 18px rgba(255, 200, 87, .28);
}

.badge-inactive,
.badge-suspended,
.badge-expired,
.badge-blacklisted {
  background: #ff174d;
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 23, 77, .34);
}

.log-stream {
  display: grid;
  gap: 10px;
  max-height: 72vh;
  overflow: auto;
}

.log-item {
  padding: 12px;
  background: rgba(16, 26, 49, .78);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
}

.log-item.critical { border-left-color: var(--danger); }
.log-item.warning { border-left-color: var(--warning); }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    gap: 8px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { min-width: 190px; margin-bottom: 0; }
  .nav-btn { width: auto; white-space: nowrap; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-panel.wide { grid-column: auto; }
  .panel-row { grid-template-columns: 1fr; }
  .license-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .license-actions {
    justify-content: flex-start;
  }
}

/* FixGuard visual refresh */
:root {
  --bg: #050608;
  --panel: #121418;
  --panel-2: #1a1d23;
  --text: #f6f7f9;
  --muted: #9da4ae;
  --cyan: #d7dde5;
  --blue: #8f98a5;
  --steel: #f3f4f6;
  --steel-dark: #69717d;
  --line: rgba(229, 231, 235, .14);
  --surface: rgba(18, 20, 24, .82);
  --surface-strong: rgba(24, 27, 33, .94);
  --shadow-soft: 0 22px 70px rgba(0, 0, 0, .34);
  --shadow-glow: 0 0 34px rgba(203, 213, 225, .1);
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(120deg, rgba(229, 231, 235, .075), transparent 34%),
    linear-gradient(180deg, rgba(31, 34, 40, .34), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 72px),
    var(--bg);
}

.shell {
  grid-template-columns: 284px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(229, 231, 235, .12);
  background:
    linear-gradient(180deg, rgba(28, 31, 37, .98), rgba(8, 9, 11, .96)),
    #0a0b0d;
  box-shadow: 18px 0 60px rgba(0, 0, 0, .28);
}

.brand {
  min-height: 70px;
  margin-bottom: 26px;
  padding: 10px;
  border: 1px solid rgba(229, 231, 235, .12);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.brand strong {
  font-size: 18px;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
}

.nav-btn {
  position: relative;
  min-height: 44px;
  border-color: rgba(229, 231, 235, .08);
  border-radius: 8px;
  color: #b5bcc7;
  background: rgba(255, 255, 255, .015);
  font-weight: 700;
  overflow: hidden;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-btn.active,
.nav-btn:hover {
  color: #fff;
  border-color: rgba(229, 231, 235, .18);
  background: linear-gradient(90deg, rgba(243, 244, 246, .18), rgba(75, 85, 99, .1));
  transform: translateX(2px);
}

.nav-btn.active::before,
.nav-btn:hover::before {
  background: linear-gradient(180deg, #fff, #8f98a5);
  box-shadow: 0 0 16px rgba(243, 244, 246, .34);
}

.workspace {
  padding: 30px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 86px;
  margin: -30px -30px 26px;
  padding: 18px 30px;
  border-bottom: 1px solid rgba(229, 231, 235, .1);
  background: rgba(5, 6, 8, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 800;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 4px;
  color: #aeb5bf;
}

#adminAvatar,
#profileAvatarPreview {
  border-color: rgba(229, 231, 235, .5) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28), 0 0 22px rgba(203, 213, 225, .12);
}

#adminEditBtn {
  color: #08090b;
  border: 1px solid rgba(255, 255, 255, .28);
  background: linear-gradient(135deg, #f8fafc, #9ca3af);
}

.actions .btn,
.obf-actions .btn,
.db-actions .btn,
.confirm-actions .btn,
.license-actions .btn {
  border-radius: 8px;
  font-weight: 700;
}

.login-panel,
.client-login {
  min-height: calc(100vh - 150px);
}

.login-box,
.tool-panel,
.data-panel,
.stats-grid article,
.metric-panel,
.client-summary article,
.client-license-card,
.db-sidebar,
.db-main {
  border-color: rgba(229, 231, 235, .13);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .045), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.login-box,
.tool-panel,
.data-panel,
.metric-panel,
.client-license-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.tool-panel:hover,
.data-panel:hover,
.metric-panel:hover,
.client-license-card:hover,
.stats-grid article:hover {
  border-color: rgba(229, 231, 235, .22);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .4), 0 0 42px rgba(203, 213, 225, .12);
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
}

.stats-grid article {
  position: relative;
  min-height: 126px;
  padding: 18px;
  overflow: hidden;
}

.stats-grid article::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #f8fafc, #8f98a5, transparent);
}

.stats-grid span,
.client-summary span,
.status-bars span,
.mini-grid span,
.highlight-list span,
.compact-list span,
.license-block span,
.client-license-main span,
.client-license-meta span,
.client-ip-inline label {
  color: #9da4ae;
  letter-spacing: .06em;
}

.stats-grid strong,
.client-summary strong,
.status-bars strong,
.mini-grid strong,
.highlight-list strong {
  color: #f8fafc;
  text-shadow: 0 0 24px rgba(203, 213, 225, .16);
}

.dashboard-grid {
  gap: 16px;
}

.metric-panel,
.tool-panel,
.data-panel {
  padding: 20px;
}

.metric-panel h3,
.tool-panel h3,
.data-panel h3,
.login-box h2 {
  color: #fff;
  font-weight: 800;
}

.form-control,
.combo-trigger,
.obf-select,
.code-area,
.current-ip-label {
  border-color: rgba(229, 231, 235, .16);
  background: rgba(5, 6, 8, .42);
  border-radius: 8px;
}

.form-control:focus,
.combo.open .combo-trigger,
.combo-trigger:focus,
.code-area:focus {
  border-color: rgba(248, 250, 252, .62);
  box-shadow: 0 0 0 .18rem rgba(203, 213, 225, .14);
}

.combo-menu {
  border-color: rgba(229, 231, 235, .2);
  background: #111316;
}

.combo-option:not(:disabled):hover,
.combo-option.active {
  color: #07080a;
  background: linear-gradient(90deg, #f8fafc, #9ca3af);
}

.btn-info {
  background: linear-gradient(135deg, #f8fafc, #9ca3af);
  border-color: rgba(248, 250, 252, .7);
  box-shadow: 0 12px 28px rgba(203, 213, 225, .14);
}

.btn-info:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-outline-info,
.btn-outline-light {
  background: rgba(255, 255, 255, .025);
}

.btn-outline-info:hover,
.btn-outline-light:hover {
  transform: translateY(-1px);
}

.table-wrap,
.db-table-container,
.log-stream {
  border: 1px solid rgba(229, 231, 235, .08);
  border-radius: 8px;
  background: rgba(5, 6, 8, .24);
}

table {
  margin-bottom: 0 !important;
}

th,
.db-table-container th {
  color: #f4f6f8;
  background: rgba(255, 255, 255, .055);
}

td,
.db-table-container td {
  color: #d6dbe2;
}

.license-row,
.status-bars div,
.mini-grid div,
.highlight-list div,
.compact-list div,
.client-license-meta div,
.client-reset-payment,
.pix-preview,
.manual-payment-card {
  border-color: rgba(229, 231, 235, .11);
  background: rgba(5, 6, 8, .32);
}

.script-name,
.key-block code,
.client-license-meta code {
  color: #e5e7eb !important;
}

.badge-active {
  background: linear-gradient(135deg, #f8fafc, #a7f3d0);
  color: #06130d;
  box-shadow: 0 0 18px rgba(167, 243, 208, .18);
}

.badge-pending {
  background: linear-gradient(135deg, #f8fafc, #fcd34d);
  color: #1d1300;
}

.badge-inactive,
.badge-suspended,
.badge-expired,
.badge-blacklisted {
  background: linear-gradient(135deg, #fb7185, #7f1d1d);
}

.log-item {
  border-left-color: #d1d5db;
  background: rgba(5, 6, 8, .34);
}

.db-sidebar,
.db-main {
  background: var(--surface-strong);
  border: 1px solid rgba(229, 231, 235, .12);
}

.db-sidebar-header,
.db-header {
  border-bottom-color: rgba(229, 231, 235, .1);
  background: rgba(255, 255, 255, .025);
}

.db-database-name,
.db-add-form,
.db-table-container th {
  background: rgba(5, 6, 8, .42);
}

.db-table-item {
  color: #cbd5e1;
}

.db-table-item.active,
.db-table-item:hover {
  color: #fff;
  background: linear-gradient(90deg, rgba(229, 231, 235, .14), rgba(107, 114, 128, .08));
}

.global-loader-card {
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .05), transparent 38%),
    rgba(12, 13, 16, .98);
}

@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .brand {
    min-width: 220px;
  }

  .topbar {
    position: static;
    margin: -30px -30px 22px;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 20px;
  }

  .topbar {
    margin: -20px -20px 20px;
    padding: 16px 20px;
    align-items: flex-start;
  }

  .stats-grid,
  .client-summary {
    grid-template-columns: 1fr;
  }

  .global-loader-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .global-loader-copy,
  .global-loader-card img,
  .global-loader-track {
    grid-column: 1;
  }
}
