/* ==========================================================================
   ScaleReels Design System & Stylesheet
   Dark Glassmorphism UI, Responsive Dashboard & Multi-account Layout
   ========================================================================== */

:root {
  /* Cores de Fundo (Ultra Dark Theme) */
  --bg-deep: #050608;
  --bg: #090b10;
  --bg2: #0e1118;
  --surf: #121622;
  --surf2: #181d2c;
  --surf3: #20273b;

  /* Cores de Acento */
  --acc: #1F6DF9;
  --acc2: #5F97FB;
  --acc3: #BED5FF;
  --acc-glow: rgba(31, 109, 249, 0.25);

  /* Status Colors */
  --grn: #22c55e;
  --grn2: #4ade80;
  --grn-glow: rgba(34, 197, 94, 0.25);
  --red: #ef4444;
  --red2: #f87171;
  --red-glow: rgba(239, 68, 68, 0.25);
  --yel: #f59e0b;
  --yel2: #fbbf24;

  /* Tipografia */
  --txt: #f8fafc;
  --txt2: #94a3b8;
  --txt3: #64748b;
  --txt4: #475569;

  /* Bordas */
  --brd: rgba(255, 255, 255, 0.08);
  --brd2: rgba(255, 255, 255, 0.15);
  --brd-soft: rgba(255, 255, 255, 0.04);
  --brd-focus: #1F6DF9;

  /* Gradientes */
  --ig-grad: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --blue-grad: linear-gradient(135deg, #1F6DF9 0%, #0d47a1 100%);

  /* Sombras */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.7);

  /* Dimensões */
  --sidebar-w: 250px;
  --sidebar-collapsed-w: 72px;
  --topbar-h: 70px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surf3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--txt3);
}

/* Shimmer de Marca */
.brand-shimmer {
  background: linear-gradient(90deg, #5F97FB 0%, #ffffff 50%, #5F97FB 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

/* Layout Geral */
.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--brd);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
}

.sb-head {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--brd);
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px;
  margin-bottom: 14px;
}

.sb-logo-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--blue-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 10px var(--acc-glow);
}

.sb-logo-t {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.sb-logo-t1 { font-weight: 400; color: var(--txt2); }
.sb-logo-t2 { font-weight: 700; }

/* Usuário no topo da sidebar */
.sb-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 7px 10px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.sb-user:hover {
  border-color: var(--brd2);
}

.sb-user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 1;
  overflow: hidden;
}

.sb-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acc), #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.sb-ui {
  overflow: hidden;
  text-align: left;
}
.sb-un {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-ur {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--txt3);
}
.s-plan-badge {
  background: rgba(31, 109, 249, 0.15);
  color: var(--acc2);
  border: 1px solid rgba(31, 109, 249, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sb-logout {
  background: transparent;
  border: none;
  color: var(--txt3);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.sb-logout:hover {
  color: var(--txt);
  background: rgba(255, 255, 255, 0.05);
}

/* Plataforma Toggle (Instagram / TikTok) */
.sb-plat {
  display: flex;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 2px;
  margin-bottom: 10px;
  gap: 2px;
}
.sb-plat-op {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--txt3);
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.sb-plat-op svg { width: 14px; height: 14px; }
.sb-plat-op.active {
  background: var(--surf2);
  color: var(--txt);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Seletor de Conta */
.sb-acc {
  position: relative;
}
.selconta {
  position: relative;
  width: 100%;
}
.selconta-tr {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--txt);
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color 0.15s;
}
.selconta-tr:hover {
  border-color: var(--brd2);
}
.selconta-av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--acc2);
}
.selconta-nome {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.selconta-seta {
  width: 14px;
  height: 14px;
  color: var(--txt3);
}

.selconta-painel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surf);
  border: 1px solid var(--brd2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 150;
  animation: fadeIn 0.15s ease;
}
.selconta-busca {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
}
.selconta-busca svg { width: 14px; height: 14px; color: var(--txt3); }
.selconta-busca input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--txt);
  font-size: 0.78rem;
  width: 100%;
}
.selconta-lista {
  max-height: 180px;
  overflow-y: auto;
}
.selconta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s;
  color: var(--txt2);
}
.selconta-item:hover, .selconta-item.active {
  background: var(--surf2);
  color: var(--txt);
}
.selconta-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-top: 6px;
  border-top: 1px solid var(--brd);
  font-size: 0.75rem;
  color: var(--acc2);
  cursor: pointer;
}
.selconta-foot svg { width: 13px; height: 13px; }

