@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --font-sans: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Manrope", sans-serif;

  --bg-0: #0b0b11;
  --bg-1: #101219;
  --bg-2: #141624;

  --surface-1: #12131b;
  --surface-2: #171a24;
  --surface-3: #1f2230;
  --surface-glass: rgba(18, 19, 27, 0.75);

  --text-strong: #f5f6fa;
  --text: #e3e5ec;
  --text-muted: #a8b0bf;
  --text-subtle: #7e8796;

  --accent-400: #ff9a3c;
  --accent-500: #ff7a1a;
  --accent-600: #ff5b1f;
  --accent-700: #f04400;
  --accent-soft: rgba(255, 122, 26, 0.14);
  --accent-glow: rgba(255, 122, 26, 0.35);

  --success: #2dd4bf;
  --warning: #f6c453;
  --danger: #ff5d6c;

  --border-weak: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --shadow-1: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 24px 60px rgba(0, 0, 0, 0.45);

  --radius-10: 10px;
  --radius-14: 14px;
  --radius-18: 18px;
  --radius-24: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(900px 500px at 12% 0%, rgba(255, 122, 26, 0.22), transparent 60%),
    radial-gradient(900px 600px at 80% -10%, rgba(255, 90, 31, 0.2), transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

small {
  color: var(--text-subtle);
}

.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

a {
  color: inherit;
  text-decoration: none;
}

.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.top-space-md { margin-top: 16px; }

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 93, 108, 0.2);
  border: 1px solid rgba(255, 93, 108, 0.35);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

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

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

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  border: 1px solid var(--border-weak);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.chip:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.tag-ok {
  background: rgba(45, 212, 191, 0.2);
  color: #8df5e6;
}

.tag-critical {
  background: rgba(246, 196, 83, 0.2);
  color: #ffd88a;
}

.shopping-items {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.shopping-item-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shopping-lists {
  display: grid;
  gap: 10px;
}

.compras-submit-actions {
  margin: 8px 0 10px;
}

.compras-grid-6040 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.shopping-list-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  padding: 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.shopping-list-card-wrap {
  display: grid;
  gap: 8px;
}

.shopping-list-card.active {
  border-color: rgba(255, 122, 26, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.12);
}

.shopping-list-card .unit-accent {
  color: var(--accent-500);
  font-weight: 700;
}

.shopping-list-meta {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
}

.shopping-list-card:focus-visible {
  outline: none;
  border-color: rgba(255, 122, 26, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.12);
}

.shopping-preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shopping-preview-line > span {
  min-width: 0;
}

.preview-remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(165, 0, 36, 0.4);
  background: #ffffff;
  color: #a50024;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.preview-remove-btn:hover {
  background: #ff375f;
  border-color: #a50024;
  color: #ffffff;
}

.preview-remove-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 55, 95, 0.35);
}

.shopping-touch-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.shopping-touch-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.shopping-touch-main h4 {
  margin-bottom: 6px;
  color: var(--text-strong);
}

.shopping-touch-main p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.shopping-touch-item.purchased {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.12);
}

.shopping-touch-item.purchased .shopping-touch-main h4 {
  text-decoration: line-through;
  color: #9deee2;
}

.shopping-touch-item.unavailable {
  border-color: rgba(255, 93, 108, 0.4);
  background: rgba(255, 93, 108, 0.1);
}

.shopping-touch-item.selected {
  border-color: rgba(255, 122, 26, 0.6);
  background: rgba(255, 122, 26, 0.08);
}

.shopping-touch-actions {
  display: grid;
  gap: 8px;
}

.shopping-touch-qty {
  display: grid;
  gap: 6px;
}

.shopping-touch-qty label {
  font-size: 12px;
  color: var(--text-subtle);
}

.shopping-touch-qty .input {
  min-height: 46px;
}

.touch-btn {
  min-height: 54px;
  font-size: 16px;
  font-weight: 700;
}

