/* ============================================================
   GLOBAL RESET & IMPORTS
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Red+Hat+Display:ital,wght@0,300..900;1,300..900&family=Red+Hat+Text:ital,wght@0,300..700;1,300..700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Red Hat Text", sans-serif;
  font-style: normal;
  font-optical-sizing: auto;
}

/* ============================================================
   COLOR VARIABLES & UTILITIES
   ============================================================ */
:root {
  /* Cores principais */
  --color-primary: #131923;
  --color-accent: #d2395b;
  --color-accent-dark: #a92f4b;
  --color-hover-bg: #181a20;
  --color-active-bg: #27222d;
  --color-active-text: #d2395b;
  --color-text: #374151;
  --color-text-white: #ffffff;

  /* Bordas e tonalidades neutras */
  --color-border: #a9a9af;
  --border-color: #d1d5db;
  --border-gray: #d1d5db;

  /* Fundos e sombras */
  --bg-white: #ffffff;
  --bg-input: #f4f4f6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

  /* Espaçamentos e dimensões gerais */
  --gap: 1rem;
  --gap-xs: 0.5rem;
  --pane-padding: 2rem;

  /* “Pills” e botões */
  --pill-height: 49px;
  --pill-radius: 0.375rem;
  --bg-pill-default: #ffffff;
  --bg-pill-active: var(--color-accent);
  --text-default: #000000;
  --text-active: #ffffff;
  --btn-size: 49px;
  --btn-radius: 0.375rem;
  --color-btn-text: #fff;

  /* Cards de produto */
  --card-max-w: 240px;
  --card-max-w-lg: 250px;
  --card-img-size: 150px;

  /* Escala de cinzas */
  --color-gray-200: #e5e7eb;
  --color-gray-500: #6b7280;
  --color-gray-900: #111827;

  /* Estoque fora/dentro */
  --bg-out: #fee2e2;
  --bg-in-stock: #ffffff;
  --hover-in-stock: #f9fafb;
  --bg-out-stock: #fef2f2;
  --text-in-stock: #1f2937;
  --text-out-stock: #9ca3af;

  /* Transições */
  --transition: 0.2s ease-in-out;

  /* Alertas (toasts) */
  --alert-success-border: #10b981;
  --alert-success-text: #065f46;
  --alert-warning-border: #fbbf24;
  --alert-warning-text: #92400e;
  --alert-error-border: #ef4444;
  --alert-error-text: #7f1d1d;
}

/* ============================================================
   SUPPLIES SCREEN
   ============================================================ */

/* Tela Principal */
.supplies-screen {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--bg-input);
}

.supplies-screen__wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ============================================================
   SIDEBAR / DRAWER
   ============================================================ */
.sidebar__container {
  width: 100%;
  flex-shrink: 0;
}

.sidebar__bg-primary {
  background: var(--color-primary);
}
.sidebar__bg-accent {
  background: var(--color-accent);
}
.sidebar__text-white {
  color: var(--color-text-white);
}

/* OVERLAY (mobile < lg) */
.sidebar__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
  display: none;
}
.sidebar__overlay--visible {
  display: block;
}

/* SIDEBAR / DRAWER */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 16rem;
  height: 100vh;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition);
  z-index: 40;
}
.sidebar--open {
  transform: translateX(0);
}

/* TOPBAR (mobile) */
.sidebar__mobile-topbar {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
}
.sidebar__mobile-menu-button {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  border: none;
  border-radius: 0.45rem;
  cursor: pointer;
  z-index: 2;
}
.sidebar__mobile-menu-icon {
  width: 1.8rem;
  height: 1.8rem;
}

/* Logo móvel */
#sidebar__mobile-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 2.5rem;
  object-fit: contain;
}

/* Topbar extended */
.sidebar__topbar.sidebar__extended {
  display: none;
}

/* DRAWER HEADER */
.sidebar__header {
  background: var(--color-primary);
  display: flex;
  justify-content: flex-start;
  position: relative;
}
.sidebar__close {
  padding: 0 0.5rem;
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-accent);
  cursor: pointer;
}

/* USER SECTION */
.sidebar__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-accent);
  display: flex;
  align-self: flex-start;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar__user-section,
