/* BotSender - estilos da casca modular (roteador, CRM embutido, componentes MC.ui). */

/* breadcrumb na barra de título */
.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; }
.crumb:empty { display: none; }
.crumb span { opacity: .75; }
.crumb b { font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.crumb svg.i { width: 13px; height: 13px; opacity: .55; }
:root[data-theme="light"] .crumb, :root[data-theme="light"] .crumb b { color: #fff; }

/* itens ainda na janela clássica */
.navitem.legacy .ext { opacity: .35; }
.navitem.legacy:hover .ext { opacity: .7; }
.legacy-tag {
  grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
  font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--muted-2);
  padding: 2px 7px; border-radius: 999px; background: var(--hover);
}
.legacy-tag svg.i { width: 11px; height: 11px; }

/* páginas embutidas (sem padding, ocupam a área toda) */
.view.embed { padding: 0; overflow: hidden; position: relative; }
.view.embed.active { display: flex; animation: none; }
.crm-frame { flex: 1; width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
.crm-loader[hidden] { display: none; }
.crm-loader { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-size: 13px; background: var(--bg); z-index: 2; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--accent-ghost); border-top-color: var(--accent); animation: mcspin .8s linear infinite; }
@keyframes mcspin { to { transform: rotate(360deg); } }

/* modal */
.mc-modal-back {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 24px;
  background: rgba(4, 12, 14, .55); backdrop-filter: blur(2px); animation: fadein .15s ease;
}
.mc-modal-back.out { opacity: 0; transition: opacity .15s; }
.mc-modal {
  width: min(480px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  animation: rise .18s ease;
}
.mc-modal.wide { width: min(820px, 100%); }
.mc-modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.mc-modal-h h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.mc-modal-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-xs); display: grid; place-items: center; }
.mc-modal-x:hover { background: var(--hover); color: var(--text); }
.mc-modal-b { padding: 4px 18px 14px; overflow-y: auto; }
.mc-modal-text { margin: 0; color: var(--text-dim); line-height: 1.5; }
.mc-modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--border-soft); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* abas */
.mc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 14px; overflow-x: auto; }
.mc-tab {
  border: 0; background: transparent; cursor: pointer; padding: 9px 14px; font-size: 13px; font-weight: 550;
  color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.mc-tab:hover { color: var(--text); }
.mc-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }

/* skeleton */
.skelbox { display: grid; gap: 10px; padding: 6px 0; }
.skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2), var(--hover), var(--panel-2)); background-size: 200% 100%; animation: skel 1.2s ease infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* importar planilha com pré-visualização (MC.ui.importSheet) */
.mc-modal.is-modal { width: min(1180px, 96vw); max-height: 92vh; }
.is-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 10px; }
.is-file { color: var(--text-dim); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 240px; }
.is-file svg { width: 15px; height: 15px; }
.is-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.is-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.is-f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.is-f span { font-weight: 600; }
.is-f.is-req span { color: var(--accent); }
.is-f select { width: 100%; min-width: 0; }
.is-links { font-size: 12px; margin: 6px 2px 8px; }
.is-links a { color: var(--accent); text-decoration: none; }
.is-links a:hover { text-decoration: underline; }
.is-grid { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: auto; max-height: 44vh; margin-top: 8px; }
.is-tbl { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.is-tbl th, .is-tbl td { border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); padding: 5px 8px; white-space: nowrap; text-align: left; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.is-tbl thead th { position: sticky; top: 0; background: var(--elev); z-index: 1; vertical-align: top; }
.is-tbl .is-rn { color: var(--muted-2); text-align: right; width: 1%; background: var(--panel-2); }
.is-tbl thead .is-rn { z-index: 2; }
.is-cl { font-size: 10.5px; color: var(--muted-2); font-weight: 700; }
.is-hn { font-weight: 600; color: var(--text); }
.is-role { font-size: 10.5px; font-weight: 700; margin-top: 2px; }
.is-tbl th.is-n .is-role { color: var(--ok); }
.is-tbl th.is-m .is-role { color: var(--accent); }
.is-tbl th.is-v .is-role { color: var(--info); }
.is-tbl td.is-off, .is-tbl th.is-off .is-hn { color: var(--muted-2); }
.is-tbl td.is-n { background: rgba(16, 185, 129, .08); }
.is-tbl td.is-m { background: var(--accent-ghost); }
.is-tbl td.is-v { background: rgba(56, 189, 248, .07); }
.is-tbl td.is-bad { color: var(--danger); text-decoration: line-through; }
.is-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 12.5px; }
.is-err { color: var(--danger); font-weight: 600; }
