:root {
  --bg: #0b0f19;
  --surface: #141b2d;
  --surface-raised: #1e293b;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #27354f;
  --accent: #0f766e;
  --accent-light: #14b8a6;
  --secondary: #e11d48;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --radius: 14px;
  --font: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Remoção total de sublinhados em links */
a, a:link, a:visited, a:hover, a:active, a:focus,
.nav a, .nav .nav-btn, .post-card a, .post-title-link,
.article-body a, .footer-network a, .network-links a,
.footer-meta a, .sidebar a, .sidebar-site-card,
button a, .btn-sm, .badge, .post-mobile-card a {
  color: inherit;
  text-decoration: none !important;
}

a:hover {
  text-decoration: none !important;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #070a12;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-block {
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.brand-badge {
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 20px;
  color: var(--accent-light);
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  padding: 3px 10px;
}

.brand {
  color: #fff;
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-domain {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.35rem;
}

.side-nav a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  font-weight: 650;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  transition: all 0.15s ease;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--surface);
  border-color: var(--line);
  color: #fff;
}

.side-nav a.active {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.35);
  color: var(--accent-light);
}

.nav-icon {
  font-size: 1.15rem;
}

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

.user-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.user-dot {
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  display: inline-block;
  height: 8px;
  width: 8px;
}

.user-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-link {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  padding: 0 0.5rem;
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mobile-header {
  align-items: center;
  background: #070a12;
  border-bottom: 1px solid var(--line);
  display: none;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand-mobile {
  font-size: 1.05rem;
  font-weight: 800;
}

.mobile-quick-btn {
  background: var(--accent);
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
}

.mobile-bottom-bar {
  align-items: center;
  background: #070a12;
  border-top: 1px solid var(--line);
  bottom: 0;
  display: none;
  height: 62px;
  justify-content: space-around;
  left: 0;
  position: fixed;
  right: 0;
  z-index: 50;
}

.mobile-bottom-bar a {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 600;
  gap: 2px;
  padding: 6px 10px;
}

.mobile-bottom-bar a.active {
  color: var(--accent-light);
}

.bar-icon {
  font-size: 1.2rem;
}

.main {
  flex: 1;
  padding: clamp(1rem, 3vw, 2.5rem);
}

/* Headings & Topline */
.topline {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.topline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h2 {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 0.25rem;
}

/* Cards & Panels */
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.grid-2 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Forms & Inputs */
label {
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

input, select, textarea {
  background: #0b0f19;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-light);
  outline: none;
}

/* Password Toggle Wrapper & Eye Button */
.password-field-wrapper {
  align-items: center;
  display: flex;
  position: relative;
  width: 100%;
}

.password-field-wrapper input {
  padding-right: 46px;
  width: 100%;
}

.btn-toggle-password {
  align-items: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 1.2rem;
  height: 100%;
  justify-content: center;
  min-height: auto !important;
  padding: 0 10px;
  position: absolute;
  right: 2px;
  user-select: none;
}

.btn-toggle-password:hover {
  color: #fff;
}

.title-input {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
}

.char-count {
  align-self: flex-end;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 0.2rem;
}

/* Buttons */
button, .button, .btn-primary {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  gap: 0.4rem;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.2rem;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

button:hover, .button:hover, .btn-primary:hover {
  background: #0d655f;
  border-color: #0d655f;
}

button.secondary, .button.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  color: var(--ink);
}

button.secondary:hover, .button.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--muted);
}

.btn-sm {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
}

.btn-sm:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Google Auth Buttons */
.google-auth-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.btn-google {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #dadce0 !important;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  color: #3c4043 !important;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 0.75rem;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.2rem;
  width: 100%;
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f8f9fa !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.btn-fast-admin {
  align-items: center;
  background: rgba(20, 184, 166, 0.15) !important;
  border: 1px solid rgba(20, 184, 166, 0.35) !important;
  border-radius: 8px;
  color: var(--accent-light) !important;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 750;
  justify-content: center;
  min-height: 38px;
  width: 100%;
}

.btn-fast-admin:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* Notices */
.notice {
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.1rem;
}

.notice.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.notice.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* Badges com Bandeiras Estilizadas */
.badge {
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  line-height: 1.2;
}

.badge-pt {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.badge-en {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.badge-link {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.badge-link:hover {
  background: rgba(168, 85, 247, 0.3);
}

.badge-published {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.badge-draft {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Tables */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.post-title-link {
  color: #fff;
  font-weight: 600;
}

.post-title-link:hover {
  color: var(--accent-light);
}

/* Mobile Post Cards */
.posts-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

.post-mobile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
}

.pmc-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.pmc-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.pmc-date {
  color: var(--muted);
  font-size: 11px;
}

.pmc-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.pmc-footer {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  padding-top: 0.6rem;
}

.pmc-cat {
  color: var(--muted);
  font-size: 12px;
}

/* Editor & Floating Toolbar */
.editor-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.floating-toolbar {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 25, 0.95);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
  padding: 0.4rem;
  position: sticky;
  top: 10px;
  z-index: 30;
}

.floating-toolbar button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  min-height: 32px;
  padding: 0.3rem 0.6rem;
}

.floating-toolbar button:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: var(--accent-light);
  color: var(--accent-light);
}

.post-content-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 480px;
  resize: vertical;
}

/* File Drop Area */
.file-drop-area {
  align-items: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  text-align: center;
  transition: border-color 0.15s ease;
}

.file-drop-area:hover {
  border-color: var(--accent-light);
}

.drop-icon {
  font-size: 2.5rem;
}

.file-drop-area input[type="file"] {
  display: none;
}

/* Media Library */
.media-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.media-row-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 1rem;
  padding: 0.85rem 1rem;
}

.media-thumb-box {
  align-items: center;
  background: #070a12;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-shrink: 0;
  height: 76px;
  justify-content: center;
  overflow: hidden;
  width: 76px;
}

.media-thumb-img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.media-row-details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.media-row-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
}

.media-full-name {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

.media-size-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  white-space: nowrap;
}

.media-row-meta {
  color: var(--muted);
  font-size: 11px;
}

.media-row-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-copy {
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 6px;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
  min-height: 28px;
  padding: 0.3rem 0.75rem;
}

.btn-copy.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
  color: var(--ink);
}