.sidebar__user-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
}
.sidebar__user-details,
.sidebar__user-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--color-text-white);
  text-align: right;
}
.sidebar__user-info {
  align-items: flex-start;
  gap: 0.25rem;
}

.sidebar__user-name {
  text-align: start;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}
.sidebar__user-role {
  font-size: 0.9rem;
  color: var(--color-border);
  margin: 0;
}
.sidebar__checkout {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.sidebar__checkout span {
  font-size: 0.875rem;
  color: var(--color-text-white);
}
.sidebar__checkout-icon {
  width: 1rem;
  height: 1rem;
}

/* NAV ITEMS */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}
.sidebar__nav a {
  text-decoration: none;
}
.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  color: var(--color-border);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar__nav-item:hover {
  background: var(--color-hover-bg);
  color: var(--color-text-white);
}
.sidebar__nav-item--active {
  background: var(--color-active-bg);
  color: var(--color-active-text);
  font-weight: bold;
}
.sidebar__nav-item--active .sidebar__icon {
  filter: brightness(1.3) saturate(1.5);
}
.sidebar__icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* CONTEÚDO PRINCIPAL */
.supplies-screen__main-content {
  flex: 1 1 0%;
  width: 100%;
  min-width: 0;
  overflow: auto;
}

/* ==============================
   MEDIA QUERIES SIDEBAR / DRAWER
   ============================== */

/* ≥ 480px */
@media (min-width: 480px) {
  #sidebar__mobile-logo {
    height: 2.75rem;
  }
  .sidebar__mobile-menu-button {
    width: 3rem;
    height: 3rem;
  }
  .sidebar__mobile-menu-icon {
    width: 2rem;
    height: 2rem;
  }
}

/* ≤ 767.98px */
@media (max-width: 767.98px) {
  #sidebar__mobile-logo {
    transform: translateX(-50%) !important;
  }
  .sidebar__header--hide-mobile {
    display: none !important;
  }
}

/* 768px ≤ width ≤ 1023.98px */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .sidebar__mobile-topbar {
    display: none;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar--open {
    transform: translateX(0);
  }
  .sidebar__overlay {
    display: none;
  }
  .sidebar__overlay--visible {
    display: block;
  }
  .sidebar__header--hide-tablet {
    display: none !important;
  }
  .sidebar__nav {
    border: none;
  }
  .sidebar__topbar.sidebar__extended {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    width: 100%;
    height: 5rem;
    background: var(--color-primary);
    position: relative;
  }
  .sidebar__btn-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    border: none;
    border-radius: 0.45rem;
    cursor: pointer;
  }
  .sidebar__btn-menu img {
    width: 3rem;
    height: 3rem;
  }
  .sidebar__user-info {
    gap: 0.25rem;
  }
  .sidebar__checkout_tablet {
    display: flex;
    align-self: flex-end;
  }
}

/* ≥ 1024px */
@media (min-width: 1024px) {
  .supplies-screen__wrapper {
    flex-direction: row;
  }
  .sidebar__container {
    width: 16rem;
  }

  .sidebar__mobile-topbar,
  .sidebar__topbar.sidebar__extended,
  .sidebar__overlay {
    display: none !important;
  }
  .sidebar {
    position: static;
    transform: translateX(0);
    display: flex;
  }
  .sidebar__header--mobile {
    display: none;
  }
  .sidebar__header--desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
  }
  .sidebar__nav-item {
    text-decoration: none;
  }
}

/* ==============================
   HEADER 
   ============================== */

.header__container {
  position: relative;
  z-index: 10;
  width: 100%;
  background: var(--bg-white);
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem;
}

.header__container p {
  margin: 0;
}

.header__text {
  white-space: nowrap;
  font-size: 0.875rem;
  width: 8ch;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.calendar-icon,
.clock-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  color: var(--color-accent);
}

.header__mobile {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.header__logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 158px;
  height: 54px;
  border: 1px solid var(--border-color);
  border-radius: var(--pill-radius);
  flex-shrink: 0;
  overflow: hidden;
}
.header__logo-box img {
  display: block;
  object-fit: contain;
  object-position: center;
}

.header__datetime {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.header__date,
.header__time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header__address {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.header__address-line {
  font-size: 0.875rem;
  color: var(--color-text);
}
.header__address-line--bold {
  font-weight: 600;
}

.header__desktop {
  display: none;
}

/* ==============================
   MEDIA QUERIES HEADER
   ============================== */

/* Tablet+ */
@media (min-width: 768px) {
  .header {
    padding: 1rem 2rem;
  }

  .header__mobile,
  .header__address {
    display: none;
  }

  .header__desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
  }

  .header__left,
  .header__middle,
  .header__right {
    display: flex;
    align-items: center;
    gap: var(--gap);
  }

  .header__right {
    position: absolute;
    right: 1rem;
  }

  .header__separator {
    width: 1px;
    height: 1.5rem;
    background: var(--border-color);
  }

  .header__address-group {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
  }

  .header__button {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .header__middle {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
  }

  .header__separator {
    display: none;
  }

  .header__button {
    display: flex; /* Já está como flex, o que é ótimo! */
    align-items: center;
    height: 54px;
    background: var(--color-accent);
    border-radius: var(--pill-radius);
    cursor: pointer;
  }

  .header__btn-text {
    /* Remover 'flex: 0 0 120px;' */
    /* Em vez de largura fixa, vamos deixar o texto crescer e encolher */
    flex: 1; /* Permite que o texto ocupe o espaço restante */
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-text-white);
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header__btn-icon {
    flex: 0 0 60px; /* Mantemos a largura fixa para o ícone */
    height: 54px;
    background: var(--color-accent-dark);
    border-radius: var(--pill-radius);
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* XL / Desktop */
@media (min-width: 1280px) {
  .header__right {
    display: flex;
  }

  .header__button {
    display: flex;
    align-items: center;
    width: 226px;
    height: 54px;
    background: var(--color-accent);
    border-radius: var(--pill-radius);
    cursor: pointer;
  }

  .header__btn-text {
    flex: 0 0 162px;
    height: 54px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-text-white);
    padding: 0 0.5rem;
  }

  .header__btn-icon {
    flex: 0 0 64px;
    height: 54px;
    background: var(--color-accent-dark);
    border-radius: var(--pill-radius);
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ==============================
   SEARCH BAR
   ============================== */

.search-bar {
  z-index: 10;
  width: 100%;
  background: var(--bg-white);
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem;
}

.search-bar__container {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.search-bar__title {
  font-weight: 600;
  font-size: 1.5rem;
  display: flex;
  justify-content: space-between;
}

.search-bar__form {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  width: 100%;
}

.search-bar__input {
  flex: 1;
  height: 52px;
  padding: 0 1rem;
  border: 1px solid var(--border-gray);
  border-radius: var(--btn-radius);
  background: var(--bg-input);
  font-size: 1rem;
}

.search-bar__button {
  height: 52px;
  padding: 0 1rem;
  background: var(--color-accent);
  border: none;
  border-radius: var(--btn-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-xs);
  cursor: pointer;
}

.search-icon {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
}

.search-bar__label {
  display: none;
  font-weight: bold;
  color: var(--color-text-white);
  font-size: 1rem;
}

/* ==============================
   MEDIA QUERIES SEARCH BAR
   ============================== */

/* Estilos existentes para telas até 1023.98px */
@media (max-width: 1023.98px) {
  .search__button {
    display: flex;
    align-items: center;
    height: 40px;
    background: var(--color-accent);
    border-radius: var(--pill-radius);
    cursor: pointer;
  }

  .search__btn-text {
    flex: 1;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-text-white);
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Por padrão, esconda o texto curto e mostre o texto completo */
  .text-full {
    display: inline; /* ou block, dependendo do layout desejado */
  }
  .text-short {
    display: none;
  }

  .search__btn-icon {
    flex: 0 0 40px;
    height: 40px;
    background: var(--color-accent-dark);
    border-radius: var(--pill-radius);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- */
  /* Media Query para telas menores que 375px */
  @media (max-width: 374.99px) {
    /* Usamos 374.99px para garantir que seja menor que 375px */
    .text-full {
      display: none; /* Esconde o texto completo */
    }

    .text-short {
      display: inline; /* Mostra o texto curto */
    }
  }
}
/* Tablet and up */
@media (min-width: 768px) {
  .search-bar {
    padding: 1rem 2rem;
  }
  .search-bar__label {
    display: block;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  .search-bar__container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .search-bar__label {
    display: inline-block;
  }
  .text-full {
    display: none; /* Esconde o texto completo */
  }

  .text-short {
    display: none; /* Mostra o texto curto */
  }
}

/* ==============================
  CategorySelector
  ============================== */
.category-selector {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}
.category-selector__title {
  font-size: 0.875rem;
  font-weight: 500;
}
.category-selector__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/*=============================
  Date Fields as Pills
==============================*/

.date-fields {
  display: flex;
  gap: 0.5rem;
}

.date-fields input[type="date"] {
  /* Mesmas medidas e espaçamentos das pills */
  height: var(--pill-height);
  padding: 0 0.8rem;
  border-radius: var(--pill-radius);

  /* Fonte e alinhamento internos */
  font-weight: 500;
  font-family: inherit;
  line-height: var(--pill-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Cores e borda iguais às pills padrão */
  background: var(--bg-pill-default);
  color: var(--text-default);
  border: 1px solid var(--color-border);

  /* Transições idênticas */
  transition: transform var(--transition), background var(--transition),
    color var(--transition), border-color var(--transition);

  /* Cursor */
  cursor: pointer;
  user-select: none;
}

/* Remove o outline padrão e centraliza o ícone de calendário */
.date-fields input[type="date"]::-webkit-inner-spin-button,
.date-fields input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

/* Hover: “crescer” um pouco igual à pill */
.date-fields input[type="date"]:hover {
  transform: scale(1.05);
}

/* Focus: estiliza como .pill--active */
.date-fields input[type="date"]:focus {
  outline: none;
  background: var(--bg-pill-active);
  color: var(--text-active);
  border-color: transparent;
}

/* Se quiser marcar manualmente um campo como “ativo” */
.date-fields input[type="date"].active {
  background: var(--bg-pill-active);
  color: var(--text-active);
  border-color: transparent;
}

.pill {
  height: var(--pill-height);
  padding: 0 0.8rem;
  border-radius: var(--pill-radius);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition), background var(--transition);
  border: 1px solid var(--color-border);
  background: var(--bg-pill-default);
  color: var(--text-default);
}
.pill:hover {
  transform: scale(1.05);
}
.pill--active {
  background: var(--bg-pill-active);
  color: var(--text-active);
  border-color: transparent;
}
.pill--active:hover {
  filter: brightness(1.1);
  transform: none;
}

/* Container de Hoje / Período */
#cats-list {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* mesmo espaçamento usado em .date-fields */
  flex-wrap: wrap; /* permite quebrar linha em telas pequenas */
}

/* =============================
   Tablets e pequenos desktops
   Até 640px
   ============================= */
@media (max-width: 640px) {
  #cats-list {
    flex-wrap: wrap; /* quebra em várias linhas */
    justify-content: center;
  }
  /* pills ocupam até 45% cada uma */
  #cats-list .pill {
    flex: 1 1 45%;
    min-width: 120px;
    text-align: center;
  }
  /* container de datas em linha cheia */
  #cats-list .date-fields {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
  }
  /* inputs de data ocupam até 45% cada */
  #cats-list .date-fields input[type="date"] {
    flex: 1 1 45%;
    min-width: 120px;
    text-align: center;
  }
}

/* =============================
   Smartphones (retrato)
   Até 480px
   ============================= */
@media (max-width: 480px) {
  #cats-list {
    flex-wrap: wrap;
    justify-content: center;
  }
  /* pills e date-fields com ~48% cada para caber duas colunas */
  #cats-list .pill,
  #cats-list .date-fields input[type="date"] {
    flex: 1 1 48%;
    min-width: 100px;
    text-align: center;
  }
}

@media (max-width: 420px) {
  #cats-list {
    max-width: 90%;
    flex-wrap: wrap; /* garante múltiplas linhas */
    gap: 0.25rem; /* menor espaçamento */
  }
  #cats-list .pill,
  #cats-list .date-fields input[type="date"] {
    flex: 1 1 100%; /* full width para não sair da tela */
    min-width: 0; /* permite encolher abaixo do tamanho padrão */
    font-size: 0.875rem; /* opcional: texto um pouco menor */
  }
}

