/* styles serão definidos depois */

:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --text: #0f1a14;
  --muted: rgba(15, 26, 20, 0.68);
  --border: rgba(15, 26, 20, 0.12);
  --shadow: 0 10px 30px rgba(15, 26, 20, 0.08);
  --green: #16a34a;
  --green-2: #22c55e;
  --danger: #dc2626;
  --warning: #f59e0b;
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.appShell {
  min-height: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brandMark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

.brandName {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brandSub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
  align-content: start;
}

.navLink {
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 650;
}

.navLink[aria-current="page"] {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

.tenant {
  display: grid;
  gap: 8px;
}

.tenantLabel {
  font-size: 12px;
  color: var(--muted);
}

.main {
  padding: 26px;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.pageHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pageTitle {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.headerActions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.input:focus {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.input.sm {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  border-color: rgba(34, 197, 94, 0.35);
  color: #ffffff;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.24);
  color: var(--danger);
}

.btn:active {
  transform: translateY(1px);
}

.toolbar {
  display: grid;
  gap: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.categoryBlock {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.categoryHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.categoryTitle {
  display: grid;
  gap: 4px;
}

.categoryName {
  font-weight: 850;
}

.categoryMeta {
  font-size: 12px;
  color: var(--muted);
}

.categoryActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.productList {
  display: grid;
  gap: 10px;
}

.productCard {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.productImage {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.productImage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.productMain {
  display: grid;
  gap: 6px;
  align-content: start;
}

.productNameRow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.productName {
  font-weight: 800;
}

.productDesc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.productRight {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.priceRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 26, 20, 0.03);
  color: var(--muted);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.switch input {
  width: 42px;
  height: 24px;
  appearance: none;
  background: rgba(15, 26, 20, 0.12);
  border-radius: 999px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease;
}

.switch input:checked {
  background: rgba(34, 197, 94, 0.75);
}

.switch input:checked::after {
  transform: translateX(18px);
}

.menu {
  position: relative;
}

.menuBtn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.menuPanel {
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 50;
}

.menuPanel[aria-hidden="false"] {
  display: grid;
  gap: 4px;
}

.menuItem {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 650;
}

.menuItem:hover {
  background: rgba(15, 26, 20, 0.04);
}

.grid2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  align-items: start;
}

.formCard {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.typeTabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dropzone {
  border: 1.5px dashed rgba(15, 26, 20, 0.22);
  background: rgba(34, 197, 94, 0.06);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.imagePreview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
}

.imagePreview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.helper {
  font-size: 12px;
  color: var(--muted);
}

.dialog::backdrop {
  background: rgba(15, 26, 20, 0.35);
}

.dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(520px, calc(100% - 24px));
  padding: 0;
  box-shadow: var(--shadow);
}

.dialogBody {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.dialogTitle {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.dialogActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px 14px;
}

.notice {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(245, 158, 11, 0.12);
  color: rgba(15, 26, 20, 0.82);
}

@media (max-width: 920px) {
  .appShell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .main {
    padding: 18px;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .productCard {
    grid-template-columns: 64px 1fr;
  }

  .productRight {
    grid-column: 1 / -1;
    justify-items: start;
  }
}
