:root {
  --bg: #090b14;
  --bg-2: #0f1220;
  --glass: rgba(16, 20, 36, 0.72);
  --glass-2: rgba(23, 29, 50, 0.78);
  --glass-3: rgba(31, 39, 66, 0.85);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #ffffff;
  --muted: #94a3b8;
  --amber: #f59e0b;
  --magenta: #ec4899;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 22px 55px rgba(2, 4, 14, 0.65);
}

[data-theme="light"] {
  --bg: #eef2ff;
  --bg-2: #f8fafc;
  --glass: rgba(255, 255, 255, 0.88);
  --glass-2: rgba(241, 245, 249, 0.92);
  --glass-3: rgba(226, 232, 240, 0.95);
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --muted: #475569;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.48;
  background-color: var(--bg);
  background-image:
    radial-gradient(620px circle at 14% 8%, rgba(236, 72, 153, 0.16), transparent 60%),
    radial-gradient(700px circle at 82% 14%, rgba(139, 92, 246, 0.18), transparent 62%),
    radial-gradient(560px circle at 52% 88%, rgba(6, 182, 212, 0.12), transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
}

/* Glass cards com borda neon 1px via pseudo-elemento */
.glass-card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: transparent;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.neon-amber::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.78), rgba(251, 146, 60, 0.25), rgba(236, 72, 153, 0.45));
}
.neon-magenta::before {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.8), rgba(244, 63, 94, 0.28), rgba(139, 92, 246, 0.5));
}
.neon-purple::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.82), rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.48));
}
.neon-cyan::before {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.82), rgba(56, 189, 248, 0.28), rgba(139, 92, 246, 0.48));
}
.neon-amber-magenta::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.7), rgba(236, 72, 153, 0.55), rgba(139, 92, 246, 0.28));
}
.neon-purple-cyan::before {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.72), rgba(236, 72, 153, 0.35), rgba(6, 182, 212, 0.65));
}
.neon-border-multi::before {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.85), rgba(236, 72, 153, 0.8), rgba(139, 92, 246, 0.8), rgba(6, 182, 212, 0.85));
}
.neon-border-subtle::before {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.28), rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.22));
}

.card-pad {
  padding: 20px 22px;
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  padding: 36px;
}

.login-card h1 {
  margin: 14px 0 8px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #f472b6;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.36);
  padding: 5px 11px;
  border-radius: 999px;
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(11, 14, 26, 0.84);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  overflow-y: auto;
  z-index: 35;
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.92);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.38);
}

.brand-title {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--muted);
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 12px 12px 6px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.18), rgba(139, 92, 246, 0.16));
  border-color: rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.22);
  color: #ffffff;
  font-weight: 600;
}

[data-theme="light"] .nav-item.active {
  color: #0f172a;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

.main-content {
  padding: 24px 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 1520px;
  width: 100%;
}

/* Mobile header & sticky bottom CTA */
.mobile-header,
.mobile-only,
.mobile-sticky-cta,
.sidebar-backdrop {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar p {
  margin: 4px 0 0;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botoes pilula com borda neon no topo */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(15, 20, 36, 0.85);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: all 0.18s ease;
}

.btn-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.btn-dryrun {
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.16);
}
.btn-dryrun .status-dot {
  background: #64748b;
}
.btn-dryrun.active {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(34, 211, 238, 0.8);
  color: #67e8f9;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.28);
}
.btn-dryrun.active .status-dot {
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
}

.btn-pause {
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.16);
}
.btn-pause .status-dot {
  background: #fb923c;
  box-shadow: 0 0 8px #fb923c;
}
.btn-pause.paused {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.85);
  color: #fca5a5;
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.3);
}
.btn-pause.paused .status-dot {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* Faixa fina do worker */
.worker-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  font-size: 0.84rem;
}

/* Dashboard Hero Grid */
.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.dashboard-left-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  transition: width 0.25s ease;
}

.progress-fill.warn { background: linear-gradient(90deg, #f59e0b, #fb923c); }
.progress-fill.danger { background: linear-gradient(90deg, #ef4444, #ec4899); }

.dash-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.neon-chart-box {
  height: 108px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(8, 11, 20, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: 8px;
  overflow: hidden;
}

.neon-chart-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Painel lateral Assistente IA */
.assistant-spotlight {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(175deg, rgba(24, 24, 48, 0.85), rgba(14, 16, 30, 0.9));
}

.assistant-orb-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.assistant-orb {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 32px rgba(236, 72, 153, 0.35), 0 0 48px rgba(6, 182, 212, 0.2);
}

.assistant-orb svg {
  width: 78px;
  height: 78px;
}

.assistant-orb-wrap h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.assistant-bubbles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

.neon-waveform {
  height: 44px;
}
.neon-waveform svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.45));
}

/* Badges neon */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-neon-green,
.badge-ok {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.18);
}

.badge-neon-cyan,
.badge-info {
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #67e8f9;
}

.badge-neon-purple,
.badge-accent {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #c4b5fd;
}

.badge-warn {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

.badge-err {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.badge-muted {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--muted);
}

/* Botoes gerais & Gradiente vibrante */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-neon-gradient,
.btn-primary {
  background: linear-gradient(90deg, #f59e0b 0%, #ec4899 42%, #8b5cf6 74%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(236, 72, 153, 0.32);
}

.btn-neon-gradient:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(236, 72, 153, 0.45);
}

.btn-glass,
.btn-secondary,
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-glass:hover:not(:disabled),
.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.55);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-full {
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-weight: 600;
  cursor: pointer;
}

/* Headers, Campos, Tabelas */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-header h3 {
  margin: 0 0 3px;
  font-size: 1.04rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stack-md { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
}

.field span {
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
textarea,
.select-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass-2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

input:focus,
textarea:focus,
.select-input:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.65);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.16);
}

