/* ============================================================
   Template RowS - Estilo Principal
   Paleta: Azul escuro, Azul vibrante, Laranja, Ciano
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Paleta principal */
  --bg-primary:    #111827;
  --bg-secondary:  #1a2540;
  --bg-card:       #1e2d4a;
  --bg-card-hover: #243558;
  --bg-sidebar:    #152035;
  --border:        #2a3d5e;
  --border-hover:  #3a5080;

  /* Cores de destaque */
  --accent:        #4a7fd4;
  --accent-light:  #6b9fe8;
  --accent-glow:   rgba(74, 127, 212, 0.3);
  --orange:        #f5a623;
  --orange-glow:   rgba(245, 166, 35, 0.25);
  --cyan:          #00c8e0;
  --cyan-glow:     rgba(0, 200, 224, 0.2);
  --red:           #e63946;

  /* Texto */
  --text-primary:  #f0f4ff;
  --text-secondary:#a8bcd8;
  --text-muted:    #5a7299;

  /* Status */
  --success:       #10b981;
  --danger:        #e63946;
  --warning:       #f5a623;

  /* UI */
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 8px 32px rgba(0,0,0,0.5);
  --shadow-card:   0 2px 16px rgba(0,0,0,0.3);
  --transition:    all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
  width: 265px;
  min-width: 265px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

