/* ═══════════════════════════════════════════
   BellaShop Revendedor — rev.css
═══════════════════════════════════════════ */
:root {
  --brand:      #C2006F;
  --brand-dk:   #96004F;
  --accent:     #FF4D8D;
  --bg:         #FFF5F9;
  --surface:    #FFFFFF;
  --border:     #F0D6E8;
  --text:       #2D0A1E;
  --muted:      #9C6B85;
  --success:    #22C55E;
  --warning:    #F59E0B;
  --danger:     #EF4444;
  --info:       #3B82F6;
  --sidebar-bg: #3D0A2E;
  --sidebar-w:  220px;
  --topbar-h:   58px;
  --font:       'Nunito', sans-serif;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(194,0,111,.07);
  --shadow-md:  0 6px 24px rgba(194,0,111,.12);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon { font-size: 1.5rem; flex-shrink: 0; }
.logo-name { font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: -.2px; line-height: 1.1; }
.logo-name b { color: var(--accent); }
.logo-sub { font-size: .68rem; color: rgba(255,255,255,.4); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  color: rgba(255,255,255,.5); text-decoration: none;
  font-size: .875rem; font-weight: 600;
  transition: all .15s; margin-bottom: 2px;
}
.nav-item i { font-size: .9rem; width: 18px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(194,0,111,.5), rgba(194,0,111,.25));
  color: #fff; border-left: 3px solid var(--accent); padding-left: 9px;
}