.select-sm {
  width: auto;
  padding: 7px 11px;
  font-size: 0.82rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.alert-banner {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #fde68a;
  font-size: 0.88rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.48);
  color: #fecaca;
}

.alert-info {
  background: rgba(6, 182, 212, 0.13);
  border-color: rgba(6, 182, 212, 0.42);
  color: #a5f3fc;
}

.form-error {
  margin: 0;
  color: #fca5a5;
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mini-post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mini-post-row:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

/* Workspace IA */
.ai-workspace-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: start;
}

.ai-cost-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-2);
  border: 1px solid var(--border);
}

.ideas-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

.structure-cards { display: flex; flex-direction: column; gap: 8px; }
.structure-step {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.ai-image-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-image-preview {
  display: flex;
  justify-content: center;
  background: #06080f;
  padding: 10px;
  border-radius: 10px;
}

.ai-image-preview img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
}

/* Composer, Calendario, Contas, Biblioteca */
.composer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: start;
}

.selected-media-list { display: flex; flex-direction: column; gap: 8px; }
.selected-media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--glass-2);
  border: 1px solid var(--border);
}
.selected-media-item img,
.selected-media-item video {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
}
.selected-media-info { flex: 1; min-width: 0; }
.selected-media-info strong {
  display: block;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-upload-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--glass-2);
  border: 1px dashed var(--border-strong);
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow-y: auto;
}

.picker-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--glass-2);
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: var(--text);
}
.picker-item.selected {
  border-color: #ec4899;
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.35);
}
.picker-item img,
.picker-item video {
  width: 100%;
  height: 86px;
  object-fit: cover;
  display: block;
  background: #05070b;
}
.picker-label {
  padding: 6px;
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.active {
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  color: #fff;
}

.cal-grid-month,
.cal-grid-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 4px;
}

.cal-cell {
  min-height: 112px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-grid-week .cal-cell { min-height: 220px; }
.cal-cell.outside { opacity: 0.42; }
.cal-cell.today { border-color: #06b6d4; box-shadow: 0 0 14px rgba(6, 182, 212, 0.2); }
.cal-day-num { font-size: 0.8rem; font-weight: 700; color: var(--muted); }

.cal-chip {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-left-width: 3px;
  background: rgba(11, 14, 24, 0.82);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 0.74rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-chip.st-scheduled { border-left-color: #8b5cf6; }
.cal-chip.st-approval { border-left-color: #f59e0b; }
.cal-chip.st-draft { border-left-color: #64748b; }
.cal-chip.st-processing { border-left-color: #06b6d4; }
.cal-chip.st-published { border-left-color: #10b981; }
.cal-chip.st-failed,
.cal-chip.st-intervention { border-left-color: #ef4444; }

.post-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.84rem;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
  gap: 16px;
}

.account-card {
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.account-meta { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.upload-bar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-radius: 12px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.media-card {
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.media-thumb {
  height: 180px;
  background: #05070d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.media-thumb img,
.media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.media-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* Modais e Toasts */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 45;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  max-height: 92vh;
  overflow-y: auto;
}
.modal-wide { max-width: 780px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h3 { margin: 0; }
.icon-close { background: none; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.wrap-actions { flex-wrap: wrap; }
.spacer { flex: 1; }

.preview-stage { display: flex; justify-content: center; align-items: center; max-height: 70vh; }
.preview-stage img,
.preview-stage video { max-width: 100%; max-height: 66vh; border-radius: 10px; }

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}

.toast {
  background: var(--glass-3);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-left: 4px solid #8b5cf6;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.87rem;
  max-width: 380px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }

/* Responsividade (Mobile fiel ao mockup) */
@media (max-width: 1120px) {
  .dashboard-hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 270px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 50;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 40;
  }

  .mobile-only {
    display: inline-block;
    margin-left: auto;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 8px;
  }

  .mobile-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .mobile-icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .mobile-brand-orb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.94rem;
  }

  .orb-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ec4899, #06b6d4);
    box-shadow: 0 0 14px rgba(236, 72, 153, 0.45);
  }

  .main-content {
    padding: 16px 16px 92px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 12px 13px;
  }

  .stat-value {
    font-size: 1.38rem;
  }

  .ai-workspace-grid,
  .composer-grid,
  .upload-bar,
  .two-col,
  .dash-two-col {
    grid-template-columns: 1fr;
  }

  .cal-grid-month,
  .cal-grid-week {
    grid-template-columns: 1fr;
  }

  .mobile-sticky-cta {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 30;
  }
}
