/* ═══════════════════════════════════════════
   BellaShop Admin — admin.css
═══════════════════════════════════════════ */
:root {
  --brand:      #C2006F;
  --brand-dark: #96004F;
  --accent:     #FF4D8D;
  --bg:         #F4F5F8;
  --surface:    #FFFFFF;
  --border:     #E8E8EE;
  --text:       #1A1A2E;
  --muted:      #7A7A9D;
  --success:    #22C55E;
  --warning:    #F59E0B;
  --danger:     #EF4444;
  --info:       #3B82F6;
  --sidebar-bg: #1E0A17;
  --sidebar-w:  220px;
  --topbar-h:   58px;
  --font:       'Nunito', sans-serif;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,.10);
}

* { 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: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-icon { font-size: 1.4rem; }
.logo-text { font-size: 1.05rem; color: rgba(255,255,255,.85); letter-spacing: -.2px; }
.logo-text b { color: var(--accent); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: .88rem; font-weight: 600;
  transition: all .18s;
  margin-bottom: 2px;
}
.nav-item i { font-size: .95rem; 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,.4), rgba(194,0,111,.2));
  color: #fff;
  border-left: 3px solid var(--brand);
  padding-left: 9px;
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 8px;
}
.admin-info { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-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;
}
.admin-meta { min-width: 0; }
.admin-name { font-size: .82rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: .7rem; color: rgba(255,255,255,.4); }
.btn-logout {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(239,68,68,.12); color: rgba(239,68,68,.7);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: all .15s; flex-shrink: 0; 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 24px;
  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: 1rem; 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; position: relative;
}
.btn-topbar:hover { border-color: var(--brand); color: var(--brand); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); border: 1.5px solid var(--surface);
}

/* ─── 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;
}

/* ─── CARDS KPI ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  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; }
.kpi-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.kpi-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.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.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-sub { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi-sub .up   { color: var(--success); font-weight: 700; }
.kpi-sub .down { color: var(--danger);  font-weight: 700; }

/* ─── PANEL ─── */
.panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.panel-title { font-size: .95rem; font-weight: 800; color: var(--text); 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: 20px; }
.panel-body.no-pad { padding: 0; }

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

.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); }

/* ─── 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-dark); }
.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 .15s;
}
.btn-icon-sm:hover { border-color: var(--brand); color: var(--brand); }
.btn-icon-sm.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon-sm.success:hover { border-color: var(--success); color: var(--success); }

/* ─── TABLE ─── */
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th {
  padding: 11px 14px; text-align: left;
  font-size: .72rem; 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: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(194,0,111,.025); }
.tbl-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.tbl-empty i { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: .25; color: var(--brand); }

/* ─── BADGES ─── */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.badge-status.ativo,.badge-status.entregue,.badge-status.pago    { background: rgba(34,197,94,.1);  color: #16a34a; }
.badge-status.inativo,.badge-status.cancelado                    { background: rgba(239,68,68,.1);  color: var(--danger); }
.badge-status.pendente,.badge-status.aguardando                  { background: rgba(245,158,11,.1); color: #d97706; }
.badge-status.enviado,.badge-status.processando                  { background: rgba(59,130,246,.1); color: var(--info); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─── THUMBNAIL ─── */
.prod-thumb {
  width: 40px; height: 40px; border-radius: 9px;
  background: linear-gradient(135deg,#FFF0F6,#FFE0EF);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; border: 1.5px solid var(--border);
}

/* ─── MODAL ─── */
.modal-content { border: none; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px 14px; background: linear-gradient(135deg, rgba(194,0,111,.04), #fff); }
.modal-title { font-size: .95rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.modal-title i { color: var(--brand); }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; gap: 8px; }
.form-label { font-size: .8rem; 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; resize: vertical; }
.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: 16px; }
.form-hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* ─── TOGGLE ─── */
.toggle-wrap { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; }
.form-check-input { width: 36px; height: 20px; cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(194,0,111,.12); }

/* ─── PROGRESS BAR ─── */
.prog-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.prog-fill { height: 100%; border-radius: 3px; background: var(--brand); transition: width .4s; }

/* ─── RECENT ORDER PILL ─── */
.order-row-mini { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.order-row-mini:last-child { border-bottom: none; }
.order-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.order-info { flex: 1; min-width: 0; }
.order-name { font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-meta { font-size: .73rem; color: var(--muted); }
.order-val { font-size: .88rem; font-weight: 800; color: var(--text); white-space: nowrap; }

/* ─── DASHBOARD CHART BAR (pure CSS) ─── */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; margin-top: 12px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar { width: 100%; border-radius: 5px 5px 0 0; background: rgba(194,0,111,.15); transition: background .18s; cursor: default; position: relative; }
.chart-bar:hover { background: var(--brand); }
.chart-bar-lbl { font-size: .65rem; color: var(--muted); }

/* ─── STOCK INDICATOR ─── */
.stock-ok   { color: var(--success); font-weight: 700; }
.stock-low  { color: var(--warning); font-weight: 700; }
.stock-zero { color: var(--danger);  font-weight: 700; }

/* ─── FRETE ZONE ─── */
.zone-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2);
  color: var(--info); font-size: .75rem; font-weight: 700;
}

/* ─── 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: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .main-content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .search-bar { min-width: 140px; }
}

/* ─── LOGIN PAGE ─── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1E0A17 0%, #3D0A2E 60%, #1E0A17 100%);
  position: relative;
}
.login-page::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 70% 40%, rgba(194,0,111,.2) 0%, transparent 70%);
}
.login-box {
  background: var(--surface); border-radius: 18px;
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35); position: relative; z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { font-size: 2.5rem; margin-bottom: 8px; }
.login-logo h1 { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.login-logo h1 span { color: var(--brand); }
.login-logo p { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.btn-login-full {
  width: 100%; height: 46px; background: var(--brand); color: #fff;
  border: none; border-radius: 10px; font-family: var(--font);
  font-weight: 800; font-size: .95rem; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login-full:hover { background: var(--brand-dark); transform: translateY(-1px); }
.input-icon-wrap { position: relative; }
.input-icon-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.input-icon-wrap .form-control { padding-left: 36px; }

/* ─── TOAST ─── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast-msg {
  background: #1E0A17; 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: .85rem;
  border-left: 4px solid var(--brand); min-width: 240px;
}
@keyframes toastIn { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }
.toast-msg.ok   { border-color: var(--success); }
.toast-msg.warn { border-color: var(--warning); }
.toast-msg.err  { border-color: var(--danger);  }
.toast-msg i { font-size: 1rem; }
.toast-msg.ok i   { color: var(--success); }
.toast-msg.warn i { color: var(--warning); }
.toast-msg.err i  { color: var(--danger);  }