.btn-copy:hover {
  background: var(--accent);
  color: #fff;
}

/* Auth / Login */
.auth-body {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-card {
  max-width: 440px;
  width: 100%;
}

.auth-header {
  margin-bottom: 1.8rem;
  text-align: center;
}

.brand-mascot-auth {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 0.25rem;
}

.auth-divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  font-weight: 750;
  gap: 1rem;
  margin: 1.4rem 0;
  text-transform: uppercase;
}

.auth-divider::before, .auth-divider::after {
  background: var(--line);
  content: "";
  flex: 1;
  height: 1px;
}

.btn-passkey {
  align-items: center;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(37, 99, 235, 0.2));
  border: 1px solid rgba(20, 184, 166, 0.4);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 0.5rem;
  justify-content: center;
  min-height: 46px;
  width: 100%;
}

.auth-links {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-links a {
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline !important;
}

/* Sites Network Card */
.sites-network-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.site-network-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  .main {
    padding-bottom: 85px;
  }

  .posts-desktop-table {
    display: none;
  }

  .posts-mobile-cards {
    display: flex;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .floating-toolbar {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
  }

  .mobile-sticky-save-bar {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(7, 10, 18, 0.94);
    border-top: 1px solid var(--line);
    bottom: 62px;
    display: flex;
    left: 0;
    padding: 0.6rem 1rem;
    position: fixed;
    right: 0;
    z-index: 45;
  }

  .editor-layout {
    padding-bottom: 65px;
  }
}

.mobile-sticky-save-bar {
  display: none;
}

.file-upload-preview {
  background: rgba(15, 118, 110, 0.08);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
}

.file-upload-preview-title {
  color: var(--accent-light);
  display: block;
  font-size: 13.5px;
  font-weight: 750;
  margin-bottom: 0.4rem;
}

.file-upload-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-upload-item {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  font-size: 12.5px;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
}

/* Analytics & Dashboard Styles */
.analytics-hero-card {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.15) 0%, rgba(37, 99, 235, 0.12) 100%);
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.ga-hub-badge {
  align-items: center;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  color: #fbbf24;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
}

.ga-hub-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.analytics-bar-bg {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  height: 8px;
  margin-top: 4px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.analytics-bar-fill {
  background: linear-gradient(90deg, var(--accent) 0%, #38bdf8 100%);
  border-radius: 6px;
  height: 100%;
  transition: width 0.6s ease;
}

.site-network-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s ease;
}

.site-network-card:hover {
  border-color: var(--accent);
}

.btn-admin-access {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 750;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-admin-access:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-site-link {
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.btn-site-link:hover {
  color: var(--text);
}