.btn-ver-aprovado {
  background: var(--success);
  color: var(--bg-0);
  border-color: var(--success);
}

.btn-ver-aprovado:hover {
  background: #22b8a5;
  border-color: #22b8a5;
}

.container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 32px;
}

.sidebar {
  width: 270px;
  background: var(--surface-1);
  color: var(--text);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border-weak);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.sidebar .spacer { flex: 1; }

.logo {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 28px;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  text-align: center;
  margin-bottom: 28px;
  background: var(--surface-2);
  padding: 16px;
  border-radius: var(--radius-18);
  border: 1px solid var(--border-weak);
  box-shadow: var(--shadow-1);
}

.user-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.9), rgba(255, 90, 31, 0.6));
  color: #1b0f06;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(255, 122, 26, 0.3);
}

.user-name { font-weight: 600; color: var(--text-strong); }
.user-role { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }

.logo-img {
  height: 26px;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.brand,
.brand-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  font-family: var(--font-display);
}

.brand { margin-bottom: 18px; }

.brand span,
.brand-inline span,
.logo span {
  color: var(--text-strong);
}

.icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-wrap {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inline-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-icon .icon {
  width: 14px;
  height: 14px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-submenu {
  display: none;
  margin-left: 30px;
  padding-left: 8px;
  border-left: 1px dashed rgba(255, 255, 255, 0.12);
  gap: 4px;
}

.nav-group.open .nav-submenu {
  display: grid;
}

.submenu-caret {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-subtle);
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}

.nav-group.open .submenu-caret {
  transform: rotate(0deg);
}

.nav-subitem {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-subitem:hover {
  background: var(--surface-2);
  color: var(--text-strong);
}

.nav-subitem.active {
  background: rgba(255, 122, 26, 0.14);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.26);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text-strong);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.24), rgba(255, 90, 31, 0.08));
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.3);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -6px;
  width: 4px;
  height: 60%;
  background: linear-gradient(180deg, var(--accent-400), var(--accent-700));
  border-radius: 4px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 26px;
  color: var(--text-strong);
  font-family: var(--font-display);
}

.refresh-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-weak);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn:hover {
  border-color: var(--accent-500);
  color: var(--text-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateY(-1px) scale(1.02);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface-2);
  border-radius: var(--radius-18);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border-weak);
}

.stat-card h2 { font-size: 30px; color: var(--text-strong); }
.stat-card p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.stat-card.alerta {
  cursor: pointer;
  border: 1px solid transparent;
  transition: border 0.2s ease;
}

.stat-card.alerta:hover { border-color: var(--warning); }
.stat-card.alerta h2 { color: var(--warning); }

.chart-list-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
}

.half-width { flex: 1 1 calc(50% - 10px); }

.panel {
  background: var(--surface-2);
  border-radius: var(--radius-18);
  padding: 20px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border-weak);
}

.chart-fallback {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.panel-spaced-top { margin-top: 16px; }
.panel-spaced-bottom { margin-bottom: 16px; }

.panel-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.panel-title-spaced { margin-bottom: 16px; }

.relatorios-lotes-title {
  font-size: 24px;
  color: #fff;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 16px;
}

.section { display: none; }
.section.active { display: block; }
.section > * + * { margin-top: 20px; }

.table-wrap { overflow-x: auto; }
.table-wrap-spaced { margin-top: 14px; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.table td small { color: var(--text-subtle); }

#relatoriosTabela .rel-lote-codigo,
#relatoriosTabela .rel-responsavel {
  color: #ff5b1f;
}

#relatoriosTabela .rel-lote-codigo {
  font-weight: 400;
}

#relatoriosTabela .rel-responsavel {
  font-weight: 600;
}

#section-relatorios .table th,
#section-relatorios .table td {
  padding: 14px 18px;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-weak);
  font-size: 14px;
  background: var(--surface-3);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="date"].input {
  color-scheme: dark;
}

