/* ==========================================================================
   VIVA SOBRE RODAS v2.0 - PAINEL ADMINISTRATIVO (CMS)
   Interface Moderna de Gerenciamento de Conteúdo, Ícones e Links
   ========================================================================== */

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

:root {
  --admin-primary: #0084a8;
  --admin-primary-dark: #00607b;
  --admin-primary-light: #e0f2fe;
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-hover: #1e293b;
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-radius: 12px;
}

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

/* ==========================================================================
   ADMIN LOGIN OVERLAY
   ========================================================================== */
.admin-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #072233 0%, #0d3851 50%, #0084a8 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.admin-login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.login-header {
  margin-bottom: 28px;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px auto;
  filter: drop-shadow(0 4px 10px rgba(0, 132, 168, 0.3));
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: #64748b;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.login-error-msg {
  display: none;
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--admin-primary);
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 132, 168, 0.35);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.login-btn:hover {
  background: var(--admin-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 132, 168, 0.45);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--admin-text-main);
  background-color: var(--admin-bg);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.admin-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: 280px;
  background: var(--admin-sidebar-bg);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.sidebar-nav {
  padding: 18px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.nav-tab-btn:hover {
  background: var(--admin-sidebar-hover);
  color: #ffffff;
}

.nav-tab-btn.active {
  background: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 132, 168, 0.35);
}

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

.sidebar-footer {
  padding: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-open-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-open-live:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* MAIN CONTENT AREA */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOPBAR */
.admin-topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-admin-primary {
  background: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 132, 168, 0.25);
}

.btn-admin-primary:hover {
  background: var(--admin-primary-dark);
}

.btn-admin-outline {
  background: #ffffff;
  color: var(--admin-text-main);
  border-color: var(--admin-border);
}

.btn-admin-outline:hover {
  background: #f1f5f9;
}

.btn-admin-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.btn-admin-danger:hover {
  background: #fecaca;
}

/* WORKSPACE SPLIT (Editor Form + Live Preview) */
.admin-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.editor-pane {
  padding: 28px;
  overflow-y: auto;
  background: var(--admin-bg);
}

.preview-pane {
  background: #e2e8f0;
  border-left: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-toolbar {
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.82rem;
  color: var(--admin-text-muted);
}

.preview-device-buttons {
  display: flex;
  gap: 6px;
}

.device-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.device-btn.active {
  background: var(--admin-primary);
  color: #ffffff;
  border-color: var(--admin-primary);
}

.preview-iframe-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: width 0.3s ease;
}

.preview-iframe.device-tablet {
  width: 768px;
}

.preview-iframe.device-mobile {
  width: 375px;
}

/* ==========================================================================
   FORM CARDS & CONTROLS
   ========================================================================== */
.admin-tab-content {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.admin-tab-content.active {
  display: flex;
}

.admin-card {
  background: var(--admin-card-bg);
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.admin-card-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card-desc {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-top: 4px;
}

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

.form-grid.single-col {
  grid-template-columns: 1fr;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--admin-text-main);
  background: #ffffff;
  transition: all 0.2s ease;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.admin-field textarea {
  min-height: 80px;
  resize: vertical;
}

.image-preview-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.img-thumbnail {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  object-fit: contain;
  background: #f8fafc;
  padding: 4px;
}

/* Toast Notifications */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10000;
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-toast.toast-success {
  background: #065f46;
  border-left: 4px solid #10b981;
}
