@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Noto+Sans:wght@400;500&family=Cinzel:wght@700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cores principais */
  --bg:        #060810;
  --surface:   #0e1219;
  --surface2:  #141b26;
  --surface3:  #1c2535;
  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.11);

  /* Dourado — cor da identidade */
  --gold:      #d4a843;
  --gold-dim:  #7a5c1e;
  --gold-bg:   rgba(212,168,67,0.10);
  --gold-glow: rgba(212,168,67,0.22);

  /* Status */
  --green:     #2ed47a;
  --green-bg:  rgba(46,212,122,0.10);
  --red:       #e84545;
  --red-bg:    rgba(232,69,69,0.10);
  --amber:     #f09a28;
  --amber-bg:  rgba(240,154,40,0.10);
  --blue:      #6baff5;
  --blue-bg:   rgba(107,175,245,0.10);

  /* Texto */
  --text:      #eef0f4;
  --text2:     #7f8c9e;
  --text3:     #3f4a58;

  /* Fontes */
  --fd:        'Rajdhani', sans-serif;
  --fb:        'Noto Sans', sans-serif;
  --fc:        'Cinzel', serif;

  /* Formas */
  --r:         12px;
  --r-sm:      8px;
  --r-lg:      18px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Textura sutil no fundo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212,168,67,0.07) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app, #toast, #loading { position: relative; z-index: 1; }

/* ── Utilitários ── */
.hidden { display: none !important; }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--r); border: 0.5px solid var(--border2);
  background: var(--surface2); color: var(--text2);
  font-family: var(--fd); font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.18s; user-select: none; position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
  pointer-events: none;
}
.btn:hover   { background: var(--surface3); color: var(--text); border-color: rgba(255,255,255,0.18); }
.btn:active  { transform: scale(0.97); }

.btn-gold {
  border-color: var(--gold-dim);
  background: linear-gradient(135deg, rgba(212,168,67,0.18) 0%, rgba(212,168,67,0.08) 100%);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(212,168,67,0.1);
}
.btn-gold:hover { background: linear-gradient(135deg, rgba(212,168,67,0.28) 0%, rgba(212,168,67,0.14) 100%); box-shadow: 0 0 28px rgba(212,168,67,0.2); }

.btn-green {
  border-color: rgba(46,212,122,0.4);
  background: linear-gradient(135deg, rgba(46,212,122,0.15) 0%, rgba(46,212,122,0.07) 100%);
  color: var(--green);
}
.btn-green:hover { background: linear-gradient(135deg, rgba(46,212,122,0.25) 0%, rgba(46,212,122,0.12) 100%); }