.input[type="checkbox"],
input[type="checkbox"] {
  accent-color: var(--accent-500);
}

.input[readonly],
.input:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-inline {
  flex: 1;
  min-width: 160px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

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

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-weak);
  background: var(--surface-3);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: var(--border-strong);
}

.nav-item:focus-visible,
.nav-subitem:focus-visible,
.refresh-btn:focus-visible,
.btn:focus-visible {
  outline: none;
  color: var(--text-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input:focus-visible,
select.input:focus-visible,
textarea.input:focus-visible {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #1a0b04;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.28);
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.btn.danger {
  background: rgba(255, 93, 108, 0.15);
  color: var(--danger);
  border-color: rgba(255, 93, 108, 0.3);
}

.btn.danger:hover { background: rgba(255, 93, 108, 0.25); }

.btn.ghost { background: transparent; }

.hint-text {
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pagination .page-info { color: var(--text-muted); font-size: 13px; }

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

#section-config .config-grid {
  width: min(100%, 1320px);
  margin-inline: auto;
  grid-template-columns: 1fr;
  justify-content: center;
  align-items: start;
  justify-items: stretch;
}

#section-config .config-intro {
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 68ch;
}

#section-config .config-square {
  width: 100%;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px 18px;
  gap: 12px;
}

#section-config .config-square .panel-title {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

#section-config .config-square .form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#section-config .config-square .input,
#section-config .config-square .readonly {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
}

#section-config .config-square .readonly {
  display: flex;
  align-items: center;
}

#section-config .config-square .btn {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

#section-config .config-square .form-actions {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  margin-top: 4px;
  align-items: stretch;
}

#section-config .config-square .form-actions .btn {
  width: 100%;
  min-width: 0;
}

#section-config .config-square .form-grid > div,
#section-config .config-square .form-grid > label,
#section-config .config-square .form-grid > .field-label,
#section-config .config-square .user-action-field,
#section-config .config-square textarea,
#section-config .config-square select,
#section-config .config-square input {
  width: 100%;
}

#section-config .config-square small {
  font-size: 12px;
}

#section-config .config-square .hint-text {
  margin-top: 6px;
  min-height: 0;
  font-size: 12px;
  line-height: 1.45;
}

#section-config .config-square .textarea-lg {
  min-height: 168px;
  max-height: none;
  resize: vertical;
}

#section-config #estoqueEmailsPanel .form-actions {
  margin-top: 6px;
  padding-top: 4px;
}

#section-config .config-square-wide {
  grid-column: auto;
}

.panel-admin-users {
  grid-column: 1 / -1;
}

#section-config .panel-admin-users {
  width: 100%;
  justify-self: stretch;
}

#section-config .config-subintro {
  margin-bottom: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

@media (min-width: 900px) {
  #section-config .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #section-config .config-square {
    padding: 24px 22px;
  }

  #section-config .config-square-wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1280px) {
  #section-config .config-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 769px) {
  #section-config .config-square .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.user-actions {
  display: grid;
  gap: 10px;
  align-items: start;
}

.user-action-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.user-action-label {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.user-actions-mobile {
  margin-top: 6px;
}

.input-compact {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.readonly {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.relatorios-hero {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 122, 26, 0.35), transparent 55%),
    linear-gradient(135deg, rgba(255, 122, 26, 0.22) 0%, rgba(24, 24, 33, 0.9) 55%, rgba(12, 13, 18, 0.95) 100%);
  color: var(--text-strong);
  border-radius: var(--radius-24);
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-2);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 122, 26, 0.2);
}

.relatorios-hero h2 { font-size: 20px; margin-bottom: 6px; font-family: var(--font-display); }
.relatorios-hero p { color: var(--text-muted); font-size: 13px; max-width: 520px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface-2);
  border-radius: var(--radius-18);
  padding: 16px;
  border: 1px solid var(--border-weak);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -30px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 122, 26, 0.12);
}

