:root {
  --bg: #edf4fb;
  --bg2: #ffffff;
  --bg3: #f4f8ff;
  --border: rgba(41, 78, 128, 0.1);
  --border2: rgba(41, 78, 128, 0.16);
  --text: #111827;
  --text2: #1a2744;
  --text3: #64748b;
  --accent: #2f6dff;
  --accent2: #1d4ed8;
  --grad: linear-gradient(135deg, #2f9bf4 0%, #1e66c7 100%);
  --grad-nav: linear-gradient(135deg, #4f7cff, #1e4dff);
  --red: #dc2626;
  --red-bg: #fef2f2;
  --green: #16a34a;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #cdddf0; border-radius: 99px; }

/* ======================================================
   LOGIN
   ====================================================== */
.login-body { height: 100vh; overflow: hidden; }

.login-page { display: flex; height: 100vh; }

.login-left {
  position: relative;
  flex: 0 0 60%;
  overflow: hidden;
  background: #04102a;
}
.login-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}
.login-slide.is-active { opacity: 1; }
.login-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(4, 16, 50, 0.4) 0%, rgba(4, 16, 50, 0.35) 40%, rgba(4, 16, 50, 0.82) 100%);
}
.login-slide-content {
  position: absolute;
  bottom: 92px;
  left: 48px;
  right: 48px;
  z-index: 2;
}
.login-slide-content h2 {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.login-slide-content p {
  max-width: 520px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.login-left-logo {
  position: absolute;
  top: 34px;
  left: 40px;
  z-index: 3;
}
.login-left-logo img {
  width: 230px;
  max-width: 50vw;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}
.login-dots {
  position: absolute;
  bottom: 40px;
  left: 48px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.login-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s;
}
.login-dot.is-active { width: 26px; background: #fff; }

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  padding: 40px;
  overflow-y: auto;
}
.login-form { width: 100%; max-width: 370px; animation: slideInRight 0.5s ease-out; }
.login-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.login-brand img { width: 240px; max-width: 100%; object-fit: contain; }
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text2);
  letter-spacing: -0.01em;
}
.login-subtitle { text-align: center; font-size: 13px; color: var(--text3); margin-top: 4px; margin-bottom: 24px; }

.login-erro {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red-bg);
  border: 1px solid #fecaca;
  color: var(--red);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  animation: fadeInUp 0.3s ease-out;
}
.login-erro svg { width: 16px; height: 16px; flex-shrink: 0; }

.login-field { margin-bottom: 16px; }
.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
}
.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #1a2744;
  opacity: 0.55;
  pointer-events: none;
}
.login-input-wrap input {
  width: 100%;
  height: 46px;
  border: 1px solid #cbdcf4;
  background: #eef5ff;
  border-radius: 12px;
  padding: 0 14px 0 46px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  outline: none;
  transition: all 0.2s;
}
.login-input-wrap input::placeholder { color: #94a3b8; font-weight: 500; }
.login-input-wrap input:focus {
  border-color: #60a5fa;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.login-eye {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #1a2744;
  opacity: 0.6;
  cursor: pointer;
  border-radius: 8px;
}
.login-eye:hover { background: rgba(15, 23, 42, 0.06); }
.login-eye svg { width: 18px; height: 18px; }

.login-btn {
  width: 100%;
  height: 47px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s, opacity 0.2s;
}
.login-btn:hover { filter: brightness(1.05); }
.login-btn:disabled { opacity: 0.7; cursor: default; }
.login-voltar {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
  text-decoration: none;
}
.login-voltar:hover { text-decoration: underline; }
.login-footer { margin-top: 26px; text-align: center; font-size: 11px; font-weight: 500; color: var(--text3); }

/* ======================================================
   PAINEL
   ====================================================== */
.painel-body { background: var(--bg); }

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

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  background: var(--bg);
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px 16px;
}
.sidebar-brand img { width: 180px; max-width: 100%; object-fit: contain; }
.sidebar-tagline {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
}
.sidebar-nav { flex: 1; }
.sidebar-section {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7d8797;
  padding: 10px 10px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 5px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: #dceaff; color: var(--accent2); }
.nav-item.is-active {
  background: var(--grad-nav);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 109, 255, 0.26);
}
.nav-item.is-active svg { opacity: 1; }
.sidebar-footer {
  padding: 12px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
}
.sidebar-overlay.is-open { display: block; }

