/* =============================================
   ESTOQUE HUB — style.css
   Paleta azul/cinza — rebranding 2025
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* ---- RESET & BASE ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #e8edf5;
  --surface:   #ffffff;
  --surface2:  #f1f5fb;
  --surface3:  #dde3ed;
  --border:    #dde3ed;
  --border2:   #c5d0e0;
  --accent:    #4a90d9;
  --accent2:   #6aaff0;
  --accent3:   #2563a8;
  --dark:      #1a2540;
  --dark2:     #222840;
  --text:      #0f172a;
  --text2:     #334155;
  --text3:     #64748b;
  --green:     #3db87a;
  --red:       #e05a5a;
  --tag-bg:    #dbeafe;
  --tag:       #2563a8;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, select { font-family: var(--font-body); }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}
.logo .logo-main { color: #e8edf5; }
.logo .logo-accent { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: rgba(255,255,255,0.55); font-size: 13px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: var(--accent2); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent2); }

/* ---- HERO ---- */
.hero {
  padding: 3rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.hero h1 span { color: var(--accent); }

.hero p {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 2rem;
  max-width: 520px;
  line-height: 1.6;
}

/* ---- SEARCH ---- */
.search-wrap {
  display: flex;
  gap: 10px;
  max-width: 680px;
  margin-bottom: 1rem;
}

.search-wrap input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text3); }

.btn-search {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-search:hover { background: var(--accent2); }

/* ---- FILTERS ---- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 2.5rem; }

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-chip:hover,
.filter-chip.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.filter-chip.active { font-weight: 600; }

/* ---- MAIN SECTION ---- */
.section { max-width: 1200px; margin: 0 auto; padding: 0 2rem 3rem; }

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.count-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
}

/* ---- STATS ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.stat-label { font-size: 11px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-val { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 11px; color: var(--green); margin-top: 2px; }

/* ---- PRODUCT GRID ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* ---- PRODUCT CARD ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
  transform: translateY(-3px);
}

.card-img-placeholder {
  width: 100%;
  height: 180px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.25s;
}
.card:hover .card-img-placeholder { background: #dbeafe; }

.card-img-placeholder img { width: 100%; height: 100%; object-fit: cover; }
.img-icon { font-size: 48px; opacity: 0.2; }

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(26, 37, 64, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8fa3c8;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-badge.novo { border-color: var(--green); color: var(--green); }

.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-cat { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); }
.card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  transition: color 0.25s;
}
.card:hover .card-title { color: var(--accent); }
.card-desc { font-size: 12px; color: var(--text2); line-height: 1.5; flex: 1; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  transition: background 0.25s;
}
.card:hover .card-footer { background: rgba(74,144,217,0.04); }

.card-price { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--accent); }
.card-price span { font-size: 10px; font-weight: 400; color: var(--text3); display: block; font-family: var(--font-body); }
.card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.card-qty { font-size: 11px; color: var(--text2); }
.card-loc { font-size: 11px; color: var(--text2); }

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--surface3); }
.modal-img { width: 100%; height: 200px; background: var(--surface2); display: flex; align-items: center; justify-content: center; margin-top: 16px; }
.modal-body { padding: 20px 24px 24px; }
.modal-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); margin-bottom: 6px; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 10px; color: var(--text); }
.modal-price { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }

.modal-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.modal-info-item { background: var(--surface2); border-radius: var(--radius-md); padding: 10px 14px; }
.modal-info-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); margin-bottom: 3px; }
.modal-info-val { font-size: 14px; font-weight: 500; color: var(--text); }
.modal-desc { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 20px; }

.btn-wpp {
  background: #25D366; color: #fff; border: none;
  padding: 14px 24px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s;
}
.btn-wpp:hover { background: #1ebe5d; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text3); grid-column: 1 / -1; }
.empty-state p { font-size: 15px; margin-top: 8px; }

/* ---- FOOTER ---- */
footer { border-top: 1px solid var(--border); padding: 2rem; text-align: center; color: var(--text3); font-size: 12px; }

/* ---- STATS MINI (painel) ---- */
.stats-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 2rem; }
.stat-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.stat-mini-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text2); margin-bottom: 4px; }
.stat-mini-val { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); }