.kpi-card.accent-amber::after { background: rgba(246, 196, 83, 0.18); }
.kpi-card.accent-green::after { background: rgba(45, 212, 191, 0.18); }
.kpi-card.accent-rose::after { background: rgba(255, 93, 108, 0.16); }

.kpi-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text-strong);
}

.kpi-sub { font-size: 12px; color: var(--text-subtle); margin-top: 4px; }
.kpi-update { font-weight: 600; margin-top: 6px; color: var(--text-strong); }

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.recent-item:last-child { border-bottom: none; }

.item-info h4 { font-size: 14px; color: var(--text-strong); }
.item-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.item-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-muted);
}

.product-section {
  background: var(--surface-2);
  border-radius: var(--radius-18);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border-weak);
}

.product-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.product-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-weak);
  background: var(--surface-3);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.product-btn.active,
.product-btn:hover {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.25), rgba(255, 90, 31, 0.08));
  border-color: rgba(255, 122, 26, 0.4);
  color: var(--text-strong);
}

.product-btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.form-row {
  margin-top: 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.gerar-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-700));
  color: #1a0b04;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 12px 24px rgba(255, 122, 26, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gerar-btn:hover { transform: translateY(-1px) scale(1.02); }

.resultado {
  margin-top: 20px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px dashed rgba(45, 212, 191, 0.4);
  padding: 14px 20px;
  border-radius: 12px;
  text-align: center;
  color: #bff6ec;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.resultado:active { transform: scale(0.98); }

.resultado.copiado {
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(45, 212, 191, 0.7);
}

.resultado .hint {
  font-size: 11px;
  font-weight: 500;
  color: rgba(191, 246, 236, 0.65);
  margin-top: 4px;
}

#toast {
  position: fixed;
  top: 20px;
  right: 24px;
  background: #ffffff;
  color: #111111;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 999;
  border: 1px solid rgba(17, 17, 17, 0.18);
  box-shadow: var(--shadow-1);
  width: min(92vw, 420px);
}

#toast.toast-ok {
  background: #ffffff;
  color: #111111;
  border-color: rgba(17, 17, 17, 0.2);
}

#toast.toast-erro {
  background: #ff375f;
  color: #ffffff;
  border-color: #a50024;
}

#toast.toast-aviso {
  background: #fff5d6;
  color: #2e1f00;
  border-color: #ffd36a;
}
#toast.show { opacity: 1; transform: translateY(0); }

#toast.toast-top-center {
  left: 50%;
  right: auto;
  top: 14px;
  transform: translate(-50%, -10px);
}

#toast.toast-top-center.show {
  transform: translate(-50%, 0);
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.show { display: flex; }

.modal {
  background: var(--surface-2);
  border-radius: var(--radius-18);
  padding: 28px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-weak);
  box-shadow: var(--shadow-2);
}

.modal h3 { font-size: 18px; margin-bottom: 16px; color: var(--text-strong); }

.vencer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vencer-item:last-child { border-bottom: none; }

.vencer-dias {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.vencer-dias.urgente { background: rgba(255, 93, 108, 0.2); color: var(--danger); }
.vencer-dias.atencao { background: rgba(246, 196, 83, 0.2); color: var(--warning); }

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-subtle);
}

.mobile-header {
  display: none;
  background: var(--surface-1);
  color: var(--text-strong);
  padding: 12px 20px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-weak);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-strong);
  margin: 5px 0;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-weak);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.inline-check input {
  flex: 0 0 auto;
}

.inline-check:focus-within {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-label {
  display: block;
}

.user-card-list {
  display: grid;
  gap: 12px;
}

.user-table-desktop {
  display: none;
}

.user-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.user-card-ident {
  min-width: 0;
}

.user-card-ident h3 {
  font-size: 16px;
  line-height: 1.3;
  color: var(--text-strong);
  word-break: break-word;
}

.user-card-ident p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-word;
}

