/* Ideia Licenças — estilos */
:root {
  --ink: #16131f;
  --ink-2: #3b3647;
  --muted: #736d80;
  --line: #e7e4ec;
  --line-2: #f1eff4;
  --bg: #f7f6f9;
  --card: #ffffff;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --accent-soft: #efebff;
  --ok: #0f8a5f; --ok-soft: #e6f6ef;
  --warn: #a86500; --warn-soft: #fff4e0;
  --bad: #c23a3a; --bad-soft: #fdecec;
  --info: #2f5fd0; --info-soft: #eaf0fd;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22,19,31,.05), 0 1px 1px rgba(22,19,31,.03);
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.hidden { display: none !important; }

/* Layout público */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1080px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; }
.brand .name { font-size: 15px; }
.topnav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topnav a { color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.topnav a:hover { background: var(--line-2); text-decoration: none; }
.page { max-width: 1080px; margin: 0 auto; padding: 32px 20px 64px; }
.page.narrow { max-width: 460px; }
.page.medium { max-width: 760px; }
.footer { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Layout admin */
.admin { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cfcadb; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.sidebar .brand { color: #fff; padding: 4px 8px 18px; }
.sidebar .brand img { height: 26px; filter: brightness(0) invert(1); }
.sidebar a.nav { display: flex; align-items: center; gap: 10px; color: #cfcadb; padding: 9px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.sidebar a.nav:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar a.nav.on { background: rgba(255,255,255,.1); color: #fff; }
.sidebar svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar .grow { flex: 1; }
.sidebar .who { font-size: 12px; color: #9c96aa; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .who button { background: none; border: 0; color: #cfcadb; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.main { padding: 28px 32px 64px; min-width: 0; }
.main-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.main-head h1 { margin: 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.menu-toggle { display: none; }

/* Cartões e grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 22px 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12.5px; color: var(--muted); }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfafc; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfbfd; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }
.card:not(.flush) .table th:first-child, .card:not(.flush) .table td:first-child { padding-left: 0; }

/* Formulários */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); background: #fff; border: 1px solid #d9d5e0; border-radius: 9px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=file] { font: inherit; font-size: 14px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.inline-form { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 180px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; font-size: 14px; line-height: 1; padding: 11px 16px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #4a2ee0; }
.btn-ghost { background: #fff; color: var(--ink); border-color: #d9d5e0; }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0c9c9; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; cursor: pointer; font: inherit; }
.btn-link.danger { color: var(--bad); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Avisos e selos */
.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: #0b6646; border-color: #c4ead9; }
.alert-warn { background: var(--warn-soft); color: #7a4a00; border-color: #f6dfb5; }
.alert-bad { background: var(--bad-soft); color: #9c2b2b; border-color: #f4cccc; }
.alert-info { background: var(--info-soft); color: #234a9f; border-color: #cfdbf7; }
.alert ul { margin: 0; padding-left: 18px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: var(--line-2); color: var(--muted); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); }
.tag-accent { background: var(--accent-soft); color: var(--accent); }

/* Chave da licença */
.key { display: flex; align-items: center; gap: 8px; background: #faf9fc; border: 1px dashed #cfc9da; border-radius: 10px; padding: 10px 12px; }
.key code { font-family: var(--mono); font-size: 14.5px; font-weight: 600; letter-spacing: .03em; flex: 1; overflow-wrap: anywhere; }
.copy { flex: none; }

/* Planos */
.product-block + .product-block { margin-top: 48px; }
.product-title { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.product-title img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; box-shadow: var(--shadow); }
.plan.featured { border: 2px solid var(--accent); }
.plan .ribbon { position: absolute; top: -11px; left: 22px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.plan h3 { margin: 0; font-size: 17px; }
.plan .price { font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; font-size: 14px; flex: 1; }
.plan li { padding: 4px 0 4px 24px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.hero { text-align: center; max-width: 640px; margin: 8px auto 40px; }
.hero h1 { font-size: 34px; }
.hero p { color: var(--muted); font-size: 16.5px; }

/* Licenças na conta */
.license-card .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 16px 0; }
.license-card .meta div span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.license-card .meta div strong { font-size: 14.5px; }
.sites { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 14px; }
.site { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; }
.meter { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Checklist do painel */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.dot { width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.dot.ok { background: var(--ok); } .dot.no { background: #d6d2dd; }

.codebox { font-family: var(--mono); font-size: 13px; background: var(--ink); color: #e9e6f0; border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 13px; }
details pre { margin: 8px 0 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted); margin: 26px 0 12px; }
.auth-card { margin-top: 6vh; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-card .brand img { height: 36px; }
.changelog h4 { font-size: 13px; margin: 10px 0 4px; }
.changelog ul { margin: 0 0 6px; padding-left: 18px; font-size: 13.5px; }
.changelog p { font-size: 13.5px; margin: 0 0 6px; }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-toggle { display: inline-flex; margin-bottom: 14px; }
  .main { padding: 18px 16px 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .hero h1 { font-size: 27px; }
  .topbar .inner { padding: 12px 16px; }
  .page { padding: 24px 16px 48px; }
}

/* Ajustes de layout */
.grid { align-items: start; }
.grid > * { min-width: 0; }
.grid > .card + .card { margin-top: 0; }
.admin { background: linear-gradient(to right, var(--ink) 236px, var(--bg) 236px); }
.btn.menu-toggle { display: none; }
@media (max-width: 820px) {
  .admin { background: var(--bg); }
  .btn.menu-toggle { display: inline-flex; }
}