.btn-red {
  border-color: rgba(232,69,69,0.4);
  background: rgba(232,69,69,0.08);
  color: var(--red);
}
.btn-full  { width: 100%; }
.btn:disabled { opacity: 0.28; cursor: not-allowed; transform: none; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: var(--r-lg); letter-spacing: 0.06em; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.card2 {
  background: var(--surface2);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center;
  font-family: var(--fd); font-size: 9px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.chip-gold  { background: var(--gold-bg);  color: var(--gold);  border: 0.5px solid var(--gold-dim); }
.chip-blue  { background: var(--blue-bg);  color: var(--blue);  border: 0.5px solid rgba(107,175,245,0.3); }
.chip-amber { background: var(--amber-bg); color: var(--amber); border: 0.5px solid rgba(240,154,40,0.35); }
.chip-red   { background: var(--red-bg);   color: var(--red);   border: 0.5px solid rgba(232,69,69,0.35); }
.chip-green { background: var(--green-bg); color: var(--green); border: 0.5px solid rgba(46,212,122,0.35); }

/* ── Avatares — 11 cores ── */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--fd); font-weight: 700; flex-shrink: 0; }
.av-1  { background:rgba(212,168,67,0.16);  color:#d4a843; border:1.5px solid rgba(212,168,67,0.4); }
.av-2  { background:rgba(107,175,245,0.16); color:#6baff5; border:1.5px solid rgba(107,175,245,0.4); }
.av-3  { background:rgba(46,212,122,0.16);  color:#2ed47a; border:1.5px solid rgba(46,212,122,0.4); }
.av-4  { background:rgba(232,100,140,0.16); color:#e8648c; border:1.5px solid rgba(232,100,140,0.4); }
.av-5  { background:rgba(160,130,240,0.16); color:#a082f0; border:1.5px solid rgba(160,130,240,0.4); }
.av-6  { background:rgba(240,130,50,0.16);  color:#f08232; border:1.5px solid rgba(240,130,50,0.4); }
.av-7  { background:rgba(140,210,70,0.16);  color:#8cd246; border:1.5px solid rgba(140,210,70,0.4); }
.av-8  { background:rgba(230,90,170,0.16);  color:#e65aaa; border:1.5px solid rgba(230,90,170,0.4); }
.av-9  { background:rgba(50,210,230,0.16);  color:#32d2e6; border:1.5px solid rgba(50,210,230,0.4); }
.av-10 { background:rgba(190,110,250,0.16); color:#be6efa; border:1.5px solid rgba(190,110,250,0.4); }
.av-11 { background:rgba(250,210,50,0.16);  color:#fad232; border:1.5px solid rgba(250,210,50,0.4); }

/* ── KPI ── */
.kpi { border-radius: var(--r-sm); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-family: var(--fd); font-size: 8px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.kpi-value { font-family: var(--fd); font-size: 18px; font-weight: 700; line-height: 1.1; }
.kpi-sub   { font-size: 10px; }
.kpi-saidor  { background: linear-gradient(135deg, rgba(212,168,67,0.14), rgba(212,168,67,0.06)); border: 0.5px solid var(--gold-dim); }
.kpi-saidor .kpi-label { color: var(--gold-dim); } .kpi-saidor .kpi-value { color: var(--gold); } .kpi-saidor .kpi-sub { color: var(--gold-dim); }
.kpi-cart    { background: linear-gradient(135deg, rgba(107,175,245,0.12), rgba(107,175,245,0.05)); border: 0.5px solid rgba(107,175,245,0.25); }
.kpi-cart .kpi-label { color: rgba(107,175,245,0.5); } .kpi-cart .kpi-value { color: var(--blue); } .kpi-cart .kpi-sub { color: rgba(107,175,245,0.5); }
.kpi-premio  { background: linear-gradient(135deg, rgba(46,212,122,0.12), rgba(46,212,122,0.05)); border: 0.5px solid rgba(46,212,122,0.25); }
.kpi-premio .kpi-label { color: rgba(46,212,122,0.5); } .kpi-premio .kpi-value { color: var(--green); } .kpi-premio .kpi-sub { color: rgba(46,212,122,0.5); }

/* ── Steps ── */
.steps { display: flex; gap: 4px; }
.step  { flex: 1; height: 3px; border-radius: 2px; background: var(--surface3); transition: background 0.3s; }
.step.active { background: var(--gold); box-shadow: 0 0 8px rgba(212,168,67,0.4); }
.step.done   { background: var(--green); }

/* ── Toggle ── */
.toggle-ind { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--fd); font-weight: 700; flex-shrink: 0; border: 1px solid var(--border2); color: var(--text3); transition: all 0.18s; }
.toggle-ind.on     { background: var(--green-bg); border-color: rgba(46,212,122,0.5); color: var(--green); box-shadow: 0 0 10px rgba(46,212,122,0.2); }
.toggle-ind.locked { background: var(--amber-bg); border-color: rgba(240,154,40,0.5); color: var(--amber); }

/* ── Pontuação cores ── */
.pts-hi  { color: var(--green); }
.pts-mid { color: var(--gold); }
.pts-lo  { color: var(--amber); }
.pts-red { color: var(--red); }

/* ── Inputs ── */
input[type=text], input[type=number] {
  width: 100%; padding: 12px 14px;
  background: var(--surface2); border: 0.5px solid var(--border2);
  border-radius: var(--r); color: var(--text); font-family: var(--fb); font-size: 15px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(212,168,67,0.08); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px; backdrop-filter: blur(6px);
}
.modal-box {
  background: var(--surface);
  border: 0.5px solid rgba(212,168,67,0.2);
  border-radius: var(--r-lg);
  padding: 22px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,168,67,0.05);
}
.modal-title {
  font-family: var(--fd); font-size: 20px; font-weight: 700;
  color: var(--gold); margin-bottom: 16px; letter-spacing: 0.04em;
}

/* ── Divider ── */
.divider { height: 0.5px; background: var(--border); margin: 12px 0; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--surface2); border: 0.5px solid var(--border2);
  border-radius: var(--r); padding: 11px 22px;
  font-size: 13px; color: var(--text);
  z-index: 9999; opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: rgba(232,69,69,0.5); color: var(--red); }

/* ── Loading ── */
#loading {
  position: fixed; inset: 0; background: rgba(6,8,16,0.88);
  display: none; align-items: center; justify-content: center;
  z-index: 9998; backdrop-filter: blur(4px);
}
.spinner {
  width: 38px; height: 38px;
  border: 2.5px solid rgba(212,168,67,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 20px rgba(212,168,67,0.15);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212,168,67,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,168,67,0.35); }

/* ── Pay badge ── */
.pay-badge {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-size: 10px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; transition: transform 0.15s;
}
.pay-badge:hover { transform: scale(1.2); }
.pay-pago    { background: var(--green-bg); color: var(--green); border: 1px solid rgba(46,212,122,0.4); }
.pay-pendente { background: var(--red-bg); color: var(--red); border: 1px solid rgba(232,69,69,0.4); }

/* ── Animações ── */
@keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse  { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes glow   { 0%,100%{box-shadow:0 0 8px rgba(212,168,67,0.3)} 50%{box-shadow:0 0 20px rgba(212,168,67,0.6)} }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ── Header da tela principal ── */
.app-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px; padding-bottom: 16px;
  border-bottom: 0.5px solid var(--border);
}

.app-logo {
  font-family: var(--fd);
  font-size: 24px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 0 30px rgba(212,168,67,0.3);
}

/* ── App bar unificada (padrão A) ────────────────────────── */
.appbar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 2px 14px 2px;
  margin-bottom: 18px;
  border-bottom: 0.5px solid var(--border);
}
.appbar__title {
  flex: 1; min-width: 0;
  font-family: var(--fd);
  font-size: 18px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 6px;
}
.appbar__icon {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 0.5px solid var(--border2);
  color: var(--text2);
  font-size: 15px; font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.appbar__icon:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--gold-bg);
}
.appbar__sep {
  width: 1px; height: 22px;
  background: var(--border2);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Pill do usuário: logado (avatar+nome+menu) e deslogado (Entrar) */
.user-pill { position: relative; display: inline-block; }
.user-pill__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: transparent;
  border: 0.5px solid var(--border2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit; font-size: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.user-pill__btn:hover { border-color: rgba(255,255,255,0.18); background: var(--surface2); }
.user-pill__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #f0c060, #d4a843);
  color: #060810;
  font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-pill__name {
  max-width: 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-pill__caret { color: var(--text3); font-size: 9px; margin-left: -2px; }
.user-pill__enter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 0.5px solid var(--gold-dim);
  background: var(--gold-bg);
  color: var(--gold);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.user-pill__enter:hover { background: rgba(212,168,67,0.18); border-color: var(--gold); }
.user-pill__menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  min-width: 200px; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  overflow: hidden;
}
.user-pill__menu-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; color: var(--text3);
  word-break: break-all;
}
.user-pill__menu a,
.user-pill__menu button {
  display: block; width: 100%;
  padding: 11px 14px;
  text-align: left;
  background: none; border: none;
  color: var(--text);
  font-size: 13px; font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s;
}
.user-pill__menu a:hover,
.user-pill__menu button:hover { background: var(--surface2); color: var(--gold); }
.user-pill__menu button { border-top: 1px solid var(--border); }
