
:root {
    --primary: #8500eb;
    --accent: #03a7ff;
    --bg: #ffffff;
    --text: #111;
    --muted: #888;
    --card: #fff;
    --shadow: 0 15px 35px rgba(0, 0, 0, .12);
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: #fff;
    padding-bottom: 50px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid #eee;
}

.app-header .left {
    display: flex;
    gap: 16px;
    align-items: center
}

.logo {
    height: 150px;
    width: 150px;
}

.logoHeader {
    height: 100px;
    width: 100px;
}

.app-header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.05
}

.app-header .right {
    display: flex;
    gap: 12px;
    align-items: center
}

.btn-sair {
    background: #eee;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333
}

.top-menu {flex-wrap: wrap;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 24px;
    border-bottom: 1px solid #eee
}

.top-menu a {
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #222;
    background: #f6f6f6
}

.top-menu a:hover {
    background: #ececec
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    padding: 24px
}

.card {
    background: var(--card);
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 18px;
    text-decoration: none;
    color: #111;
    box-shadow: var(--shadow)
}

.card h3 {
    margin: 0 0 6px
}

.card p {
    margin: 0;
    color: #555
}

.table-cob{
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #eee;
    background-color: white;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px
}

.modal.open {
    display: flex
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    min-width: 320px;
    max-width: 900px;
    width: 90%;
    box-shadow: var(--shadow)
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee
}

.modal-body {
    padding: 16px
}

.modal .close {
    border: none;
    background: #f3f3f3;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer
}

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

.tbl {
    width: 100%;
    border-collapse: collapse
}

.tbl th,
.tbl td {
    border-bottom: 1px solid #eee;
    padding: 8px
}

/* LOGIN */
body.Login {
    background:
        linear-gradient(135deg, #F8E711 0%, #F8E711 35%, transparent 35%) left top/65% 100% no-repeat,
        linear-gradient(-45deg, #F8E711 0%,#F8E711 35%, transparent 35%) right bottom/55% 100% no-repeat,
        #fff;
    height: 100vh;
}

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    padding: 20px
}

.login-card {
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px;
    max-width: 560px;
    width: 100%;
    position: relative
}

.login-card .logo {
    display: block;
    margin: 6px auto 14px
}

.login-card h2 {
    margin: 0 0 16px;
    text-align: center;
    font-size: 32px
}

.form-row {
    margin: 10px 0
}

.label {
    display: block;
    margin-bottom: 6px
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    outline: none
}

.input:focus {
    border-color: #bbb
}

.btn-full {
    width: 100%;
    margin-top: 12px;
    background: var(--accent);
    border-radius: 10px;
    border: none;
    color: #fff;
    padding: 12px 14px;
    font-weight: 600
}

/* CADASTROS */
.page {
    padding: 22px
}

.form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 900px
}

.obrigatorio{
    color: red;
    padding: 0;
    margin: 0;
}

.form .full {
    grid-column: 1/-1
}

.table-wrap {
    margin-top: 18px
}

/* VENDAS */
.vendas {
    display: grid;
    grid-template-columns: 280px 1fr 360px;
    gap: 16px;
    padding: 16px
}

.vbox {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow)
}

.vbox h3 {
    margin: 0 0 10px
}

.list {
    max-height: 55vh;
    overflow: auto
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #eee;
    padding: 8px 0
}

.item .name {
    font-weight: 600
}

.badge {
    background: #f0f0f0;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 6px
}

.cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding: 8px 0
}

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

.qty button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fafafa
}

.total {
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    margin-top: 8px
}

.search {
    display: flex;
    gap: 6px
}

select,
.search input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 10px
}

.text-right {
    text-align: right
}

/* ===========================
   RESPONSIVO (Tablet & Mobile)
   =========================== */

/* Ajustes gerais progressivos */
.app-header h1 {
  font-size: clamp(20px, 2.2vw, 28px);
}
.logo {
  width: clamp(72px, 10vw, 150px);
  height: clamp(72px, 10vw, 150px);
}

/* ====== Tablet (≤ 1024px) ====== */
@media (max-width: 1024px) {
  .app-header {
    padding: 12px 16px;
    gap: 10px;
  }
 
  /* Cards com colunas mais fluidas */
  .cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    padding: 16px;
  }

  /* Form de 2 → 2 mas com gaps menores */
  .form {
    gap: 10px;
    max-width: 100%;
  }

  /* Tabelas com rolagem horizontal suave */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tbl {
    min-width: 640px; /* evita quebra feia, ativa scroll */
  }

  .modal-card {
    max-width: 720px;
    width: 94%;
  }
}