.sidebar-footer {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 8px;
}
.rev-info { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.rev-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rev-meta { min-width: 0; }
.rev-name { font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-badge { font-size: .68rem; color: var(--accent); font-weight: 700; margin-top: 1px; }
.btn-logout {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(239,68,68,.12); color: rgba(239,68,68,.65);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: all .15s; font-size: .85rem;
}
.btn-logout:hover { background: rgba(239,68,68,.25); color: var(--danger); }

/* ─── TOPBAR ─── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  z-index: 100; box-shadow: var(--shadow); transition: left .28s;
}
.sidebar-toggle {
  display: none; width: 36px; height: 36px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: none; cursor: pointer; color: var(--text);
  align-items: center; justify-content: center; font-size: .9rem;
}
.topbar-title { font-size: .98rem; font-weight: 800; color: var(--text); flex: 1; }
.topbar-right { display: flex; gap: 8px; }
.btn-topbar {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1.5px solid var(--border); background: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; transition: all .15s; text-decoration: none;
}
.btn-topbar:hover { border-color: var(--brand); color: var(--brand); }

/* ─── MAIN ─── */
.main-content {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  padding: 24px; min-height: calc(100vh - var(--topbar-h));
  transition: margin-left .28s;
}

/* ─── KPI CARDS ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.kpi-icon.pink   { background: rgba(194,0,111,.1);  color: var(--brand); }
.kpi-icon.green  { background: rgba(34,197,94,.1);  color: var(--success); }
.kpi-icon.yellow { background: rgba(245,158,11,.1); color: var(--warning); }
.kpi-icon.blue   { background: rgba(59,130,246,.1); color: var(--info); }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.kpi-sub { font-size: .72rem; color: var(--muted); }

/* ─── PANELS ─── */
.panel { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.panel-title { font-size: .92rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--brand); }
.panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 18px; }
.panel-body.np { padding: 0; }

/* ─── LIMIT BAR ─── */
.limit-bar-wrap { margin-bottom: 6px; }
.limit-labels { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: 6px; }
.limit-labels .used { font-weight: 700; color: var(--brand); }
.limit-labels .total { color: var(--muted); }
.limit-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.limit-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .5s; }
.limit-fill.warn { background: linear-gradient(90deg, var(--warning), #f59e0b); }
.limit-fill.danger { background: linear-gradient(90deg, var(--danger), #ef4444); }

/* ─── TABLE ─── */
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th {
  padding: 10px 14px; text-align: left;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted);
  background: var(--bg); border-bottom: 2px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: rgba(194,0,111,.02); }
.tbl-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.tbl-empty i { font-size: 2.2rem; display: block; margin-bottom: 10px; opacity: .2; color: var(--brand); }

/* ─── BADGES ─── */
.badge-s {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700;
}
.badge-s.pendente   { background: rgba(245,158,11,.1); color: #d97706; }
.badge-s.processando{ background: rgba(59,130,246,.1);  color: var(--info); }
.badge-s.enviado    { background: rgba(139,26,107,.12); color: var(--brand); }
.badge-s.entregue   { background: rgba(34,197,94,.1);  color: #16a34a; }
.badge-s.cancelado  { background: rgba(239,68,68,.1);  color: var(--danger); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ─── PRODUCT CARD (catálogo) ─── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.prod-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all .2s; display: flex; flex-direction: column;
}
.prod-card:hover { border-color: rgba(194,0,111,.35); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.prod-img {
  aspect-ratio: 1; background: linear-gradient(135deg,#FFF0F6,#FFE0EF);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; position: relative;
}
.prod-badge { position: absolute; top: 8px; left: 8px; font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.badge-desc { background: var(--brand); color: #fff; }
.badge-new  { background: var(--accent); color: #fff; }
.prod-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.prod-cat { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.prod-name { font-size: .9rem; font-weight: 700; line-height: 1.3; margin-bottom: 8px; flex: 1; }
.prod-estoque { font-size: .72rem; margin-bottom: 8px; }
.prod-estoque.ok   { color: var(--success); }
.prod-estoque.low  { color: var(--warning); }
.prod-estoque.zero { color: var(--danger); }
.price-orig { font-size: .72rem; color: var(--muted); text-decoration: line-through; }
.price-rev  { font-size: 1.1rem; font-weight: 800; color: var(--brand); }
.price-economia { font-size: .72rem; color: var(--success); font-weight: 700; margin-top: 2px; }
.btn-add-cart {
  width: 100%; height: 36px; margin-top: 10px;
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  font-family: var(--font); font-size: .83rem; font-weight: 700;
  cursor: pointer; transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-add-cart:hover { background: var(--brand-dk); }
.btn-add-cart:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

/* ─── CART SIDEBAR ─── */
.cart-overlay { position: fixed; inset: 0; background: rgba(61,10,46,.45); z-index: 1100; opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(3px); }
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 95vw;
  background: var(--surface); z-index: 1101;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: -4px 0 40px rgba(194,0,111,.15);
}
.cart-sidebar.open { transform: translateX(0); }
.cart-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.cart-head h5 { font-size: .95rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cart-head h5 i { color: var(--brand); }
.cart-close { width: 32px; height: 32px; border: 1.5px solid var(--border); border-radius: 7px; background: none; cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: center; transition: all .15s; }
.cart-close:hover { border-color: var(--danger); color: var(--danger); }
.cart-body { flex: 1; overflow-y: auto; padding: 14px; }
.cart-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.cart-empty i { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: .2; color: var(--brand); }
.cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ci-img { width: 52px; height: 52px; min-width: 52px; background: linear-gradient(135deg,#FFF0F6,#FFE0EF); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: .85rem; font-weight: 700; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-price { font-size: .78rem; color: var(--brand); font-weight: 700; margin-bottom: 6px; }
.ci-qty { display: flex; align-items: center; gap: 7px; }
.qty-btn { width: 24px; height: 24px; border: 1.5px solid var(--border); border-radius: 5px; background: none; cursor: pointer; font-size: .72rem; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.qty-btn:hover { border-color: var(--brand); color: var(--brand); }
.qty-val { font-size: .88rem; font-weight: 700; min-width: 18px; text-align: center; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.ci-total { font-weight: 800; font-size: .9rem; }
.btn-rm { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; transition: color .12s; padding: 2px; }
.btn-rm:hover { color: var(--danger); }
.cart-foot { padding: 14px 18px; border-top: 1px solid var(--border); }
.cart-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: .85rem; }
.cart-row span { color: var(--muted); }
.cart-row strong { font-weight: 700; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); margin-bottom: 14px; }
.cart-total-row span { font-weight: 700; }
.cart-total-row strong { font-size: 1.2rem; font-weight: 800; color: var(--brand); }
.btn-checkout { width: 100%; height: 44px; background: var(--brand); color: #fff; border: none; border-radius: 9px; font-family: var(--font); font-weight: 800; font-size: .9rem; cursor: pointer; transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-checkout:hover { background: var(--brand-dk); }
.btn-clear-cart { width: 100%; height: 36px; margin-top: 6px; background: none; border: 1.5px solid var(--border); border-radius: 9px; color: var(--muted); font-size: .82rem; cursor: pointer; transition: all .15s; }
.btn-clear-cart:hover { border-color: var(--danger); color: var(--danger); }

/* ─── FORM ─── */
.form-label { font-size: .78rem; font-weight: 700; color: var(--text); margin-bottom: 5px; display: block; }
.form-control, .form-select {
  border: 1.5px solid var(--border); border-radius: 8px;
  height: 40px; font-family: var(--font); font-size: .875rem;
  padding: 0 12px; color: var(--text); transition: border-color .18s; width: 100%;
}
textarea.form-control { height: auto; padding: 10px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(194,0,111,.1); outline: none; }
.form-group { margin-bottom: 14px; }
.form-hint { font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* ─── BUTTONS ─── */
.btn-primary {
  height: 36px; padding: 0 16px; border-radius: 8px;
  background: var(--brand); color: #fff; border: none;
  font-family: var(--font); font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .18s; display: inline-flex; align-items: center; gap: 7px;
}
.btn-primary:hover { background: var(--brand-dk); }
.btn-secondary {
  height: 36px; padding: 0 14px; border-radius: 8px;
  background: none; color: var(--text); border: 1.5px solid var(--border);
  font-family: var(--font); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: all .18s; display: inline-flex; align-items: center; gap: 7px;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-icon-sm { width: 30px; height: 30px; border-radius: 7px; border: 1.5px solid var(--border); background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; color: var(--muted); transition: all .12s; }
.btn-icon-sm:hover { border-color: var(--brand); color: var(--brand); }

/* ─── MODAL ─── */
.modal-content { border: none; border-radius: 14px; box-shadow: 0 20px 60px rgba(194,0,111,.15); }
.modal-header { border-bottom: 1px solid var(--border); padding: 16px 20px 12px; background: linear-gradient(135deg,rgba(194,0,111,.04),#fff); }
.modal-title { font-size: .92rem; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.modal-title i { color: var(--brand); }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border); padding: 12px 20px; gap: 8px; }

/* ─── SEARCH BAR ─── */
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; pointer-events: none; }
.search-bar { height: 36px; border: 1.5px solid var(--border); border-radius: 8px; padding: 0 12px 0 32px; font-family: var(--font); font-size: .85rem; background: var(--bg); color: var(--text); transition: border-color .15s; min-width: 190px; }
.search-bar:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.filter-select { height: 36px; padding: 0 10px; border: 1.5px solid var(--border); border-radius: 8px; font-family: var(--font); font-size: .85rem; background: var(--surface); color: var(--text); cursor: pointer; }
.filter-select:focus { outline: none; border-color: var(--brand); }

/* ─── TOAST ─── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast-msg { background: #3D0A2E; color: #fff; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-md); margin-top: 8px; animation: toastIn .3s ease; font-size: .84rem; min-width: 230px; border-left: 4px solid var(--brand); }
@keyframes toastIn { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }
.toast-msg.ok   { border-color: var(--success); }
.toast-msg.err  { border-color: var(--danger); }
.toast-msg.warn { border-color: var(--warning); }
.toast-msg i { font-size: .95rem; }
.toast-msg.ok i   { color: var(--success); }
.toast-msg.err i  { color: var(--danger); }
.toast-msg.warn i { color: var(--warning); }

/* ─── LOGIN ─── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#3D0A2E 0%,#7A1050 55%,#3D0A2E 100%); position: relative; }
.login-page::before { content:''; position:absolute; inset:0; background:radial-gradient(ellipse 50% 60% at 65% 40%,rgba(255,77,141,.2) 0%,transparent 70%); }
.login-box { background: var(--surface); border-radius: 18px; padding: 38px 34px; width: 100%; max-width: 390px; box-shadow: 0 24px 64px rgba(0,0,0,.3); position: relative; z-index: 1; }
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .lic { font-size: 2.4rem; margin-bottom: 8px; }
.login-logo h1 { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.login-logo h1 b { color: var(--brand); }
.login-logo p { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.input-icon .form-control { padding-left: 36px; }
.btn-login-full { width: 100%; height: 44px; background: var(--brand); color: #fff; border: none; border-radius: 10px; font-family: var(--font); font-weight: 800; font-size: .92rem; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }
.btn-login-full:hover { background: var(--brand-dk); transform: translateY(-1px); }

/* ─── CONTA PAGE ─── */
.account-card { background: linear-gradient(135deg,#3D0A2E,#7A1050); border-radius: 14px; padding: 24px; color: #fff; margin-bottom: 20px; }
.account-avatar { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.account-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.account-email { font-size: .82rem; color: rgba(255,255,255,.65); margin-bottom: 14px; }
.account-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.account-chip { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 5px 14px; font-size: .8rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); }
}
@media (max-width: 500px) {
  .main-content { padding: 14px; }
  .search-bar { min-width: 130px; }
}
