* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f0f13;
  color: #e6e6e6;
  margin: 0;
  padding: 2rem;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.subtitle { color: #999; margin-bottom: 2rem; font-size: 0.9rem; }
.subtitle a { color: #a78bfa; }

.card {
  background: #1a1a20;
  border: 1px solid #2a2a33;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 0.25rem; margin-top: 0.75rem; }
label:first-child { margin-top: 0; }

.meta { font-size: 0.8rem; color: #999; }

input, select {
  width: 100%;
  padding: 0.5rem;
  background: #0f0f13;
  border: 1px solid #3a3a45;
  border-radius: 4px;
  color: #e6e6e6;
  font-size: 0.9rem;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-primary { background: #8b5cf6; color: white; margin-top: 1rem; }
.btn-approve { background: #22c55e; color: white; }
.btn-reject { background: #444; color: #ddd; margin-top: 1rem; }
.btn-complete { background: #3b82f6; color: white; }
.btn-progress { background: #f59e0b; color: white; }
button + button { margin-left: 0.4rem; }

.btn-link {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.divider {
  border: none;
  border-top: 1px solid #2a2a33;
  margin: 1.5rem 0 0.75rem;
}

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.tabs button { background: #24242c; color: #aaa; }
.tabs button.active { background: #8b5cf6; color: white; }

.challenge {
  border-bottom: 1px solid #2a2a33;
  padding: 0.75rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.challenge:last-child { border-bottom: none; }
.challenge .title { font-weight: 600; }
.challenge .description { font-size: 0.8rem; }
.challenge .meta { font-size: 0.8rem; color: #999; }
.challenge .actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.error {
  background: #3b1414;
  border: 1px solid #7a2020;
  color: #ff9b9b;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.empty { color: #777; font-size: 0.9rem; text-align: center; padding: 1.5rem 0; }

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.checkbox-row input { width: auto; }

input[type="color"] {
  padding: 0 0.2rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap; /* Garante boa exibição em telas menores */
}

.tabs button {
  background: #24242c;
  color: #aaa;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tabs button.active {
  background: #8b5cf6;
  color: white;
}

/* ============================================================
   Utilitários de layout — substituem estilo inline repetido no app.html
   ============================================================ */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.select-inline { width: auto; }

.tabs-wrap { margin-bottom: 1.5rem; }

.block-spaced { margin: 0.75rem 0; }
.mt-1 { margin-top: 1rem; }
.mt-075 { margin-top: 0.75rem; }
.mb-05 { margin-bottom: 0.5rem; }
.mt-035 { margin-top: 0.35rem; }
.mt-04 { margin-top: 0.4rem; }

.progress-track {
  height: 8px;
  background: #2a2a33;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill { height: 100%; transition: width 0.4s ease; }
.progress-fill.trial { background: #8b5cf6; }
.progress-fill.cycle { background: #3b82f6; }
.progress-fill.is-full { background: #d81a3a; }

.warning {
  background: #3b2e14;
  border: 1px solid #7a5c20;
  color: #ffce9b;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.subscribe-label { font-weight: 600; margin-bottom: 0.5rem; }
.plan-btn { margin-right: 0.5rem; margin-bottom: 0.5rem; }

.saved-indicator { color: #22c55e; font-size: 0.85rem; margin-left: 0.6rem; }

.fineprint { color: #999; font-size: 0.8rem; }

.is-disabled { opacity: 0.5; }

/* ---- Prévia do overlay (aba Overlay) ---- */
.theme-preview-bg {
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  background-image:
    linear-gradient(45deg, #1a1a20 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a20 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a20 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a20 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #0f0f13;
}
.theme-preview-content {
  align-items: center;
  color: #f0f0f0;
  display: flex;
  font-family: 'Segoe UI', system-ui, sans-serif;
  gap: 10px;
}
.theme-preview-icon {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: rgba(139, 143, 153, 0.15);
  flex-shrink: 0;
}
.theme-preview-body { flex: 1; }
.theme-preview-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.theme-preview-requester { font-size: 13px; color: #a0a0a0; margin-bottom: 6px; }
.theme-preview-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.theme-preview-fill {
  width: 66%;
  height: 100%;
}
.theme-preview-progress {
  font-size: 13px;
  font-weight: bold;
  color: #ccc;
  margin-top: 3px;
  text-align: right;
}

/* ---- Comandos / tokens de dispositivo (aba Integrações) ---- */
.cmd-name { font-family: monospace; font-size: 0.85rem; }
.mono-label { font-family: monospace; margin-bottom: 0.4rem; }
.curl-block { margin-bottom: 1.25rem; }
.curl-textarea {
  width: 100%;
  font-family: monospace;
  font-size: 0.8rem;
  background: #0f0f13;
  color: #e6e6e6;
  border: 1px solid #3a3a45;
  border-radius: 4px;
  padding: 0.5rem;
}

/* ---- Barra de notificações (topo do painel) ---- */
.notification-bar {
  max-width: 760px;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  border: 1px solid;
  font-size: 0.85rem;
}

.notice-critical { background: #3b1414; border-color: #7a2020; color: #ff9b9b; }
.notice-warning  { background: #3b2e14; border-color: #7a5c20; color: #ffce9b; }
.notice-info     { background: #1a1a2e; border-color: #3a3a6a; color: #b3b3ff; }

.notice-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* Três colunas iguais */
  align-items: center;
}

.history-amount {
  font-family: monospace;
  font-size: 0.85rem;
  color: #ccc;
  text-align: right;
}

.history-status {
  text-align: right;
}