.user-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-card-status.is-active {
  background: rgba(45, 212, 191, 0.16);
  color: #8df5e6;
}

.user-card-status.is-inactive {
  background: rgba(255, 93, 108, 0.14);
  color: #ff9aa7;
}

.user-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-card-meta-item {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
}

.user-card-meta-item strong {
  display: block;
  margin-top: 4px;
  color: var(--text-strong);
}

.user-card-meta-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.user-empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-glass);
  border-radius: var(--radius-24);
  box-shadow: var(--shadow-2);
  padding: 28px;
  border: 1px solid rgba(255, 122, 26, 0.18);
  backdrop-filter: blur(18px);
}

h1 { font-size: 22px; margin-bottom: 6px; color: var(--text-strong); }

p.sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.btn:disabled {
  background: rgba(255, 255, 255, 0.12);
  cursor: not-allowed;
  color: var(--text-subtle);
}

.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.login-actions .btn,
.login-actions a.btn {
  flex: 1;
  justify-content: center;
}

.msg {
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}

.hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-subtle);
  text-align: center;
}

body.no-scroll {
  overflow: hidden;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  z-index: 55;
}

.mobile-overlay.show {
  display: block;
}

.hamburger {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
}

.container {
  display: block;
  min-height: 100vh;
}

.mobile-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(18px);
  background: rgba(18, 19, 27, 0.88);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 320px);
  transform: translateX(-102%);
  transition: transform 0.24s ease;
  z-index: 70;
  overflow-y: auto;
  padding-bottom: 32px;
}

.sidebar.open {
  transform: translateX(0);
}

.main-content {
  padding: 16px 16px 32px;
}

.logo-img {
  max-width: 180px;
  height: 30px;
}

.header {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.header .refresh-btn {
  width: 100%;
}

.header h1 {
  font-size: 24px;
}

.panel-title {
  font-size: 16px;
}

.refresh-btn,
.btn,
.gerar-btn,
.product-btn {
  min-height: 46px;
  justify-content: center;
}

.stats-grid,
.kpi-grid,
.config-grid,
.form-grid,
.chart-list-container {
  grid-template-columns: 1fr;
}

.stats-grid {
  display: grid;
}

.chart-list-container {
  display: grid;
  gap: 16px;
}

.half-width {
  flex: initial;
}

.panel,
.product-section,
.relatorios-hero,
.login-card,
.modal {
  padding: 18px;
  border-radius: 18px;
}

.product-btns,
.form-actions,
.form-row,
.login-actions {
  flex-direction: column;
  align-items: stretch;
}

.product-btns {
  display: grid;
  grid-template-columns: 1fr;
}

/* Dashboard mobile-first tuning */
#section-dashboard .product-section {
  margin-top: 0;
}

#section-dashboard .product-btns {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 122, 26, 0.4) transparent;
}

#section-dashboard .product-btns::-webkit-scrollbar {
  height: 6px;
}

#section-dashboard .product-btns::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 26, 0.45);
  border-radius: 999px;
}

#section-dashboard .product-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 14px;
  white-space: nowrap;
  scroll-snap-align: start;
}

#section-dashboard .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#section-dashboard .gerar-btn {
  width: 100%;
}

#section-dashboard .stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#section-dashboard .stat-card {
  padding: 16px 12px;
}

#section-dashboard .stat-card h2 {
  font-size: 26px;
}

#section-dashboard #ultimosLotes {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

#section-dashboard #textoLote {
  font-size: clamp(16px, 4.6vw, 24px);
  line-height: 1.25;
  word-break: break-word;
}

.input-inline {
  min-width: 0;
}

.item-badge {
  white-space: normal;
  text-align: right;
}

.pagination {
  justify-content: space-between;
}

#toast {
  top: 12px;
  right: 12px;
  left: auto;
  width: min(calc(100vw - 24px), 420px);
}

