:root {
  --radius: 0.625rem;
  --bg: oklch(97.5% 0.003 255);
  --bg-soft: oklch(96.5% 0.006 255);
  --card: oklch(100% 0 0);
  --text: oklch(21% 0.02 258);
  --muted: oklch(52% 0.015 257);
  --secondary: oklch(96.5% 0.006 255);
  --border: oklch(92.5% 0.008 257);
  --border-strong: oklch(88% 0.01 257);
  --primary: oklch(56% 0.19 266);
  --primary-hover: oklch(50% 0.2 266);
  --primary-soft: oklch(56% 0.19 266 / 0.1);
  --primary-fg: oklch(99% 0.002 260);
  --danger: oklch(58% 0.2 25);
  --ok: oklch(55% 0.15 160);
  --amber: oklch(65% 0.16 75);
  --rose: oklch(60% 0.2 15);
  --teal: oklch(50% 0.12 190);
  --sidebar: oklch(100% 0 0);
  --shadow: 0 1px 2px oklch(21% 0.02 258 / 0.05);
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 16rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.brand-mark,
.page-title,
.login-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

/* —— Login split (hero + painel) —— */
.page-login-split {
  min-height: 100vh;
  background: #0a0a0a;
  color: #fff;
}

.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
}

.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  background: linear-gradient(145deg, #0a0a0a, #111 45%, #0a0a0a);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.login-hero-glow {
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(72px);
  pointer-events: none;
}

.login-hero-glow-a {
  top: -6rem;
  left: -6rem;
  background: rgba(16, 185, 129, 0.14);
}

.login-hero-glow-b {
  bottom: -6rem;
  right: -6rem;
  background: rgba(59, 130, 246, 0.12);
}

.login-hero-top {
  position: relative;
  z-index: 1;
  animation: rise 0.6s var(--ease) both;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.login-hero-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  padding: 4px;
}

.login-hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.04em;
  line-height: 1;
}

.login-hero-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
}

.login-hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.6vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.login-hero-lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 36rem;
}

.login-hero-foot {
  position: relative;
  z-index: 1;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.75rem;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 48px);
  background: #fff;
  color: var(--text);
  min-height: 100vh;
}

.login-panel-inner {
  width: min(400px, 100%);
  animation: rise 0.55s var(--ease) 0.05s both;
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.75rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.05);
}

.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.5rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: 0.15s var(--ease);
}

.auth-tab.active {
  background: #0a0a0a;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.auth-head {
  margin-bottom: 1.25rem;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-sub {
  margin: 0;
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-field .field-caps {
  margin: 0;
  color: rgba(0, 0, 0, 0.45);
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s var(--ease);
}

.auth-form input:focus {
  outline: none;
  border-color: #0a0a0a;
}

.mono-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-login-dark,
.btn-login-green {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
}

.btn-login-dark {
  background: #0a0a0a;
  color: #fff;
}

.btn-login-dark:hover {
  background: #1a1a1a;
}

.btn-login-green {
  background: #059669;
  color: #fff;
}

.btn-login-green:hover {
  background: #047857;
}

.keys-box {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 0.85rem;
}

.keys-box-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.keys-list {
  display: grid;
  gap: 0.5rem;
}

.key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  font-size: 0.78rem;
}

.key-row-main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  grid-column: 1 / -1;
}

.key-row-main code {
  font-size: 0.8rem;
}

.key-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #a3a3a3;
  flex-shrink: 0;
}

.key-dot.on {
  background: #10b981;
}

.key-dot.off {
  background: #f59e0b;
}

.key-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  color: rgba(0, 0, 0, 0.45);
}

.toast-container {
  position: fixed;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.4rem;
  background: #0a0a0a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast-success {
  background: #059669;
  border-color: #34d399;
}

.toast-error {
  background: #e11d48;
  border-color: #fb7185;
}

.toast-warning {
  background: #f59e0b;
  color: #111;
  border-color: #fcd34d;
}

.toast-out {
  opacity: 0;
  transform: translateX(0.75rem);
}

.toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .login-split {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 28px 22px 22px;
  }

  .login-hero-title {
    max-width: none;
  }

  .login-panel {
    min-height: auto;
    padding: 28px 20px 40px;
  }
}

/* —— App shell —— */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.4);
}

.sidebar-backdrop[hidden] {
  display: none !important;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.28s var(--ease), width 0.28s var(--ease);
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.08);
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: 4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: none;
}

img.brand-mark.brand-logo {
  display: block;
  object-fit: contain;
  background: #fff;
  padding: 0.15rem;
  border: 1px solid var(--border);
}

.shop-logo-wordmark,
.sidebar-logo-wordmark,
.login-logo-wordmark {
  display: block;
  height: auto;
  object-fit: contain;
}

.shop-logo-wordmark {
  width: min(200px, 62vw);
  margin: 0;
}

.sidebar-logo-wordmark {
  width: 8.5rem;
  max-width: 100%;
}