/* ====== Mobile grande / Tablet pequeno (≤ 768px) ====== */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .app-header .left {
    width: 100%;
    justify-content: space-between;
  }
  .app-header .right {
    width: 100%;
    justify-content: flex-end;
  }
  /* Form de 2 colunas → 1 coluna */
  .form {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form .full { grid-column: 1; }

  /* Vendas: 2 colunas → 1 coluna (empilha tudo) */
  .vendas {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }
  .list {
    max-height: 45vh; /* reduz para caber melhor */
  }
  .total {
    font-size: 18px;
  }

  .search {
    flex-direction: column;
  }
  select,
  .search input {
    width: 100%;
  }

  /* Tabelas ocupam largura total e rolagem horizontal */
  .table-wrap {
    margin-top: 14px;
    overflow-x: auto;
  }
  .tbl {
    min-width: 560px;
  }

  /* Modal mais “cheio” */
  .modal-card {
    width: 96%;
    max-width: 640px;
    border-radius: 12px;
  }

  /* Login: reduz efeitos e margens */
  body.Login {
    background:
      linear-gradient(135deg, rgba(255,234,0,1) 0%, rgba(255,234,0,1) 25%, transparent 25%) left top/75% 100% no-repeat,
      #fff;
  }
  .login-card {
    margin: 0 10px;
    padding: 22px;
  }
  .login-card h2 {
    font-size: 26px;
  }
  .logo {
    margin: 0 auto 8px;
  }
}

/* ====== Mobile pequeno (≤ 480px) ====== */
@media (max-width: 480px) {
  .app-header {
    padding: 10px 12px;
  }
  .btn, .btn-sair {
    padding: 8px 10px;
    font-size: 14px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .vbox {
    padding: 10px;
  }
  .item {
    align-items: flex-start;
    gap: 8px;
  }
  .badge {
    margin-top: 4px;
    display: inline-block;
  }

  /* Modal tela cheia */
  .modal {
    padding: 0;
    align-items: stretch;
  }
  .modal-card {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
  }
  .modal-body {
    height: calc(100vh - 120px);
    overflow: auto;
  }

  /* Footer com menos padding em telas pequenas */
  .app-footer {
    padding: 12px;
    font-size: 13px;
  }
}

/* ====== Preferência do usuário: reduzir movimento ====== */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
/*---------------------------------------------*/


/* ====== Tablets (≤ 1024px) ====== */
@media (max-width: 1024px) {
  .vendas {
    grid-template-columns: 1fr 1fr; /* 2 colunas: busca | carrinho/pagamento */
    gap: 12px;
    padding: 12px;
  } 
  .vbox { padding: 12px; }
}

/* ====== Celulares (≤ 720px) ====== */
@media (max-width: 720px) {
 

  /* Vendas empilhado */
  .vendas {
    grid-template-columns: 1fr; /* 1 coluna */
    padding: 12px;
    gap: 12px;
  }

  /* Busca vertical e controles full-width */
  .search { flex-direction: column; gap: 8px; }
  .search input, select { width: 100%; }
  #btnBuscar, #btnConfirmar { width: 100%; }

  /* Lista e carrinho mais compactos */
  .list { max-height: 42vh; }
  .item { align-items: flex-start; }
  .item .name { display: block; margin-bottom: 4px; }
  .qty button { width: 36px; height: 36px; }
  .btn, .btn-full { padding: 12px 16px; font-size: 1rem; }

  /* Modal adaptável */
  .modal-card {
    width: 100%;
    max-width: none;
    border-radius: 14px;
  }
  .modal-body { max-height: 60vh; overflow: auto; }

}

/* ====== Telas muito pequenas (≤ 420px) ====== */
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }

  /* Total sempre visível ao rolar */
  .total {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px;
    margin: 0;
    border-top: 1px solid #eee;
  }

  .cart-row { gap: 10px; }

  /* Modal quase tela cheia */
  .modal-card {
    height: 92vh;
    display: flex;
    flex-direction: column;
  }
  .modal-body { flex: 1 1 auto; }
  #pwdBlock { padding: 0 12px 12px; }
}
