/* ═══════════════════════════════════════════════════
   Rank de Vendedores – Mahalo  |  style.css  v2
═══════════════════════════════════════════════════ */

:root {
  --teal:      #14b8a6;
  --teal-dark: #0d9488;
  --teal-grad: linear-gradient(135deg, #2dd4bf 0%, #0891b2 100%);
  --bg:        #f0f2f5;
  --card:      #ffffff;
  --text:      #111827;
  --text2:     #374151;
  --muted:     #6b7280;
  --border:    #e5e7eb;
  --shadow:    0 2px 16px rgba(0,0,0,.08);
  --shadow-sm: 0 1px 6px rgba(0,0,0,.05);
  --radius:    18px;
  --radius-sm: 12px;
  --terca:     #ef4444;
  --quarta:    #3b82f6;
  --quinta:    #22c55e;
  --sexta:     #f59e0b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── APP WRAPPER ─────────────────────────────────── */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}
@media (min-width: 481px) { .app { box-shadow: 0 0 40px rgba(0,0,0,.1); } }

/* ── HEADER ─────────────────────────────────────── */
.app-header {
  background: var(--teal-grad);
  padding: 1.4rem 1.1rem 1.6rem;
  border-radius: 0 0 22px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.app-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
  line-height: 1.3;
}
.app-header h1 small { display: block; font-size: .72rem; font-weight: 400; opacity: .85; }
.header-icon-group { display: flex; gap: .4rem; }
.header-icon-btn {
  background: rgba(255,255,255,.22);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  text-decoration: none;
}
.header-icon-btn:hover { background: rgba(255,255,255,.38); text-decoration: none; }

/* ── UPDATE BAR ─────────────────────────────────── */
.update-bar {
  background: #fff8f0;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  margin: .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.update-icon  { font-size: 1rem; color: #f59e0b; flex-shrink: 0; }
.update-label { font-size: .64rem; font-weight: 700; color: #f59e0b; letter-spacing: .08em; text-transform: uppercase; display: block; }
.update-time  { font-size: .88rem; font-weight: 600; color: var(--text); }

/* ── WEEK NAV ───────────────────────────────────── */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 0 .85rem .3rem;
}
.btn-week {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: .4rem .7rem;
  border-radius: 10px;
  font-size: .76rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.btn-week:hover    { background: #f3f4f6; text-decoration: none; color: var(--text); }
.btn-week-disabled { opacity: .35; pointer-events: none; }
.week-label-center { font-size: .8rem; color: var(--muted); text-align: center; flex: 1; }
.week-label-center strong { color: var(--text); }
.badge-live {
  display: inline-block;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #16a34a;
  border-radius: 20px;
  padding: .1rem .5rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  margin-left: .35rem;
  vertical-align: middle;
  animation: pulse 2s infinite;
}

/* ── MAIN CONTENT ───────────────────────────────── */
.main-content { padding-bottom: 2rem; }

/* ── TABS ───────────────────────────────────────── */
.tabs-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin: .85rem;
}
.tab-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: .6rem .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.tab-btn:hover { border-color: var(--teal); color: var(--teal); }
.tab-btn.active {
  background: var(--teal-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(14,184,166,.3);
}

/* ── SECTION CARD ───────────────────────────────── */
.section-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 .85rem .85rem;
  padding: 1.25rem;
  overflow: hidden;
}
.section-title-row  { margin-bottom: .9rem; }
.section-title      { font-size: 1.15rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .45rem; }
.section-title-icon { color: var(--teal); }
.section-sub        { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

/* ── VENDOR GRID ────────────────────────────────── */
.vendor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.vendor-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem .6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.vendor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .7rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.vendor-name-text {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: .25rem;
}
.vendor-see-text { font-size: .72rem; color: var(--muted); }

/* ── RANKING TABLE ──────────────────────────────── */
.rank-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.rank-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.rank-table thead th {
  background: #f9fafb;
  padding: .65rem .55rem;
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.rank-table tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.rank-table tbody tr:last-child { border-bottom: none; }
.rank-table tbody tr:hover { background: #f9fafb; }
.rank-table td { padding: .65rem .55rem; text-align: center; vertical-align: middle; }
.rank-table .col-nome  { text-align: left; font-weight: 600; font-size: .82rem; }
.rank-table .col-total { font-weight: 800; font-size: 1rem; color: var(--teal-dark); }
.rank-table .col-fat   { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.top-1 td { background: #fef9c328; }
.top-2 td { background: #f1f5f928; }
.top-3 td { background: #fff7ed28; }
.day-pts      { font-size: .88rem; font-weight: 700; }
.day-pts-zero { color: var(--muted); font-size: .8rem; }
.day-fat-sm   { font-size: .68rem; color: var(--muted); display: block; margin-top: .1rem; }
.tbl-terca th  { border-top: 2px solid var(--terca)!important; }
.tbl-quarta th { border-top: 2px solid var(--quarta)!important; }
.tbl-quinta th { border-top: 2px solid var(--quinta)!important; }
.tbl-sexta th  { border-top: 2px solid var(--sexta)!important; }

/* ── PODIUM ─────────────────────────────────────── */
.podium-wrap { display: flex; align-items: flex-end; justify-content: center; gap: .75rem; padding: .5rem 0 0; }
.podium-item { display: flex; flex-direction: column; align-items: center; min-width: 88px; }
.podium-medal { font-size: 1.7rem; margin-bottom: .2rem; }
.podium-name  { font-size: .75rem; font-weight: 700; text-align: center; text-transform: uppercase; color: var(--text); margin-bottom: .15rem; line-height: 1.3; }
.podium-pts   { font-size: 1.35rem; font-weight: 900; line-height: 1; }
.podium-pts span { font-size: .65rem; color: var(--muted); font-weight: 400; }
.podium-1 .podium-pts { color: #d97706; }
.podium-2 .podium-pts { color: #64748b; }
.podium-3 .podium-pts { color: #92400e; }
.podium-block { width: 100%; border-radius: 8px 8px 0 0; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.9); margin-top: .5rem; }
.podium-block-1 { background: linear-gradient(180deg,#d97706,#b45309); height: 78px; }
.podium-block-2 { background: linear-gradient(180deg,#3b82f6,#1d4ed8); height: 58px; }
.podium-block-3 { background: linear-gradient(180deg,#9ca3af,#6b7280); height: 42px; }

/* ── METRIC CARDS ───────────────────────────────── */
.metric-card { border-radius: var(--radius); padding: 1.25rem; margin: 0 .85rem .75rem; color: #fff; }
.mc-blue   { background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%); }
.mc-purple { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.mc-orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.mc-green  { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.mc-teal   { background: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%); }
.mc-red    { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.mc-yellow { background: linear-gradient(135deg, #eab308 0%, #d97706 100%); }
.mc-title    { font-size: .95rem; font-weight: 700; margin-bottom: .15rem; }
.mc-subtitle { font-size: .78rem; opacity: .82; margin-bottom: .9rem; }
.mc-value    { font-size: 2.3rem; font-weight: 900; line-height: 1; margin-bottom: .15rem; }
.mc-sublabel { font-size: .65rem; opacity: .8; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .85rem; }
.mc-milestones { display: flex; justify-content: space-between; font-size: .68rem; font-weight: 600; opacity: .88; margin-bottom: .45rem; }
.mc-milestones span { flex: 1; text-align: center; }
.mc-milestones span:first-child { text-align: left; }
.mc-milestones span:last-child  { text-align: right; }

/* ── SEGMENT BARS ───────────────────────────────── */
.seg-bars { display: flex; gap: .4rem; margin-bottom: .35rem; }
.seg      { flex: 1; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.55); background: rgba(255,255,255,.2); transition: background .2s; }
.seg-s1.seg-on, .seg-terca.active  { background: #ef4444; color: #fff; }
.seg-s2.seg-on, .seg-quarta.active { background: #3b82f6; color: #fff; }
.seg-s3.seg-on, .seg-quinta.active { background: #22c55e; color: #fff; }
.seg-s4.seg-on, .seg-sexta.active  { background: #eab308; color: #fff; }
.seg-s4.seg-on { background: #eab308; }
.seg.seg-off   { background: rgba(255,255,255,.25); }
.mc-footer { display: flex; justify-content: flex-end; margin-top: .25rem; }
.mc-badge  { background: rgba(0,0,0,.3); color: #fff; border-radius: 8px; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; }
.mc-header { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; }
.mc-icon   { font-size: 1rem; }
.mc-sub    { font-size: .8rem; opacity: .82; margin-bottom: .5rem; }
.mc-unit   { font-size: 1rem; font-weight: 400; opacity: .8; }

/* ── REVEAL CARDS ───────────────────────────────── */
.reveal-list { display: flex; flex-direction: column; gap: .7rem; margin-top: .25rem; }
.reveal-card { border-radius: var(--radius-sm); padding: 1rem 1.15rem; cursor: pointer; transition: filter .15s, transform .12s; user-select: none; }
.reveal-card:hover { filter: brightness(1.06); transform: translateY(-1px); }
.reveal-front { display: flex; align-items: center; gap: .6rem; }
.reveal-icon  { font-size: 1.2rem; }
.reveal-label { flex: 1; font-size: .88rem; font-weight: 700; color: rgba(255,255,255,.9); }
.reveal-tap   { font-size: .72rem; color: rgba(255,255,255,.6); white-space: nowrap; }
.reveal-back  { display: none; align-items: center; justify-content: center; padding: .35rem 0; }
.reveal-big   { font-size: 1.7rem; font-weight: 900; color: #fff; }
.reveal-card.revealed .reveal-front { display: none; }
.reveal-card.revealed .reveal-back  { display: flex; }
/* legacy */
.reveal-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.reveal-main  { font-size: 1.15rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: .4rem; }
.reveal-placeholder { display: flex; align-items: center; gap: .4rem; }
.reveal-value       { display: none; }
.reveal-card.revealed .reveal-placeholder { display: none; }
.reveal-card.revealed .reveal-value       { display: flex; }
.reveal-sub { font-size: .73rem; color: rgba(255,255,255,.68); margin-top: .2rem; }

/* ── POSITION BANNER ────────────────────────────── */
.position-banner { background: var(--teal-grad); border-radius: var(--radius); padding: 1rem 1.5rem; margin: 0 .85rem .75rem; display: flex; align-items: center; justify-content: space-around; color: #fff; gap: 1rem; }
.pos-banner-left, .pos-banner-right { text-align: center; }
.pos-banner-pos  { font-size: 2rem; font-weight: 900; line-height: 1; }
.pos-banner-pts  { font-size: 2rem; font-weight: 900; line-height: 1; }
.pos-banner-label { font-size: .7rem; opacity: .82; margin-top: .15rem; text-transform: uppercase; letter-spacing: .05em; }
.pos-banner-divider { width: 1px; height: 3rem; background: rgba(255,255,255,.3); }
/* legacy aliases */
.pos-label { font-size: .68rem; opacity: .82; text-transform: uppercase; letter-spacing: .06em; }
.pos-value { font-size: 1.7rem; font-weight: 900; line-height: 1; }
.pos-right { text-align: right; }
.pos-pts   { font-size: 1.5rem; font-weight: 900; }
.pos-sub   { font-size: .72rem; opacity: .8; }

/* ── DAY CARDS GRID ─────────────────────────────── */
.day-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: 0 .85rem .75rem; }
.day-cards-grid .metric-card { margin: 0; }

/* ── AWARDS ─────────────────────────────────────── */
.awards-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-top: .25rem; }
.award-card { background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .85rem .5rem; text-align: center; }
.award-1 { border-top: 3px solid #d97706; }
.award-2 { border-top: 3px solid #64748b; }
.award-3 { border-top: 3px solid #92400e; }
.award-pos   { font-size: 1rem; margin-bottom: .3rem; }
.award-prize { font-size: .7rem; color: var(--muted); line-height: 1.4; }
.tiebreaker  { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .75rem; }

/* ── LEGEND RULES ───────────────────────────────── */
.legend-card { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: .6rem; box-shadow: var(--shadow-sm); }
.legend-card.lc-terca  { border-left-color: var(--terca);  }
.legend-card.lc-quarta { border-left-color: var(--quarta); }
.legend-card.lc-quinta { border-left-color: var(--quinta); }
.legend-card.lc-sexta  { border-left-color: var(--sexta);  }
.lc-day   { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .2rem; }
.lc-title { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.lc-goal  { font-size: .8rem; color: var(--muted); margin-bottom: .55rem; }
.lc-rules { list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.lc-rules li { font-size: .82rem; }
.pts-badge { display: inline-block; background: #4f46e5; color: #fff; border-radius: 20px; padding: .08rem .48rem; font-size: .7rem; font-weight: 700; }
.pts-bonus { background: linear-gradient(135deg,#d97706,#f59e0b); }
.lc-tip { font-size: .74rem; color: var(--muted); font-style: italic; margin-top: .55rem; padding-top: .5rem; border-top: 1px solid var(--border); }

/* ── LOGIN PAGE ─────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f0f2f5; padding: 1rem; }
.login-wrap { width: 100%; max-width: 400px; }
.login-header { background: var(--teal-grad); border-radius: var(--radius) var(--radius) 0 0; padding: 2.5rem 1.5rem 2rem; text-align: center; color: #fff; }
.login-icon      { font-size: 3rem; display: block; margin-bottom: .75rem; }
.login-header h1 { font-size: 1.3rem; font-weight: 700; margin-bottom: .25rem; }
.login-header p  { font-size: .85rem; opacity: .85; }
.login-body-card { background: var(--card); border-radius: 0 0 var(--radius) var(--radius); padding: 1.75rem 1.5rem 1.5rem; box-shadow: var(--shadow); }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--text2); margin-bottom: .4rem; }
.form-group input { width: 100%; padding: .7rem .95rem; background: #f9fafb; border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); font-size: .95rem; transition: border-color .2s, box-shadow .2s; }
.form-group input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,184,166,.15); background: #fff; }
.btn-primary { background: var(--teal-grad); color: #fff; border: none; border-radius: 10px; padding: .8rem 1.5rem; font-size: 1rem; font-weight: 700; cursor: pointer; transition: opacity .2s, transform .1s; box-shadow: 0 4px 12px rgba(14,184,166,.28); }
.btn-primary:hover  { opacity: .92; transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; display: block; text-align: center; }
.alert { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; font-size: .88rem; }
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.link-back { color: var(--teal); font-size: .88rem; font-weight: 500; }

/* ── RULES DETAILS (collapsible) ────────────────── */
.rules-details { margin: 0 .85rem .75rem; }
.rules-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}
.rules-summary::-webkit-details-marker { display: none; }
.rules-summary::after { content: '▸'; margin-left: auto; color: var(--muted); transition: transform .2s; }
details[open] .rules-summary::after { transform: rotate(90deg); }
.rules-summary:hover { background: #f1f5f9; }
.rules-body { padding-top: .6rem; }

/* ── FOOTER ─────────────────────────────────────── */
.app-footer { background: var(--card); border-top: 1px solid var(--border); text-align: center; padding: .8rem; color: var(--muted); font-size: .72rem; }

/* ── UTILS ──────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty-state p { margin-top: .5rem; }

@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.6 } }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 400px) {
  .avatar { width: 60px; height: 60px; font-size: 1.5rem; }
  .mc-value { font-size: 1.8rem; }
}