@media (max-width: 350px) {
  #cats-list {
    max-width: 80%; /* mais espaço para pills */
    flex-wrap: wrap; /* garante múltiplas linhas */
    gap: 0.25rem; /* menor espaçamento */
  }
  #cats-list .pill,
  #cats-list .date-fields input[type="date"] {
    flex: 1 1 100%; /* full width para não sair da tela */
    min-width: 0; /* permite encolher abaixo do tamanho padrão */
    font-size: 0.875rem; /* opcional: texto um pouco menor */
  }
}

@media (min-width: 1024px) {
  #cats-list .date-fields input[type="date"] {
    flex: 1 1 100%; /* full width para não sair da tela */
    max-width: 168px; /* permite encolher abaixo do tamanho padrão */
    font-size: 0.875rem; /* opcional: texto um pouco menor */
  }
}

/* ==============================
INVENTÁRIO + BOTÃO & PANES 
   ============================== */

/* Inventário */
.inventory-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.inventory-container__label {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-text);
}
.inventory-container__button {
  width: var(--pill-height);
  height: var(--pill-height);
  background: var(--color-accent);
  border: none;
  border-radius: var(--pill-radius);
  color: var(--text-active);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

/* Panes */
.panes_container {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--pane-padding);
  width: 100%;
  min-height: 100vh;
}
.pane {
  width: 100%;
}
.pane__header {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-bottom: var(--gap-xs);
}

/* Categoria dentro de pane */
.pane__cats_container {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--gap-xs);
}
.pane__cats_container h2 {
  margin: 0;
}
.pane__cats {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  gap: 0.625rem;
}

/* Ação */
.pane__action {
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
}
.pane__label {
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--color-text);
}
.pane__cats_list {
  margin-top: 1.75rem;
}
.btn-supplies {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-size);
  height: var(--btn-size);
  background: var(--color-accent);
  border: none;
  border-radius: var(--btn-radius);
  color: var(--color-btn-text);
  font-size: 1.25rem;
  cursor: pointer;
}
.pane__cats.cats--end {
  justify-content: flex-end;
}

/* Show/hide helpers */
.hidden {
  display: none !important;
}
.block {
  display: block !important;
}

/* ==============================
   MEDIA QUERIES INVENTÁRIO + BOTÃO & PANES 
   ============================== */

/* Até 639px */
@media (max-width: 639px) {
  .pane__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .category-selector__title {
    display: none;
  }
  .pane__cats_list {
    margin-top: 0;
  }
  .pane__cats_container {
    gap: 0.5rem;
  }
}

/* 640px até 1023.98px */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .pane__header {
    flex-direction: row;
    align-items: flex-end;
  }
  .pane__cats_container {
    flex-direction: column;
    gap: 0.5rem;
  }
  .hrd-list-title {
    display: none;
  }
}

/* ≥ 1024px */
@media (min-width: 1024px) {
  .panes_container {
    flex-direction: row;
    justify-content: space-between;
  }
  .pane {
    width: 48%;
    display: block !important;
  }
  .pane__cats_list {
    margin: 0;
  }
  .pane__action {
    display: none;
  }
  .category-selector__title {
    display: block;
    color: var(--color-text);
  }
}

/* ==============================
   INVENTORY SCREEN & PRODUCT CARD
   ============================== */

/* Container do grid */
.product-grid__container {
  margin-top: var(--gap);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  justify-items: center;
  gap: var(--gap);
  padding: var(--gap);
}

/* Card */
.product-card {
  width: 100%;
  max-width: var(--card-max-w);
  border-radius: var(--pill-radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: var(--gap);
  background: var(--bg-white);
  transition: background var(--transition);
}
.product-card.out-of-stock {
  background: var(--bg-out);
}

/* Imagem */
.product-card__img-container {
  width: var(--card-img-size);
  height: var(--card-img-size);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card__img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity var(--transition);
}
.product-card.out-of-stock .product-card__img-container img {
  opacity: 0.5;
}

/* Texto */
.product-card__info {
  min-height: 4rem;
  margin-top: var(--gap);
}
.product-card__title {
  font-size: 1rem;
  font-weight: 700;
  height: 5rem;
  word-break: break-word;
  transition: color var(--transition);
  color: var(--color-gray-900);
}
.product-card.out-of-stock .product-card__title {
  color: var(--color-gray-500);
}
.product-card__subtitle {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  transition: color var(--transition);
  color: var(--color-gray-500);
}
.product-card.out-of-stock .product-card__subtitle {
  color: var(--color-gray-500);
}

/* Controles */
.product-card__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  gap: var(--gap);
  gap: 1rem;
  flex-shrink: 0;
}

.product-card__button-row {
  display: flex;
  width: 100%;
  justify-content: center;
}

.product-card__button-row .control-icon,
.product-card__button-row .product-card__request {
  width: 8rem;
}

.product-card.stock-empty .control-icon,
.product-card.stock-empty .product-card__quantity {
  display: none;
}

.control-icon {
  width: 8rem;
  padding: 0.5rem;
  background: var(--color-accent);
  color: var(--text-active);
  font-weight: 700;
  border: none;
  border-radius: var(--pill-radius);
  cursor: pointer;
  transition: transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  height: 2.5rem;
  margin-bottom: 1.2rem;
}
.control-icon:hover {
  transform: scale(1.05);
}
.product-card__quantity {
  font-size: 1.5rem;
  font-weight: 600;
}

.control-icon img {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.control-icon span {
  flex: 1;
  text-align: center;
  font-size: 0.875rem;
}

/* Botão solicitar */
.product-card__request {
  margin-top: 4rem;
  width: 8rem;
  padding: 0.5rem;
  background: var(--color-accent);
  color: var(--text-active);
  font-weight: 700;
  border: none;
  border-radius: var(--pill-radius);
  cursor: pointer;
  transition: transform var(--transition);
  height: 2.5rem;
}

.product-card__request:hover {
  transform: scale(1.05);
}

/* Indicadores */
.product-card__minmax {
  display: flex;
  width: 100%;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--color-gray-900);
}

.minmax-wrapper {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--color-gray-200);
  border-radius: 0.25rem;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-accent);
  width: 0;
  transition: width var(--transition);
}

/* ==============================
   MEDIA QUERIES
   ============================== */

/* ≥ 480px: 2 colunas */
@media (min-width: 550px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .product-card__controls {
    gap: 2rem;
  }
}

/* ≥ 640px: ícones maiores */
@media (min-width: 640px) {
  .product-card__controls {
    gap: 2rem;
  }
}

/* ≥ 768px: 3 colunas */
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .product-card__controls {
    gap: 2rem;
  }
}

/* ≥ 1024px: 4 colunas e cards maiores */
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .product-card__controls {
    gap: 2rem;
  }
}

/* ≥ 1280px: 5 colunas */
@media (min-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .product-card__controls {
    gap: 1rem;
  }
}

/* ==============================
   ALERT (toasts no topo)
   ============================== */

#alert-container {
  position: fixed;
  top: var(--gap-xs);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  width: auto;
}

.alert-supplies {
  position: relative;
  z-index: 1;
  width: 20rem;
  padding: var(--gap);
  background: var(--bg-white);
  color: var(--color-gray-900);
  font-size: 0.875rem;
  border-left-width: var(--gap-xs);
  border-left-style: solid;
  border-left-color: currentColor;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.alert--success {
  border-left-color: var(--alert-success-border);
  color: var(--alert-success-text);
}
.alert--warning {
  border-left-color: var(--alert-warning-border);
  color: var(--alert-warning-text);
}
.alert--error {
  border-left-color: var(--alert-error-border);
  color: var(--alert-error-text);
}

.alert__close {
  position: absolute;
  top: var(--gap-xs);
  right: var(--gap-xs);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
  padding: 0;
  transition: color var(--transition);
}
.alert__close:hover {
  color: var(--color-gray-500);
}

/* ==============================
   PRODUCT LIST & ITEMS
   ============================== */

.product-list__container {
  margin-top: 1.5rem;
}

.overflow-hidden {
  overflow: hidden;
}

.list-container {
  width: 100%;
}

.list-header {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: var(--gap-xs) 0 var(--gap-xs) 1rem;
  height: 2.4375rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--color-gray-900);
  color: var(--color-text-white);
  border-radius: var(--pill-radius);
  overflow: hidden;
}

.list-header .col-insumo {
  flex: 1;
  padding-left: var(--gap-xs);
}

.list-header .col-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7rem;
  text-align: center;
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  margin-top: var(--gap-xs);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0.75rem 1rem;
  border-radius: var(--pill-radius);
  transition: background var(--transition);
}

.list-item.in-stock {
  background: var(--bg-in-stock);
}
.list-item.in-stock:hover {
  background: var(--hover-in-stock);
}
.list-item.out-stock {
  background: var(--bg-out-stock);
}

.item-insumo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.item-insumo img {
  width: auto;
  height: 2rem;
  object-fit: contain;
  transition: opacity var(--transition);
}
.out-stock .item-insumo img {
  opacity: 0.5;
}

.item-text {
  display: flex;
  flex-direction: column;
}

.item-text .name {
  font-size: 0.875rem;
  font-weight: 700;
  transition: color var(--transition);
  color: var(--text-in-stock);
}
.out-stock .item-text .name {
  color: var(--text-out-stock);
}

.item-text .subtitle {
  font-size: 0.75rem;
  transition: color var(--transition);
  color: var(--text-in-stock);
}
.out-stock .item-text .subtitle {
  color: var(--text-out-stock);
}

.item-number {
  width: 6rem;
  text-align: center;
}

.item-number .num {
  font-size: 1.25rem;
  font-weight: 700;
  transition: color var(--transition);
  color: var(--text-in-stock);
}
.out-stock .item-number .num {
  color: #ef4444;
}

/* ==============================
   MEDIA QUERY PRODUCT LIST & ITEMS
   ============================== */

@media (max-width: 425px) {
  .list-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .list-header,
  .list-item {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    gap: 1rem;
  }

  .list-item.out-stock {
    background-color: var(--bg-out);
  }

  .list-header .col-insumo,
  .list-item .item-insumo {
    flex: 2;
    gap: var(--gap-xs);
  }

  .item-insumo img {
    width: 1.5rem;
    height: 1.5rem;
  }

  .list-header .col-center,
  .list-item .item-number {
    width: 3rem;
    font-size: 0.75rem;
  }

  .list-header .col-available,
  .list-item .item-number.available {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  .list-header {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .list-header .col-insumo {
    flex: 1;
    padding-left: 0.5rem;
  }

  .list-header .col-center {
    width: 4rem;
    text-align: center;
  }

  .list-item {
    padding: 0.75rem 1rem;
    gap: 2rem;
  }

  .item-insumo img {
    width: auto;
    height: 2rem;
  }

  .item-number {
    width: 4rem;
    text-align: center;
  }
}

/* ==============================
   MODAL DE AJUSTE
   ============================== */

.supplies-adjust-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.supplies-adjust-modal--hidden {
  display: none;
}

.supplies-adjust-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.supplies-adjust-modal__dialog {
  position: relative;
  background: var(--bg-white);
  border-radius: var(--pill-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  width: 90%;
  max-width: 24rem;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.supplies-adjust-modal__header h3 {
  margin: 0;
  padding-right: var(--gap-xs);
  font-size: 1.25rem;
  color: var(--color-primary);
}

.supplies-adjust-modal__body label {
  display: block;
  margin-bottom: var(--gap-xs);
  font-weight: 500;
}

.supplies-adjust-modal__body input {
  width: 100%;
  padding: var(--gap-xs);
  border: 1px solid var(--border-gray);
  border-radius: var(--pill-radius);
  font-size: 1rem;
}

.supplies-adjust-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--gap-xs);
}

/* Botão de fechar (X) */
.supplies-adjust-modal__close {
  position: absolute;
  top: var(--gap);
  right: var(--gap);
  background: none;
  border: none;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--text-default);
  cursor: pointer;
  transition: color var(--transition);
}
.supplies-adjust-modal__close:hover {
  color: var(--color-accent-dark);
}

/* Botões do modal */
.supplies-adjust-modal__footer .btn-modal {
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem;
  border-radius: var(--pill-radius);
  transition: background var(--transition), color var(--transition);
}

.btn--primary-modal {
  background: var(--color-accent);
  color: var(--color-text-white);
  border: none;
}
.btn--primary-modal:hover {
  background: var(--color-accent-dark);
}

.btn--secondary-modal {
  background: transparent;
  color: var(--text-default);
  border: 1px solid var(--border-gray);
}
.btn--secondary-modal:hover {
  background: var(--border-gray);
  color: var(--color-primary);
}

#supplies-request-modal .supplies-adjust-modal__body {
  /* limita em 60% da altura da viewport */
  max-height: 60vh;
  overflow-y: auto;
  /* opcional: remove padding pra tabela "encostar" */
  padding: 0;
}