/* Main */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 16px 24px 28px;
  min-width: 0;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(145deg, #ffffff, #f7faff);
  box-shadow: 0 8px 28px rgba(45, 78, 128, 0.08);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-menu {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 0; border-radius: 12px;
  background: #eef4fc;
  color: var(--text2);
  cursor: pointer;
}
.topbar-menu svg { width: 20px; height: 20px; }
.topbar-title { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { display: flex; align-items: center; gap: 9px; }
.topbar-avatar {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 99px;
  background: var(--grad-nav);
  color: #fff;
  font-size: 12px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(47, 109, 255, 0.26);
}
.topbar-username { font-size: 13px; font-weight: 700; color: var(--text2); }
.topbar-logout {
  display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border-radius: 13px;
  border: 1px solid transparent;
  color: var(--text3);
  font-size: 12.5px; font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.topbar-logout svg { width: 15px; height: 15px; }
.topbar-logout:hover { background: var(--red-bg); color: var(--red); border-color: #fecaca; }

/* Content */
.content { padding-top: 22px; }
.aba { display: none; animation: fadeInUp 0.35s ease-out; }
.aba.is-active { display: block; }
.aba-desc { font-size: 13.5px; color: var(--text3); margin-bottom: 20px; }
.aba-desc strong { color: var(--text2); }

.surface {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 6px 22px rgba(45, 78, 128, 0.05);
}

/* Valores */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.card-produto { padding: 20px 22px; }
.card-produto-titulo { font-size: 16px; font-weight: 800; color: var(--text2); margin-bottom: 14px; }
.linha-origem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.origem-label { font-size: 13px; font-weight: 600; color: var(--text3); }
.campo-valor {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eef5ff;
  border: 1px solid #cbdcf4;
  border-radius: 11px;
  padding: 6px 12px;
}
.campo-prefixo, .campo-sufixo { font-size: 12.5px; font-weight: 700; color: var(--text3); }
.campo-valor input {
  width: 90px;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  text-align: right;
  outline: none;
}

.acao-publicar { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.btn-primario {
  border: 0;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 800;
  padding: 12px 24px;
  cursor: pointer;
  transition: filter 0.2s, opacity 0.2s;
}
.btn-primario:hover { filter: brightness(1.05); }
.btn-primario:disabled { opacity: 0.65; cursor: default; }

/* Imagens */
.bloco-secao { padding: 20px 22px; margin-bottom: 18px; }
.bloco-secao-header { margin-bottom: 16px; }
.bloco-secao-header h3 { font-size: 15.5px; font-weight: 800; color: var(--text2); }
.bloco-secao-header p { font-size: 12.5px; color: var(--text3); margin-top: 3px; }
.grade-imagens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.card-imagem {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  transition: opacity 0.2s;
}
.card-imagem.is-loading { opacity: 0.55; }
.card-imagem-thumb {
  border-radius: 11px;
  overflow: hidden;
  background: #dde9f7;
}
.card-imagem-thumb img { width: 100%; height: 120px; object-fit: cover; display: block; }
.img-nome { font-size: 11.5px; font-weight: 600; color: var(--text3); word-break: break-all; }
.btn-trocar {
  text-align: center;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.2s;
}
.btn-trocar:hover { filter: brightness(1.05); }

/* Mensagens */
.msg { font-size: 13px; font-weight: 600; }
.msg.ok { color: var(--green); }
.msg.erro { color: var(--red); }
.msg.info { color: var(--accent); }
.msg-fixa { display: block; margin-top: 14px; min-height: 20px; }

/* ======================================================
   ANIMAÇÕES
   ====================================================== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }

/* ======================================================
   RESPONSIVO
   ====================================================== */
@media (max-width: 960px) {
  .login-left { display: none; }
  .login-right { flex: 1 1 100%; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); background: var(--bg); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; padding: 12px 14px 22px; }
  .topbar-menu { display: flex; }
  .topbar-username { display: none; }
}
