:root{
  --azul: #1476FF;
  --azul-escuro: #0E4FB0;

  --amarelo: #FFC93C;
  --rosa: #FF4FA3;

  --bg: #F6F8FC;
  --card: #FFFFFF;
  --texto: #0F172A;
  --muted: #64748B;
  --borda: #E6EAF2;

  --radius: 14px;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--texto);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(20,118,255,.10), transparent 60%),
              radial-gradient(1200px 600px at 90% 0%, rgba(255,79,163,.10), transparent 60%),
              var(--bg);
}

h1,h2,h3{
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}
h2{ font-size: 22px; }
small{ color: var(--muted); }

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

.container{
  max-width: 1100px;
  margin: 26px auto;
  padding: 0 16px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.brand{
  display:flex;
  flex-direction: column;
}
.brand strong{
  font-size: 20px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,201,60,.18);
  color: #6B4C00;
  border: 1px solid rgba(255,201,60,.35);
  font-weight: 600;
  font-size: 12px;
}

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

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

.card{
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h3{
  font-size: 16px;
  margin-bottom: 12px;
}

.section-title{
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 10px 0 8px;
}

.form{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.label{
  font-weight: 700;
  font-size: 13px;
  color: var(--texto);
  margin-bottom: 4px;
}

.input, select{
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  outline: none;
  background: #fff;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}

.input:focus, select:focus{
  border-color: rgba(20,118,255,.45);
  box-shadow: 0 0 0 4px rgba(20,118,255,.12);
}

.row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px){
  .row{ grid-template-columns: 1fr; }
}

.estampa-pill{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20,118,255,.06);
  border: 1px solid rgba(20,118,255,.15);
  color: var(--azul-escuro);
  font-weight: 700;
  font-size: 13px;
}

.foto-box{
  border-radius: 16px;
  border: 1px dashed rgba(100,116,139,.35);
  background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(246,248,252,.8));
  height: 260px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  font-size: 13px;
}

.actions{
  display:flex;
  gap: 10px;
  margin-top: 6px;
}
@media (max-width: 520px){
  .actions{ flex-direction: column; }
}

.btn{
  width:100%;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 14px;
  cursor:pointer;
  transition: transform .05s, filter .15s, box-shadow .15s;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: linear-gradient(135deg, var(--azul), #3A9BFF);
  color: #fff;
  box-shadow: 0 10px 18px rgba(20,118,255,.22);
}
.btn-primary:hover{ filter: brightness(1.03); }

.btn-secondary{
  background: rgba(15,23,42,.05);
  color: var(--texto);
  border: 1px solid var(--borda);
}

.btn-warn{
  background: linear-gradient(135deg, var(--rosa), #FF78BF);
  color: #fff;
  box-shadow: 0 10px 18px rgba(255,79,163,.18);
}

.btn-accent{
  background: linear-gradient(135deg, var(--amarelo), #FFD977);
  color: #523A00;
  box-shadow: 0 10px 18px rgba(255,201,60,.18);
}

.sidebar-list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.resumo-item{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: #fff;
  display:flex;
  justify-content: space-between;
  gap: 10px;
}
.resumo-item strong{ font-size: 13px; }
.resumo-item span{ font-size: 12px; color: var(--muted); }

hr{
  border: none;
  border-top: 1px solid var(--borda);
  margin: 14px 0;
}

/* Revisar pedido (itens) */
.item-card{
  padding: 12px 0;
}
.item-header{
  display:flex;
  justify-content: space-between;
  gap: 14px;
}
.item-title{
  font-weight: 900;
  letter-spacing: .01em;
}
.item-sub{
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.item-foto{
  width: 62px;
  height: 62px;
  border-radius: 14px;
  border: 1px solid var(--borda);
  background: radial-gradient(circle at 30% 30%, rgba(255,79,163,.22), transparent 55%),
              radial-gradient(circle at 70% 60%, rgba(255,201,60,.22), transparent 55%),
              rgba(20,118,255,.10);
  flex: 0 0 auto;
}
.item-actions{
  display:flex;
  gap: 10px;
  margin-top: 10px;
}
.item-actions button{
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--borda);
  padding: 10px 12px;
  font-weight: 800;
  background: #fff;
  cursor:pointer;
}
.item-actions button:first-child{
  border-color: rgba(20,118,255,.35);
  box-shadow: 0 8px 14px rgba(20,118,255,.08);
}
.item-actions button:last-child{
  border-color: rgba(255,79,163,.30);
}
.item-edit{
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(15,23,42,.03);
  border: 1px solid var(--borda);
}

/* ===== Gate (Site em construção) ===== */

html, body { height: 100%; }

.gate-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;

  /* centraliza de verdade */
  display: none;
  align-items: center;
  justify-content: center;

  /* altura correta no mobile */
  min-height: 100vh;
  min-height: 100dvh;

  padding: 18px;

  background: rgba(15, 23, 42, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.gate-overlay.is-active{
  display: flex;
}

#appRoot.is-blurred{
  filter: blur(10px);
  transform: translateZ(0); /* ajuda em alguns mobiles */
  pointer-events: none;
  user-select: none;
}


.gate-card{
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(230, 234, 242, 0.9);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  padding: 18px;
}

.gate-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,201,60,.18);
  color: #6B4C00;
  border: 1px solid rgba(255,201,60,.35);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 12px;
}

.gate-title{
  margin: 0 0 6px 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.gate-subtitle{
  margin: 0 0 14px 0;
  color: var(--muted);
  line-height: 1.35;
}

.gate-form{
  display: grid;
  gap: 10px;
}

.gate-label{
  font-weight: 800;
  font-size: 13px;
}

.gate-input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  outline: none;
  font-size: 14px;
}
.gate-input:focus{
  border-color: rgba(20,118,255,.45);
  box-shadow: 0 0 0 4px rgba(20,118,255,.12);
}

.gate-error{
  color: #B00020;
  font-weight: 700;
  font-size: 13px;
}
/* ===== Menu lateral (hamburger) ===== */
.menu-btn{
  position: fixed;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 18px rgba(15,23,42,.10);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 4000; /* abaixo do gate (9999), acima do app */
}

.menu-icon{
  width: 18px;
  height: 12px;
  position: relative;
}
.menu-icon span{
  position:absolute;
  left:0;
  width:100%;
  height:2px;
  border-radius: 999px;
  background: rgba(15,23,42,.75);
}
.menu-icon span:nth-child(1){ top:0; }
.menu-icon span:nth-child(2){ top:5px; width: 86%; }
.menu-icon span:nth-child(3){ top:10px; width: 72%; }

.menu-overlay{
  position: fixed;
  inset:0;
  background: rgba(15,23,42,.35);
  display:none;
  z-index: 3999;
}
.menu-overlay.is-open{ display:block; }

.side-menu{
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  width: min(300px, 85vw);
  background: rgba(255,255,255,0.96);
  border-right: 1px solid var(--borda);
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
  transform: translateX(-110%);
  transition: transform .18s ease;
  z-index: 4001;
  padding: 14px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.side-menu.is-open{ transform: translateX(0); }

.menu-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 10px;
}
.menu-title{
  font-weight: 900;
  letter-spacing: -0.02em;
}
.menu-close{
  border: 1px solid var(--borda);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 900;
}

.menu-links{
  display:flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;

  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
}
.menu-link{
  text-decoration: none;
  color: var(--texto);
  border: 1px solid var(--borda);
  background: #fff;
  border-radius: 12px;
  padding: 12px 12px;
  font-weight: 900;
}
.menu-link small{
  display:block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
}
.menu-link.is-active{
  border-color: rgba(20,118,255,.35);
  box-shadow: 0 10px 18px rgba(20,118,255,.10);
}

/* ===== Cadastro de estampas ===== */
.upload-list{
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.upload-item{
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.9);
}
.upload-item-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.upload-item-title{
  font-weight: 900;
  letter-spacing: -0.01em;
}
.upload-remove{
  border: 1px solid rgba(255,79,163,.30);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor:pointer;
}
.status-box{
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.8);
  max-height: 60vh;
  overflow:auto;
}
.status-line{
  padding: 8px 0;
  border-bottom: 1px dashed rgba(100,116,139,.25);
}
.status-line:last-child{ border-bottom: none; }

