/* ── shared.css — Layout unificado WA Platform ── */

:root {
  --sidebar-bg: #1a1d23;
  --sidebar-hover: #23272f;
  --sidebar-active: #2d3748;
  --sidebar-text: #a0aec0;
  --accent: #25d366;
  --accent-dim: rgba(37,211,102,0.10);
  --border: #e2e8f0;
  --surface: #f8fafc;
}

body { background: var(--surface); font-family: 'Segoe UI', system-ui, sans-serif; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand { padding: 20px 20px 16px; border-bottom: 1px solid #2d3748; }
.sidebar-brand h5 { color: #fff; font-weight: 700; font-size: 16px; margin: 0; }
.sidebar-brand small { color: var(--sidebar-text); font-size: 11px; letter-spacing: 0.05em; }

.brand-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
  box-shadow: 0 0 16px rgba(37,211,102,0.3);
}

.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4a5568;
  font-weight: 600;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link-item.active { background: var(--sidebar-active); color: #fff; border-left-color: var(--accent); }
.nav-link-item i { width: 18px; text-align: center; font-size: 15px; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid #2d3748;
}

.sidebar-footer label { font-size: 10px; color: #4a5568; letter-spacing: 0.1em; text-transform: uppercase; }
.sidebar-footer input {
  background: #2d3748;
  border: 1px solid #4a5568;
  border-radius: 6px;
  padding: 6px 10px;
  color: #a0aec0;
  font-size: 11px;
  width: 100%;
  outline: none;
}

/* ── Main ── */
.main-content { margin-left: 240px; min-height: 100vh; }

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

.topbar h4 { font-size: 18px; font-weight: 600; margin: 0; color: #1a202c; }
.topbar p  { font-size: 12px; color: #718096; margin: 0; }
.content-area { padding: 28px; }

/* ── Cards ── */
.card { border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); padding: 14px 20px; font-weight: 600; font-size: 14px; color: #2d3748; border-radius: 10px 10px 0 0 !important; }

/* ── Status pill ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500; border: 1px solid;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }

.pill-disconnected { background: #f7fafc; color: #718096; border-color: #e2e8f0; }
.pill-disconnected .status-dot { background: #cbd5e0; }
.pill-qr, .pill-connecting { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.pill-qr .status-dot, .pill-connecting .status-dot { background: #f59e0b; animation: blink 0.8s infinite; }
.pill-ready { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.pill-ready .status-dot { background: var(--accent); animation: blink 2s infinite; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Buttons ── */
.btn-wa { background: var(--accent); color: #fff; border: none; }
.btn-wa:hover { background: #1fba57; color: #fff; }

/* ── QR ── */
.qr-box {
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  border-radius: 10px;
  min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
.qr-box img { width: 190px; height: 190px; border-radius: 6px; }
.qr-placeholder { text-align: center; color: #a0aec0; }
.qr-placeholder i { font-size: 40px; display: block; margin-bottom: 8px; }
.qr-placeholder p { font-size: 13px; margin: 0; }

/* ── Terminal ── */
.log-terminal {
  background: #1a1d23;
  border-radius: 8px;
  padding: 12px 14px;
  height: 90px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #68d391;
}
.log-line { padding: 1px 0; }
.log-green { color: #68d391; }
.log-amber { color: #f6ad55; }
.log-red   { color: #fc8181; }

/* ── Tabs ── */
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { color: #718096; font-size: 13px; font-weight: 500; border: none; padding: 8px 16px; }
.nav-tabs .nav-link.active { color: #1a202c; border-bottom: 2px solid var(--accent); background: none; }
.badge-count { background: var(--accent-dim); color: #16a34a; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-left: 4px; font-weight: 600; }

/* ── Group list ── */
.group-list { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.group-list::-webkit-scrollbar { width: 4px; }
.group-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.group-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.group-item:hover, .group-item.selected { border-color: var(--accent); background: var(--accent-dim); }
.group-name { font-size: 13px; font-weight: 500; color: #2d3748; }
.group-meta { font-size: 11px; color: #a0aec0; margin-top: 2px; }

/* ── Table ── */
.table { font-size: 13px; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #718096; font-weight: 600; background: #f8fafc; }
.table td { vertical-align: middle; color: #2d3748; }

/* ── Chips ── */
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.chip-green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.chip-amber { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.chip-gray  { background: #f7fafc; color: #718096; border: 1px solid #e2e8f0; }
.chip-red   { background: #fff5f5; color: #c0392b; border: 1px solid #fed7d7; }

/* ── Progress ── */
.progress { height: 6px; border-radius: 3px; background: #e2e8f0; }
.progress-bar { background: var(--accent); border-radius: 3px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; color: #a0aec0; }
.empty-state i { font-size: 36px; display: block; margin-bottom: 10px; }
.empty-state p { font-size: 13px; margin: 0; }

/* ── Product cards ── */
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.product-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(37,211,102,0.12); transform: translateY(-2px); }

.card-img-wrap { aspect-ratio: 4/3; background: #f1f5f9; overflow: hidden; position: relative; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.product-card:hover .card-img-wrap img { transform: scale(1.04); }
.card-no-img { width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:48px;color:#cbd5e0; }

.status-badge {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.status-ativo     { background: rgba(22,163,74,0.9);  color: #fff; }
.status-vendido   { background: rgba(26,21,16,0.8);   color: #e2e8f0; }
.status-reservado { background: rgba(217,119,6,0.9);  color: #fff; }
.status-inativo   { background: rgba(113,128,150,0.8);color: #fff; }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed #cbd5e0;
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-dim); }

/* ── Media thumbs ── */
.media-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.media-thumb {
  position: relative; aspect-ratio: 1;
  border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer;
}
.media-thumb.is-capa { border-color: var(--accent); }
.media-thumb img, .media-thumb video { width:100%;height:100%;object-fit:cover; }
.media-overlay {
  position:absolute;inset:0;
  background:rgba(0,0,0,0.6);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  opacity:0;transition:opacity 0.2s;
}
.media-thumb:hover .media-overlay { opacity:1; }
.capa-tag {
  position:absolute;top:5px;left:5px;
  background:var(--accent);color:#fff;
  font-size:8px;font-weight:700;letter-spacing:0.08em;
  padding:2px 6px;border-radius:3px;text-transform:uppercase;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
}
