/* relataEndo · interface
   Tipografia Instrument Sans, cores sólidas, pensado primeiro para celular. */
:root {
  --pri: #3B5B8C;
  --sec: #EEF2F8;
  --txt: #1C2230;
  --txt2: #5B6474;
  --txt3: #8A93A3;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --line: #E3E6EC;
  --line2: #EEF0F4;
  --ok: #1F7A4D;
  --ok-bg: #E7F4EC;
  --warn: #9A6200;
  --warn-bg: #FFF4DE;
  --err: #B42318;
  --err-bg: #FDECEA;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 28, 45, .06), 0 2px 8px rgba(20, 28, 45, .04);
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--txt); background: var(--bg);
  font-size: 15px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pri); text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
svg { display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; }
.brand-mark { font-weight: 500; font-size: 18px; letter-spacing: -0.03em; color: var(--txt); }
.brand-mark b { font-weight: 700; color: var(--pri); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--txt); font-weight: 600; font-size: 14px; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; text-decoration: none;
}
.btn:hover { border-color: #CBD1DA; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn-pri:hover { border-color: var(--pri); opacity: .92; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--txt2); }
.btn-ghost:hover { background: var(--line2); border-color: transparent; }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-bg); border-color: #F3C4BF; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--txt2); cursor: pointer;
}
.icon-btn:hover { background: var(--line2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Formulários ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: 13px; font-weight: 600; color: var(--txt2); margin-bottom: 6px; }
.field small { display: block; color: var(--txt3); font-size: 12px; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A3' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 36px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 16%, transparent); }
input[type=color] { width: 48px; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--pri); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.span-2 { grid-column: 1 / -1; }

/* ---------- Alertas ---------- */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.alert-erro { background: var(--err-bg); color: var(--err); }
.alert-info { background: var(--sec); color: var(--txt); }

/* ---------- Telas de acesso ---------- */
body.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; padding: 32px 24px 22px; box-shadow: var(--shadow); border: 1px solid var(--line2); }
.auth-logo { display: block; max-height: 64px; max-width: 220px; margin: 0 auto 14px; object-fit: contain; }
.auth-app { text-align: center; }
.auth-app .brand-mark { font-size: 24px; }
.auth-sub { text-align: center; color: var(--txt2); margin: 2px 0 0; font-size: 14px; }
.auth-title { font-size: 20px; margin: 22px 0 16px; }
.auth-help { color: var(--txt2); font-size: 14px; margin: -6px 0 16px; }
.auth-credit { text-align: center; color: var(--txt3); font-size: 12px; margin: 22px 0 0; }

/* ---------- Estrutura do app ---------- */
body.app { min-height: 100vh; }
.sidebar { display: none; }
.main-wrap { min-height: 100vh; padding-bottom: calc(76px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 12px 0 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.view { padding: 18px 16px 24px; max-width: 1120px; margin: 0 auto; outline: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; color: var(--txt3); font-size: 11px; font-weight: 600; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--pri); }

@media (min-width: 960px) {
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 30;
    background: #fff; border-right: 1px solid var(--line); padding: 20px 14px;
  }
  .sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 4px 10px 20px; }
  .sidebar-brand img { max-height: 46px; max-width: 180px; object-fit: contain; }
  .nav { display: flex; flex-direction: column; gap: 2px; }
  .nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--txt2); font-weight: 600; font-size: 14.5px; }
  .nav a:hover { background: var(--line2); }
  .nav a.on { background: var(--sec); color: var(--pri); }
  .nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--line2); }
  .user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .user-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--sec); color: var(--pri); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
  .main-wrap { margin-left: 248px; padding-bottom: 0; }
  .topbar { display: none; }
  .tabbar { display: none; }
  .view { padding: 32px 36px 48px; }
}

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--txt2); font-size: 14px; }
.page-head .acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--txt2); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.voltar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Cartões ---------- */
.card { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h2 { font-size: 17px; }
.card-title .muted { font-size: 13px; }
.muted { color: var(--txt3); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; color: var(--txt); line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--txt2); font-weight: 500; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .dash-grid { grid-template-columns: 1.6fr 1fr; } }

/* ---------- Listas ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--txt3); stroke-width: 2; }
.toolbar .search input { padding-left: 38px; }
.toolbar select { width: auto; flex: 0 0 auto; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line2);
  border-radius: var(--r); box-shadow: var(--shadow); color: var(--txt); cursor: pointer; text-align: left; width: 100%;
}
.item:hover { border-color: var(--line); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { color: var(--txt2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12.5px; color: var(--txt3); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: 0; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-neutral { background: var(--line2); color: var(--txt2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--sec); color: var(--pri); font-weight: 700; font-size: 12.5px; }
.empty { text-align: center; padding: 38px 16px; color: var(--txt2); }
.empty b { display: block; color: var(--txt); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.rank { display: flex; flex-direction: column; }
.rank a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); color: var(--txt); font-size: 14px; }
.rank a:last-child { border-bottom: 0; }
.rank b { color: var(--pri); }
.dl { display: grid; grid-template-columns: 1fr; gap: 10px 18px; }
@media (min-width: 640px) { .dl { grid-template-columns: 1fr 1fr; } }
.dl div span { display: block; font-size: 12px; color: var(--txt3); font-weight: 600; }
.dl div b { font-weight: 500; font-size: 14.5px; word-break: break-word; }

/* ---------- Editor de relatório ---------- */
.editor-head { position: sticky; top: 58px; z-index: 15; margin: -18px -16px 16px; padding: 10px 16px; background: rgba(246, 247, 249, .96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media (min-width: 960px) { .editor-head { top: 0; margin: -32px -36px 20px; padding: 14px 36px; } }
.editor-head .titulo { min-width: 0; }
.editor-head .titulo b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-head .titulo small { color: var(--txt3); font-size: 12.5px; }
.editor-head .acoes { display: flex; gap: 6px; flex: none; }
.save-state { font-size: 12px; color: var(--txt3); }
.save-state.salvando { color: var(--warn); }
.save-state.erro { color: var(--err); }
.sec-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sec); color: var(--pri); font-weight: 700; font-size: 13px; margin-right: 10px; flex: none; }
.card-title h2 { display: flex; align-items: center; }

.picker { position: relative; }
.picker-row { display: flex; gap: 8px; }
.picker-row > :first-child { flex: 1; min-width: 0; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 28, 45, .14); max-height: 280px; overflow: auto; }
.picker-list button { display: block; width: 100%; text-align: left; padding: 11px 14px; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--line2); }
.picker-list button:hover, .picker-list button.ativo { background: var(--sec); }
.picker-list small { color: var(--txt3); display: block; font-size: 12px; }
.picker-sel { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.picker-sel b { font-weight: 600; }
.picker-sel small { color: var(--txt3); display: block; font-size: 12px; }

.dento-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 4px 6px 8px; }
.dento-wrap svg { width: 100%; min-width: 560px; height: auto; }
.dento-wrap .dt { cursor: pointer; outline: none; }
.dento-wrap .dt:focus-visible rect { stroke: var(--pri); stroke-width: 2; }
.dento-tip { font-size: 12.5px; color: var(--txt3); margin-top: 4px; }
.dento-acoes { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }

.dente-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; background: #fff; }
.dente-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dente-card-head b { font-size: 16px; }
.dente-card-head small { display: block; color: var(--txt3); font-size: 12.5px; font-weight: 500; }
.dente-num { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: 10px; background: var(--pri); color: #fff; font-weight: 700; font-size: 16px; margin-right: 10px; }
.canais { width: 100%; border-collapse: collapse; }
.canais th { text-align: left; font-size: 12px; font-weight: 600; color: var(--txt3); padding: 0 6px 6px 0; white-space: nowrap; }
.canais td { padding: 0 6px 8px 0; vertical-align: top; }
.canais input { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.canais td.del { width: 40px; padding-right: 0; }
.canais-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.canais-wrap table { min-width: 520px; }
@media (max-width: 639px) {
  .canais-wrap table, .canais-wrap thead, .canais-wrap tbody, .canais-wrap tr, .canais-wrap td { display: block; min-width: 0; }
  .canais-wrap thead { display: none; }
  .canais-wrap tr { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 10px 2px; margin-bottom: 8px; position: relative; background: var(--bg); }
  .canais-wrap td { padding: 0 0 8px; }
  .canais-wrap td::before { content: attr(data-l); display: block; font-size: 12px; color: var(--txt3); font-weight: 600; margin-bottom: 3px; }
  .canais-wrap td.del { position: absolute; top: 4px; right: 4px; width: auto; }
  .canais-wrap td.del::before { display: none; }
}

.fotos-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .fotos-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .fotos-grid { grid-template-columns: 1fr 1fr 1fr; } }
.foto-card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.foto-img { position: relative; aspect-ratio: 4 / 3; background: var(--line2); }
.foto-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.foto-img .ordem { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; }
.foto-img .ordem button, .foto-img .del { width: 34px; height: 34px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .94); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.foto-img .del { position: absolute; right: 8px; top: 8px; color: var(--err); }
.foto-img svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.foto-body { padding: 12px; }
.foto-body .field { margin-bottom: 10px; }
.foto-body textarea { min-height: 70px; }
.upload-zone { display: block; border: 1.5px dashed #C7CDD8; border-radius: var(--r); padding: 22px 16px; text-align: center; color: var(--txt2); cursor: pointer; background: #fff; margin-bottom: 14px; transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--pri); background: var(--sec); }
.upload-zone b { color: var(--pri); }
.upload-zone svg { width: 30px; height: 30px; margin: 0 auto 6px; fill: none; stroke: var(--pri); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.progresso { height: 4px; background: var(--line2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progresso i { display: block; height: 100%; background: var(--pri); width: 0; transition: width .2s; }

.status-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--line2); padding: 4px; border-radius: 12px; }
.status-switch button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; cursor: pointer; color: var(--txt2); }
.status-switch button.on { background: #fff; color: var(--txt); box-shadow: var(--shadow); }
.bottom-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bottom-actions .btn { flex: 1 1 160px; }

/* ---------- Configurações ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13.5px; color: var(--txt2); cursor: pointer; }
.tabs button.on { background: var(--pri); border-color: var(--pri); color: #fff; }
@media (min-width: 960px) { .tabs { margin: 0 0 18px; padding: 0; } }
.cor-row { display: flex; align-items: center; gap: 10px; }
.cor-row input[type=text] { flex: 1; text-transform: uppercase; }
.asset-box { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 14px; flex-wrap: wrap; }
.asset-prev { width: 120px; height: 64px; border-radius: 8px; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; color: var(--txt3); font-size: 12px; text-align: center; }
.asset-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-info { flex: 1; min-width: 160px; }
.asset-info b { display: block; font-size: 14px; }
.asset-info small { color: var(--txt3); font-size: 12.5px; }
.asset-acoes { display: flex; gap: 6px; }
.lista-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.lista-edit .row { display: flex; gap: 6px; align-items: center; }
.lista-edit .row input { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.lista-edit .row .mv { display: flex; flex-direction: column; }
.lista-edit .row .mv button { width: 30px; height: 20px; border: 0; background: none; color: var(--txt3); cursor: pointer; padding: 0; }
.lista-edit .row .mv svg { width: 16px; height: 16px; margin: 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; }
.proto-item { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; background: #fff; }
.proto-item-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.proto-item-head input { font-weight: 600; }
.preview-cab { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 18px 20px; margin-bottom: 16px; }
.preview-cab .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1.5px solid var(--pri); }
.preview-cab img { max-height: 54px; max-width: 46%; object-fit: contain; }
.preview-cab .pc-nome { text-align: right; }
.preview-cab .pc-nome b { display: block; font-size: 16px; }
.preview-cab .pc-nome small { display: block; font-size: 12px; color: var(--txt2); }
.preview-cab .pc-faixa { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.sticky-save { position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 12; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0 4px; background: var(--bg); }
@media (min-width: 960px) { .sticky-save { bottom: 0; padding-bottom: 16px; } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 32, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.modal { width: 100%; max-width: 560px; max-height: 92vh; background: #fff; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .2s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px 20px; border-bottom: 1px solid var(--line2); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 16px 20px; overflow: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line2); }
.modal-foot .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .modal-back { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; }
  .modal-foot .btn { flex: 0 0 auto; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + var(--safe-b)); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 420px; }
@media (min-width: 960px) { #toast-root { bottom: 24px; } }
.toast { background: #1C2230; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: up .2s ease; pointer-events: auto; }
.toast.erro { background: var(--err); }

.carregando { display: flex; justify-content: center; padding: 48px 0; }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--pri); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.hide { display: none !important; }
