:root {
  --bg: #09090d;
  --side: #101013;
  --side-strong: #08090d;
  --panel: rgba(20, 20, 22, 0.9);
  --panel-soft: rgba(30, 28, 35, 0.78);
  --header: rgba(55, 38, 74, 0.86);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(157, 91, 255, 0.45);
  --text: #f7f5fb;
  --muted: #bab4c8;
  --purple: #9b5cff;
  --blue: #3e6bff;
  --cyan: #17c8ff;
  --orange: #ffab16;
  --green: #24d17e;
  --red: #ff405d;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.45)),
    url("./network-bg.png") center / cover no-repeat;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 34px;
  border: 1px solid rgba(155, 92, 255, 0.38);
  border-radius: 8px;
  background: rgba(10, 10, 13, 0.86);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 126px;
  height: 126px;
  object-fit: contain;
}

.login-card h1,
.login-card p {
  margin: 0;
  text-align: center;
}

.login-card p {
  color: var(--muted);
}

.login-form {
  width: 100%;
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #141416, #090a0d);
}

.sidebar-logo {
  padding: 20px 18px 16px;
  display: grid;
  place-items: center;
}

.sidebar-logo img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  background: transparent;
}

.sidebar-credits {
  min-height: 88px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
}

.sidebar-credits span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.sidebar-credits strong {
  color: var(--green);
  font-size: 1.55rem;
  line-height: 1;
}

.nav-list {
  display: grid;
  gap: 8px;
  padding: 26px 8px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 16px;
  background: transparent;
  color: #c7c1d1;
  text-align: left;
  font-weight: 800;
}

.nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  opacity: 0.8;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(164, 93, 255, 0.62);
  background: linear-gradient(135deg, rgba(156, 83, 255, 0.62), rgba(54, 74, 171, 0.58));
  color: #fff;
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(12, 12, 14, 0.58), rgba(12, 12, 14, 0.78)),
    url("./network-bg.png") center / cover fixed no-repeat;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 12, 14, 0.88);
}

.menu-button,
.icon-button {
  width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
}

.topbar-spacer {
  flex: 1;
}

.account-badge {
  display: grid;
  gap: 1px;
}

.account-badge strong {
  font-size: 0.9rem;
}

.account-badge span {
  color: var(--muted);
  font-size: 0.78rem;
}

.balance-pill {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
}

.balance-pill strong {
  min-width: 54px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: #0ac39f;
}

.panel-section,
.stats-grid {
  width: min(1080px, calc(100vw - 244px));
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 30px;
  padding-top: 18px;
}

.stats-grid article {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(18, 18, 20, 0.78);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.25);
}

.stats-grid strong {
  color: var(--cyan);
  font-size: 1.35rem;
}

.stats-grid article:nth-child(2) strong {
  color: #00d0aa;
}

.stats-grid article:nth-child(4) strong {
  color: var(--orange);
}

.stats-grid article:nth-child(5) strong {
  color: var(--red);
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-section {
  padding: 34px 0 42px;
}

.section-banner,
.hero-panel,
.create-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(108, 82, 255, 0.38);
  border-radius: 8px 8px 0 0;
  padding: 18px 20px;
  background: linear-gradient(100deg, rgba(82, 47, 102, 0.92), rgba(27, 35, 82, 0.92));
}

.hero-panel {
  border-radius: 8px;
}

.section-banner h1,
.hero-panel h1,
.create-heading h1 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
}

.section-banner p,
.hero-panel p {
  margin: 5px 0 0;
  color: var(--muted);
}

.eyebrow,
label span {
  margin: 0;
  color: #dfd9ea;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.credit-strip {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(28, 28, 29, 0.78);
  color: #fff;
}

.credit-strip strong {
  color: #fff;
}

.filters-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px);
  gap: 30px;
  margin: 32px 0 24px;
}

label {
  display: grid;
  gap: 9px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(16, 16, 18, 0.9);
  color: var(--text);
  outline: none;
  padding: 10px 13px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

select option {
  color: #121216;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(155, 92, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.18);
}

.primary-button,
.warning-button,
.success-button,
.danger-button,
.secondary-button,
.ghost-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 9px 15px;
  color: #fff;
  font-weight: 900;
}

