/* ─── Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--fit-bg);
  color: var(--fit-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ────────────────────────────────────────────── */
.fit-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (desktop) */
.fit-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--fit-bg-sidebar);
  border-right: 1px solid var(--fit-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: width .2s ease;
}

.fit-sidebar .brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--fit-border);
}

.fit-sidebar .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--fit-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.fit-sidebar .brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--fit-text);
  letter-spacing: -0.3px;
}

.fit-sidebar .brand-name span {
  color: var(--fit-primary);
}

.fit-nav {
  list-style: none;
  padding: 12px 10px;
  margin: 0;
  flex: 1;
}

.fit-nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--fit-radius-sm);
  color: var(--fit-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
}

.fit-nav-item a:hover {
  background: var(--fit-bg-hover);
  color: var(--fit-text);
}

.fit-nav-item a.active,
.fit-nav-item a[aria-current="page"] {
  background: var(--fit-primary);
  color: white;
}

[data-bs-theme="light"] .fit-nav-item a.active {
  background: #ECFDF5;
  color: var(--fit-primary);
}

.fit-nav-item a i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.fit-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--fit-border);
}

/* Main content */
.fit-main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  padding-bottom: 80px; /* space for mobile nav */
}

/* Top bar */
.fit-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--fit-bg-card);
  border-bottom: 1px solid var(--fit-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.fit-page-content {
  padding: 24px;
}

/* ─── Cards ─────────────────────────────────────────────── */
.fit-card {
  background: var(--fit-bg-card);
  border: 1px solid var(--fit-border);
  border-radius: var(--fit-radius);
  box-shadow: var(--fit-shadow);
}

.fit-card-body {
  padding: 20px;
}

.fit-card-sm .fit-card-body {
  padding: 16px;
}

/* Metric cards */
.metric-card {
  background: var(--fit-bg-card);
  border: 1px solid var(--fit-border);
  border-radius: var(--fit-radius);
  padding: 20px;
  box-shadow: var(--fit-shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}

.metric-card:hover {
  box-shadow: var(--fit-shadow-md);
  transform: translateY(-2px);
}

.metric-card .metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.metric-card .metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fit-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.metric-card .metric-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--fit-text);
  line-height: 1.2;
}

.metric-card .metric-sub {
  font-size: 12px;
  color: var(--fit-text-muted);
  margin-top: 4px;
}

/* ─── Botões ─────────────────────────────────────────────── */
.btn-fit {
  background: var(--fit-primary);
  color: white;
  border: none;
  border-radius: var(--fit-radius-sm);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-fit:hover {
  background: var(--fit-primary-hover);
  color: white;
  transform: translateY(-1px);
}

.btn-fit:active { transform: translateY(0); }

.btn-fit-outline {
  background: transparent;
  color: var(--fit-primary);
  border: 1.5px solid var(--fit-primary);
  border-radius: var(--fit-radius-sm);
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.btn-fit-outline:hover {
  background: var(--fit-primary);
  color: white;
}

/* ─── Formulários ────────────────────────────────────────── */
.fit-input {
  background: var(--fit-bg-card);
  border: 1.5px solid var(--fit-border);
  border-radius: var(--fit-radius-sm);
  color: var(--fit-text);
  padding: 12px 16px;
  font-size: 15px;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.fit-input:focus {
  outline: none;
  border-color: var(--fit-primary);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .12);
}

[data-bs-theme="dark"] .fit-input {
  background: var(--fit-bg-elevated);
}

.fit-input::placeholder { color: var(--fit-text-muted); }

.fit-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fit-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ─── Auth Pages ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fit-bg);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--fit-bg-card);
  border: 1px solid var(--fit-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--fit-shadow-md);
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand-logo {
  width: 56px;
  height: 56px;
  background: var(--fit-primary);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  margin-bottom: 12px;
}

.auth-brand h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--fit-text);
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}

.auth-brand h1 span { color: var(--fit-primary); }

.auth-brand p {
  color: var(--fit-text-muted);
  font-size: 14px;
  margin: 0;
}

/* ─── Bottom Navigation (mobile) ────────────────────────── */
.fit-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--fit-bg-card);
  border-top: 1px solid var(--fit-border);
  z-index: 200;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.fit-bottom-nav-inner {
  display: flex;
  justify-content: space-around;
}

.fit-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  color: var(--fit-text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  transition: color .15s ease;
  min-width: 60px;
}

.fit-bottom-nav a i {
  font-size: 22px;
}

.fit-bottom-nav a.active,
.fit-bottom-nav a:hover {
  color: var(--fit-primary);
}

/* ─── Badges / Status ────────────────────────────────────── */
.fit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ─── Plans page ─────────────────────────────────────────── */
.plan-card {
  border: 2px solid var(--fit-border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.plan-card.featured {
  border-color: var(--fit-primary);
  box-shadow: 0 0 0 4px rgba(4, 120, 87, .1);
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--fit-shadow-md);
}

.plan-header {
  background: var(--fit-primary);
  color: white;
  padding: 24px;
  text-align: center;
}

.plan-price {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.plan-price sup { font-size: 22px; vertical-align: top; margin-top: 8px; }
.plan-price sub { font-size: 16px; font-weight: 500; }

.plan-features {
  padding: 24px;
}

.plan-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--fit-text);
  border-bottom: 1px solid var(--fit-border);
}

.plan-feature:last-child { border-bottom: none; }

.plan-feature i {
  color: var(--fit-success);
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Onboarding ─────────────────────────────────────────── */
.onboarding-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fit-bg);
  padding: 20px;
}

.onboarding-card {
  width: 100%;
  max-width: 540px;
  background: var(--fit-bg-card);
  border: 1px solid var(--fit-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--fit-shadow-md);
}

.step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}

.step-dot {
  height: 4px;
  border-radius: 2px;
  flex: 1;
  background: var(--fit-border);
  transition: background .3s ease;
}

.step-dot.active { background: var(--fit-primary); }
.step-dot.done   { background: var(--fit-success);  }

/* ─── Theme Toggle ───────────────────────────────────────── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--fit-border);
  border-radius: 10px;
  background: var(--fit-bg-card);
  color: var(--fit-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all .15s ease;
}

.theme-toggle:hover {
  color: var(--fit-primary);
  border-color: var(--fit-primary);
}

/* ─── Admin Layout ───────────────────────────────────────── */
.admin-sidebar {
  width: 220px;
  min-height: 100vh;
  background: #111827;
  border-right: 1px solid #1F2937;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.admin-main { margin-left: 220px; min-height: 100vh; }

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #9CA3AF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  margin: 2px 8px;
  transition: all .15s ease;
}

.admin-nav a:hover { background: #1F2937; color: #F9FAFB; }
.admin-nav a.active { background: #22C55E; color: #111; font-weight: 700; }
.admin-nav a i { font-size: 16px; width: 18px; text-align: center; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .fit-sidebar { display: none; }
  .fit-main { margin-left: 0; padding-bottom: 72px; }
  .fit-bottom-nav { display: block; }
  .fit-topbar { padding: 12px 16px; }
  .fit-page-content { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .onboarding-card { padding: 28px 20px; }
  .plan-price { font-size: 40px; }
  .metric-card .metric-value { font-size: 22px; }
}

@media (max-width: 480px) {
  .fit-page-content { padding: 12px; }
  .metric-card { padding: 16px; }
}

/* ─── Utilitários ────────────────────────────────────────── */
.text-primary-fit { color: var(--fit-primary) !important; }
.text-muted-fit   { color: var(--fit-text-muted) !important; }
.bg-card          { background-color: var(--fit-bg-card) !important; }
.border-fit       { border-color: var(--fit-border) !important; }

.divider {
  border: none;
  border-top: 1px solid var(--fit-border);
  margin: 16px 0;
}

/* Alert overrides */
.alert { border-radius: var(--fit-radius-sm); border: none; font-size: 14px; }

/* Table overrides */
.table { color: var(--fit-text); }
.table td, .table th { border-color: var(--fit-border); }
[data-bs-theme="dark"] .table th {
  background: var(--fit-bg-elevated);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fit-border); border-radius: 3px; }