/* Navegação da Sidebar */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 16px;
}

.sb-sec {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt4);
  padding: 12px 10px 4px;
}

.ni {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--txt2);
  cursor: pointer;
  position: relative;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.ni svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--txt3);
  transition: color 0.15s;
}
.ni-lbl {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}
.ni-t {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--txt);
  line-height: 1.25;
}
.ni-s {
  font-size: 0.68rem;
  color: var(--txt3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ni:hover {
  background: rgba(255, 255, 255, 0.035);
}
.ni:hover svg {
  color: var(--txt);
}
.ni.active {
  background: rgba(31, 109, 249, 0.12);
  color: #fff;
}
.ni.active svg {
  color: var(--acc2);
}
.ni.active .ni-t {
  color: #fff;
  font-weight: 600;
}
.ni-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: var(--acc);
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* Rodapé da Sidebar */
.sb-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--brd);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-wa {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--grn2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.sb-wa:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: var(--grn);
}
.sb-wa svg { width: 16px; height: 16px; }

.sb-pin {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--txt3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.74rem;
  transition: all 0.15s;
}
.sb-pin:hover {
  color: var(--txt);
  background: var(--surf);
}
.sb-pin svg { width: 14px; height: 14px; }

/* ==========================================================================
   ÁREA PRINCIPAL (MAIN & TOPBAR)
   ========================================================================== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--brd);
  background: rgba(9, 11, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.tb-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--txt);
  cursor: pointer;
  padding: 6px;
}

.tb-greet h1 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--txt);
}
.tb-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.tb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surf);
  border: 1px solid var(--brd);
  color: var(--txt2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.tb-action:hover {
  background: var(--surf2);
  color: var(--txt);
  border-color: var(--brd2);
}
.tb-action svg { width: 16px; height: 16px; }

.tb-badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--acc2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--acc);
}

/* ==========================================================================
   CONTEÚDO DAS VIEWS
   ========================================================================== */
.content-body {
  padding: 24px 28px 48px;
  flex: 1;
}

.view-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.vh-left h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.vh-left p {
  font-size: 0.82rem;
  color: var(--txt3);
  margin-top: 2px;
}
.vh-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botões Padrão */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-p {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
  box-shadow: 0 2px 8px var(--acc-glow);
}
.btn-p:hover {
  background: #185bd1;
}
.btn-g {
  background: var(--surf);
  color: var(--txt);
  border-color: var(--brd);
}
.btn-g:hover {
  background: var(--surf2);
  border-color: var(--brd2);
}
.btn-xs { padding: 4px 9px; font-size: 0.74rem; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* Botão Oficial Instagram */
.btn-ig-gradient {
  background: var(--ig-grad);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-ig-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 39, 67, 0.45);
}

/* ==========================================================================
   VIEW 1: DASHBOARD ESPECÍFICOS
   ========================================================================== */
.period-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.period-pills {
  display: inline-flex;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: 6px;
  padding: 2px;
}
.p-pill {
  border: none;
  background: transparent;
  color: var(--txt3);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.p-pill:hover { color: var(--txt); }
.p-pill.active {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 1px 4px var(--acc-glow);
}
.period-label {
  font-size: 0.74rem;
  color: var(--txt3);
}
.period-label strong { color: var(--txt2); font-weight: 500; }

/* Grid de Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--brd2);
}

.mc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--txt3);
  margin-bottom: 10px;
}
.mc-head svg { width: 14px; height: 14px; }

.mc-val {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--txt);
  line-height: 1;
}

/* Cores de status nos cards */
.card-agendados {
  box-shadow: inset 0 2px 0 var(--acc);
}
.card-publicados {
  box-shadow: inset 0 -2px 0 var(--grn);
}
.card-erros {
  box-shadow: inset 0 -2px 0 var(--red);
}

.text-grn { color: var(--grn) !important; }
.text-red { color: var(--red) !important; }

/* Seções de Dashboard */
.dash-section {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.ds-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ds-title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt3);
}
.ds-desc {
  font-size: 0.78rem;
  color: var(--txt3);
  margin-top: 2px;
}
.ds-subhead {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--txt3);
}

/* Empty State Box */
.empty-state-box {
  border: 1px dashed var(--brd);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.empty-state-box.small {
  padding: 20px;
  border: none;
}
.empty-state-box.full {
  width: 100%;
}
.es-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--brd);
  color: var(--txt3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.es-txt {
  font-size: 0.82rem;
  color: var(--txt3);
}

/* Tabelas */
.table-card {
  width: 100%;
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--brd);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--brd-soft);
  color: var(--txt2);
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status-badge.agendado {
  background: rgba(31, 109, 249, 0.15);
  color: var(--acc2);
}
.status-badge.publicado {
  background: rgba(34, 197, 94, 0.15);
  color: var(--grn2);
}
.status-badge.erro {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red2);
}

/* ==========================================================================
   VIEW 2: CONTAS DO INSTAGRAM ESPECÍFICOS
   ========================================================================== */
.ig-connect-banner {
  background: linear-gradient(135deg, rgba(220, 39, 67, 0.07) 0%, rgba(31, 109, 249, 0.05) 100%);
  border: 1px solid rgba(220, 39, 67, 0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.icb-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.icb-badge-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 700px;
}
.ig-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ig-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}
.ig-logo-badge svg { width: 24px; height: 24px; }
.icb-title {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  margin-bottom: 4px;
}
.icb-desc {
  font-size: 0.8rem;
  color: var(--txt2);
  line-height: 1.5;
}

.tags-bar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.tb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tb-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--txt3);
}
.tags-pill-list {
  display: flex;
  gap: 6px;
}
.tag-pill {
  background: var(--surf2);
  border: 1px solid var(--brd);
  color: var(--txt2);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-pill.active {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
.tb-hint {
  font-size: 0.74rem;
  color: var(--txt3);
}
.tb-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  width: 220px;
}
.search-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--txt);
  font-size: 0.78rem;
  width: 100%;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.account-card {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.acc-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.acc-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ig-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}
.acc-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt);
}
.acc-tag {
  font-size: 0.7rem;
  color: var(--grn2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.manual-connect-link {
  text-align: center;
  margin-top: 18px;
}
.manual-connect-link a {
  font-size: 0.78rem;
  color: var(--txt3);
  text-decoration: underline;
  transition: color 0.15s;
}
.manual-connect-link a:hover {
  color: var(--acc2);
}

/* ==========================================================================
   CARDS DE CONFIGURAÇÃO (HORÁRIOS, LEGENDAS, HASHTAGS)
   ========================================================================== */
.card-box {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.cb-subhead {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--txt3);
  display: block;
}
.cb-desc {
  font-size: 0.78rem;
  color: var(--txt3);
  margin-top: 4px;
  margin-bottom: 12px;
}
.hint-text {
  font-size: 0.8rem;
  color: var(--txt3);
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fg label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--txt3);
  text-transform: uppercase;
}

.select-styled, .input-styled, .textarea-styled {
  background: var(--bg2);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  color: var(--txt);
  padding: 8px 12px;
  font-size: 0.82rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  width: 100%;
}
.select-styled:focus, .input-styled:focus, .textarea-styled:focus {
  border-color: var(--brd-focus);
}

/* Horários Slots */
.slots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.time-slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surf2);
  border: 1px solid var(--brd);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--txt);
}
.time-slot-del {
  cursor: pointer;
  color: var(--txt3);
  font-size: 1rem;
  line-height: 1;
}
.time-slot-del:hover { color: var(--red); }

