/* EvoluaPay — estilos base */
:root {
  --brand: #211843;
  --brand-2: #2f2360;
  --accent: #75EFFF;
  --bg: #f5f4f9;
  --surface: #ffffff;
  --text: #1c1830;
  --muted: #6b6787;
  --border: #e4e2ee;
  --success: #0f9d6b;
  --success-bg: #e3f7ef;
  --error: #d6334a;
  --error-bg: #fde8eb;
  --warn: #b7791f;
  --warn-bg: #fdf3e1;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--brand-2); font-weight: 500; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; }
.muted { color: var(--muted); margin: 0 0 1.5rem; }

/* Logo */
.brand-logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--brand); }
.brand-logo--light { color: #fff; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--brand); font-weight: 800; }

/* Formulários */
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .35rem; font-size: .88rem; font-weight: 500; }
.form small { color: var(--muted); font-weight: 400; }
.form input {
  width: 100%; padding: .72rem .85rem; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.form input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47,35,96,.15); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-end { text-align: right; font-size: .88rem; margin-top: -.4rem; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .72rem 1.1rem; border: 0; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-accent { background: var(--accent); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: #fff; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* Alertas */
.alert { padding: .75rem 1rem; border-radius: 9px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-error div + div { margin-top: .2rem; }

/* ---------- Telas de autenticação ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 100vh; }
.auth-brand {
  display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem;
  background: radial-gradient(120% 80% at 0% 100%, rgba(117,239,255,.18), transparent 60%), var(--brand); color: #fff;
}
.auth-brand .brand-logo { color: #fff; }
.auth-pitch h2 { font-size: 2.1rem; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 1rem; max-width: 14ch; }
.auth-pitch p { color: rgba(255,255,255,.75); max-width: 38ch; margin: 0; }
.auth-foot { color: rgba(255,255,255,.5); }
.auth-main { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.brand-logo--mobile { display: none; margin-bottom: 2rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; color: var(--muted); font-size: .92rem; }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .brand-logo--mobile { display: flex; }
  .auth-main { place-items: start center; padding-top: 3rem; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Painel ---------- */
.app-body { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--brand); color: #fff; display: flex; flex-direction: column; padding: 1.4rem 1rem; position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: grid; gap: .2rem; margin-top: 2rem; }
.sidebar nav a { display: flex; justify-content: space-between; align-items: center; padding: .62rem .8rem; border-radius: 8px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: rgba(117,239,255,.14); color: var(--accent); }
.sidebar nav a.soon { opacity: .55; pointer-events: none; }
.tag { font-size: .68rem; padding: .1rem .45rem; border-radius: 99px; background: rgba(255,255,255,.12); }
.sidebar-foot { margin-top: auto; }
.company-chip { padding: .8rem; border-radius: 10px; background: rgba(255,255,255,.07); display: grid; }
.company-chip span { font-size: .8rem; color: var(--accent); }

.app-main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1rem 2rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar-title { font-size: 1.2rem; margin: 0; flex: 1; }
.user-menu { display: flex; align-items: center; gap: .7rem; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--accent); font-weight: 700; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1200px; }
.period { margin-bottom: 1rem; font-size: .9rem; }

.banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1.1rem; border-radius: var(--radius); background: var(--brand); color: #fff; margin-bottom: 1.5rem; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: grid; gap: .3rem; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 1.55rem; letter-spacing: -.02em; }
.stat-sub { color: var(--muted); font-size: .8rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.5rem; }
.empty { color: var(--muted); margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.steps li { display: flex; align-items: center; gap: .75rem; }
.steps li span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); font-size: .85rem; font-weight: 700; color: var(--muted); }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.steps li.done span { background: var(--success); border-color: var(--success); color: #fff; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); padding: .55rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.badge { padding: .18rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-refused, .badge-chargeback { background: var(--error-bg); color: var(--error); }
.badge-canceled, .badge-refunded { background: #eeedf3; color: var(--muted); }

/* Processadoras */
.form select { width: 100%; padding: .72rem .85rem; font: inherit; color: var(--text); border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.gw-card { margin-bottom: 0; }
.gw-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.gw-head h2 { margin: 0; flex: 1; }
.gw-info { display: grid; gap: .5rem; margin: 0 0 1.2rem; }
.gw-info div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.gw-info dt { color: var(--muted); }
.gw-info dd { margin: 0; font-weight: 500; text-align: right; }
.gw-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.gw-actions form { margin: 0; }
.btn-danger { color: var(--error); }
.btn-danger:hover { color: var(--error); background: var(--error-bg); }
.steps a { color: inherit; }

.gw-webhook { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.gw-webhook summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.gw-webhook p { margin: .8rem 0; font-size: .88rem; }
.gw-webhook label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 500; margin-bottom: .7rem; }
.gw-webhook input { width: 100%; padding: .55rem .7rem; font: inherit; font-size: .82rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }

/* Pedidos */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input, .filters select { padding: .6rem .8rem; font: inherit; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text); }
.filters input { flex: 1; min-width: 220px; }
.cell-sub { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.cell-error { color: var(--error); white-space: normal; max-width: 260px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }

/* ---------- Checkout público ---------- */
.co-body { min-height: 100vh; }
.co-wrap { max-width: 480px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.co-card { margin-bottom: 1rem; }
.co-seller { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }
.co-product { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.co-product h1 { font-size: 1.25rem; }
.co-product .muted { margin: .3rem 0 0; font-size: .9rem; }
.co-price { font-size: 1.4rem; white-space: nowrap; color: var(--brand); }
.co-secure { text-align: center; color: var(--muted); font-size: .82rem; margin: 1rem 0 0; }
.co-pix { text-align: center; }
.co-pix .muted { margin-bottom: 1rem; }
.co-qr { width: 220px; height: 220px; margin: 0 auto 1rem; display: block; }
.co-copy { width: 100%; font: .8rem/1.4 ui-monospace, monospace; padding: .6rem; border: 1px solid var(--border); border-radius: 9px; resize: none; margin-bottom: .8rem; background: var(--bg); }
.co-waiting { display: flex; align-items: center; justify-content: center; gap: .5rem; color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.co-done { text-align: center; padding: 2rem 1.4rem; }
.co-done .muted { margin: 0; }
.co-check { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; }

/* Menu mobile */
.nav-btn, .nav-overlay { display: none; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 15; }
  .nav-btn { display: block; font-size: 1.4rem; cursor: pointer; }
  .topbar { padding: .8rem 1rem; }
  .user-name { display: none; }
  .content { padding: 1.25rem 1rem 2rem; }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }
