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

/* ==========================================
   1. BASE E CORES
   ========================================== */

:root {
  --green: #006b2b;
  --green2: #008b36;
  --ink: #123b20;
  --muted: #748078;
  --line: #e6ebe7;
  --bg: #f3f7f8;
  --white: #fff;
  --red: #bd3e3e;
  --shadow: 0 8px 30px rgba(21,55,35,.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px 'DM Sans', sans-serif;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   2. CABEÇALHO E LOGOTIPO
   ========================================== */

.topbar {
  background: #004b2b;
  color: #fff;
  min-height: 100px;
  padding: 9px max(24px, calc((100vw - 1650px)/2));

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  border-bottom: 2px solid #087a42;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 260px;
  height: 85px;
  object-fit: contain;

  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  flex-shrink: 0;
}

.brand-description {
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.35);
}

.brand-description strong {
  display: block;
  font: 800 21px/1.2 'Manrope', sans-serif;
  color: #fff;
}

.brand-description small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #d1ead9;
}

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

.today {
  font-size: 13px;
  color: #e2f1e6;
  margin-right: 6px;
}

/* ==========================================
   3. BOTÕES E NAVEGAÇÃO
   ========================================== */

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-ghost {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.55);
  padding: 10px 14px;
}

.btn-ghost:hover {
  background: rgba(255,255,255,.22);
}

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green2);
}

.btn-light {
  background: #edf2ee;
  color: var(--green);
  border: 1px solid #dce6df;
}

.btn-large {
  width: 100%;
  padding: 18px;
  font-size: 18px;
}

.tabs {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 8px max(24px, calc((100vw - 1650px)/2));
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  background: transparent;
  color: #7a867e;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 20px;
  border-radius: 12px;
  cursor: pointer;
}

.tab.active {
  background: var(--green);
  color: #fff;
}

/* ==========================================
   4. CONTEÚDO E PAINÉIS
   ========================================== */

.page {
  max-width: 1650px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 23px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #8a978e;
  margin: 0 0 7px;
}

.section-heading h1 {
  font: 800 34px 'Manrope', sans-serif;
  margin: 0;
  letter-spacing: -1px;
}

.muted {
  color: var(--muted);
  font-size: 16px;
  margin: 6px 0 0;
}

.live-pill {
  background: #e7f4e9;
  color: #277345;
  border-radius: 30px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

.live-pill i {
  width: 7px;
  height: 7px;
  background: #37a45c;
  border-radius: 50%;
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 400px;
  gap: 22px;
  align-items: start;
}

.catalog-panel,
.cart-panel,
.toolbar-card,
.table-wrap,
.report-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.catalog-panel {
  padding: 18px;
  min-width: 0;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.category-filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filter {
  border: 1px solid var(--line);
  background: #fff;
  color: #66736a;
  padding: 11px 17px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.filter.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.search,
.input,
.select {
  height: 45px;
  border: 1px solid #dfe6e0;
  border-radius: 9px;
  padding: 0 11px;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search {
  width: 210px;
  max-width: 100%;
}

.search:focus,
.input:focus,
.select:focus {
  border-color: #70a786;
  box-shadow: 0 0 0 3px rgba(28,117,73,.08);
}

.select {
  width: 100%;
  height: 48px;
  font-size: 15px;
}

/* ==========================================
   5. CATÁLOGO E FOTOS
   ========================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 15px;
}

.product-card {
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
  background: #fff;
  cursor: pointer;

  display: flex;
  flex-direction: column;

  transition:
    transform .15s,
    border-color .15s,
    box-shadow .15s;
}

.product-card:hover {
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,61,28,.13);
}

.product-image-area {
  width: 100%;
  overflow: hidden;
  background: #eaf5e9;
}

.product-photo {
  display: block;
  width: 100%;
  height: 145px;
  object-fit: cover;
  background: #e9f2e9;
}

.product-photo-fallback {
  height: 145px;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: #eaf5e9;
}

.product-content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.product-size {
  font-size: 13px;
  color: #849087;
}

.product-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
}

.product-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #91a096;
}

.product-arrow {
  color: var(--green);
  font-weight: 800;
}

/* ==========================================
   6. CARRINHO DE COMPRAS
   ========================================== */

.cart-panel {
  overflow: hidden;
  position: sticky;
  top: 16px;
}

.cart-head {
  padding: 18px 18px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  font: 800 23px 'Manrope', sans-serif;
  margin: 0;
}

.count {
  font-size: 11px;
  font-weight: 700;
  background: #edf3ee;
  color: var(--green);
  padding: 4px 7px;
  border-radius: 20px;
  vertical-align: middle;
}

.text-btn {
  border: 0;
  background: none;
  color: #a04b4b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.cart-items {
  padding: 7px 17px;
  max-height: 360px;
  overflow: auto;
  min-height: 100px;
}

.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 5px;
  color: #89958d;
  gap: 6px;
}

.empty-cart span {
  font-size: 28px;
  color: #aab7ae;
}

.empty-cart strong {
  font-size: 12px;
  color: #59675e;
}

.empty-cart small {
  font-size: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f2f0;
}

.cart-item:last-child {
  border: 0;
}

.cart-item-name {
  font-size: 15px;
  font-weight: 700;
}

.cart-item-price {
  font-size: 13px;
  color: #829087;
  margin-top: 4px;
}

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

.qty-control button {
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.qty-control span {
  font-size: 12px;
  font-weight: 700;
  min-width: 10px;
  text-align: center;
}

.cart-summary {
  background: #fbfcfb;
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.summary-line,
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-line {
  font-size: 12px;
  color: #7d8981;
}

.summary-total {
  margin: 9px 0 15px;
}

.summary-total span {
  font-size: 13px;
  font-weight: 700;
}

.summary-total strong {
  font: 800 30px 'Manrope', sans-serif;
  color: var(--green);
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #68766d;
  margin: 12px 0 6px;
}

.microcopy {
  font-size: 10px;
  color: #99a39c;
  text-align: center;
  margin: 9px 0 0;
}

/* ==========================================
   7. HISTÓRICO E TABELAS
   ========================================== */

.toolbar-card {
  padding: 15px;
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar-card .field-label {
  margin: 0 0 6px;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-total {
  font: 800 20px 'Manrope', sans-serif;
  color: var(--green);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #8b978f;
  background: #fafcfb;
  padding: 13px 16px;
}

td {
  padding: 14px 16px;
  border-top: 1px solid #eef1ee;
  font-size: 12px;
  color: #536158;
}

td strong {
  color: var(--ink);
}

.row-action {
  border: 0;
  background: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: #9aa49d;
  font-size: 12px;
}

.empty-state.small {
  padding: 15px;
}

/* ==========================================
   8. RELATÓRIOS E FECHAMENTO
   ========================================== */

.report-controls {
  display: flex;
  align-items: end;
  gap: 9px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 17px;
}

.report-controls .field-label {
  margin: 0 0 6px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 17px;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-card span {
  font-size: 11px;
  color: #7d8981;
  font-weight: 600;
}

.metric-card strong {
  display: block;
  font: 800 23px 'Manrope', sans-serif;
  margin-top: 8px;
  color: var(--green);
}

.report-columns {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 15px;
}

.report-card {
  padding: 18px;
  min-width: 0;
}

.report-card h2 {
  font: 800 16px 'Manrope', sans-serif;
  margin: 0 0 14px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eff2ef;
  font-size: 12px;
}

.breakdown-row:last-child {
  border: 0;
}

.breakdown-row strong {
  color: var(--green);
}

.compact {
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.compact table {
  min-width: 0;
}

.compact th,
.compact td {
  padding: 10px 7px;
}

.notice {
  background: #edf6ee;
  border: 1px solid #d5ead9;
  color: #27623d;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12px;
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

.footnote {
  font-size: 11px;
  color: #8b968f;
  margin-top: 15px;
}

/* ==========================================
   9. AVISOS E JANELAS
   ========================================== */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%,20px);
  background: #183c29;
  color: #fff;
  border-radius: 10px;
  padding: 12px 17px;
  font-size: 12px;
  box-shadow: 0 8px 25px #0002;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%,0);
}

.dialog {
  border: 0;
  border-radius: 16px;
  width: min(460px,calc(100% - 28px));
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 20px 80px #0004;
}

.dialog::backdrop {
  background: rgba(13,27,18,.66);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 15px;
}

.dialog h2 {
  font: 800 20px 'Manrope', sans-serif;
  margin: 0;
}

.icon-btn {
  border: 0;
  background: #f0f3f0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.detail-total {
  font: 800 22px 'Manrope', sans-serif;
  color: var(--green);
  text-align: right;
  margin-top: 15px;
}

/* ==========================================
   10. SELEÇÃO VERTICAL DE TAMANHOS
   ========================================== */

#sizeDialog {
  width: min(480px,calc(100% - 30px));
  padding: 28px;
  border-radius: 22px;
}

#sizeDialog::backdrop {
  background: rgba(7,32,17,.65);
  backdrop-filter: blur(4px);
}

#sizeDialog .dialog-head {
  margin-bottom: 25px;
}

#sizeDialog .eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
}

#sizeDialog h2 {
  font-size: 27px;
  color: var(--ink);
}

#sizeDialog .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 25px;
}

#sizeOptions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#sizeDialog .size-option {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid #dce8df;
  border-radius: 13px;
  background: #fff;
  font-size: 17px;
  font-weight: 700;
  color: #183b26;
  text-align: left;
  cursor: pointer;
  transition: background .2s,border-color .2s;
}

#sizeDialog .size-option strong {
  font: 800 19px 'Manrope', sans-serif;
  color: var(--green);
  white-space: nowrap;
}