/* se quiser que a própria tabela tenha scroll,
   mantenha o <tbody> como bloco: */
#supplies-request-modal tbody {
  display: block;
  max-height: 50vh;
  overflow-y: auto;
}
/* e faça o thead “fixed” para não rolar junto: */
#supplies-request-modal thead,
#supplies-request-modal tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* Individual positioning for each column */
#supplies-request-modal .list-header .col-insumo {
  /* Insumo */
  padding-left: 3rem;
}

#supplies-request-modal .list-header .col-center-modal:nth-child(2) {
  /* Mínimo */
  padding-left: 2.65rem;
}

#supplies-request-modal .list-header .col-center-modal:nth-child(3) {
  /* Máximo */
  padding-left: 0.1rem;
}

#supplies-request-modal .list-header .col-center-modal:nth-child(4) {
  /* Disponível */
  padding-left: 0rem;
  margin-left: -0.5rem;
}

.list-item .col-center-modal {
  width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quantidade Desejada column - red header - ALL STYLING IN ONE RULE */
#supplies-request-modal .list-header .col-center-modal.col-qty-desired {
  /* COLORS */
  background: #d2395b;
  color: #ffffff;
  font-weight: 700;

  /* SIZE */
  width: auto;
  min-width: 12rem;
  line-height: 1.2;

  /* SPACING */
  padding: 1.25rem 3rem 1.25rem 0.75rem;
  margin-top: -0.5rem;

  /* POSITIONING */
  align-self: stretch;
  display: flex;
  justify-content: center;
  align-items: center;

  /* ROUNDED CORNERS */
  border-top-right-radius: 1.25rem;
  border-bottom-right-radius: 1.25rem;
}

.list-item .col-qty-desired {
  width: 6rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quantity input styling - simple and clean */
.qty-input {
  width: 100%;
  max-width: 4rem;
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  background: #ffffff;
  color: #000000;
  -moz-appearance: textfield;
}

/* Remove spinner arrows */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input:focus {
  outline: none;
}

/* Remove bold from quantity columns */
.list-item .item-number .num {
  font-weight: 400;
}

/* === Ajustes para telas menores que 600px (ex.: phablets) === */
@media (max-width: 600px) {
  .supplies-adjust-modal__dialog {
    width: 95vw; /* ocupa quase toda a largura */
    max-width: none; /* tira o limite de 24rem */
    padding: 1rem; /* reduz o padding interno */
  }
  .supplies-adjust-modal__header h3 {
    font-size: 1rem; /* texto um pouco menor */
  }
  .supplies-adjust-modal__close {
    font-size: 1.75rem; /* ícone de fechar menor */
    top: 0.75rem;
    right: 0.75rem;
  }
  .supplies-adjust-modal__footer .btn-modal {
    font-size: 0.9rem; /* botões levemente menores */
    padding: 0.5rem 0.75rem;
  }
  .supplies-adjust-modal__body input {
    font-size: 0.95rem;
    padding: 0.4rem;
  }
}

/* === Ajustes para telas ainda menores que 400px (ex.: celulares muito estreitos) === */
@media (max-width: 400px) {
  .list-header .col-center-modal {
    width: 2rem;
    font-size: 0.7rem;
  }
  .supplies-adjust-modal__dialog {
    width: 98vw; /* ocupa quase 100% da tela */
    padding: 0.75rem; /* padding mínimo */
  }
  .supplies-adjust-modal__header h3 {
    font-size: 0.9rem;
  }
  .supplies-adjust-modal__close {
    font-size: 1.5rem;
    top: 0.5rem;
    right: 0.5rem;
  }
  .supplies-adjust-modal__footer .btn-modal {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  .supplies-adjust-modal__body input {
    font-size: 0.9rem;
    padding: 0.35rem;
  }
}
