/* ==========================================================================
   KipoTech — design system e estilos do painel
   Mobile first (360 → 768 → 1024 → 1440). Nomes em BEM.

   1. Tokens          6. Botões e links      11. Modal e painel lateral
   2. Base            7. Cartões e números   12. Avisos e estados
   3. Marca           8. Tabelas             13. Autenticação
   4. Shell           9. Formulários         14. Módulos (páginas)
   5. Cabeçalhos     10. Listas e chips      15. Impressão e movimento
   ========================================================================== */

/* 1. Tokens
   ========================================================================== */
:root {
  /* Paleta */
  --navy-950: #0b1f36;
  --navy-900: #0f2a47;
  --navy-800: #163a60;
  --navy-700: #1f4b7a;
  --navy-200: #b9c9dc;
  --navy-100: #e7eef6;
  --navy-50: #f3f7fb;

  --red-700: #a8302f;
  --red-600: #c63b3b;
  --red-100: #fbe4e2;

  --orange-700: #9a4a12;
  --orange-300: #f8bb8d;
  --orange-200: #fcd7bb;
  --orange-100: #feeadb;
  --orange-50: #fff7f0;

  --green-700: #23704a;
  --green-100: #e3f3ea;

  --white: #ffffff;
  --gray-50: #f6f8fa;
  --gray-100: #eef1f5;
  --gray-200: #e1e6ec;
  --gray-300: #cbd3dc;
  --gray-500: #5c6b7d;
  --gray-700: #3a4656;
  --gray-900: #17202b;

  /* Uso semântico */
  --color-bg: var(--gray-50);
  --color-surface: var(--white);
  --color-text: var(--gray-900);
  --color-muted: var(--gray-500);
  --color-border: var(--gray-200);
  --color-structure: var(--navy-900);
  --color-accent: var(--red-600);
  --color-accent-hover: var(--red-700);
  --color-soft: var(--orange-100);
  --color-focus: var(--red-600);

  /* Espaçamento (base 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Tipografia */
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;

  /* Formas e profundidade */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px #0f2a4714;
  --shadow-md: 0 6px 18px #0f2a471a;
  --shadow-lg: 0 20px 48px #0f2a4733;

  /* Movimento */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --duration: .18s;

  --sidebar-width: 256px;
  --topbar-height: 64px;
}

/* 2. Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 var(--text-md)/1.5 var(--font);
  overflow-x: hidden;
}

h1, h2, h3, h4, p, dl, dd, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

h1, h2, h3 {
  color: var(--navy-900);
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--navy-700);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--gray-100);
  font-size: .92em;
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.no-scroll {
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy-900);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-3);
}

.icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.block {
  display: block;
}

.text {
  color: var(--gray-700);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.text + .text,
.text + .btn,
.text + .button-row {
  margin-top: var(--space-3);
}

.text--muted {
  color: var(--color-muted);
}

.noscript {
  padding: var(--space-6);
  text-align: center;
}

.boot {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--space-6);
}

/* 3. Marca
   ========================================================================== */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--navy-900);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.8px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--red-600);
  color: var(--white);
  font-size: 20px;
}

.brand__name b {
  font-weight: 400;
}

.brand--light {
  color: var(--white);
}

/* 4. Shell (menu lateral + barra superior)
   ========================================================================== */
.shell__main {
  min-width: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: min(300px, 86vw);
  padding: var(--space-5) var(--space-4);
  overflow-y: auto;
  background: var(--navy-900);
  color: var(--white);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .28s var(--ease), visibility 0s linear .28s;
}

.sidebar.is-open {
  transform: none;
  visibility: visible;
  transition: transform .28s var(--ease);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0b1f3680;
}

.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-inline: var(--space-2);
}

.sidebar__workspace {
  display: grid;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: #ffffff10;
}