/* Legendas Wrap */
.caption-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.caption-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.char-count {
  font-size: 0.75rem;
  color: var(--txt3);
  font-family: 'JetBrains Mono', monospace;
}

.captions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.caption-item-card {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.caption-item-card p {
  font-size: 0.82rem;
  color: var(--txt);
  white-space: pre-wrap;
  flex: 1;
}

/* Hashtags */
.hashtag-form-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
}
.hashtag-groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.ht-group-card {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ht-tags {
  font-size: 0.78rem;
  color: var(--acc2);
}

/* Storage Meter */
.storage-meter-card {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.smc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.smc-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--txt3);
}
.smc-stats {
  font-size: 0.76rem;
  color: var(--txt3);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--grn));
  border-radius: 3px;
}

/* Pastas Grid */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.new-folder-card {
  border: 1px dashed var(--brd);
  border-radius: var(--radius);
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.new-folder-card:hover {
  border-color: var(--acc);
  background: rgba(31, 109, 249, 0.05);
}
.nfc-ic {
  font-size: 1.8rem;
  color: var(--txt3);
}
.nfc-txt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt2);
}
.folder-card {
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Planos / Pricing */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.pricing-card {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 26px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card.featured {
  border-color: var(--acc);
  box-shadow: 0 0 25px rgba(31, 109, 249, 0.18);
}
.pc-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--txt3);
  margin-bottom: 8px;
}
.pc-badge.highlight {
  color: var(--acc2);
}
.pc-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.pc-price {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 18px;
}
.pc-price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--txt3);
}
.pc-features {
  list-style: none;
  font-size: 0.82rem;
  color: var(--txt2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  flex: 1;
}
.pc-features .muted { color: var(--txt4); }

/* Analytics Paywall */
.analytics-paywall-box {
  background: var(--surf);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 80px 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.apb-content {
  max-width: 440px;
}
.apb-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.apb-content p {
  font-size: 0.82rem;
  color: var(--txt3);
  margin-bottom: 20px;
}

/* Editor Mock Preview */
.editor-mock-preview {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
}
.emp-frame {
  width: 220px;
  height: 380px;
  background: #000;
  border-radius: 16px;
  border: 3px solid var(--brd2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.emp-screen {
  text-align: center;
  color: var(--txt3);
  font-size: 0.78rem;
}
.emp-watermark {
  position: absolute;
  top: 15px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.74rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.emp-controls {
  flex: 1;
  max-width: 400px;
}

/* ==========================================================================
   MODAIS & TOASTS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}
.modal-box {
  background: var(--surf);
  border: 1px solid var(--brd2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.mb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mb-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--txt3);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover { color: var(--txt); }
.mb-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* WhatsApp Contacts List */
.wa-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.wa-contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surf2);
  border: 1px solid var(--brd);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-decoration: none;
  color: var(--txt);
  transition: all 0.15s;
}
.wa-contact-card:hover {
  border-color: var(--grn);
  background: rgba(34, 197, 94, 0.08);
}
.wa-ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: var(--grn2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wa-contact-card strong {
  display: block;
  font-size: 0.82rem;
}
.wa-contact-card span {
  font-size: 0.72rem;
  color: var(--txt3);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
}
.toast {
  background: var(--surf2);
  border: 1px solid var(--brd2);
  color: var(--txt);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease, fadeOut 0.3s ease 3.7s forwards;
}
.toast.success { border-color: var(--grn); }
.toast.error { border-color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-4px); }
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE / TABLET)
   ========================================================================== */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pricing-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .tb-mobile-toggle {
    display: block;
  }
  .content-body {
    padding: 16px;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .hashtag-form-grid {
    grid-template-columns: 1fr;
  }
}
