.admin-body { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.sidebar {
  width: 260px; background: linear-gradient(180deg, var(--navy), var(--navy-dark)); color: #fff;
  display: flex; flex-direction: column; padding: 24px 18px; position: sticky; top: 0; height: 100vh;
}
.sb-logo { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 28px; }
.sb-logo img { height: 38px; margin: 0 auto; }
.sb-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sb-link {
  display: flex; align-items: center; gap: 12px; background: transparent; border: none; color: rgba(255,255,255,.8);
  padding: 13px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
  transition: background .15s, color .15s; font-family: inherit;
}
.sb-link span { font-size: 18px; }
.sb-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-link.active { background: var(--gold); color: var(--navy-dark); }
.sb-badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; }
.sb-badge:empty { display: none; }

/* Cotações / leads */
.leads-list { display: grid; gap: 14px; }
.lead-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 4px 16px rgba(27,27,143,.06); border-left: 4px solid var(--gold); }
.lead-card.atendido { border-left-color: #22c55e; opacity: .85; }
.lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lead-head h4 { color: var(--navy); font-size: 17px; display: flex; align-items: center; gap: 10px; }
.lead-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lead-body { margin: 12px 0; padding: 12px 14px; background: var(--bg); border-radius: 10px; font-size: 14.5px; color: var(--ink); white-space: pre-wrap; }
.lead-body .obs { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.lead-contacts { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.lead-contacts b { color: var(--navy); }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-actions button, .lead-actions a { padding: 8px 14px; border-radius: 9px; border: none; cursor: pointer; font-weight: 600; font-size: 13px; font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.lead-wa { background: #25d366; color: #fff; }
.lead-done { background: #dcfce7; color: #15803d; }
.lead-reopen { background: #fef9c3; color: #92660a; }
.lead-status { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; }
.lead-status.novo { background: #fee2e2; color: #b91c1c; }
.lead-status.atendido { background: #dcfce7; color: #15803d; }
.lead-source { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: #ede9fe; color: #6d28d9; text-transform: uppercase; }
.lead-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.ltag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: #eef0f7; color: var(--navy); }
.ltag.urg { background: #fef3c7; color: #92660a; }

.sb-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.sb-view { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 600; padding: 10px; text-align: center; border-radius: 10px; background: rgba(255,255,255,.08); }
.sb-view:hover { background: rgba(255,255,255,.15); }
.sb-logout { background: rgba(255,255,255,.1); border: none; color: #fff; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 600; font-family: inherit; }
.sb-logout:hover { background: #ef4444; }

/* Content */
.content { flex: 1; padding: 30px 40px; max-width: 1100px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.topbar h1 { font-size: 26px; color: var(--navy); }
.topbar p { color: var(--muted); font-size: 15px; }

.tab { display: none; }
.tab.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* Botões extra */
.btn-ghost-dark { background: #eef0f7; color: var(--navy); }
.btn-ghost-dark:hover { background: #e0e3f0; }

/* Produtos - cards admin */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.adm-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 18px rgba(27,27,143,.07); border: 1px solid rgba(27,27,143,.05); }
.adm-card .img { height: 150px; background: linear-gradient(135deg,#eef0fb,#e3e6f7); display: grid; place-items: center; position: relative; }
.adm-card .img img { width: 100%; height: 100%; object-fit: cover; }
.adm-card .img .ph { font-size: 44px; opacity: .25; }
.adm-card .tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.adm-card .tag { font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 99px; text-transform: uppercase; }
.tag.featured { background: var(--gold); color: var(--navy-dark); }
.tag.hidden { background: #94a3b8; color: #fff; }
.adm-card .body { padding: 16px; }
.adm-card .cat { font-size: 11px; font-weight: 700; color: var(--gold-dark); text-transform: uppercase; }
.adm-card h4 { color: var(--navy); font-size: 16px; margin: 4px 0; }
.adm-card .price { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.adm-card .actions { display: flex; gap: 8px; }
.adm-card .actions button { flex: 1; padding: 9px; border-radius: 9px; border: none; font-weight: 600; cursor: pointer; font-size: 13px; font-family: inherit; }
.btn-edit { background: #eef0f7; color: var(--navy); }
.btn-edit:hover { background: #e0e3f0; }
.btn-del { background: #fee2e2; color: #b91c1c; }
.btn-del:hover { background: #fecaca; }

/* Vendedores */
.info-banner { background: #fef9e7; border: 1px solid #fde68a; color: #92660a; padding: 14px 18px; border-radius: 12px; font-size: 14.5px; margin-bottom: 18px; line-height: 1.5; }
.queue-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #fff; border: 1.5px solid rgba(27,27,143,.1); border-radius: 12px; padding: 14px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.queue-next { font-size: 15px; color: var(--navy); }
.queue-next b { color: var(--gold-dark); }
.queue-actions { display: flex; align-items: center; gap: 14px; }
.queue-mode { font-size: 13px; color: var(--muted); font-weight: 600; }
.btn-reset { background: #f1f5f9; border: none; color: var(--navy); padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; font-family: inherit; }
.btn-reset:hover { background: #e2e8f0; }

.sellers-list { display: grid; gap: 14px; }
.seller-card { background: #fff; border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 4px 16px rgba(27,27,143,.06); border: 1.5px solid transparent; transition: border .15s; }
.seller-card.is-next { border-color: var(--gold); background: #fffdf5; }
.seller-pos { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.seller-pos .num { width: 26px; height: 26px; border-radius: 8px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.seller-pos .arrows { display: flex; flex-direction: column; gap: 2px; }
.seller-pos .arrows button { width: 26px; height: 18px; border: none; background: #eef0f7; color: var(--navy); border-radius: 5px; cursor: pointer; font-size: 10px; line-height: 1; padding: 0; }
.seller-pos .arrows button:hover { background: var(--gold); }
.seller-pos .arrows button:disabled { opacity: .3; cursor: default; }
.seller-av { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--navy-dark); display: grid; place-items: center; font-weight: 900; font-size: 20px; flex-shrink: 0; }
.seller-card .info { flex: 1; min-width: 0; }
.seller-card .info h4 { color: var(--navy); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.next-tag { font-size: 10px; font-weight: 800; background: var(--gold); color: var(--navy-dark); padding: 2px 8px; border-radius: 99px; text-transform: uppercase; }
.seller-card .info p { color: var(--muted); font-size: 14px; }
.seller-leads { text-align: center; padding: 0 6px; }
.seller-leads .n { font-size: 22px; font-weight: 900; color: var(--navy); line-height: 1; }
.seller-leads .l { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.seller-status { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 99px; }
.seller-status.on { background: #dcfce7; color: #15803d; }
.seller-status.off { background: #f1f5f9; color: #64748b; }
.seller-card .actions { display: flex; gap: 8px; }
.seller-card .actions button { padding: 8px 12px; border-radius: 9px; border: none; cursor: pointer; font-weight: 600; font-size: 13px; font-family: inherit; }

/* Guia de ajuda (Pixels) */
.help-box { border: 1.5px solid #e2e8f0; border-radius: 12px; margin-bottom: 20px; background: #f8fafc; overflow: hidden; }
.help-box summary { cursor: pointer; padding: 13px 16px; font-weight: 700; color: var(--navy); font-size: 14.5px; list-style: none; user-select: none; }
.help-box summary::-webkit-details-marker { display: none; }
.help-box summary:hover { background: #eef0f7; }
.help-box[open] summary { border-bottom: 1px solid #e2e8f0; }
.help-body { padding: 16px; display: grid; gap: 14px; }
.help-tip { background: #fff7e6; border: 1px solid #fde68a; color: #92660a; padding: 11px 14px; border-radius: 9px; font-size: 13.5px; line-height: 1.5; }
.help-item h4 { color: var(--navy); font-size: 14.5px; margin-bottom: 6px; }
.help-item ol { margin: 0; padding-left: 20px; }
.help-item li { font-size: 13.5px; color: var(--muted); margin-bottom: 3px; }
.help-box code { background: #eef0f7; color: var(--navy); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; font-family: ui-monospace, monospace; }
.fld-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Formulários */
.form-panel { background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 4px 18px rgba(27,27,143,.06); margin-bottom: 22px; max-width: 760px; }
.panel-title { color: var(--navy); font-size: 18px; margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fld { margin-bottom: 16px; }
.fld label { display: block; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.fld input, .fld textarea, .fld select {
  width: 100%; padding: 12px 14px; border: 1.5px solid rgba(27,27,143,.14); border-radius: 11px;
  font-size: 15px; outline: none; font-family: inherit; transition: border .15s; background: #fff;
}
.fld input:focus, .fld textarea:focus, .fld select:focus { border-color: var(--gold); }
.fld input[type="color"] { height: 48px; padding: 5px; cursor: pointer; }
.fld textarea { resize: vertical; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(20,20,60,.5); backdrop-filter: blur(3px); z-index: 100; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-box { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px; border-bottom: 1px solid #eef0f7; position: sticky; top: 0; background: #fff; border-radius: 20px 20px 0 0; }
.modal-head h3 { color: var(--navy); font-size: 19px; }
.modal-close { background: #f1f5f9; border: none; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 16px; color: var(--muted); }
.modal-close:hover { background: #e2e8f0; }
#productForm, #sellerForm { padding: 24px 26px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.modal-foot .btn { flex: 0; }

.upload-row { display: flex; align-items: center; gap: 14px; }
.upload-info { color: var(--muted); font-size: 13px; }
.img-preview { margin-top: 12px; }
.img-preview img { height: 110px; border-radius: 10px; border: 1px solid #e2e8f0; }
.check-row { display: flex; gap: 24px; margin: 6px 0 4px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--navy); cursor: pointer; }
.switch input { width: auto; }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--navy); color: #fff; padding: 14px 26px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform .3s ease; z-index: 200; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: #ef4444; }

@media (max-width: 820px) {
  .admin-body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; position: static; padding: 14px; }
  .sb-logo { margin: 0 12px 0 0; padding: 8px; }
  .sb-nav { flex-direction: row; flex-wrap: wrap; }
  .sb-foot { flex-direction: row; border: none; padding: 0; }
  .content { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
}