.sidebar__workspace-name {
  font-size: var(--text-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sidebar__workspace-id {
  color: var(--navy-200);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.nav__group {
  margin: var(--space-3) var(--space-3) var(--space-2);
  color: var(--navy-200);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.nav__list {
  display: grid;
  gap: 2px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: #d5e0ec;
  font-size: 14px;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.nav__link:hover {
  background: #ffffff14;
  color: var(--white);
}

.nav__link[aria-current="page"] {
  background: var(--orange-100);
  color: var(--navy-900);
  font-weight: 600;
}

.nav__link:focus-visible {
  outline-color: var(--orange-300);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--topbar-height);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--white);
}

.topbar__crumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.topbar__crumb > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__workspace {
  display: none;
}

.topbar__sep {
  display: none;
}

#crumb-page {
  color: var(--navy-900);
  font-weight: 600;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.sync {
  display: none;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.sync--offline {
  color: var(--red-700);
}

.topbar__alerts {
  position: relative;
}

.dot-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--red-600);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
}

.profile {
  position: relative;
}

.profile__btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-1);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.profile__btn:hover,
.profile__btn[aria-expanded="true"] {
  border-color: var(--color-border);
  background: var(--gray-50);
}

.profile__text {
  display: none;
  text-align: left;
}

.profile__text b {
  display: block;
  font-size: var(--text-sm);
  line-height: 1.2;
}

.profile__text small {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: 700;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 35;
  display: grid;
  width: 240px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.menu__header {
  padding: var(--space-2) var(--space-3);
  color: var(--color-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 42px;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--navy-900);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--navy-50);
}

.menu__item--danger {
  color: var(--red-700);
}

.content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-10);
}

.content:focus {
  outline: none;
}

.content > * + * {
  margin-top: var(--space-5);
}

@media (min-width: 768px) {
  .topbar {
    padding-inline: var(--space-6);
  }

  .topbar__workspace,
  .topbar__sep,
  .sync {
    display: inline;
  }

  .profile__text {
    display: block;
  }

  .content {
    padding: var(--space-8) var(--space-6) var(--space-10);
  }
}

@media (min-width: 1024px) {
  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: auto;
    height: 100vh;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .sidebar__close,
  .topbar__menu,
  .sidebar-backdrop {
    display: none !important;
  }

  .content {
    padding-inline: var(--space-8);
  }
}

/* 5. Cabeçalho de página
   ========================================================================== */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.page-head__text {
  flex: 1 1 320px;
  min-width: 0;
}

.page-head__title {
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -.4px;
}

.page-head__desc {
  max-width: 64ch;
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: 14px;
}

.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.page-head__actions .btn {
  flex: 1 1 auto;
}

@media (min-width: 768px) {
  .page-head__title {
    font-size: var(--text-2xl);
  }

  .page-head__actions .btn {
    flex: 0 0 auto;
  }
}

/* 6. Botões e links
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), color var(--duration) var(--ease);
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--white);
}

.btn--primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  border-color: var(--gray-300);
  background: var(--white);
  color: var(--navy-900);
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--navy-700);
  background: var(--navy-50);
}

.btn--ghost {
  background: transparent;
  color: var(--navy-700);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--navy-50);
}

.btn--ghost-danger {
  background: transparent;
  color: var(--red-700);
}

.btn--ghost-danger:hover:not(:disabled) {
  background: var(--red-100);
}

.btn--danger {
  background: var(--red-700);
  color: var(--white);
}

.btn--danger:hover:not(:disabled) {
  background: #8f2827;
}

.btn--sm {
  min-height: 36px;
  padding: 6px var(--space-3);
  font-size: var(--text-sm);
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: .55;
}

/* Indicador de carregamento dentro do botão */
.btn.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy-900);
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.icon-btn:hover {
  border-color: var(--navy-700);
  background: var(--navy-50);
}

.icon-btn--light {
  border-color: #ffffff33;
  background: transparent;
  color: var(--white);
}

.icon-btn--light:hover {
  background: #ffffff14;
}

.link {
  color: var(--navy-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--red-700);
}

.button-row,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* 7. Cartões e indicadores
   ========================================================================== */
.card {
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.card__head:only-child {
  margin-bottom: 0;
}

.card__title {
  font-size: var(--text-lg);
  font-weight: 650;
}

.card__subtitle {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--color-text);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.stat__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.stat__label .icon {
  width: 18px;
  height: 18px;
}

.stat__value {
  color: var(--navy-900);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.stat__note {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.stat__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: var(--space-1);
  color: var(--red-700);
  font-size: var(--text-xs);
  font-weight: 600;
}

.stat__more .icon {
  width: 14px;
  height: 14px;
}

.stat--primary {
  border-color: var(--navy-900);
  background: var(--navy-900);
}

.stat--primary .stat__label,
.stat--primary .stat__note {
  color: var(--navy-200);
}

.stat--primary .stat__value {
  color: var(--white);
}

.stat--primary .stat__more {
  color: var(--orange-200);
}

.stat--warning {
  border-color: var(--orange-200);
  background: var(--orange-50);
}

.stat--interactive {
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.stat--interactive:hover {
  border-color: var(--navy-700);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.grid {
  display: grid;
  gap: var(--space-5);
}

.stack {
  display: grid;
  gap: var(--space-3);
}

.figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--navy-900);
  font-size: var(--text-xl);
  font-weight: 700;
}

.figure__note {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 400;
}

.details {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.details div {
  display: grid;
  gap: 2px;
}

.details dt {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.details dd {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.mini-stats div {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--orange-50);
}

.mini-stats dt {
  color: var(--gray-700);
  font-size: 11px;
  line-height: 1.3;
}

.mini-stats dd {
  margin-top: var(--space-1);
  color: var(--navy-900);
  font-size: var(--text-lg);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mini-stats dd.is-warning {
  color: var(--red-700);
}

.section-title {
  margin: var(--space-5) 0 var(--space-3);
  font-size: var(--text-md);
}

@media (min-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1024px) {
  .grid--split {
    grid-template-columns: 1.2fr 1fr;
  }

  .grid--cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 8. Tabelas: viram cartões quando o espaço disponível é menor que 720px
   ========================================================================== */
.table-wrap {
  container: tabela / inline-size;
}

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

.table thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.table tbody {
  display: grid;
  gap: var(--space-3);
}

.table__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--white);
}

.table td {
  display: grid;
  min-width: 0;
  gap: 2px;
  align-content: start;
  overflow-wrap: anywhere;
}

.table td::before {
  content: attr(data-label);
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.table td.table__primary {
  grid-column: 1 / -1;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}

.table td.table__primary::before,
.table td.table__actions::before {
  content: none;
}

.table td.table__actions {
  grid-column: 1 / -1;
}

.table td > .badge,
.table td > .btn {
  justify-self: start;
}

.table td small {
  display: block;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 400;
}

.table__row.is-clickable {
  cursor: pointer;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.table__row.is-clickable:hover {
  border-color: var(--navy-700);
  box-shadow: var(--shadow-md);
}

.table__row.is-clickable:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

@container tabela (min-width: 720px) {
  .table {
    border: 1px solid var(--color-border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .table thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

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

  .table__row {
    display: table-row;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .table th {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    background: var(--navy-50);
    color: var(--navy-900);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: .4px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .table td {
    display: table-cell;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
  }

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

  .table td.table__primary {
    padding-bottom: var(--space-3);
  }

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

  .table .is-right {
    text-align: right;
  }

  .table td.table__actions {
    text-align: right;
  }

  .table td.table__actions .row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .table__row:hover {
    background: var(--orange-50);
  }

  .table__row.is-clickable:hover {
    box-shadow: inset 3px 0 0 var(--red-600);
  }
}

.amount {
  font-weight: 600;
  white-space: nowrap;
}

.amount--in {
  color: var(--green-700);
}

.amount--out {
  color: var(--red-700);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.product-cell > span:last-child {
  min-width: 0;
}

.product-cell__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--orange-100);
  font-size: 20px;
}

.file-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.file-name .icon {
  color: var(--red-600);
}

/* 9. Formulários
   ========================================================================== */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field__label {
  padding: 0;
  color: var(--navy-900);
  font-size: var(--text-sm);
  font-weight: 600;
}

.field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.field__output {
  color: var(--red-700);
  font-weight: 700;
}

.field__hint {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.field__error {
  color: var(--red-700);
  font-size: var(--text-xs);
  font-weight: 600;
}

.field__error:empty {
  display: none;
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: var(--text-md);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.input:hover {
  border-color: var(--navy-200);
}

.input:focus {
  border-color: var(--navy-700);
  outline: none;
  box-shadow: 0 0 0 3px #1f4b7a33;
}

.input[aria-invalid="true"] {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px #c63b3b22;
}

.input:disabled {
  background: var(--gray-100);
}

.input--area {
  min-height: 110px;
  resize: vertical;
}

.input-group {
  display: flex;
}

.input-group .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group__btn {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  border: 1px solid var(--gray-300);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--gray-50);
  color: var(--navy-900);
}

.input-group__btn:hover {
  background: var(--navy-50);
}

.form-grid {
  display: grid;
  gap: var(--space-4);
}

.dialog__body > * + *,
.auth__form > * + * {
  margin-top: var(--space-4);
}

.form-error {
  color: var(--red-700);
  font-size: var(--text-sm);
  font-weight: 600;
}

.form-error:empty {
  display: none;
}

.form-alert {
  display: none;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.form-alert.is-visible {
  display: flex;
}

.form-alert .icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.form-alert--danger {
  background: var(--red-100);
  color: var(--red-700);
}

.form-alert--warning {
  background: var(--orange-100);
  color: var(--orange-700);
}

.form-alert--success {
  background: var(--green-100);
  color: var(--green-700);
}

.auth__card > .form-alert {
  margin-bottom: var(--space-4);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  cursor: pointer;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--red-600);
}

.choice-group {
  display: grid;
  gap: var(--space-2);
}

.choice {
  position: relative;
  cursor: pointer;
}

.choice__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__box {
  display: grid;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.choice__box small {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.choice:hover .choice__box {
  border-color: var(--navy-700);
}

.choice__input:checked + .choice__box {
  border-color: var(--navy-900);
  background: var(--navy-50);
  box-shadow: inset 0 0 0 1px var(--navy-900);
}

.choice__input:focus-visible + .choice__box {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.range {
  width: 100%;
  accent-color: var(--red-600);
}

@media (min-width: 560px) {
  .form-grid,
  .choice-group {
    grid-template-columns: 1fr 1fr;
  }
}

/* 10. Listas, chips e barra de filtros
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge--success { background: var(--green-100); color: var(--green-700); }
.badge--warning { background: var(--orange-100); color: var(--orange-700); }
.badge--danger { background: var(--red-100); color: var(--red-700); }
.badge--neutral { background: var(--gray-100); color: var(--gray-700); }
.badge--info { background: var(--navy-100); color: var(--navy-800); }

.item-list {
  display: grid;
}

.item-list > li + li {
  border-top: 1px solid var(--color-border);
}

.item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 56px;
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  transition: background-color var(--duration) var(--ease);
}

.item:hover {
  background: var(--orange-50);
}

.item__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  font-size: 18px;
}

.item__icon--warning {
  background: var(--orange-100);
  color: var(--orange-700);
}

.item__body {
  display: grid;
  flex: 1;
  min-width: 0;
}

.item__title {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.item__meta {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.item__chevron {
  width: 16px;
  height: 16px;
  color: var(--color-muted);
}

.setting,
.person,
.campaign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  font-size: 14px;
}

.setting > span:first-child,
.campaign {
  display: grid;
  min-width: 0;
}

.setting small,
.campaign small,
.person small {
  display: block;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.person {
  flex-wrap: nowrap;
}

.person__info {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toolbar {
  display: grid;
  gap: var(--space-2);
}

.toolbar__search {
  position: relative;
}

.toolbar__search > .icon {
  position: absolute;
  top: 50%;
  left: var(--space-3);
  color: var(--color-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.toolbar__search .input {
  padding-left: 40px;
}

.drawer__body .toolbar__search {
  margin-bottom: var(--space-3);
}

.toolbar--filters {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.toolbar--filters .btn {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .toolbar {
    grid-template-columns: 1fr 220px 200px;
  }

  #catalog-search {
    min-width: 0;
  }

  .toolbar:has(#catalog-search) {
    grid-template-columns: 1fr 240px;
  }

  .toolbar--filters {
    grid-template-columns: 200px 200px auto;
    justify-content: start;
  }

  .toolbar--filters .btn {
    grid-column: auto;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.drawer__body .chips {
  margin-bottom: var(--space-3);
}

.chip {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--navy-900);
  font-size: var(--text-sm);
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.chip:hover {
  border-color: var(--navy-700);
}

.chip.is-active {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: var(--white);
}

.steps {
  display: grid;
  gap: var(--space-4);
  counter-reset: step;
}

.steps__item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 2px var(--space-3);
  font-size: 14px;
  counter-increment: step;
}

.steps__item::before {
  content: counter(step);
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange-100);
  color: var(--orange-700);
  font-weight: 700;
}

.steps__item span {
  color: var(--color-muted);
}

/* 11. Modal e painel lateral
   ========================================================================== */
.dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop,
.drawer::backdrop {
  background: #0b1f368c;
}

.dialog[open] {
  animation: rise .22s var(--ease);
}

.dialog__head,
.dialog__foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}

.dialog__head {
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

.dialog__title {
  font-size: var(--text-lg);
}

.dialog__body {
  padding: var(--space-5);
}

.dialog__text {
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.6;
}

.dialog__foot {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
  background: var(--white);
}

@media (max-width: 559px) {
  .dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .dialog__foot .btn {
    flex: 1;
  }
}

.drawer {
  width: min(480px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--white);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
}

.drawer[open] {
  animation: slide-in .26s var(--ease);
}

.drawer__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--navy-900);
}

.drawer__title {
  color: var(--white);
  font-size: var(--text-lg);
}

.drawer__subtitle {
  margin-top: 2px;
  color: var(--navy-200);
  font-size: var(--text-sm);
}

.drawer__head .icon-btn {
  border-color: #ffffff33;
  background: transparent;
  color: var(--white);
}

.drawer__head .icon-btn:hover {
  background: #ffffff14;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.drawer__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
}

.progress {
  overflow: hidden;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
}

.progress__bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--navy-700);
  transition: width .2s linear;
}

/* 12. Avisos e estados
   ========================================================================== */
.toast {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  z-index: 200;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--navy-900);
  color: var(--white);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast--danger { background: var(--red-700); }
.toast--warning { background: var(--orange-700); }

@media (min-width: 768px) {
  .toast {
    left: auto;
    max-width: 420px;
  }
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.notice .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.notice--info {
  background: var(--orange-50);
  border: 1px solid var(--orange-200);
  color: var(--gray-700);
}

.notice--warning {
  background: var(--orange-100);
  color: var(--orange-700);
}

.state {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.state__icon {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--orange-100);
  color: var(--orange-700);
}

.state__title {
  color: var(--navy-900);
  font-size: var(--text-md);
  font-weight: 650;
}

h1.state__title {
  font-size: var(--text-xl);
}

.state__text {
  max-width: 46ch;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Estado vazio com mascote flutuando (componente reutilizável) */
.state--mascot {
  gap: var(--space-3);
  padding-block: var(--space-10);
}

.state__mascot {
  width: auto;
  height: 112px;
  margin-bottom: var(--space-2);
  animation: float 3.4s ease-in-out infinite;
  filter: drop-shadow(0 10px 8px rgba(15, 42, 71, .12));
}

.state--mascot .state__title {
  font-size: var(--text-lg);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.state--error .state__icon,
.state--denied .state__icon {
  background: var(--red-100);
  color: var(--red-700);
}

.state--denied {
  margin-top: var(--space-10);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--navy-100);
  border-top-color: var(--navy-900);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* 13. Autenticação
   ========================================================================== */
.auth {
  display: grid;
  min-height: 100vh;
}

.auth__aside {
  display: grid;
  gap: var(--space-5);
  align-content: start;
  padding: var(--space-5) var(--space-4);
  background: var(--navy-900);
  color: var(--white);
}

.auth__aside .brand {
  color: var(--white);
}

.auth__pitch {
  display: none;
}

.auth__kicker {
  color: var(--orange-200);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.auth__headline {
  margin-top: var(--space-3);
  font-size: 32px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.8px;
  text-wrap: balance;
}

.auth__list {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
  color: #d5e0ec;
}

.auth__list li {
  display: flex;
  gap: var(--space-2);
}

.auth__list .icon {
  color: var(--orange-300);
}

.auth__foot {
  display: none;
  color: var(--navy-200);
  font-size: var(--text-xs);
}

.auth__main {
  display: grid;
  place-items: start center;
  padding: var(--space-6) var(--space-4) var(--space-10);
}

.auth__card {
  width: 100%;
  max-width: 440px;
}

.auth__title {
  font-size: var(--text-2xl);
  font-weight: 650;
  letter-spacing: -.5px;
}

.auth__intro {
  margin: var(--space-1) 0 var(--space-6);
  color: var(--color-muted);
}

.auth__row {
  display: flex;
  justify-content: flex-end;
}

.auth__switch {
  margin-top: var(--space-6);
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
}

/* Mascote apoiado no topo do formulário de login */
.auth__main {
  background: var(--white);
}

.auth__card--mascot {
  position: relative;
  padding-top: 64px;
}

.auth__mascot {
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 84px;
  pointer-events: none;
  transform-origin: 50% 100%;
}

.auth__mascot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transition: opacity .3s ease, transform .3s ease;
}

.auth__mascot-img--hello {
  animation: mascot-wave 3.2s ease-in-out infinite;
}

.auth__mascot-img--watch {
  opacity: 0;
  transform: translateY(4px);
}

/* Campo de senha em foco: o mascote fica pensativo, "prestando atenção" */
.auth__card--mascot:has(input[name="password"]:focus) .auth__mascot-img--hello {
  opacity: 0;
  animation: none;
}

.auth__card--mascot:has(input[name="password"]:focus) .auth__mascot-img--watch {
  opacity: 1;
  transform: none;
  animation: mascot-attentive 1.6s ease-in-out infinite;
}

@keyframes mascot-wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-4deg) translateY(-3px); }
}

@keyframes mascot-attentive {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

@media (min-width: 1024px) {
  .auth {
    grid-template-columns: minmax(380px, 5fr) 7fr;
  }

  .auth__aside {
    position: sticky;
    top: 0;
    height: 100vh;
    grid-template-rows: auto 1fr auto;
    padding: var(--space-10) 56px;
  }

  .auth__pitch {
    display: block;
    align-self: center;
  }

  .auth__foot {
    display: block;
  }

  .auth__main {
    place-items: center;
    padding: var(--space-10);
  }
}

/* 14. Módulos
   ========================================================================== */

/* Gráfico de caixa */
.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  height: 160px;
  margin-top: var(--space-4);
}

.chart__group {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--space-1);
  min-width: 0;
}

.chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--color-border);
}

.chart__bar {
  width: 40%;
  max-width: 14px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
}

.chart__bar--in { background: var(--navy-700); }
.chart__bar--out { background: var(--orange-300); }

.chart__label {
  color: var(--color-muted);
  font-size: 11px;
  text-align: center;
}

.legend {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-3);
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.legend__item::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
}

.legend__item--in::before { background: var(--navy-700); }
.legend__item--out::before { background: var(--orange-300); }

/* Marketplace */
.highlight {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--orange-100);
}

.highlight__tag {
  color: var(--orange-700);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.highlight__title {
  margin-top: var(--space-1);
  color: var(--navy-900);
  font-size: var(--text-lg);
  font-weight: 650;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.product:hover {
  border-color: var(--navy-200);
  box-shadow: var(--shadow-md);
}

.product__art {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--orange-50);
  font-size: 34px;
}

.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.product__supplier,
.product__region {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.product__name {
  font-size: var(--text-md);
}

.product__price {
  margin: var(--space-2) 0 var(--space-3);
  color: var(--navy-900);
  font-size: var(--text-lg);
  font-weight: 700;
}

.product__price small {
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 400;
}

.product__body .btn {
  margin-top: auto;
}

@media (min-width: 560px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1440px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Carrinho */
.cart {
  display: grid;
}

.cart__item {
  display: grid;
  grid-template-columns: 1fr 88px auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.cart__info {
  grid-column: 1 / -1;
  display: grid;
}

.cart__info small {
  color: var(--color-muted);
}

.cart__total {
  text-align: right;
}

.cart__sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block: var(--space-4);
}

.cart__sum strong {
  color: var(--navy-900);
  font-size: var(--text-xl);
}

@media (min-width: 560px) {
  .cart__item {
    grid-template-columns: 1fr 88px 110px auto;
  }

  .cart__info {
    grid-column: auto;
  }
}

/* Pedidos */
.order {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.order__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.order__title {
  font-size: var(--text-md);
}

.order__meta {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.order__side {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.order__total {
  color: var(--navy-900);
  font-size: var(--text-lg);
}

.order__items {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font-size: var(--text-sm);
}

.order__items li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.order__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.order__review {
  color: var(--orange-700);
  font-size: var(--text-sm);
}

.quote {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}

.quote__supplier {
  font-weight: 600;
}

.quote__supplier small {
  color: var(--color-muted);
  font-weight: 400;
}

.quote__text {
  color: var(--gray-700);
  font-size: 14px;
}

.quote__response {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  font-size: 14px;
}

.quote .btn,
.quote .badge {
  justify-self: start;
}

/* Reposição */
.suggestion {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.suggestion__qty {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--orange-100);
  color: var(--navy-900);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
}

.suggestion__qty small {
  font-size: 11px;
  font-weight: 400;
}

.suggestion__body {
  min-width: 0;
}

.suggestion__name {
  font-size: var(--text-md);
}

.suggestion__total {
  grid-column: 1 / -1;
  color: var(--navy-900);
  font-size: var(--text-lg);
}

@media (min-width: 768px) {
  .suggestion {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .suggestion__total {
    grid-column: auto;
  }
}

/* Regularização */
.license {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.license__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.license__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--navy-50);
  color: var(--navy-900);
}

.license__name {
  margin-top: var(--space-2);
  font-size: var(--text-lg);
}

.license__meta,
.license__file {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.license__file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-wrap: anywhere;
}

.license .button-row {
  margin-top: var(--space-2);
}

/* Documentos */
.dropzone {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  text-align: center;
  transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.dropzone.is-dragging {
  border-color: var(--red-600);
  background: var(--orange-50);
}

.dropzone__icon {
  width: 32px;
  height: 32px;
  color: var(--navy-700);
}

.dropzone__text {
  color: var(--gray-700);
  font-size: 14px;
}

.upload-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.upload-list:empty {
  display: none;
}

.upload-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.upload-item__icon {
  margin-top: 2px;
  color: var(--red-600);
}

.upload-item__info {
  display: grid;
  flex: 1;
  gap: var(--space-1);
  min-width: 0;
}

.upload-item__name {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.upload-item__meta {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.upload-item__error {
  color: var(--red-700);
  font-size: var(--text-xs);
  font-weight: 600;
}

.upload-item--error {
  border-color: var(--red-100);
  background: #fdf3f2;
}

.upload-item--done {
  border-color: var(--green-100);
  background: #f4fbf7;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.print-only {
  display: none;
}

/* 15. Impressão e movimento reduzido
   ========================================================================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}

@keyframes slide-in {
  from { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .page-head__actions,
  .toolbar--filters,
  .card__actions,
  .skip-link,
  .toast {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .card,
  .stat {
    box-shadow: none;
    break-inside: avoid;
  }
}