/* ---- FORM CARD ---- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; display: none; }
.form-card.open { display: block; }
.form-card h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: 1/-1; }
.form-group label { display: block; font-size: 11px; font-weight: 500; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); padding: 10px 13px; border-radius: var(--radius-md);
  font-size: 13px; font-family: var(--font-body); outline: none; transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text3); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; margin-top: 1.5rem; justify-content: flex-end; }

/* ---- BUTTONS ---- */
.btn-accent { background: var(--accent); color: #fff; border: none; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; font-family: var(--font-body); cursor: pointer; transition: background 0.2s; }
.btn-accent:hover { background: var(--accent2); }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text2); padding: 7px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; font-family: var(--font-body); cursor: pointer; transition: all 0.2s; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---- PRODUTO ROW (painel) ---- */
.produto-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 10px; transition: border-color 0.2s; }
.produto-row:hover { border-color: var(--border2); }
.produto-thumb { width: 56px; height: 56px; background: var(--surface2); border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--text3); }
.produto-info { flex: 1; min-width: 0; }
.produto-titulo { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.produto-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.produto-preco { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.produto-acoes { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- BTN SM ---- */
.btn-sm { border: 1px solid var(--border2); background: transparent; color: var(--text2); padding: 5px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; font-family: var(--font-body); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm.danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm.vendido:hover { border-color: var(--green); color: var(--green); }

/* ---- BADGES ---- */
.badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.badge.ativo { background: rgba(61,184,122,0.12); color: var(--green); }
.badge.pendente { background: rgba(74,144,217,0.12); color: var(--accent); }
.badge.pausado { background: rgba(100,116,139,0.12); color: var(--text2); }
.badge.vendido { background: rgba(100,116,139,0.1); color: var(--text3); }

/* ---- MSG ---- */
.msg { padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 1rem; display: none; }
.msg.erro { background: rgba(224,90,90,0.08); border: 1px solid var(--red); color: var(--red); }
.msg.ok { background: rgba(61,184,122,0.08); border: 1px solid var(--green); color: var(--green); }

/* ---- UPLOAD ---- */
.upload-area { border: 1px dashed var(--border2); border-radius: var(--radius-md); padding: 1.5rem; text-align: center; cursor: pointer; transition: border-color 0.2s; background: var(--surface2); }
.upload-area:hover { border-color: var(--accent); }
.upload-area input { display: none; }
.upload-area p { font-size: 12px; color: var(--text3); margin-top: 6px; }
.upload-previews { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.upload-preview { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---- FOTO GERENCIAMENTO ---- */
.foto-item { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.foto-item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }
.foto-item .foto-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; background: var(--red); border: none; border-radius: 50%; color: #fff; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; transition: transform 0.15s; }
.foto-item .foto-del:hover { transform: scale(1.15); }
.foto-item .foto-capa { position: absolute; bottom: 3px; left: 3px; background: rgba(0,0,0,0.6); color: var(--accent2); font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 3px; }

/* ---- PERFIL ---- */
.perfil-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 2rem; display: none; }
.perfil-card.open { display: block; }
.perfil-card h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 1.5rem; }
.perfil-grid { display: grid; grid-template-columns: 140px 1fr; gap: 1.5rem; align-items: start; }
.logo-upload { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 140px; flex-shrink: 0; }
.logo-preview { width: 120px; height: 120px; border-radius: var(--radius-lg); background: var(--surface2); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; transition: border-color 0.2s; flex-shrink: 0; }
.logo-preview:hover { border-color: var(--accent); }
.logo-preview img { width: 120px; height: 120px; object-fit: cover; display: block; max-width: 120px; max-height: 120px; }
.logo-hint { font-size: 11px; color: var(--text3); text-align: center; line-height: 1.4; width: 120px; }

/* ---- EMPTY PAINEL ---- */
.empty-painel { text-align: center; padding: 3rem; color: var(--text3); }
.empty-painel p { margin-top: 8px; font-size: 14px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
  .hero { padding: 2rem 1rem 1rem; }
  .section { padding: 0 1rem 2rem; }
  .search-wrap { flex-direction: column; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .modal-info { grid-template-columns: 1fr; }
  .perfil-grid { grid-template-columns: 1fr; }
}

/* ---- HERO DARK (seção de destaque) ---- */
.hero-dark {
  background: var(--dark);
  padding: 3.5rem 2rem 2.5rem;
  margin-bottom: 0;
}
.hero-dark h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  color: #e8edf5;
}
.hero-dark h1 span { color: var(--accent2); }
.hero-dark p {
  color: rgba(255,255,255,0.55);
  font-size: 15px;
  margin-bottom: 2rem;
  max-width: 520px;
  line-height: 1.6;
}
.hero-dark .search-wrap input {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: #e8edf5;
}
.hero-dark .search-wrap input::placeholder { color: rgba(255,255,255,0.3); }
.hero-dark .search-wrap input:focus { border-color: var(--accent2); }
.hero-dark .search-wrap select {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.6) !important;
}
.hero-dark .filter-chip {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
}
.hero-dark .filter-chip:hover,
.hero-dark .filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