/* Logo */
.sidebar-logo {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-svg-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon-svg {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.logo-text-wrap h1 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.logo-text-wrap h1 span {
  color: var(--orange);
}

.logo-text-wrap p {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* Search */
.sidebar-search {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-wrap { position: relative; }

.search-wrap svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 15px; height: 15px;
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.sidebar-search input:focus {
  border-color: var(--accent);
  background: rgba(74,127,212,0.06);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 18px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(74,127,212,0.07);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(74,127,212,0.12);
  color: var(--accent-light);
  border-left-color: var(--accent);
}

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

.nav-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.nav-item.active .nav-badge {
  background: rgba(74,127,212,0.2);
  color: var(--accent-light);
  border-color: var(--accent);
}

/* User card */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: var(--text-muted); }

.btn-logout {
  background: none; border: none;
  color: var(--text-muted);
  padding: 5px; border-radius: 6px;
  display: flex; transition: var(--transition);
}
.btn-logout:hover { color: var(--danger); background: rgba(230,57,70,0.1); }
.btn-logout svg { width: 16px; height: 16px; }

/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */

.main-content {
  flex: 1;
  margin-left: 265px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0; z-index: 50;
}

.topbar-left h2 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.topbar-left p { font-size: 11px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.stats-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.stats-pill strong { color: var(--orange); font-weight: 700; }

.page-content { flex: 1; padding: 28px 32px; }

/* ============================================================
   FILTROS
   ============================================================ */

.filter-bar {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 26px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500;
  padding: 7px 16px;
  border-radius: 20px;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-btn:hover { border-color: var(--accent); color: var(--text-primary); }

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 14px var(--accent-glow);
}

/* ============================================================
   GRID DE CARDS
   ============================================================ */

.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 18px;
}

.block-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.block-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Preview */
.card-preview {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d1428 0%, #1a2040 100%);
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.block-card:hover .card-preview img {
  transform: scale(1.04);
}

.preview-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1428 0%, #1a2040 100%);
  position: relative;
}

.preview-fallback::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(74,127,212,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,127,212,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* Badge de tipo no canto do preview */
.card-type-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(10,20,40,0.85);
  border: 1px solid rgba(74,127,212,0.4);
  color: var(--accent-light);
  font-size: 9px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.6px;
  backdrop-filter: blur(4px);
  z-index: 3;
}

/* Barra de busca */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 10px 14px 10px 40px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.templates-count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

.templates-count span {
  color: var(--accent-light);
  font-weight: 700;
}

.preview-css    { background: linear-gradient(135deg, #0d1a2e 0%, #1a2d4a 100%); }
.preview-html   { background: linear-gradient(135deg, #0d1a18 0%, #1a3028 100%); }
.preview-js     { background: linear-gradient(135deg, #1a1a0d 0%, #2e2a10 100%); }
.preview-block  { background: linear-gradient(135deg, #0d1428 0%, #1a2040 100%); }
.preview-script { background: linear-gradient(135deg, #1a0d28 0%, #2a1040 100%); }

.preview-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(74,127,212,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,127,212,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.preview-content {
  text-align: center; padding: 16px;
  z-index: 2; position: relative;
}

.preview-icon { font-size: 32px; margin-bottom: 8px; display: block; }

.preview-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(74,127,212,0.15);
  border: 1px solid rgba(74,127,212,0.35);
  color: var(--accent-light);
  font-size: 9.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* Overlay */
.card-overlay {
  position: absolute; inset: 0;
  background: rgba(10,20,40,0.8);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}
.block-card:hover .card-overlay { opacity: 1; }

.btn-preview {
  background: white; color: #111;
  border: none; font-size: 12px; font-weight: 700;
  padding: 9px 20px; border-radius: 8px;
  transition: var(--transition);
}
.btn-preview:hover { background: var(--accent); color: white; }

/* Card body */
.card-body {
  padding: 15px;
  flex: 1; display: flex; flex-direction: column;
}

.card-category {
  font-size: 9.5px; font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

.card-title {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4; margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 11.5px; color: var(--text-muted);
  line-height: 1.5; flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 13px;
}

.card-actions { display: flex; gap: 7px; }

.btn-copy {
  flex: 1;
  background: linear-gradient(135deg, var(--accent), #3a6fc4);
  color: white; border: none;
  font-size: 12px; font-weight: 600;
  padding: 9px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: var(--transition);
}
.btn-copy:hover { background: linear-gradient(135deg, var(--accent-light), var(--accent)); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-copy.copied { background: linear-gradient(135deg, var(--success), #0d9668); }

.btn-detail {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 500;
  padding: 9px 12px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: var(--transition);
}
.btn-detail:hover { border-color: var(--orange); color: var(--orange); }
.btn-copy svg, .btn-detail svg { width: 13px; height: 13px; }

/* ============================================================
   MODAL DE CÓDIGO
   ============================================================ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5,12,25,0.9);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 880px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-subtitle { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

.modal-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); color: white; }
.modal-close svg { width: 16px; height: 16px; }

.modal-tabs {
  display: flex; gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.modal-tab {
  background: none; border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11px; font-weight: 700;
  padding: 6px 14px; border-radius: 6px;
  transition: var(--transition);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.modal-tab:hover { color: var(--text-primary); border-color: var(--border); }
.modal-tab.active { background: var(--accent); color: white; border-color: var(--accent); }

.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

.code-block-wrap { position: relative; }

.code-block {
  background: #07111e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12.5px; line-height: 1.75;
  color: #c8d8f0;
  max-height: 420px; overflow-y: auto;
}

.code-block::-webkit-scrollbar { width: 5px; height: 5px; }
.code-block::-webkit-scrollbar-track { background: transparent; }
.code-block::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.btn-copy-modal {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: white;
  border: none; font-size: 11px; font-weight: 600;
  padding: 6px 12px; border-radius: 6px;
  display: flex; align-items: center; gap: 5px;
  transition: var(--transition);
}
.btn-copy-modal:hover { background: var(--accent-light); }
.btn-copy-modal.copied { background: var(--success); }
.btn-copy-modal svg { width: 12px; height: 12px; }

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: 0 0 16px 16px;
}
.modal-info { font-size: 11.5px; color: var(--text-muted); }
.modal-info strong { color: var(--text-secondary); }

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */

.login-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
}

.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(74,127,212,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(0,200,224,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(245,166,35,0.08) 0%, transparent 50%);
}

.login-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(74,127,212,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74,127,212,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.login-logo { text-align: center; margin-bottom: 34px; }

.login-logo-svg {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
}

.login-logo h1 {
  font-size: 21px; font-weight: 800;
  color: var(--text-primary); margin-bottom: 4px;
}
.login-logo h1 span { color: var(--orange); }
.login-logo p { font-size: 12.5px; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.6px;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px; font-family: inherit;
  outline: none; transition: var(--transition);
}
.form-input:focus {
  border-color: var(--accent);
  background: rgba(74,127,212,0.06);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #3060b0 100%);
  color: white; border: none;
  font-size: 14px; font-weight: 700;
  padding: 13px; border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-top: 6px; letter-spacing: 0.3px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

/* Alerts */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-error   { background: rgba(230,57,70,0.1);  border: 1px solid rgba(230,57,70,0.3);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-info    { background: rgba(74,127,212,0.1); border: 1px solid rgba(74,127,212,0.3); color: #93c5fd; }

/* ============================================================
   SETUP WIZARD
   ============================================================ */

.setup-page {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 580px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.setup-header {
  background: linear-gradient(135deg, #1a3a6e 0%, #0f2040 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.setup-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(74,127,212,0.3) 0%, transparent 70%);
}

.setup-header h1 { font-size: 22px; font-weight: 800; color: white; margin-bottom: 5px; position: relative; }
.setup-header h1 span { color: var(--orange); }
.setup-header p { font-size: 12.5px; color: rgba(255,255,255,0.6); position: relative; }

.setup-steps {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 20px; position: relative;
}

.setup-step {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.5);
  transition: var(--transition);
}
.setup-step.active { background: var(--orange); border-color: var(--orange); color: white; box-shadow: 0 0 16px var(--orange-glow); }
.setup-step.done   { background: rgba(16,185,129,0.3); border-color: var(--success); color: var(--success); }

.setup-body { padding: 32px 36px; }
.setup-body h2 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.setup-body .step-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }

.setup-footer {
  padding: 18px 36px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-secondary);
  border-radius: 0 0 20px 20px;
}

/* ============================================================
   PAINEL ADMIN
   ============================================================ */

.admin-section { margin-bottom: 32px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}

.section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.section-subtitle { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.btn-add {
  background: var(--accent); color: white; border: none;
  font-size: 12.5px; font-weight: 600;
  padding: 9px 18px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.btn-add:hover { background: var(--accent-light); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-add svg { width: 14px; height: 14px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px; margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue   { background: rgba(74,127,212,0.15); color: var(--accent-light); }
.stat-icon.orange { background: rgba(245,166,35,0.12); color: var(--orange); }
.stat-icon.green  { background: rgba(16,185,129,0.1);  color: var(--success); }
.stat-icon.cyan   { background: rgba(0,200,224,0.1);   color: var(--cyan); }

.stat-info .stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-info .stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* Table */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th {
  background: var(--bg-secondary);
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 13px 16px;
  font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(74,127,212,0.04); }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-admin    { background: rgba(74,127,212,0.15); color: var(--accent-light); border: 1px solid rgba(74,127,212,0.3); }
.badge-user     { background: rgba(0,200,224,0.1);   color: var(--cyan);         border: 1px solid rgba(0,200,224,0.2); }
.badge-active   { background: rgba(16,185,129,0.1);  color: var(--success);      border: 1px solid rgba(16,185,129,0.2); }
.badge-inactive { background: rgba(230,57,70,0.1);   color: var(--danger);       border: 1px solid rgba(230,57,70,0.2); }

.table-actions { display: flex; gap: 6px; }

.btn-icon {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(230,57,70,0.1); }
.btn-icon svg { width: 14px; height: 14px; }

/* ============================================================
   MOBILE TOGGLE
   ============================================================ */

.mobile-toggle {
  display: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 38px; height: 38px;
  border-radius: 8px;
  align-items: center; justify-content: center;
}
.mobile-toggle svg { width: 20px; height: 20px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: 0.25; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,0.6); }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: flex; }
  .page-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .blocks-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
}

@media (max-width: 480px) {
  .blocks-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 6px; }
  .filter-btn { font-size: 12px; padding: 6px 12px; }
  .login-card { padding: 32px 22px; }
  .setup-body { padding: 22px; }
  .setup-footer { padding: 16px 22px; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================================
   UTILITIES
   ============================================================ */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 22px 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* Sidebar overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }
