/* KesiAGV — painel do indicador */

:root {
  --blue: #0029bc;
  --blue-600: #0136d6;
  --blue-soft: rgba(0, 41, 188, 0.08);
  --blue-deep: #001b5e;
  --kesi-light: #7aa2ff;
  --orange: #ffa811;
  --ocre: #b8790c;
  --ocre-light: #ffb01f;
  --green: #25d366;
  --green-dark: #0d7a3d;
  --red: #b42318;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --line: #e6e6ea;
  --bg: #f5f6fa;
  --card: #ffffff;
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.12; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
::selection { background: rgba(0, 41, 188, 0.16); }

/* ---------------- logo ---------------- */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, #2b57ff, var(--blue)); color: #fff;
  font-size: 15px; font-weight: 800; box-shadow: 0 4px 12px rgba(0, 41, 188, 0.28);
}
.logo-text { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; display: inline-flex; gap: 1px; }
.logo-text .l-kesi { color: var(--blue); }
.logo-text .l-agv { color: var(--ocre); }
.logo.light .logo-text .l-kesi { color: var(--kesi-light); }
.logo.light .logo-text .l-agv { color: var(--ocre-light); }

/* ---------------- botões ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.18s, transform 0.15s, border-color 0.18s;
  white-space: nowrap;
}
.btn:hover { background: #fafafa; }
.btn:active { transform: scale(0.985); }
.btn svg { width: 17px; height: 17px; stroke-width: 2; }
.btn.primary { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(0, 41, 188, 0.24); }
.btn.primary:hover { background: var(--blue-600); }
.btn.wa { background: var(--green); color: #04240f; border-color: transparent; box-shadow: 0 8px 22px rgba(37, 211, 102, 0.22); }
.btn.wa:hover { background: #1ebe5d; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.14); }
.btn.small { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }

/* ---------------- login ---------------- */
.login-screen { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-art {
  position: relative; overflow: hidden; display: flex; align-items: center; padding: 64px;
  background: radial-gradient(120% 100% at 15% 10%, #0a2ea8 0%, #001b5e 45%, #000a22 100%); color: #fff;
}
.login-art::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: rgba(255, 168, 17, 0.18); filter: blur(110px); right: -160px; bottom: -160px;
}
.login-art-inner { position: relative; z-index: 2; max-width: 460px; }
.login-art h2 { font-size: clamp(32px, 3.6vw, 50px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.07; margin: 34px 0 18px; }
.login-art h2 span { color: var(--orange); }
.login-art p { color: #a9bbe6; font-size: 16px; max-width: 42ch; line-height: 1.5; }
.art-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.art-pills span {
  font-size: 12.5px; font-weight: 600; color: #dfe8ff; background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 99px; padding: 7px 13px;
}
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-form { width: min(360px, 100%); }
.login-form .logo { margin-bottom: 28px; }
.login-form h1 { font-size: 27px; }
.login-sub { color: var(--ink-2); font-size: 14px; margin: 5px 0 26px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 0 0 10px; }
.login-links { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; text-align: center; font-size: 13px; }
.login-links a { color: var(--blue); font-weight: 550; }
.login-links .muted-link { color: var(--ink-2); font-weight: 400; }
.login-links .muted-link:hover { color: var(--ink); }

/* ---------------- campos ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid #d9d9de; border-radius: 11px; padding: 12px 13px; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s; -webkit-appearance: none;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 41, 188, 0.11); }
.login-form .btn { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; margin-top: 4px; }

/* ---------------- topo do painel ---------------- */
.app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.topbar-inner {
  width: min(1120px, 100% - 40px); margin-inline: auto; height: 60px;
  display: flex; align-items: center; gap: 14px;
}
.topbar-label {
  font-size: 12.5px; font-weight: 550; color: var(--ink-2); padding-left: 14px;
  border-left: 1px solid var(--line);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.user-name { font-size: 13px; font-weight: 600; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #d9e2ff, #b9c9ff); color: var(--blue);
  font-weight: 700; font-size: 12px; text-transform: uppercase;
}

/* ---------------- conteúdo ---------------- */
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; padding: 30px 0 44px; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.hello { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.welcome h1 { font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.04em; }
.welcome-sub { margin: 7px 0 0; font-size: 13.5px; color: var(--ink-2); }
.welcome-badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: var(--green-dark); background: #e7f9ee; border: 1px solid #c8efd7; border-radius: 99px; padding: 7px 13px;
}
.welcome-badge svg { width: 15px; height: 15px; }

/* link */
.share-card {
  display: flex; align-items: center; gap: 24px; justify-content: space-between;
  background: radial-gradient(120% 160% at 0% 0%, #0a35c8 0%, #0029bc 45%, #001b7e 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 24px;
  box-shadow: 0 18px 46px rgba(0, 41, 188, 0.24);
  margin-bottom: 14px; flex-wrap: wrap;
}
.share-main { flex: 1; min-width: 280px; }
.share-label { font-size: 11.5px; color: #b9c9ff; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.link-row { display: flex; gap: 8px; margin-top: 9px; }
.link-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; font-weight: 550;
  background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff; border-radius: 11px; padding: 12px 14px; outline: none;
}
.link-row input::selection { background: rgba(255, 168, 17, 0.4); }
.btn.copy { background: var(--orange); color: #241500; border: 0; font-weight: 650; box-shadow: none; }
.btn.copy:hover { background: #ffb62f; }
.share-hint { margin: 9px 0 0; font-size: 11.5px; color: #a9bbee; }
.share-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.share-actions .btn { border: 0; }
.share-actions .ghost { background: rgba(255, 255, 255, 0.12); color: #fff; }
.share-actions .ghost:hover { background: rgba(255, 255, 255, 0.2); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 15px 14px;
  display: flex; align-items: center; gap: 11px; min-height: 78px;
}
.stat-ic {
  width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
}
.stat-ic svg { width: 18px; height: 18px; }
.stat-ic.blue { background: #edf1ff; color: var(--blue); }
.stat-ic.sky { background: #e8f3ff; color: #0a84ff; }
.stat-ic.green { background: #e7f9ee; color: #0d7a3d; }
.stat-ic.orange { background: #fff4df; color: #a35b00; }
.stat-ic.dark { background: #eef0f4; color: #424245; }
.stat b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { display: block; font-size: 11px; color: var(--ink-2); margin-top: 2px; }

/* grid */
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.025em; }
.count-pill { font-size: 11.5px; font-weight: 600; color: var(--blue); background: var(--blue-soft); border-radius: 99px; padding: 3px 9px; }

/* lista de indicações */
.ref-list { display: grid; gap: 2px; }
.ref-item { display: flex; align-items: center; gap: 11px; padding: 12px 2px; border-bottom: 1px solid #f0f0f3; }
.ref-item:last-child { border-bottom: 0; }
.ref-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: #eef1fb; color: var(--blue); font-size: 12.5px; font-weight: 700;
}
.ref-main { flex: 1; min-width: 0; }
.ref-main b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-main small { font-size: 11.5px; color: var(--ink-3); }
.ref-right { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ref-value { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ref-value.pending { color: #a35b00; }
.ref-value.paid { color: #0d7a3d; }
.ref-value.cancel { color: var(--ink-3); text-decoration: line-through; }
.ref-value.wait { color: var(--ink-3); font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: #f0f0f3; color: #424245; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.blue { background: #eaf2ff; color: #0a5bd6; }
.badge.green { background: #e7f9ee; color: #0d7a3d; }
.badge.orange { background: #fff4df; color: #a35b00; }
.badge.gray { background: #f0f0f3; color: #6e6e73; }
.empty-mini { text-align: center; padding: 34px 16px; }
.empty-ic { font-size: 30px; display: block; margin-bottom: 8px; opacity: 0.6; }
.empty-mini b { display: block; font-size: 14px; margin-bottom: 4px; }
.empty-mini p { margin: 0; font-size: 12.5px; color: var(--ink-2); }

/* passos / lado */
.status-steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px; }
.status-steps li { display: flex; gap: 11px; align-items: flex-start; }
.ss-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.ss-dot.blue { background: #0a84ff; box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.13); }
.ss-dot.green { background: #30d158; box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.14); }
.ss-dot.orange { background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 168, 17, 0.16); }
.status-steps b { display: block; font-size: 13px; font-weight: 600; }
.status-steps small { display: block; font-size: 11.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.com-mini { border-top: 1px solid #f0f0f3; padding-top: 14px; display: grid; gap: 7px; }
.com-mini div { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.com-mini b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* boas práticas */
.practices { margin-top: 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.section-head h2 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.035em; }
.section-sub { margin: 0; font-size: 13px; color: var(--ink-2); max-width: 34ch; }
.practice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.practice { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.p-num { font-size: 11px; font-weight: 700; color: var(--orange); letter-spacing: 0.06em; }
.practice h3 { font-size: 14.5px; margin: 9px 0 6px; letter-spacing: -0.02em; }
.practice p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* mensagens prontas */
.messages { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.msg-head h3 { font-size: 16px; }
.msg-head p { margin: 3px 0 14px; font-size: 12.5px; color: var(--ink-2); }
.msg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.msg { background: #f8f9fc; border: 1px solid #eceef4; border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.msg p { margin: 0; font-size: 12.5px; color: #3a3a3d; line-height: 1.5; flex: 1; }
.msg .btn { align-self: flex-start; background: #fff; }
.msg .btn svg { width: 14px; height: 14px; }

/* rodapé / toast */
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
}
.foot a { color: var(--blue); font-weight: 550; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 300;
  background: #1d1d1f; color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: all 0.28s var(--ease);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* skeleton */
.skel { background: linear-gradient(90deg, #eee 25%, #f7f7f9 50%, #eee 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* responsivo */
@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
  .msg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner, .wrap { width: calc(100% - 32px); }
  .topbar-label { display: none; }
  .user-name { display: none; }
  .wrap { padding-top: 22px; }
  /* 16px evita o zoom automático do iOS e o corte lateral dos campos */
  .field input, .link-row input { font-size: 16px; }
  .field, .share-main, .share-card, .link-row { min-width: 0; }
  .link-row input { max-width: 100%; overflow-wrap: anywhere; }
  .share-main { flex: 1 1 100%; }
  .share-card { padding: 18px; gap: 16px; }
  .share-actions { width: 100%; }
  .share-actions .btn { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 13px 12px; min-height: 72px; }
  .stat b { font-size: 19px; }
  .stat small { font-size: 10.5px; }
  .practice-grid { grid-template-columns: 1fr; }
  .welcome-badge { display: none; }
  .welcome h1 { font-size: 27px; }
  .link-row { flex-direction: column; }
  .link-row .btn { width: 100%; }
  .ref-item { align-items: flex-start; gap: 9px; }
  .ref-avatar { width: 32px; height: 32px; font-size: 11.5px; }
  .ref-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .ref-right { padding-top: 0; }
  .ref-right .badge { font-size: 9.5px; padding: 2px 7px; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .stat { min-height: 62px; }
  .welcome h1 { font-size: 24px; }
  .msg { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
