/* ===== MyVouncher — estilos ===== */
:root {
  --primary: #0d468c;
  --primary-dark: #0a3a73;
  --primary-light: #dbe4f5;
  --sidebar: #0d468c;
  --sidebar-hover: #1a5099;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;  --green-bg: #dcfce7;
  --amber: #d97706;  --amber-bg: #fef3c7;
  --red: #dc2626;    --red-bg: #fee2e2;
  --blue: #2563eb;   --blue-bg: #dbeafe;
  --gray: #475569;   --gray-bg: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d468c 0%, #2563c4 100%); padding: 20px;
}
.login-card {
  background: var(--card); width: 100%; max-width: 400px; border-radius: 16px;
  padding: 40px 32px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.brand { text-align: center; margin-bottom: 28px; }
.brand h1 { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.brand h1 span { color: var(--primary); }
.brand p { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== Layout app ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--sidebar); color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { padding: 22px 22px 18px; font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.sidebar .logo span { color: #9bb8f5; }
.sidebar nav { flex: 1; padding: 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px;
  color: #cbd5e1; text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 2px;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: #2f6ad1; color: #fff; }
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; }
.sidebar .foot { padding: 14px; border-top: 1px solid #1e293b; font-size: 12px; color: #64748b; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border); padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 18px; font-weight: 700; }
.topbar .user { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.content { padding: 28px; flex: 1; }

/* ===== Componentes ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { padding: 20px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -1px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.accent { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border: none; }
.stat.accent .label, .stat.accent .sub { color: rgba(255,255,255,.85); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px;
  border: 1px solid transparent; background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ativo { background: var(--green-bg); color: var(--green); }
.badge.usado { background: var(--blue-bg); color: var(--blue); }
.badge.expirado { background: var(--amber-bg); color: var(--amber); }
.badge.cancelado { background: var(--red-bg); color: var(--red); }
.badge.propria { background: var(--primary-light); color: var(--primary-dark); }
.badge.parceira { background: var(--gray-bg); color: var(--gray); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 700; }
td { padding: 13px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.codigo { font-family: 'SF Mono', 'Roboto Mono', Menlo, monospace; font-weight: 700; letter-spacing: .5px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.toolbar input[type=search] { min-width: 220px; }
.datefld { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.datefld input[type=date] { color: var(--text); }

.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; margin-bottom: 10px; }
.page-actions { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.bulkbar { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fff7ed; border-radius: var(--radius) var(--radius) 0 0; }
.vsel, #sel-todos { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ===== Consulta anti-fraude ===== */
.consulta-box { max-width: 620px; margin: 0 auto; }
.consulta-search { display: flex; gap: 10px; margin-bottom: 22px; }
.consulta-search input {
  flex: 1; padding: 16px 18px; font-size: 18px; border: 2px solid var(--border); border-radius: 10px;
  text-transform: uppercase; letter-spacing: 1px; font-family: 'SF Mono', monospace; font-weight: 700;
}
.consulta-search input:focus { outline: none; border-color: var(--primary); }
.resultado { border-radius: var(--radius); padding: 26px; border: 2px solid; }
.resultado.ok { border-color: var(--green); background: var(--green-bg); }
.resultado.alerta { border-color: var(--amber); background: var(--amber-bg); }
.resultado.erro { border-color: var(--red); background: var(--red-bg); }
.resultado .titulo { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.resultado .det { background: #fff; border-radius: 10px; padding: 18px; margin-top: 18px; }
.det-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.det-row:last-child { border-bottom: none; }
.det-row .k { color: var(--muted); font-weight: 500; }
.det-row .v { font-weight: 600; text-align: right; }

/* ===== Modal ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.x { background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; }

/* ===== Timeline eventos ===== */
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.timeline .ev { font-weight: 700; font-size: 13px; text-transform: capitalize; }
.timeline .meta { font-size: 12px; color: var(--muted); }

/* ===== Toast ===== */
.toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--text); color: #fff; padding: 13px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: 360px; animation: slideIn .2s ease; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; display: none; }
.alert.err { background: var(--red-bg); color: var(--red); display: block; }

.hide { display: none !important; }
.flex { display: flex; align-items: center; gap: 10px; }
.mt { margin-top: 18px; }

@media (max-width: 760px) {
  .sidebar { width: 64px; }
  .sidebar .logo { font-size: 0; padding: 18px 0; text-align: center; }
  .sidebar .logo span { font-size: 20px; }
  .nav-item span:not(.ico) { display: none; }
  .nav-item { justify-content: center; }
  .sidebar .foot { display: none; }
  .row { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
