/* TX FITNESS — Identidade Visual 1.0.0 aplicada à Central Growth */
:root {
  --tx-navy: #10243A;
  --tx-blue: #245EEA;
  --tx-white: #FFFFFF;
  --tx-black: #000000;
  --tx-graphite: #24292E;
  --tx-light-blue: #60A5FA;
  --tx-bg: #F3F6FA;
  --tx-border: #DCE3EE;
  --tx-muted: #5A677A;
  --tx-ok: #0F766E;
  --tx-ok-bg: #CCFBF1;
  --tx-warn: #B45309;
  --tx-warn-bg: #FEF3C7;
  --tx-danger: #B91C1C;
  --tx-danger-bg: #FEE2E2;
  --tx-header-height: 54px;
  --tx-header-logo-height: 34px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--tx-bg);
  color: var(--tx-navy);
  line-height: 1.45;
}

.tx-header {
  min-height: var(--tx-header-height);
  background: var(--tx-graphite);
  color: var(--tx-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid var(--tx-blue);
  gap: 16px;
}
.tx-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tx-header__logo {
  display: block;
  width: auto;
  height: var(--tx-header-logo-height);
  flex-shrink: 0;
}
.tx-header__subtitle {
  font-size: 12px;
  color: #CBD5E1;
  border-left: 1px solid #475569;
  padding-left: 12px;
}
.tx-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill--ok { background: var(--tx-ok-bg); color: var(--tx-ok); }
.pill--warn { background: var(--tx-warn-bg); color: var(--tx-warn); }
.pill--danger { background: var(--tx-danger-bg); color: var(--tx-danger); }
.pill--blue { background: #DBEAFE; color: #1D4ED8; }
.pill--dark { background: #334155; color: #F8FAFC; }

.tabs-bar {
  background: var(--tx-white);
  border-bottom: 1px solid var(--tx-border);
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--tx-navy); }
.tab-btn.active {
  color: var(--tx-blue);
  border-bottom-color: var(--tx-blue);
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }

.card {
  background: var(--tx-white);
  border: 1px solid var(--tx-border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(16, 36, 58, 0.05);
}
.card--dark {
  background: linear-gradient(135deg, var(--tx-navy) 0%, #1B365D 100%);
  color: var(--tx-white);
  border-color: #1E3A5F;
}
.card h2, .card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  margin: 6px 0 4px;
  color: var(--tx-navy);
}
.card--dark .kpi-value { color: var(--tx-white); }
.muted { color: var(--tx-muted); font-size: 13px; }
.card--dark .muted { color: #CBD5E1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--tx-blue); color: var(--tx-white); }
.btn-navy { background: var(--tx-navy); color: var(--tx-white); }
.btn-ok { background: var(--tx-ok); color: var(--tx-white); }
.btn-outline { background: var(--tx-white); color: var(--tx-navy); border-color: var(--tx-border); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.form-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx-navy);
}
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--tx-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--tx-navy);
  background: var(--tx-white);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(36, 94, 234, 0.25);
  border-color: var(--tx-blue);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.item-box {
  border: 1px solid var(--tx-border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: #FAFBFD;
}
.item-box__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.code-box {
  background: #0F172A;
  color: #E2E8F0;
  padding: 12px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
}

.log-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-entry {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #F8FAFC;
  border-left: 3px solid var(--tx-blue);
}
.log-entry strong { color: var(--tx-navy); }
.log-time { color: var(--tx-muted); font-size: 11px; margin-right: 6px; }

.studio-wrap {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .studio-wrap { grid-template-columns: 1fr; }
}
.studio-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #E2E8F0;
  border-radius: 12px;
  padding: 20px;
  min-height: 460px;
}
.studio-preview svg {
  max-width: 100%;
  max-height: 560px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 36, 58, 0.25);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--tx-navy);
  color: var(--tx-white);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 100;
  display: none;
  max-width: 420px;
}
.toast.show { display: block; }
.channel-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.channel-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 12px;
  background: #EFF6FF;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.channel-checks input { width: auto; }
