:root {
  --bg-main: #030d1a;
  --bg-card: #071e3d;
  --bg-card-alt: #0a254a;
  --bg-input: #041427;
  --tio-green: #8FC725;
  --tio-green-glow: rgba(143, 199, 37, 0.35);
  --tio-gold: #FFB800;
  --tio-gold-glow: rgba(255, 184, 0, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --success: #22c55e;
  --text-main: #ffffff;
  --text-sub: #94a3b8;
  --border: rgba(255, 255, 255, 0.12);
  --border-focus: #8FC725;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Barra Superior */
.app-header {
  background: rgba(3, 13, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 12px 16px;
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 38px;
  width: auto;
  border-radius: 8px;
}

.logo-text h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.logo-text h1 span {
  color: var(--tio-green);
}

.logo-text p {
  font-size: 11px;
  color: var(--text-sub);
}

.header-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tio-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Container Principal */
.app-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

/* Step 1: Seleção de Loja */
.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin-bottom: 24px;
}

.welcome-badge {
  display: inline-block;
  background: rgba(143, 199, 37, 0.15);
  color: var(--tio-green);
  border: 1px solid rgba(143, 199, 37, 0.3);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.welcome-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.welcome-card p {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-select, .form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 15px;
  color: #ffffff;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.form-select:focus, .form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 14px var(--tio-green-glow);
}

.btn-start {
  width: 100%;
  background: linear-gradient(135deg, var(--tio-green) 0%, #7db31e 100%);
  color: #031124;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--tio-green-glow);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.btn-start:hover, .btn-start:active {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Step 2: Conferência de Produtos */
.sticky-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  position: sticky;
  top: 68px;
  z-index: 900;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.store-active-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 10px;
}

.store-active-name {
  font-weight: 800;
  color: var(--tio-green);
}

.leader-active-name {
  color: var(--text-sub);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.progress-track {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  background: linear-gradient(90deg, var(--tio-green), #4ade80);
  height: 100%;
  width: 0%;
  transition: width 0.25s ease;
}

.counts-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.count-tag {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.count-tag.sim { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.count-tag.nao { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.count-tag.pend { background: rgba(255, 184, 0, 0.2); color: #facc15; }

/* Filtros de Categoria */
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-chip.active {
  background: var(--tio-green);
  color: #031124;
  border-color: var(--tio-green);
  box-shadow: 0 0 10px var(--tio-green-glow);
}

/* Card do Produto Mobile */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  position: relative;
}

.product-card.marked-sim {
  border-color: rgba(34, 197, 94, 0.7);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, var(--bg-card) 100%);
}

.product-card.marked-nao {
  border-color: rgba(239, 68, 68, 0.7);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, var(--bg-card) 100%);
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.product-thumb {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.product-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-details {
  flex: 1;
}

.product-num-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.badge-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--tio-green);
}

.badge-brand {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
}

.product-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.product-gtin {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-sub);
}

.product-price-pts {
  display: flex;
  gap: 12px;
  font-size: 11px;
  margin-top: 4px;
}

.price-item {
  color: #ffffff;
  font-weight: 700;
}

.pts-item {
  color: var(--tio-gold);
  font-weight: 800;
}

/* Botões de Ação SIM / NÃO (Grandes para Touch) */
.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-choice {
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-choice.btn-sim {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

.btn-choice.btn-sim:active, .btn-choice.btn-sim.active {
  background: #22c55e !important;
  color: #031124 !important;
  border-color: #16a34a !important;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-choice.btn-nao {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-choice.btn-nao:active, .btn-choice.btn-nao.active {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Botão de Envio Flutuante */
.bottom-send-bar {
  background: rgba(3, 13, 26, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  padding: 14px 16px;
  margin-top: 20px;
  z-index: 950;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--tio-green) 0%, #7db31e 100%);
  color: #031124;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--tio-green-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Tela de Confirmação e Sucesso */
.success-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.success-icon {
  font-size: 54px;
  margin-bottom: 16px;
}

.success-card h2 {
  font-size: 22px;
  color: var(--tio-green);
  margin-bottom: 10px;
}

.success-card p {
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 24px;
}

.success-stats-box {
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

/* Painel da Diretoria (Admin) */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.admin-grid-stores {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.store-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s;
}

.store-admin-card.completed {
  border-left: 4px solid var(--tio-green);
}

.store-admin-card.pending {
  border-left: 4px solid var(--tio-gold);
}

.table-responsive {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 900px;
}

.admin-matrix-table th {
  background: #041427;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.admin-matrix-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pill-yes {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.pill-no {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.pill-none {
  color: rgba(255,255,255,0.2);
}