.primary-button {
  background: linear-gradient(135deg, var(--purple), var(--blue));
}

.warning-button {
  color: #3b2500;
  background: linear-gradient(135deg, #ffc32c, #ff9700);
  box-shadow: inset 0 0 0 3px rgba(123, 65, 255, 0.55);
}

.success-button {
  background: linear-gradient(135deg, #26d982, #12a968);
}

.danger-button {
  background: linear-gradient(135deg, #ff405d, #e22f4d);
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.table-panel,
.create-card,
.tool-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(17, 17, 19, 0.82);
  box-shadow: var(--shadow);
}

.client-table {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.seller-table {
  min-width: 760px;
}

.licenses-table {
  min-width: 940px;
}

th {
  padding: 14px 13px;
  background: rgba(82, 59, 92, 0.95);
  color: #f1e9fb;
  text-align: left;
  font-size: 0.9rem;
}

td {
  padding: 14px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(38, 38, 39, 0.78);
  vertical-align: middle;
}

td strong {
  display: block;
}

td small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.code-pill {
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 900;
  padding: 0;
}

.whatsapp-link {
  color: #00dc97;
  text-decoration: none;
}

.status,
.time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.status.active,
.status.ok,
.time-pill.ok {
  color: #dfffee;
  background: rgba(36, 209, 126, 0.72);
}

.status.used {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
}

.status.paused,
.time-pill.warn {
  color: #ffe9ba;
  background: rgba(255, 171, 22, 0.3);
}

.status.expired,
.time-pill.danger {
  color: #ffd8de;
  background: rgba(255, 64, 93, 0.44);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.square-action {
  width: 36px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.square-action.success {
  background: linear-gradient(135deg, #24d17e, #12a866);
}

.square-action.danger {
  background: linear-gradient(135deg, #ff405d, #d82343);
}

.square-action.warning-square {
  color: #271700;
  background: linear-gradient(135deg, #ffc32c, #ff9700);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--orange);
  color: #251600;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.create-card {
  width: min(720px, 100%);
  display: grid;
  gap: 18px;
  margin: 0 auto;
  padding: 0 20px 20px;
}

.create-heading {
  margin: 0 -20px 4px;
  justify-content: center;
  text-align: center;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.credits-note,
.form-error,
.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.form-error {
  color: var(--red);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.tool-panel,
.table-panel:not(.client-table) {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 14px;
}

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

.panel-heading h2 {
  margin: 0;
}

.mini-input {
  width: 74px;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 8px;
}

.stacked-actions {
  align-items: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 9, 12, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
}

.modal-card {
  width: min(500px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(14, 14, 16, 0.98);
  box-shadow: var(--shadow);
}

.wide-modal {
  width: min(560px, 100%);
}

.modal-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(13, 13, 16, 0.96);
}

.modal-header h2 {
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.25;
}

.modal-close {
  width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 900;
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.modal-body small {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.split-actions {
  justify-content: space-between;
}

.info-box {
  padding: 13px 16px;
  border-radius: 10px;
  background: #3398dc;
  color: #fff;
  line-height: 1.45;
}

.modal-credit {
  margin: 0;
  border-radius: 10px;
}

.share-card {
  text-align: center;
}

.share-body {
  justify-items: center;
}

.share-code {
  display: block;
  color: var(--orange);
  font-size: 2.65rem;
  letter-spacing: 3px;
  line-height: 1;
}

.share-body p {
  margin: 0;
  font-weight: 800;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.share-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    transform: translateX(-104%);
    transition: transform 0.2s ease;
  }

  .dashboard-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .panel-section,
  .stats-grid {
    width: min(100% - 28px, 1080px);
  }

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

  .content-grid,
  .filters-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-spacer {
    display: none;
  }

  .balance-pill {
    margin-left: auto;
  }

  .section-banner,
  .hero-panel,
  .create-heading {
    display: grid;
  }

  .banner-actions,
  .banner-actions button {
    width: 100%;
  }

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