.modal {
  width: calc(100% - 24px);
  max-height: calc(100vh - 48px);
}

.table-wrap {
  overflow: visible;
}

.table,
.table tbody,
.table tr,
.table td {
  display: block;
  width: 100%;
}

.table thead {
  display: none;
}

.table tr {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 12px;
}

.table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 0;
}

.table td:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.table td[data-label]::before {
  content: attr(data-label);
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 6px;
}

#relatoriosTabela td[data-label]::before {
  display: none;
}

.table td[data-label="Ações"] {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table td[data-label="Ações"] .user-actions {
  flex-direction: column;
  align-items: stretch;
}

.table td[data-label="Ações"] .user-actions .input-compact,
.table td[data-label="Ações"] .user-actions .btn {
  width: 100%;
  max-width: none;
}

.recent-item,
.vencer-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.kpi-value,
.stat-card h2 {
  font-size: 28px;
}

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

  .main-content {
    padding: 14px 14px 28px;
  }

  .user-info {
    padding: 14px;
  }
}

@media (max-width: 420px) {
  #section-dashboard .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .mobile-overlay {
    display: none !important;
  }

  .container {
    display: flex;
  }

  .mobile-header {
    display: none;
  }

  .sidebar {
    position: static;
    transform: none;
    width: 270px;
    z-index: auto;
    overflow: visible;
    padding-bottom: 28px;
  }

  .main-content {
    padding: 32px;
  }

  .header {
    flex-direction: row;
    align-items: center;
  }

  .header .refresh-btn {
    width: auto;
  }

  .header h1,
  .relatorios-lotes-title {
    font-size: 45px;
    line-height: 1.1;
  }

  .panel-title {
    font-size: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .chart-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
  }

  .half-width {
    flex: 1 1 calc(50% - 10px);
  }

  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .config-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .user-card-list {
    display: none;
  }

  .user-table-desktop {
    display: block;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .product-btns,
  .form-actions,
  .form-row,
  .login-actions {
    flex-direction: row;
    align-items: center;
  }

  .product-btns {
    display: flex;
  }

  #section-dashboard .product-btns {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }

  #section-dashboard .product-btn {
    flex: 0 1 auto;
    min-height: 0;
  }

  #section-dashboard .form-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
  }

  #section-dashboard .gerar-btn {
    width: auto;
  }

  #section-dashboard .stats-grid {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }

  #section-dashboard #ultimosLotes {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .table {
    display: table;
  }

  .table thead {
    display: table-header-group;
  }

  .table tbody {
    display: table-row-group;
  }

  .table tr {
    display: table-row;
    padding: 0;
    margin-bottom: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .table td,
  .table th {
    display: table-cell;
    width: auto;
    padding: 10px 12px;
  }

  .table td::before {
    display: none;
  }

  .table td[data-label="Ações"] {
    display: table-cell;
  }

  .table td[data-label="Ações"] .btn {
    width: auto;
  }

  .table td[data-label="Ações"] .user-actions {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) auto auto;
    align-items: end;
  }

  .table td[data-label="Ações"] .user-actions .input-compact {
    width: 100%;
  }

  .table td[data-label="Ações"] .user-actions .btn {
    width: auto;
  }

  .table td[data-label="Ações"] .user-action-label {
    display: none;
  }

  #section-compras .compras-grid-6040 {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }

  #section-compras .compras-submitted-panel {
    display: flex;
    flex-direction: column;
    max-height: min(72vh, 640px);
    min-height: 0;
  }

  #section-compras #comprasListas {
    overflow-y: auto;
    min-height: 0;
    padding-right: 6px;
  }

  #toast {
    top: 20px;
    right: 24px;
    left: auto;
    width: min(92vw, 420px);
  }

  .modal {
    width: 90%;
    max-width: 520px;
  }

  .recent-item,
  .vencer-item {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
}
