/* =========================================================
   LAS NFC — Painéis (design system LAS Hub) · MOBILE-FIRST
   Verde #3ecf7e · Space Grotesk + Inter · tema escuro
   90% dos acessos são no celular (admin na rua + clientes).
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #0a0a0b;
  --fg: #f2f2f0;
  --primary: #3ecf7e;
  --primary-2: #2fae68;
  --primary-fg: #0a0a0b;
  --gold: #ffcb6e;
  --danger: #ff6b6b;
  --blue: #6ea8ff;
  --card: #131315;
  --card-2: #17171a;
  --muted: #8a8a88;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --radius: 0.875rem;
  --radius-lg: 1.25rem;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 16px; /* 16px evita zoom automático no iOS */
  width: 100%; background: #0d0d0f; color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: 0.6rem; padding: 0.8rem 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
label { display: block; font-size: 0.82rem; color: var(--muted); margin: 0 0 0.35rem; font-weight: 600; }
.field { margin-bottom: 1rem; }

/* ---- botões (touch-friendly: mín. 44px de altura) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.3rem; min-height: 44px; border-radius: 0.7rem;
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; transition: transform .1s ease, background .15s, border-color .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.5rem 0.85rem; min-height: 38px; font-size: 0.85rem; border-radius: 0.55rem; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255,107,107,.3); }
.btn-block { width: 100%; }

/* ---- topo ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(10,10,11,.92); backdrop-filter: blur(10px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 12px var(--primary); flex-shrink: 0; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 1rem; }

/* ---- abas (roláveis no celular) ---- */
.tabs {
  display: flex; gap: 0.4rem; margin-bottom: 1.25rem; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 0.55rem 1rem; border-radius: 0.6rem; background: var(--card);
  border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 0.88rem;
  white-space: nowrap; flex-shrink: 0;
}
.tab.active { color: var(--primary); border-color: rgba(62,207,126,.3); background: rgba(62,207,126,.08); }

/* ---- saudação / cabeçalho de dashboard ---- */
.dash-hi { margin-bottom: 1.1rem; }
.dash-hi h2 { font-size: 1.35rem; }
.dash-hi p { color: var(--muted); margin: 0.15rem 0 0; font-size: 0.9rem; }

/* ---- stats ---- */
.grid { display: grid; gap: 0.8rem; }
.stats { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem;
}
.stat .n { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 0.78rem; margin-top: 0.2rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.section-title { font-size: 1.05rem; margin: 1.5rem 0 0.8rem; display: flex; align-items: center; gap: 0.5rem; }

/* ---- feed de atividades ---- */
.feed { display: flex; flex-direction: column; gap: 0; }
.feed-item {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-ico {
  width: 34px; height: 34px; border-radius: 0.6rem; flex-shrink: 0; display: grid; place-items: center;
  font-size: 1rem; background: rgba(62,207,126,.1); border: 1px solid rgba(62,207,126,.18);
}
.feed-txt { flex: 1; min-width: 0; }
.feed-txt .d { font-size: 0.9rem; }
.feed-txt .t { color: var(--muted); font-size: 0.75rem; margin-top: 0.1rem; }
.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; font-size: 0.9rem; }

/* ---- tabela (desktop) ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.8rem 0.7rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.code { font-family: ui-monospace, monospace; color: var(--gold); }

/* ---- badges ---- */
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge.livre { background: rgba(138,138,136,.15); color: var(--muted); }
.badge.vendida { background: rgba(255,203,110,.15); color: var(--gold); }
.badge.ativa { background: rgba(62,207,126,.15); color: var(--primary); }
.badge.pausada { background: rgba(255,107,107,.15); color: var(--danger); }

/* ---- cartão de placa (usado no mobile e no painel do cliente) ---- */
.placa-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.placa-card .row { justify-content: space-between; align-items: flex-start; }
.placa-card .meta { color: var(--muted); font-size: 0.85rem; margin: 0.4rem 0; }
.mini-qr { width: 84px; height: 84px; border-radius: 0.5rem; background: #fff; padding: 5px; flex-shrink: 0; }
.mini-qr img, .mini-qr canvas { width: 100% !important; height: 100% !important; display: block; }

/* ---- modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: none; z-index: 50; padding: 1rem; overflow-y: auto; }
.overlay.open { display: grid; place-items: center; }
.modal { background: var(--card-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 1.5rem; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 1.1rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.4rem; }
.warn-box { background: rgba(255,203,110,.08); border: 1px solid rgba(255,203,110,.28); border-radius: 0.7rem;
  padding: 0.85rem 1rem; font-size: 0.88rem; margin: 0.5rem 0 0.5rem; }

/* ---- login ---- */
.login-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.login-box { width: 100%; max-width: 380px; }
.login-box .card { text-align: center; }
.login-box .brand { justify-content: center; margin-bottom: 1.4rem; font-size: 1.3rem; }

/* ---- utilidades ---- */
.hidden { display: none !important; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.mt { margin-top: 1.1rem; }
.center { text-align: center; }
#qr-box { display: grid; place-items: center; padding: 1rem; background: #fff; border-radius: 0.8rem; min-height: 200px; }
#qr-box img, #qr-box canvas { display: block; }
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--primary); color: var(--fg);
  padding: 0.85rem 1.3rem; border-radius: 0.7rem; z-index: 100; box-shadow: var(--shadow);
  display: none; max-width: 90vw; text-align: center; font-size: 0.9rem; }
.toast.show { display: block; }

/* ---- MOBILE: tabela vira lista de cartões ---- */
.table-wrap { overflow-x: auto; }
@media (max-width: 680px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* tabela empilhada: cada linha vira um cartão, cada célula "rótulo: valor" */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.5rem 0.9rem; margin-bottom: 0.7rem;
  }
  .table td { border-bottom: 1px solid var(--border); padding: 0.55rem 0;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
  .table td:last-child { border-bottom: none; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table td[data-label=""]::before { content: ""; }
  .table td.acoes { flex-wrap: wrap; justify-content: flex-start; }
  .table td.acoes::before { width: 100%; }
}
@media (min-width: 560px) { .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