.login-logo-wordmark {
  width: min(300px, 72vw);
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-copy {
  min-width: 0;
  line-height: 1.15;
}

.sidebar-brand-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.sidebar-brand-sub {
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.nav-section {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-mark.xl {
  width: 3.4rem;
  height: 3.4rem;
  font-size: 1.2rem;
  border-radius: 0.9rem;
}

img.brand-mark.brand-logo.xl {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.9rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

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

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
  font-weight: 500;
}

.sidebar-foot {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}

.sidebar-user:hover {
  background: var(--secondary);
}

.sidebar-user-copy {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  color: var(--muted);
}

.sidebar-user .avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
}

.sidebar-user .icon-btn {
  border: none;
  background: transparent;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--muted);
}

.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.topbar {
  height: 4rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 1rem;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.page-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-body);
  letter-spacing: -0.01em;
}

.page-sub {
  margin: 0.1rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--font-body);
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.stat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 1rem;
  height: 1rem;
}

.stat-icon.blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.green {
  background: oklch(55% 0.15 160 / 0.1);
  color: oklch(45% 0.14 160);
}

.stat-icon.yellow,
.stat-icon.amber {
  background: oklch(70% 0.16 75 / 0.12);
  color: oklch(55% 0.16 75);
}

.stat-icon.red,
.stat-icon.rose {
  background: oklch(60% 0.2 15 / 0.1);
  color: oklch(50% 0.2 15);
}

.stat-icon.teal {
  background: oklch(60% 0.12 190 / 0.1);
  color: oklch(45% 0.12 190);
}

.stat-label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
}

.stat-value {
  margin: 0.75rem 0 0;
  font-family: var(--font-body);
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.stat-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.plans-card {
  padding: 0;
  border-radius: 0.75rem;
}

.plans-card .card-head {
  padding: 1.5rem 1.5rem 0;
  margin-bottom: 0;
}

.plans-card .card-head h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: var(--font-body);
}

.plans-card .plans-body {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .plans-card .plans-body {
    grid-template-columns: 1fr 1fr;
  }
}

.donut-wrap {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.plans-donut {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 100%);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%);
  mask: radial-gradient(circle, transparent 58%, #000 59%);
}

.plans-donut::after {
  display: none;
}

.plans-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.plans-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid oklch(92.5% 0.008 257 / 0.6);
}

.plans-legend li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.plans-legend .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.plans-legend .dot.off {
  background: oklch(52% 0.015 257 / 0.3);
}

.plans-legend strong {
  font-weight: 500;
}

.create-card {
  margin-bottom: 1.25rem;
}

.with-icon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.spark {
  color: var(--primary);
  font-size: 0.95rem;
}

.create-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.9fr 0.9fr;
  gap: 0.85rem;
}

.create-grid.secondary {
  grid-template-columns: 1fr 1.2fr 1.2fr;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.link-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.result-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.result-inline code {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.status-active {
  display: inline-flex;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #059669;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-expired {
  display: inline-flex;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
}

.key-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.key-cell code {
  font-size: 0.8rem;
}

.top-search input {
  width: 14rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  background: oklch(96.5% 0.006 255 / 0.6);
  border-color: transparent;
}

.top-search input:focus {
  background: var(--card);
  border-color: var(--border);
}

.status-pill {
  display: none;
}

.avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.licenses-table th {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.user-chip svg {
  width: 1rem;
  height: 1rem;
}

.user-chip .chevron {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--muted);
}

.user-chip-name {
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.user-chip .dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px oklch(56% 0.19 266 / 0.2);
}

.status-pill {
  display: none !important;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}

.status-pill.online {
  color: var(--ok);
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.status-pill.offline {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn.ghost {
  border-color: transparent;
  background: transparent;
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.icon-btn:hover {
  color: var(--text);
  border-color: transparent;
  background: var(--secondary);
}

.icon-btn.danger {
  border-color: transparent;
  background: transparent;
}

.icon-btn.danger:hover {
  color: var(--danger);
  background: #fef2f2;
}

.content {
  flex: 1;
  padding: 1.5rem;
  width: 100%;
  max-width: none;
}

.panel {
  animation: rise 0.4s var(--ease) both;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.card-accent {
  background: linear-gradient(180deg, #f8fbff, #fff);
  border-color: #dbeafe;
}

.card-head {
  margin-bottom: 1rem;
}

.card-head.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.stack {
  display: grid;
  gap: 0.95rem;
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

input,
select,
textarea {
  width: 100%;
  height: 2.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid var(--border-strong);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  height: auto;
  padding: 0.7rem 0.8rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(56% 0.19 266 / 0.18);
}

.toggle-row {
  display: flex;
  gap: 0.5rem;
}

.flex-1 {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 1rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 6px 14px oklch(56% 0.19 266 / 0.28);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg-soft);
}

.btn-outline.on,
.btn-primary.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-danger {
  background: #fff;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  height: 2rem;
  padding: 0 0.7rem;
  font-size: 0.75rem;
}

.msg {
  margin: 0;
  font-size: 0.875rem;
}

.msg.ok {
  color: var(--ok);
}

.msg.err {
  color: var(--danger);
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  height: 2rem;
  padding-left: 2rem;
  font-size: 0.8rem;
  width: 9.5rem;
}

.table-frame {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  background: #f9fafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f9fafb;
}

.text-right {
  text-align: right;
}

.empty {
  height: 10rem;
  text-align: center;
  color: var(--muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 12rem;
  color: var(--muted);
  padding: 2rem 1rem;
}

.empty-state .icon-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  color: #9ca3af;
}

.empty-state .icon-circle svg {
  width: 1.25rem;
  height: 1.25rem;
}

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82em;
  word-break: break-all;
  color: #1f2937;
}

.badge {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge.off {
  background: #f3f4f6;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.result {
  margin-top: 1rem;
  border-color: #bfdbfe;
  background: #f8fbff;
}

.result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.result-row > span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.result-row code {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
}

.result-meta {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.app-footer {
  padding: 1.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: transparent;
}

.app-footer p {
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.modal[hidden] {
  display: none !important;
}

.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  animation: rise 0.25s var(--ease) both;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.modal-actions {
  border-bottom: none;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-body {
  padding: 1.15rem;
}

.mobile-only {
  display: inline-grid;
}

@media (min-width: 768px) {
  .content {
    padding: 1.75rem 2rem;
  }

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

@media (max-width: 900px) {
  .create-grid,
  .create-grid.secondary {
    grid-template-columns: 1fr 1fr;
  }

  .top-search {
    display: none;
  }
}

@media (max-width: 560px) {
  .create-grid,
  .create-grid.secondary {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .sidebar {
    position: relative;
    transform: none;
    width: var(--sidebar-w);
    flex-shrink: 0;
  }

  .sidebar-backdrop {
    display: none !important;
  }

  .mobile-only {
    display: none !important;
  }

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

@media (max-width: 900px) {
  .card-head.row {
    flex-direction: column;
  }

  .search-wrap input {
    width: 100%;
  }
}

/* —— Manage license modal (Lovable clone) —— */
.modal-card-lg {
  width: min(420px, 100%);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card-lg .modal-body {
  overflow-y: auto;
  padding: 0.85rem 1rem;
}

.modal-card-lg .modal-head,
.modal-card-lg .modal-actions {
  padding: 0.7rem 1rem;
  flex-shrink: 0;
}

.modal-card-lg .modal-head h3 {
  font-size: 1rem;
}

.manage-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.manage-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.manage-sub {
  display: none;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: oklch(55% 0.15 160 / 0.15);
  color: oklch(40% 0.12 160);
  text-transform: lowercase;
}

.badge-status.off {
  background: oklch(96.5% 0.006 255);
  color: var(--muted);
}

.manage-body {
  gap: 0.65rem !important;
}

.manage-box {
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: oklch(98.5% 0.003 255);
}

.manage-box.compact {
  min-width: 0;
}

.field-caps {
  margin: 0 0 0.3rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.pin-code {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.used-by {
  min-height: 1.6rem;
  display: flex;
  align-items: center;
}

.used-by.empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.used-by-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.manage-body label {
  font-size: 0.8rem;
  gap: 0.3rem;
}

.manage-body input,
.manage-body select,
.manage-body textarea {
  height: auto;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}

.manage-body textarea {
  min-height: 3.2rem;
  resize: vertical;
}

.tiny {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 400;
}

.manage-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.manage-meta-row p {
  margin: 0;
  color: var(--muted);
}

.manage-meta-row strong {
  color: var(--text);
  font-weight: 600;
}

.extend-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
}

.extend-row input {
  width: 4rem;
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
}

.extend-row select {
  flex: 1;
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.manage-actions .btn {
  height: 2rem;
  padding: 0 0.65rem;
  font-size: 0.78rem;
}

.manage-actions .spacer {
  flex: 1;
  min-width: 0.5rem;
}

#license-modal .result-row {
  gap: 0.4rem;
}

#license-modal .result-row code {
  font-size: 0.78rem;
  word-break: break-all;
}

.btn-link-danger {
  background: transparent;
  border: none;
  color: var(--danger);
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
}

.btn-link-danger:hover {
  text-decoration: underline;
}

.gen-result-box {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--primary-soft);
}

@media (max-width: 560px) {
  .manage-grid-2,
  .manage-meta-row {
    grid-template-columns: 1fr;
  }
}

/* —— Loja pública /c/{slug} —— */
.page-shop {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, oklch(56% 0.19 266 / 0.12), transparent 40%),
    var(--bg);
}

.shop-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.shop-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.shop-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.shop-brand-name {
  margin: 0;
  font-weight: 700;
  font-family: var(--font-display);
}

.wa-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--card);
  overflow: hidden;
}

.wa-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(56% 0.19 266 / 0.15);
}

.wa-prefix {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.7rem;
  background: var(--secondary);
  border-right: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.wa-field input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
}

.shop-title {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.shop-hero {
  margin: 0 0 1.15rem;
}

.shop-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.shop-hero-lead {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.shop-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.shop-quick-actions {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.shop-quick-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.shop-quick-actions .tiny {
  margin: 0;
  text-align: center;
}

.btn-block {
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.shop-status h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.token-line {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.token-line code {
  font-size: 0.72rem;
  word-break: break-all;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
