:root {
  --sidebar-width: 250px;
  --topbar-height: 64px;
  --primary: #4f46e5;
  --bg-soft: #f4f6fb;
}

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

[data-bs-theme="dark"] body { background: #0f1220; }
[data-bs-theme="dark"] { --bg-soft: #0f1220; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: #14162b;
  color: #cfd3ec;
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform .25s ease;
}
.sidebar-brand {
  padding: 1.25rem 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  display: flex; align-items: center; gap: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { padding: .75rem 0; display: flex; flex-direction: column; }
.sidebar-nav a {
  color: #b7bbe0;
  padding: .65rem 1.25rem;
  text-decoration: none;
  display: flex; align-items: center; gap: .65rem;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: rgba(79,70,229,.18); color: #fff; border-left-color: var(--primary); font-weight: 600; }
.sidebar-heading { color: #6b6f96; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: 1rem 1.25rem .35rem; }

.main-content { margin-left: var(--sidebar-width); flex: 1; min-width: 0; }

.topbar {
  height: var(--topbar-height);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  position: sticky; top: 0; z-index: 1020;
}

.page-content { padding: 1.5rem; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ---------- Cards / KPIs ---------- */
.kpi-card {
  border: none;
  border-radius: 14px;
  padding: 1.25rem;
  background: var(--bs-body-bg);
  box-shadow: 0 2px 10px rgba(20,22,43,.06);
  height: 100%;
}
.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.kpi-value { font-size: 1.5rem; font-weight: 700; }
.kpi-label { font-size: .8rem; color: var(--bs-secondary-color); }

.card { border-radius: 14px; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); border-bottom-width: 1px; }

.badge-status-ativo { background: #16a34a1a; color: #16a34a; }
.badge-status-inativo { background: #dc26261a; color: #dc2626; }

.stock-low { color: #dc2626; font-weight: 600; }

/* ---------- Auth ---------- */
.auth-body { background: linear-gradient(135deg, #4f46e5, #7c3aed); min-height: 100vh; }
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; border-radius: 18px; }

/* ---------- Product photo thumb ---------- */
.product-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: #eee; }

/* Print (relatório em PDF via impressão do navegador) */
@media print {
  .no-print { display: none !important; }
}
