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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #0B0F14;
  color: #ffffff;
  min-height: 100vh;
  padding-bottom: 60px;
}

.safe-area {
  padding-bottom: env(safe-area-inset-bottom);
}

.appbar {
  background: #1a1f2e;
  border-bottom: 1px solid #2a2f3e;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.titles h1 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.subtitle {
  font-size: 0.875rem;
  color: #9ca3af;
}

.chip {
  background: #2a2f3e;
  border: 1px solid #3a3f4e;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.chip-live {
  background: #000000;
  color: #22c55e;
  font-weight: 600;
  border: 1px solid #2a2f3e;
}

.chip-live.bg-yellow-600 {
  background: #000000;
  color: #f59e0b;
}

.content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.card {
  background: #1a1f2e;
  border: 1px solid #2a2f3e;
  border-radius: 12px;
  padding: 1.25rem;
}

.card.mini {
  padding: 1rem;
}

.card.highlight {
  border-color: #22c55e;
  border-width: 2px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-head h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.pill {
  background: #2a2f3e;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pill.green {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.pill.loss {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.velas-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.analisando {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #60a5fa;
}

.servidor-offline {
  color: #f59e0b !important;
  font-weight: 600;
}

.ping {
  width: 8px;
  height: 8px;
  background: #60a5fa;
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.dots {
  display: inline-flex;
  gap: 4px;
}

.dots i {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.dots i:nth-child(1) {
  animation-delay: -0.32s;
}

.dots i:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.velas {
  display: flex;
  gap: 0.3rem;
  flex-wrap: nowrap;
  list-style: none;
  width: 100%;
}

.vela-pill {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.25rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #000000 !important;
  border: 1px solid #2a2f3e;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.entry-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: #0f1419;
  border: 1px solid #2a2f3e;
  border-radius: 8px;
}

.entry-metric .label {
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 400;
}

.entry-metric .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: #22c55e;
  color: #ffffff;
}

.btn-primary:hover {
  background: #16a34a;
}

.btn-warn {
  background: #f59e0b;
  color: #ffffff;
}

.btn-warn:hover {
  background: #d97706;
}

.filters {
  display: flex;
  gap: 0.5rem;
}

.filters .chip {
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
}

.filters .chip[aria-pressed="true"] {
  background: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
}

.history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.history li {
  background: #0f1419;
  border: 1px solid #2a2f3e;
  border-radius: 8px;
  padding: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history .time {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.history .meta {
  display: flex;
  gap: 0.3rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

.history .meta .chip {
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
  background: #2a2f3e;
  white-space: nowrap;
}

.history .badge {
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.history .badge.green {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.history .badge.loss {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.hint {
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
}

.tutorial-wrap {
  padding: 0 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.cta-push {
  background: #1a1f2e;
  border: 1px solid #2a2f3e;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cta-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cta-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.cta-text span {
  font-size: 0.875rem;
  color: #9ca3af;
}

.cta-btn {
  width: 100%;
}

#toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

@media (max-width: 640px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
  
  .actions {
    grid-template-columns: 1fr;
  }
}
