:root {
  --navy-950: #050d1c; --navy-900: #081630; --navy-800: #0c2147;
  --azul: #1677ff; --azul-suave: #e8f1ff;
  --texto: #14213a; --suave: #5d6a80; --linha: #dbe3ee; --fundo: #f3f6fa;
  --perigo: #d93a3a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Barlow", system-ui, sans-serif; color: var(--texto); background: var(--fundo); }
h1, h2, h3 { font-family: "Barlow Condensed", sans-serif; margin: 0; line-height: 1.1; }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
input, select, textarea { font: 500 15px "Barlow", sans-serif; color: var(--texto); border: 1.5px solid var(--linha); border-radius: 9px; padding: 11px 13px; background: #fff; width: 100%; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; padding: 12px 20px; font: 700 15px "Barlow", sans-serif; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn--azul { background: var(--azul); color: #fff; }
.btn--azul:hover { background: #0d62d6; }
.btn--azul:disabled { opacity: .6; cursor: wait; }
.btn--linha { background: #fff; border: 1.5px solid var(--linha); color: var(--texto); }
.btn--linha:hover { border-color: var(--azul); color: var(--azul); }
.btn--sm { padding: 7px 12px; font-size: 14px; }
.link { background: none; border: 0; color: var(--perigo); font: 600 14px "Barlow", sans-serif; cursor: pointer; padding: 6px 0; }
.alerta { background: #fff7e0; border: 1px solid #f3d27a; color: #6b5100; padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; font-size: 14px; }
.alerta--erro { background: #fdecec; border-color: #f2b8b8; color: #9b1c1c; }
.alerta a { color: inherit; font-weight: 700; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 70% 10%, #12306a, transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-950)); }
.login__caixa { width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 34px; display: grid; gap: 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.login__logo { width: 220px; margin: 0 auto 4px; background: var(--navy-900); border-radius: 12px; padding: 14px 18px; box-sizing: content-box; }
.login h1 { font-size: 30px; text-transform: uppercase; text-align: center; }
.login__info { margin: -6px 0 0; color: var(--suave); text-align: center; font-size: 14px; }
.login .alerta { margin: 0; }
.login__voltar { text-align: center; color: var(--suave); font-size: 14px; text-decoration: none; }

/* topo */
.adm-topo { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 64px; background: var(--navy-950); color: #fff; }
.adm-topo__logo { height: 34px; }
.adm-topo__tag { background: var(--azul); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; }
.abas { display: flex; gap: 4px; margin-left: 18px; }
.aba { background: none; border: 0; color: #a9b8cf; font: 600 15px "Barlow", sans-serif; padding: 10px 14px; border-radius: 8px; cursor: pointer; }
.aba:hover { color: #fff; }
.aba.ativa { background: rgba(255,255,255,.1); color: #fff; }
.adm-topo__dir { margin-left: auto; display: flex; gap: 18px; }
.link-claro { color: #cfd8e6; text-decoration: none; font-weight: 600; font-size: 14px; }
.link-claro:hover { color: #fff; }

.adm { width: min(1100px, 100% - 32px); margin: 28px auto 80px; }
.barra { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.barra h2 { font-size: 34px; text-transform: uppercase; color: var(--navy-900); }
.sub { margin: 4px 0 0; color: var(--suave); }
.filtros { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 22px; }

.grupo { margin-bottom: 26px; }
.grupo__titulo { display: flex; align-items: center; gap: 10px; font-size: 21px; text-transform: uppercase; color: var(--navy-900); margin-bottom: 10px; }
.grupo__titulo svg { width: 22px; height: 22px; color: var(--azul); }
.grupo__titulo small { font: 600 13px "Barlow", sans-serif; color: var(--suave); background: #e6ecf4; padding: 2px 8px; border-radius: 10px; }
.linhas { background: #fff; border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; }
.linha { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--linha); }
.linha:first-child { border-top: 0; }
.linha:hover { background: #fafcff; }
.linha--oculta .linha__img, .linha--oculta .linha__info { opacity: .45; }
.linha__img { width: 58px; height: 58px; flex: none; border: 1px solid var(--linha); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.linha__img img { width: 100%; height: 100%; object-fit: contain; }
.linha__img .sem { font-size: 11px; color: var(--suave); text-align: center; }
.linha__icone { width: 44px; height: 44px; border-radius: 10px; background: var(--azul-suave); color: var(--azul); display: grid; place-items: center; }
.linha__icone svg { width: 22px; height: 22px; }
.linha__info { flex: 1; min-width: 0; display: grid; }
.linha__info strong { font-size: 16px; }
.linha__info span { font-size: 13px; color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha__acoes { display: flex; align-items: center; gap: 6px; }
.ib { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--linha); background: #fff; cursor: pointer; font-size: 15px; color: var(--suave); }
.ib:hover { border-color: var(--azul); color: var(--azul); }
.ib--perigo:hover { border-color: var(--perigo); background: #fdecec; }
.vazio { text-align: center; color: var(--suave); padding: 30px; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #c8d1dd; border-radius: 12px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: #1fae54; }
.switch input:checked + span::before { transform: translateX(20px); }

.cartao { background: #fff; border: 1px solid var(--linha); border-radius: 14px; padding: 24px; display: grid; gap: 16px; }
.cartao--estreito { max-width: 420px; }

/* modal */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(760px, 100% - 24px); box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); }
.modal--peq { width: min(480px, 100% - 24px); }
.modal::backdrop { background: rgba(5, 13, 28, .6); }
.modal__cab { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--linha); }
.modal__cab h3 { font-size: 26px; text-transform: uppercase; color: var(--navy-900); }
.fechar { background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--suave); }
.modal__corpo { display: grid; grid-template-columns: 260px 1fr; gap: 22px; padding: 22px 24px; }
.modal__corpo--col { grid-template-columns: 1fr; }
.modal .alerta { margin: 0 24px 4px; }
.modal__rodape { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--linha); background: var(--fundo); }
.campos { display: grid; gap: 14px; align-content: start; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 18px; height: 18px; }

.foto { display: grid; gap: 6px; align-content: start; }
.foto__area { position: relative; aspect-ratio: 1; border: 2px dashed var(--linha); border-radius: 12px; display: grid; place-items: center; cursor: pointer; overflow: hidden; background: #fff; transition: border-color .15s, background .15s; }
.foto__area:hover, .foto__area.arrastando { border-color: var(--azul); background: var(--azul-suave); }
.foto__area input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto__area img { width: 100%; height: 100%; object-fit: contain; }
.foto__vazio { text-align: center; color: var(--suave); font-size: 14px; padding: 16px; font-weight: 500; }
.foto__vazio small { font-size: 12px; }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.icones { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.icone-op { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 1.5px solid var(--linha); border-radius: 10px; cursor: pointer; color: var(--navy-800); }
.icone-op input { position: absolute; opacity: 0; }
.icone-op svg { width: 24px; height: 24px; }
.icone-op:has(input:checked) { border-color: var(--azul); background: var(--azul); color: #fff; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); background: var(--navy-900); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; transition: transform .25s; z-index: 100; }
.toast.visivel { transform: translate(-50%, 0); }
.toast--erro { background: var(--perigo); }

@media (max-width: 760px) {
  .adm-topo { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; }
  .abas { order: 3; width: 100%; margin: 0; }
  .filtros { grid-template-columns: 1fr; }
  .barra { flex-direction: column; align-items: stretch; }
  .modal__corpo { grid-template-columns: 1fr; }
  .foto__area { aspect-ratio: 16/10; }
  .linha { flex-wrap: wrap; }
  .linha__acoes { width: 100%; justify-content: flex-end; }
}

/* ---------- complementos ---------- */
.btn--navy { background: var(--navy-900); color: #fff; }
.btn--navy:hover { background: var(--navy-800); }
.btn--verde { background: #1fae54; color: #fff; }
.btn--verde:hover { background: #178a42; }
.btn--laranja { background: #e07a10; color: #fff; }
.btn--laranja:hover { background: #c56a0b; }
.btn svg { width: 17px; height: 17px; }
.btn:disabled { opacity: .6; cursor: wait; }
label small { font-weight: 500; color: var(--suave); font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--linha); margin: 4px 0; width: 100%; }
.login__caixa--larga { width: min(560px, 100%); }
.grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grade2 .full { grid-column: 1 / -1; }
.grade3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grade-end { display: grid; grid-template-columns: 150px 1fr 110px 1fr; gap: 14px; }
.e-bairro { grid-column: span 2; } .e-cidade { grid-column: span 1; } .e-uf { grid-column: span 1; }
.cartao__titulo { margin: 6px 0 -4px; font: 700 13px "Barlow", sans-serif; text-transform: uppercase; letter-spacing: 1.2px; color: var(--azul); }
.cartao__titulo:first-child { margin-top: 0; }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; }
.link-smtp { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-family: inherit; }
.link-smtp:hover { border-color: var(--azul); }
.link-smtp svg { width: 16px; height: 16px; }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: #8a96a8; }
.ponto--ok { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,.25); }
.ponto--off { background: #f5a524; box-shadow: 0 0 0 3px rgba(245,165,36,.25); }

/* modal SMTP (modelo enviado pelo cliente) */
.modal--smtp { width: min(440px, 100% - 24px); border-radius: 18px; }
.smtp__cab { display: flex; align-items: center; gap: 12px; background: var(--navy-900); color: #fff; padding: 18px 20px; }
.smtp__cab h3 { font: 700 17px "Barlow", sans-serif; }
.smtp__cab p { margin: 2px 0 0; font-size: 12px; color: #a9b8cf; }
.smtp__icone { width: 38px; height: 38px; border-radius: 10px; background: #7cc142; display: grid; place-items: center; flex: none; }
.smtp__icone svg { width: 20px; height: 20px; color: #fff; }
.smtp__fechar { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.smtp__fechar:hover { background: rgba(255,255,255,.22); }
.smtp__corpo { padding: 18px 22px 20px; display: grid; gap: 16px; }
.smtp__intro { margin: 0; font-size: 13px; color: var(--suave); line-height: 1.5; }
.smtp__grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.smtp__grade label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--navy-900); }
.smtp__grade input, .smtp__grade select { font-size: 14px; text-transform: none; letter-spacing: 0; }
.col-2 { grid-column: span 3; } .col-2-meio { grid-column: span 2; } .col-full { grid-column: 1 / -1; }
.senha-campo { position: relative; display: block; }
.senha-campo input { padding-right: 40px; }
.olho { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--suave); cursor: pointer; padding: 6px; display: grid; }
.olho svg { width: 18px; height: 18px; }
.smtp__teste { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff8e8; border: 1px solid #f6d58e; color: #a5560b; border-radius: 10px; padding: 12px 14px; font-size: 13px; font-weight: 600; }
.smtp__teste > span { display: flex; gap: 8px; align-items: flex-start; }
.smtp__teste > span svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.smtp__teste .btn { flex: none; }
.smtp__teste--ok { background: #eafaf0; border-color: #a6e3bd; color: #157a3c; }
.smtp__teste--erro { background: #fdecec; border-color: #f2b8b8; color: #9b1c1c; }
.smtp__teste--testando { background: var(--azul-suave); border-color: #b9d5ff; color: #0d62d6; }
.check--peq { font-size: 13px; font-weight: 500; color: var(--suave); align-items: flex-start; }
.check--peq input { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.smtp__rodape { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--linha); background: var(--fundo); }

/* orçamentos */
.barra select#filtroOrc { width: auto; min-width: 180px; }
.orc { background: #fff; border: 1px solid var(--linha); border-left: 4px solid var(--azul); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.orc--respondido { border-left-color: #f5a524; } .orc--fechado { border-left-color: #1fae54; } .orc--perdido { border-left-color: #a0a9b8; opacity: .8; }
.orc__cab { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 14px 16px 8px; }
.orc__cab strong { font-size: 17px; }
.orc__emp { font-size: 14px; color: var(--suave); font-weight: 600; }
.orc__meta { font-size: 13px; color: var(--suave); margin-top: 3px; }
.orc__corpo { padding: 0 16px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.orc__itens { margin: 0; padding-left: 18px; font-size: 14px; }
.orc__itens b { color: var(--azul); }
.orc__obs { margin: 0; font-size: 14px; white-space: pre-wrap; background: var(--fundo); border-radius: 8px; padding: 8px 10px; }
.orc__rodape { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--linha); background: #fafcff; }
.orc__email { margin-left: auto; font-size: 12px; font-weight: 600; }
.orc__email.ok { color: #157a3c; } .orc__email.falha { color: #b45309; cursor: help; }
.status { width: auto; padding: 6px 10px; font-weight: 700; font-size: 13px; border-radius: 20px; }
.status--novo { background: var(--azul-suave); color: var(--azul); border-color: #b9d5ff; }
.status--respondido { background: #fff5e0; color: #a5560b; border-color: #f6d58e; }
.status--fechado { background: #eafaf0; color: #157a3c; border-color: #a6e3bd; }
.status--perdido { background: #f0f2f5; color: #5d6a80; }

@media (max-width: 760px) {
  .grade2, .grade3 { grid-template-columns: 1fr; }
  .grade-end { grid-template-columns: 1fr 1fr; }
  .e-rua, .e-comp, .e-bairro { grid-column: 1 / -1; }
  .orc__corpo { grid-template-columns: 1fr; }
  .adm-topo__dir { flex-wrap: wrap; }
}
.grade2 label, .grade3 label, .grade-end label { align-content: start; }
.alerta--ok { background: #eafaf0; border-color: #a6e3bd; color: #157a3c; }

/* usuários */
.usuario-topo { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--azul); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar--g { width: 44px; height: 44px; font-size: 18px; }
.tag { font: 600 11px "Barlow", sans-serif; background: var(--azul-suave); color: var(--azul); padding: 2px 8px; border-radius: 10px; vertical-align: middle; margin-left: 4px; }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

/* modal de confirmação */
.modal--confirma { width: min(420px, 100% - 24px); }
.conf { padding: 28px 28px 8px; text-align: center; }
.conf__visual { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: #fdecec; color: var(--perigo); box-shadow: 0 0 0 8px #fef5f5; }
.conf__visual svg { width: 28px; height: 28px; }
.conf__visual--img { width: 96px; height: 96px; border-radius: 14px; background: #fff; border: 1px solid var(--linha); box-shadow: none; overflow: hidden; }
.conf__visual--img img { width: 100%; height: 100%; object-fit: contain; }
.modal--aviso .conf__visual { background: #fff5e0; color: #c56a0b; box-shadow: 0 0 0 8px #fffaf0; }
.conf h3 { font: 700 24px "Barlow Condensed", sans-serif; text-transform: uppercase; color: var(--navy-900); margin-bottom: 8px; }
.conf__msg { margin: 0 0 8px; font-size: 16px; }
.conf__detalhe { margin: 0; font-size: 14px; color: var(--suave); line-height: 1.5; }
.conf__rodape { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; padding: 20px 28px 24px; }
.btn--perigo { background: var(--perigo); color: #fff; }
.btn--perigo:hover { background: #b92e2e; }
.modal--aviso .btn--perigo { background: var(--navy-900); }
.icones { grid-template-columns: repeat(8, 1fr); max-height: 260px; overflow-y: auto; padding: 2px; }

.linha__cod { flex: none; min-width: 52px; text-align: center; font: 700 14px "Barlow", sans-serif; color: var(--azul); background: var(--azul-suave); border-radius: 8px; padding: 6px 8px; }
.cod { display: inline-block; font-weight: 700; font-size: 12px; color: var(--suave); background: #eef2f7; border-radius: 6px; padding: 1px 6px; margin-right: 2px; }
