/* ───────── Design "Release Hub" — glassmorphism claro (paleta Hub4Cities) ───────── */
:root {
  --ink: #383536;
  --ink-2: #383536;
  --muted: #666666;
  --muted-2: #666666;
  --line: rgba(102, 102, 102, 0.15);
  --accent: #0D94A6;
  --accent-2: #175974;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --shadow: 0 10px 30px rgba(56, 53, 54, 0.08);
  --ok: #1f8a64;
  --ok-dot: #2eaa82;
  --warn: #c98a1f;
  --warn-dot: #e0a73c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--ink);
  background: #eef3f4;
  -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; }
.hidden { display: none !important; }
.mono { font-family: 'JetBrains Mono', monospace; }
::selection { background: rgba(13, 148, 166, 0.22); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.scrl::-webkit-scrollbar { width: 10px; height: 10px; }
.scrl::-webkit-scrollbar-thumb { background: rgba(13, 148, 166, 0.22); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }

/* App background */
.bg {
  position: relative; min-height: 100vh; width: 100%;
  background: #eef3f4;
}

/* Shell */
.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex: none; padding: 22px 16px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(255, 255, 255, 0.45); backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%); border-right: 1px solid rgba(255, 255, 255, 0.6);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 20px; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(140deg, #175974, #0D94A6); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; }
.brand .name { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; }
.brand .sub { font-size: 11px; color: var(--muted); font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px; border: none;
  cursor: pointer; font-weight: 600; font-size: 14px; width: 100%; text-align: left; transition: all 0.15s;
  background: transparent; color: var(--ink-2);
}
.nav-item:hover { background: rgba(13, 148, 166, 0.07); }
.nav-item.active { background: linear-gradient(140deg, rgba(23, 89, 116, 0.11), rgba(13, 148, 166, 0.08)); color: var(--accent); }
.user-chip { margin-top: auto; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.7); display: flex; align-items: center; gap: 11px; }
.user-chip .av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(140deg, #3aa17e, #5ad0b5); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; }
.user-chip .nm { font-weight: 700; font-size: 13px; }
.user-chip .rl { font-size: 11px; color: var(--muted); }
.user-chip .out { margin-left: auto; border: none; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 12px; }

.main { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.crumb { font-size: 12px; font-weight: 600; color: var(--muted-2); letter-spacing: 0.3px; text-transform: uppercase; }
.page-title { margin: 3px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 13px; background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.65); min-width: 260px; }
.search input { border: none; background: transparent; outline: none; font-size: 13.5px; width: 100%; color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: none; border-radius: 13px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.btn.primary { background: linear-gradient(140deg, #175974, #0D94A6); color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, 0.5); color: var(--ink-2); border: 1px solid rgba(102, 102, 102, 0.25); }
.btn.link { background: transparent; color: var(--accent); padding: 0; box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* Cards / glass */
.card { padding: 22px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border: 1px solid var(--glass-strong); box-shadow: var(--shadow); }
.grid-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.metric { padding: 20px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border: 1px solid var(--glass-strong); box-shadow: var(--shadow); animation: fadeUp 0.5s both; }
.metric .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.metric .val { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin-top: 12px; }
.metric .dot { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.metric .trend { font-size: 12px; font-weight: 600; margin-top: 2px; }
.cols { display: grid; gap: 18px; }
.cols.dash { grid-template-columns: 1.55fr 1fr; }
.cols.rep { grid-template-columns: 1.4fr 1fr; margin-bottom: 18px; }
h3.sec { margin: 0 0 16px; font-size: 16px; font-weight: 700; }

/* Recent / row item */
.recent-row { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 13px; cursor: pointer; transition: background 0.15s; }
.recent-row:hover { background: rgba(13, 148, 166, 0.07); }
.chip-ver { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--accent); background: rgba(13, 148, 166, 0.1); padding: 5px 9px; border-radius: 8px; flex: none; }
.row-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12px; color: var(--muted-2); }
.badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.status { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.status .sd { width: 7px; height: 7px; border-radius: 50%; }

/* Bars */
.bar-track { height: 8px; border-radius: 20px; background: rgba(102, 102, 102, 0.13); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; transition: width 0.5s; }
.bar-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* List table */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 9px 15px; border-radius: 11px; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.15s; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.55); color: var(--ink-2); }
.chip.on { background: linear-gradient(140deg, #175974, #0D94A6); color: #fff; border-color: transparent; }
.sel { padding: 9px 12px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(16px); font-size: 13px; font-weight: 600; color: var(--ink); outline: none; cursor: pointer; }
.tablewrap { border-radius: 22px; background: var(--glass); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border: 1px solid var(--glass-strong); box-shadow: var(--shadow); overflow: hidden; }
.trow { display: grid; grid-template-columns: 110px 1fr 150px 150px 150px 70px; gap: 14px; align-items: center; }
/* linhas da lista de atualizações: última coluna maior (botões "Ver" + "Enviar") */
.trow.upd { grid-template-columns: 110px 1fr 150px 150px 150px 180px; }
/* mesma linha com a caixa de seleção pro envio em lote (só quem pode enviar vê) */
.trow.upd.pick { grid-template-columns: 32px 110px 1fr 150px 150px 150px 180px; }
.trow.pick input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; display: block; }
.trow.tbody.marcada { background: rgba(13, 148, 166, 0.07); }
.trow.cli { grid-template-columns: 130px 1fr 150px; }
/* rastreio de envios: cliente · atualização · quando · push · endpoint · visualização */
.trow.trk { grid-template-columns: 150px minmax(0, 1.2fr) 150px 170px minmax(0, 1fr) 130px; }
.thead { padding: 14px 22px; font-size: 11.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--line); }
.tbody { padding: 15px 22px; border-bottom: 1px solid rgba(102, 102, 102, 0.09); transition: background 0.15s; }
.tbody:hover { background: rgba(13, 148, 166, 0.05); }
.empty { padding: 48px; text-align: center; color: var(--muted-2); font-size: 14px; }

/* Barra de ação do envio em lote: fica colada no rodapé enquanto houver seleção,
   pra decisão e ação ficarem juntas mesmo com a lista rolada. */
.bulkbar {
  position: sticky; bottom: 14px; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 14px; padding: 13px 18px;
  border-radius: 16px; border: 1px solid var(--glass-strong);
  background: var(--glass); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 600; color: var(--ink-2);
}

/* Entrega do push por cliente (card de envio no detalhe da atualização) */
.push-table { margin-top: 12px; border-top: 1px solid var(--line); }
.push-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 150px 170px 130px; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid rgba(102, 102, 102, 0.09); font-size: 13px; }
.push-head { font-size: 11.5px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.4px; }
/* url_cconet costuma ser longa: trunca em vez de estourar o card (completa no title). */
.push-url { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* cards-filtro do topo do rastreio: clicar filtra a tabela pelo status */
.trk-card { transition: all 0.15s; }
.trk-card:hover { transform: translateY(-2px); }
.trk-card.on { outline: 2px solid var(--accent); outline-offset: -2px; }
.push-err { padding: 8px 10px; margin: 0 0 8px; border-radius: 8px; background: rgba(210, 71, 63, 0.08); color: #a3352e; font-size: 11.5px; word-break: break-word; }

/* Modal (envio de atualização) */
.modal-back {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(56, 53, 54, 0.34); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.16s both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 680px; max-height: 88vh; display: flex; flex-direction: column;
  border-radius: 24px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%); border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 22px 60px rgba(56, 53, 54, 0.24); animation: fadeUp 0.22s both; overflow: hidden;
}
.modal-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head .mt { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.modal-head .ms { margin: 5px 0 0; font-size: 13px; color: var(--muted-2); font-weight: 500; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { padding: 16px 24px 20px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; }
.modal .warn { padding: 11px 14px; border-radius: 12px; background: rgba(224, 167, 60, 0.14); color: #96661a; font-size: 12.5px; font-weight: 600; margin-bottom: 16px; }

/* Combobox de clientes (digita, busca, seleciona -> vira tag) */
.combo { position: relative; }
.combo-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 9px 10px; min-height: 46px;
  border-radius: 12px; border: 1px solid rgba(102, 102, 102, 0.22); background: rgba(255, 255, 255, 0.7);
}
.combo-box:focus-within { border-color: rgba(13, 148, 166, 0.5); }
.combo-box input {
  flex: 1; min-width: 140px; border: none; outline: none; background: transparent; font-size: 13.5px; color: var(--ink);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 8px;
  background: rgba(13, 148, 166, 0.1); color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.tag button {
  border: none; background: rgba(13, 148, 166, 0.18); color: var(--accent); width: 16px; height: 16px; border-radius: 50%;
  font-size: 11px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.tag button:hover { background: var(--accent); color: #fff; }
/* position:fixed + top/left/width calculados via JS (posicionarDropdown em app.js) —
   precisa ESCAPAR do .modal-body (que tem overflow-y:auto e corta qualquer coisa
   posicionada dentro dele que "vaze" pra fora da área visível). Por isso o elemento
   é anexado direto no <body>, fora da árvore do modal. */
.combo-drop {
  position: fixed; z-index: 60; max-height: 320px; overflow-y: auto;
  border-radius: 14px; background: #fff; border: 1px solid rgba(102, 102, 102, 0.18); box-shadow: 0 16px 40px rgba(56, 53, 54, 0.18);
  padding: 6px;
}
.combo-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.combo-opt:hover, .combo-opt.hl { background: rgba(13, 148, 166, 0.08); }
.combo-opt.all { font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; margin-bottom: 4px; }
.combo-empty { padding: 14px; text-align: center; font-size: 13px; color: var(--muted-2); }

/* Forms */
.form-card { max-width: 760px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 7px; color: #4a4960; }
.input, .textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(102, 102, 102, 0.22); background: rgba(255, 255, 255, 0.7); font-size: 14px; color: var(--ink); outline: none; }
.input:focus, .textarea:focus { border-color: rgba(13, 148, 166, 0.5); }
.textarea { resize: vertical; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.hint { font-size: 12.5px; color: var(--muted-2); }
.err { color: #d2473f; font-size: 13px; min-height: 1em; margin: 8px 0 0; }

/* Detail */
.detail { max-width: 880px; }
.detail-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-meta .k { font-size: 11.5px; color: var(--muted-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.detail-meta .v { font-weight: 700; font-size: 14.5px; margin-top: 4px; }
.callout { padding: 16px 18px; border-radius: 15px; background: rgba(13, 148, 166, 0.07); border: 1px solid rgba(13, 148, 166, 0.15); }
a { color: var(--accent); }

/* Reports bars */
.barchart { display: flex; align-items: flex-end; gap: 16px; height: 200px; }
.barchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.barchart .bar { width: 100%; max-width: 42px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #175974, #0D94A6); transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; position: relative; z-index: 1; }
.login-card { width: 360px; padding: 30px; border-radius: 24px; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%); border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 14px 40px rgba(56, 53, 54, 0.12); animation: fadeUp 0.5s both; }
.login-card h1 { margin: 12px 0 2px; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.login-card .sub { margin: 0 0 22px; font-size: 13px; color: var(--muted); }

@media (max-width: 920px) {
  .grid-metrics { grid-template-columns: repeat(2, 1fr); }
  .cols.dash, .cols.rep { grid-template-columns: 1fr; }
  .trow { grid-template-columns: 90px 1fr 110px 70px; }
  .trow.upd { grid-template-columns: 90px 1fr 110px 180px; }
  .trow.upd.pick { grid-template-columns: 28px 90px 1fr 110px 180px; }
  .trow.cli { grid-template-columns: 90px 1fr 110px; }
  .trow.trk { grid-template-columns: 110px minmax(0, 1fr) 150px; }
  .trow.trk > :nth-child(3), .trow.trk > :nth-child(5), .trow.trk > :nth-child(6) { display: none; }
  .push-row { grid-template-columns: 90px minmax(0, 1fr) 130px; }
  .push-row > :nth-child(4), .push-row > :nth-child(5) { display: none; }
  .trow .col-type, .trow .col-date { display: none; }
}
