/* HS Portal base (preto + dourado) */
*,*::before,*::after{ box-sizing:border-box }
:root{
  --bg:#0b0b0b; --panel:#121212; --bd:#2b2b2b;
  --gold:#e4c95c; --muted:#aaa; --text:#eee;
  --green:#1b6c1b; --green2:#114b11;
}
html,body{ background:var(--bg); color:var(--text); font-family:system-ui,Segoe UI,Roboto,Arial; }
a{ color:var(--gold); text-decoration:none }

.shell{ display:grid; grid-template-columns:260px 1fr; min-height:100dvh; }
.sidebar{ border-right:1px solid var(--bd); background:#0e0e0e; padding:16px; position:sticky; top:0; height:100dvh; }
.brand{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.brand img{ width:28px; height:28px }
.brand h1{ font-size:18px; margin:0; color:var(--gold) }
.nav a{ display:block; padding:10px 12px; margin:6px 0; border-radius:10px; color:#ddd; }
.nav a.active, .nav a:hover{ background:var(--panel); border:1px solid var(--bd); }
.nav-group{ margin:6px 0; }
.nav a.has-sub{ position:relative; }
.nav a.has-sub::after{ content:'›'; position:absolute; right:10px; opacity:.7 }
.nav-group.open a.has-sub::after{ content:'‹'; }
.subnav{ display:none; padding-left:10px; }
.nav-group.open .subnav{ display:block; }
.main{ padding:18px; }

.box{ border:1px solid var(--bd); border-radius:12px; background:var(--panel); padding:14px; }
.row{ display:flex; gap:10px; flex-wrap:wrap; }
.row.compact{ gap:2px; }
.grow{ flex:1 1 auto }
input, select{ background:#161616; border:1px solid var(--bd); color:#eee; border-radius:8px; padding:9px 10px; }
.btn{ display:inline-block; background:var(--gold); color:#000; font-weight:700; padding:10px 14px; border:none; border-radius:10px; cursor:pointer; }
.btn.secondary{ background:#222; color:#ddd; border:1px solid var(--bd) }
.btn.btn-demanda{ background:#2563eb; color:#fff; border:none }
.btn.btn-demanda:hover{ background:#1d4ed8 }
.btn.btn-disabled{ opacity:.55; cursor:not-allowed; pointer-events:none }
.btn.btn-demanda.btn-disabled{ background:#1e3a8a }
.muted{ color:var(--muted) }

/* Oculta filtros antigos na lista de orçamentos */
.row .st[data-st="aguardando"],
.row .st[data-st="em_andamento"],
.row .st[data-st="concluido"],
.row .st[data-st="cancelado"]{ display:none; }

/* Cards */
.grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.card{ background:#111; border:1px solid var(--bd); border-radius:12px; overflow:hidden; }
.card .thumb{ height:160px; background:#0c0c0c; display:flex; align-items:center; justify-content:center }
.card .thumb img{ width:100%; height:100%; object-fit:cover }
.card .body{ padding:10px }
.card .title{ font-weight:700; margin:0 0 6px 0; color:#fff }
.badge{ display:inline-block; padding:2px 8px; border-radius:999px; font-weight:700; font-size:12px }
.badge.gold{ background:var(--gold); color:#000 }
.badge.instock{ background:var(--green2); color:#9cf09c; border:1px solid var(--green) }
.price{ font-weight:800; color:#fff }
.brandx{ color:#bbb; font-size:13px }

.toolbar{ display:flex; gap:8px; align-items:center; margin-bottom:12px }
.pager{ display:flex; gap:8px; justify-content:flex-end; margin-top:12px }

/* Progress */
.progress{ position:relative; height:8px; background:#1a1a1a; border:1px solid var(--bd); border-radius:999px; overflow:hidden }
.progress .bar{ position:absolute; left:0; top:0; bottom:0; width:0; background:linear-gradient(90deg, var(--gold), #fff3a0); transition:width .2s ease }
.progress.indeterminate .bar{ width:40%; animation: indet 1.2s infinite }
@keyframes indet{ 0%{ left:-40% } 50%{ left:60% } 100%{ left:100% } }

/* ==== Tema HS (escuro) ==== */
:root{
  --hs-bg:#0b0b0b;
  --hs-surface:#0e0e0e;
  --hs-surface-2:#101010;
  --hs-text:#eee;
  --hs-text-dim:#bbb;
  --hs-border:#2b2b2b;
  --hs-yellow:#e4c95c;
  --hs-yellow-press:#d7ba45;
}

/* Base dark */
body, .card{
  background: var(--bg) !important;
  color: var(--text) !important;
}
.card{
  border: 1px solid var(--hs-border);
}
.form-control, .form-select, input, select{
  background: var(--hs-surface);
  color: var(--hs-text);
  border: 1px solid var(--hs-border);
}
.form-control:focus, .form-select:focus{
  outline: none;
  border-color: var(--hs-accent);
  box-shadow: 0 0 0 2px #4ea1ff22;
}

/* BotÃµes amarelos */
.btn-primary, .btn-warning, .hs-btn-yellow{
  background: var(--hs-yellow) !important;
  color: #151515 !important;
  border: none !important;
}
.btn-primary:hover, .btn-warning:hover, .hs-btn-yellow:hover{
  background: var(--hs-yellow-press) !important;
}

/* Modal */
.hs-help-backdrop, .modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .60);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  z-index: 1049;
}
.hs-help-modal, .modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1050;
}
.hs-help-modal .hs-modal-content, .modal .modal-box{
  width: min(980px, 92vw);
  max-height: 82vh;
  overflow: auto;
  background: rgba(12,12,12,.68);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  color: var(--hs-text);
}
.hs-help-modal header, .modal-header{
  padding: 18px 20px;
  border-bottom: 1px solid var(--hs-border);
  font-weight: 600;
  font-size: 18px;
}
.hs-help-modal .hs-modal-body, .modal-content{
  padding: 18px 20px 22px;
}
.hs-help-modal .hs-modal-body pre{
  background: #0a101c;
  color: #cfe6ff;
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow: auto;
}
.hs-help-modal .hs-modal-close, .modal-close{
  position: absolute;
  top: 10px;
  right: 14px;
  background: #00000055;
  color: #ff4d4f; /* X em vermelho */
  border: 1px solid #ff4d4f55;
  width: 34px; height: 34px;
  border-radius: 8px;
}

/* FAB */
#hs-help-fab{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 54px; height: 54px;
  border-radius: 10%;
  background: #1a1a1a;
  color: var(--gold);
  border: 1px solid var(--bd);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  z-index: 1030;
  font-weight: 700;
}
#hs-help-fab.hidden{ display:none }
#hs-help-fab:not(.hidden){ display:inline-flex }
#hs-help-fab:hover{ background: var(--hs-yellow-press); }

/* FAB Demanda (azul) */
.fab-demanda{
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #2563eb; /* azul */
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  z-index: 1030;
  font-weight: 700;
}
.fab-demanda:hover{ background:#1d4ed8 }

/* utilitários */
.opacity-60{ opacity:.6 }

/* Exibição via [hidden] */
.hs-help-backdrop[hidden]{ display:none }
.hs-help-modal[hidden]{ display:none }
.hs-help-backdrop:not([hidden]){ display:block }
.hs-help-modal:not([hidden]){ display:flex }

/* ===== Oficina form overrides (layout util classes) ===== */
label.muted{ display:block; margin-bottom:4px }
.svc-label{ display:flex; align-items:center; gap:6px; min-height:20px }
.svc-label .svc{ width:16px; height:16px }
.container-1100{ max-width:1100px; margin:20px auto }
.lead{ margin-top:-6px; color:var(--hs-text-dim) }
.text-right{ text-align:right }
.mt-8{ margin-top:8px }
.mt-10{ margin-top:10px }
.mt-12{ margin-top:12px }
.mt-16{ margin-top:16px }
.row.compact{ gap:2px !important }
.row > *{ min-width:0 }
.col{ display:block; flex:1 1 200px }
input, select{ width:100% }
.col-wide{ flex: 2 1 320px }
.col-wide-420{ flex: 2 1 420px }
.col-med{ flex: 1 1 160px }
.col-cep{ flex: 0 1 160px }
.col-num{ flex: 0 1 120px }

/* ===== Modal de peças (Pç) ===== */
.pc-results{ display:flex; flex-direction:column; gap:10px }
.pc-card{ display:flex; gap:12px; border:1px solid #e5e7eb; border-radius:10px; background:#ffffff; padding:10px }
.pc-thumb{ width:96px; height:96px; background:#ffffff; border:1px solid #e5e7eb; border-radius:8px; display:flex; align-items:center; justify-content:center; overflow:hidden }
.pc-thumb img{ width:100%; height:100%; object-fit:contain; background:#fff }
.pc-info{ flex:1 1 auto; min-width:0; color:#111 }
.pc-title{ font-weight:700; color:#111; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.pc-meta{ color:#4b5563; font-size:13px; margin-bottom:6px }
.pc-price{ font-weight:800; color:#111; margin-bottom:8px }
.pc-actions{ display:flex; gap:8px; align-items:center }
.col-uf{ flex: 0 1 80px }
/* ícone e botão editar */
.btn-edit{ color: var(--gold); border:1px solid var(--bd); padding:8px 10px }
.btn-edit .ico{ width:16px; height:16px; display:inline-block; vertical-align:middle; fill: currentColor }
/* fotos miniaturas */
.photos{ display:flex; gap:8px; flex-wrap:wrap; margin-top:6px }
.photo{ position:relative; width:96px; height:96px; border:1px solid var(--bd); border-radius:8px; overflow:hidden; background:#101010 }
.photo img{ width:100%; height:100%; object-fit:cover }
.photo .rm{ position:absolute; top:4px; right:4px; background:#00000088; color:#fff; border:1px solid #ffffff55; width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center }

/* Grid 12 cols for precise alignment */
.grid-12{ display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); column-gap:12px; row-gap:8px }
.span-1{ grid-column: span 1 }
.span-2{ grid-column: span 2 }
.span-3{ grid-column: span 3 }
.span-4{ grid-column: span 4 }
.span-5{ grid-column: span 5 }
.span-6{ grid-column: span 6 }
.span-7{ grid-column: span 7 }
.span-8{ grid-column: span 8 }
.span-9{ grid-column: span 9 }
.span-10{ grid-column: span 10 }
.span-11{ grid-column: span 11 }
.span-12{ grid-column: span 12 }

/* Final overrides for grid sizing */
.grid-12 > *{ min-width:0 }

/* ===== Orçamentos: cards estilo Demanda (layout limpo) ===== */
.orcCard{ background:#111; border:1px solid var(--bd); border-radius:12px; margin:10px 0; overflow:hidden }
.orcCard .cardHead{ display:grid; grid-template-columns: 1fr 120px; gap:12px; align-items:center; padding:12px }
.orcCard .left{ display:flex; gap:12px; align-items:center }
.orcCard .thumb{ width:120px; height:80px; border:1px solid var(--bd); border-radius:8px; overflow:hidden; background:#0c0c0c }
.orcCard .thumb img{ width:100%; height:100%; object-fit:cover }
.orcCard .carInfo b{ color:#fff }
.orcCard .carInfo .muted{ display:block }
.orcCard .carInfo .small{ font-size:13px; margin-top:3px }
.orcCard .k{ color:#d0d0d0; font-weight:700 }
.orcCard .cardRight{ display:flex; flex-direction:column; gap:8px; align-items:flex-end }

/* ====== CONFIGURAÇÕES (copiado do portal da loja para manter identidade) ====== */
.configBox{ max-width: 980px; margin: 16px auto; }
.configHdr{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.configHdr h2{ color:var(--gold); margin:0; }

.configGrid{
  display:grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
@media (max-width: 900px){ .configGrid{ grid-template-columns: 1fr; } }

.cardPanel{ background:#111; border:1px solid var(--bd); border-radius:12px; padding:14px; }
.cardPanel h3{ margin:0 0 10px; color:#eaeaea; }
.formRowX{ display:grid; grid-template-columns: repeat(12, 1fr); gap:10px; margin:8px 0; }
.formRowX > .col-12{ grid-column: span 12; }
.formRowX > .col-8 { grid-column: span 8; }
.formRowX > .col-6 { grid-column: span 6; }
.formRowX > .col-5 { grid-column: span 5; }
.formRowX > .col-4 { grid-column: span 4; }
.formRowX > .col-3 { grid-column: span 3; }
.formRowX > .col-2 { grid-column: span 2; }

.configLogo{ display:flex; gap:12px; align-items:center; }
.configLogo .logoPrev{
  width: 160px; height: 90px; border:1px solid var(--bd); border-radius:10px;
  background:#0f0f0f center/contain no-repeat;
}
.configLogo .btn{ white-space:nowrap; }

.inputNote{ font-size:12px; color:#9aa0a6; margin-top:4px; }
.btn.warn{ background:#b58900; color:#000; border:1px solid #8c6c00; }
.grid-12 input, .grid-12 select{ width:100% }

/* ====== Utilidades para formulários da Oficina ====== */
.container-1100{ max-width:1100px; margin:20px auto; }
.lead{ margin-top:-6px; color:var(--hs-text-dim); }
.text-right{ text-align:right }
.mt-8{ margin-top:8px }
.mt-10{ margin-top:10px }
.mt-12{ margin-top:12px }
.mt-16{ margin-top:16px }
.row.compact{ gap:2px }
.col-wide{ flex: 2 1 380px }
.col-wide-420{ flex: 2 1 420px }
.col-med{ flex: 1 1 220px }
.col-cep{ flex: 0 1 160px }
.col-num{ flex: 0 1 120px }
.col-uf{ flex: 0 1 80px }
label.muted{ display:block; margin-bottom:4px }

/* ==== Demanda (modal): lista de peças ==== */
#demModal .modal-content{
  text-align: left !important;      /* força alinhado à esquerda */
}

#demModal #demListSel{
  padding: 8px 0;
  text-align: left !important;      /* evita centralização herdada */
}

#demModal #demListSel .dem-item{
  display: grid;                     /* grid fixa a coluna do checkbox */
  grid-template-columns: 18px 1fr;   /* 18px pro checkbox, resto para o texto */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-bottom: 1px dashed var(--bd, #333);
  color: var(--text, #eee);
}

#demModal #demListSel .dem-item input[type="checkbox"]{
  justify-self: start;               /* gruda à esquerda */
  margin: 0;
  translate: 0 1px;                  /* micro-ajuste vertical */
}

#demModal #demListSel .dem-item .desc{
  min-width: 0;
  color: var(--text, #fff);
  white-space: normal;               /* deixa quebrar linha (visível) */
  overflow: hidden;                  /* mantém seguro se for muito longa */
  text-overflow: ellipsis;
}

#demModal #demListSel .dem-item .muted{
  color: #bbb;
  margin-left: 6px;
}