#sizeDialog .size-option:hover {
  background: #eaf7ed;
  border-color: var(--green2);
}

#sizeDialog .size-option:active {
  background: #d6eedc;
  transform: scale(.99);
}

#sizeDialog .size-option:focus-visible {
  outline: 3px solid #82c99b;
  outline-offset: 2px;
}

/* ==========================================
   11. TABLET
   ========================================== */

@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .topbar {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 1000px) {
  .sales-layout {
    grid-template-columns: minmax(0,1fr) 330px;
  }

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

  .brand-logo {
    width: 210px;
    height: 75px;
  }

  .brand-description strong {
    font-size: 18px;
  }
}

@media (max-width: 900px) {
  .sales-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

/* ==========================================
   12. CELULAR
   ========================================== */

@media (max-width: 760px) {
  .topbar {
    min-height: 0;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-logo {
    width: 150px;
    height: 65px;
  }

  .brand-description {
    padding-left: 10px;
  }

  .brand-description strong {
    font-size: 15px;
  }

  .brand-description small {
    font-size: 8px;
    letter-spacing: .5px;
  }

  .top-actions {
    width: 100%;
    gap: 8px;
  }

  .today {
    display: none;
  }

  .top-actions .btn-ghost {
    flex: 1;
    padding: 9px;
    font-size: 12px;
  }

  .tabs {
    min-height: 0;
    gap: 4px;
    padding: 8px 10px;
  }

  .tab {
    font-size: 12px;
    padding: 12px 9px;
  }

  .page {
    padding: 22px 14px 40px;
  }

  .section-heading h1 {
    font-size: 27px;
  }

  .catalog-panel {
    padding: 12px;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

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

  .product-photo,
  .product-photo-fallback {
    height: 115px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-price {
    font-size: 18px;
  }

  .product-content {
    padding: 10px;
  }

  .metric-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }

  .metric-card {
    padding: 14px;
  }

  .metric-card strong {
    font-size: 19px;
  }

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

  .toolbar-card {
    flex-wrap: wrap;
  }

  .toolbar-spacer {
    display: none;
  }

  .toolbar-total {
    margin-left: auto;
  }

  .report-controls > * {
    flex: 1 1 130px;
  }

  #sizeDialog {
    width: calc(100% - 24px);
    padding: 20px;
    border-radius: 18px;
  }

  #sizeDialog h2 {
    font-size: 23px;
  }

  #sizeDialog .size-option {
    min-height: 62px;
    padding: 14px 16px;
    font-size: 16px;
  }

  #sizeDialog .size-option strong {
    font-size: 17px;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    width: 130px;
    height: 60px;
  }

  .brand-description strong {
    font-size: 13px;
  }

  .brand-description small {
    font-size: 7px;
  }
}

/* ==========================================
   13. IMPRESSÃO DO RELATÓRIO
   ========================================== */

@media print {
  .topbar,
  .tabs,
  .report-controls,
  .footnote {
    display: none !important;
  }

  .page {
    padding: 0;
  }

  .view {
    display: none !important;
  }

  #reportsView {
    display: block !important;
  }

  .metric-card,
  .report-card {
    box-shadow: none;
  }

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