/* ===== Buscar estampas ===== */
.stamps-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* Mobile: grade mais compacta (4 estampas por linha) */
@media (max-width: 540px){
  .stamps-grid{
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .stamp-card{
    border-radius: 12px;
  }

  .stamp-info{
    padding: 6px 8px 8px;
  }

  .stamp-cod{
    font-size: 12px;
  }

  .stamp-desc{
    font-size: 11px;
    line-height: 1.2;
  }
}

/* Telas bem pequenas: mantém 4 colunas, mas com menos espaçamento */
@media (max-width: 380px){
  .stamps-grid{ gap: 6px; }
  .stamp-info{ padding: 5px 6px 7px; }
}

.stamp-card{
  border: 1px solid var(--borda);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  overflow: hidden;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}

.stamp-imgwrap{
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(246,248,252,.9));
}

.stamp-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stamp-info{
  padding: 10px 12px 12px;
}

.stamp-cod{
  font-weight: 900;
  letter-spacing: .01em;
}

.stamp-desc{
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}


/* ================= Clientes (tabela + modal) ================= */
.table-wrap{ width:100%; overflow:auto; border:1px solid var(--borda); border-radius: 12px; }
.table{ width:100%; border-collapse: collapse; background: var(--card); }
.table th, .table td{ padding: 12px 12px; border-bottom: 1px solid var(--borda); text-align:left; vertical-align: top; }
.table th{ font-size: 13px; color: var(--muted); font-weight: 700; background: linear-gradient(180deg, rgba(20,118,255,.06), transparent); }
.table tr:hover td{ background: rgba(20,118,255,.06); }
.table tr.is-selected td{ background: rgba(20,118,255,.14); }

.modal-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9999;
}
.modal-card{
  width: min(820px, 100%);
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.modal-title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.icon-btn{
  border: 1px solid var(--borda);
  background: var(--card);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.icon-btn:hover{ background: rgba(20,118,255,.06); }
/* ============================================================ */


/* Clientes: CEP row + loading */
.cep-row{
  display:flex;
  gap:10px;
  align-items:center;
}
.cep-row .input{ flex: 1 1 auto; }
.modal-card{ position: relative; }

.modal-loading{
  position:absolute;
  inset:0;
  z-index: 5;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  gap: 10px;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  font-weight: 700;
  color: var(--texto);
}

.spinner{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.18);
  border-top-color: rgba(15, 23, 42, 0.68);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
