/* ── ADMIN CSS ── */
:root {
  --sidebar-w: 240px;
}

.admin-layout {
  display: flex; min-height: 100vh;
  padding-top: 0;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); background: var(--black);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 200; overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo a {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: white; text-decoration: none;
}
.sidebar-logo a span { color: var(--accent); }
.sidebar-logo p { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-section { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3); letter-spacing: 0.1em; text-transform: uppercase; padding: 12px 8px 6px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: rgba(255,255,255,0.6); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: all 0.2s;
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-nav a.active { background: rgba(200,169,110,0.2); color: var(--accent); }
.sidebar-nav a .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center;
  justify-content: center; color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-nome { font-size: 13px; color: white; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

/* ── MAIN CONTENT ── */
.admin-main {
  margin-left: var(--sidebar-w); flex: 1;
  background: #f8f8f6; min-height: 100vh;
}
.admin-topbar {
  background: white; border-bottom: 1px solid var(--gray-200);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.admin-topbar h1 { font-size: 18px; font-weight: 600; }
.admin-content { padding: 32px; }

/* ── STATS CARDS ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: white; border-radius: var(--radius);
  padding: 20px 24px; border: 1px solid var(--gray-200);
}
.stat-card-label { font-size: 13px; color: var(--gray-600); margin-bottom: 8px; }
.stat-card-value { font-size: 28px; font-weight: 700; font-family: 'Playfair Display', serif; }
.stat-card-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.stat-card.accent .stat-card-value { color: var(--accent); }
.stat-card.green .stat-card-value { color: var(--green); }
.stat-card.red .stat-card-value { color: var(--red); }

/* ── TABELA ── */
.table-card {
  background: white; border-radius: var(--radius);
  border: 1px solid var(--gray-200); overflow: hidden;
}
.table-card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.table-card-header h2 { font-size: 15px; font-weight: 600; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 12px; font-weight: 600; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--gray-200); background: var(--gray-100);
}
td {
  padding: 14px 16px; font-size: 14px;
  border-bottom: 1px solid var(--gray-200); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-100); }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-100); border-radius: 10px;
  padding: 8px 14px; border: 1.5px solid transparent;
  transition: all 0.2s; min-width: 240px;
}
.search-bar:focus-within { background: white; border-color: var(--black); }
.search-bar input {
  border: none; background: none; font-size: 14px;
  font-family: 'Inter', sans-serif; outline: none; flex: 1;
}
.search-bar svg { color: var(--gray-400); flex-shrink: 0; }

/* ── PRODUTO FORM ── */
.form-card {
  background: white; border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: 24px; margin-bottom: 20px;
}
.form-card h2 { font-size: 15px; font-weight: 600; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── IMAGEM PREVIEW ── */
.img-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.img-preview {
  width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
  position: relative; border: 1px solid var(--gray-200);
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-remove {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,0.6); color: white;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; border: none;
}

/* ── SCRAPE PREVIEW ── */
.scrape-preview {
  background: var(--gray-100); border-radius: var(--radius);
  padding: 20px; margin-top: 16px; display: none;
}
.scrape-preview.show { display: block; }
.scrape-preview-img {
  width: 100%; max-height: 200px; object-fit: contain;
  border-radius: 8px; margin-bottom: 12px; background: white;
}

/* ── RESPONSIVE ADMIN ── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-content { padding: 20px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
