/* Big4Tech Plataforma — tokens visuais.
   --brand / --brand-2 são trocados em tempo real pela empresa ativa. */
:root {
  --brand: #E6365A;
  --brand-2: #1E1B24;
  --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --rail: #17151C;
  --rail-ink: #A9A6B3;
  --rail-hover: #24212B;
  --bg: #F4F4F7;
  --surface: #FFFFFF;
  --ink: #1D1B22;
  --muted: #6B6878;
  --line: #E4E3EA;
  --ok: #10B981;
  --warn: #F59E0B;
  --danger: #E11D48;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 18, 28, .06), 0 4px 14px rgba(20, 18, 28, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }

/* ------------------------------------------------ estrutura */
#app { display: grid; grid-template-rows: 56px 1fr; grid-template-columns: auto 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; text-decoration: none; white-space: nowrap; }
.logo .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--brand-2))); display: grid; place-items: center; color: var(--brand-ink); font-size: 13px; font-weight: 800; }
.logo img { height: 28px; }
.logo small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

.sectors { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin: 0 auto; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.sectors button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.sectors button svg { width: 15px; height: 15px; }
.sectors button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.sectors button.on svg { color: var(--brand); }

.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.empresa-pick { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px 0 10px; height: 36px; background: var(--surface); }
.empresa-pick .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.empresa-pick select { border: 0; background: transparent; font-weight: 600; outline: none; cursor: pointer; padding-right: 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; cursor: pointer; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-pop { position: absolute; right: 12px; top: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.14); min-width: 240px; padding: 6px; z-index: 50; }
.menu-pop .who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop .who b { display: block; }
.menu-pop .who span { color: var(--muted); font-size: 12px; }
.menu-pop button { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu-pop button:hover { background: var(--bg); }

/* ------------------------------------------------ barra lateral recolhida */
.rail { background: var(--rail); width: 64px; display: flex; flex-direction: column; align-items: stretch; padding: 10px 8px; gap: 4px; overflow-y: auto; transition: width .18s ease; }
.rail.wide { width: 228px; }
.rail button, .rail a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--rail-ink); background: none; border: 0; cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden; }
.rail button:hover, .rail a:hover { background: var(--rail-hover); color: #fff; }
.rail a.on { background: color-mix(in srgb, var(--brand) 22%, transparent); color: color-mix(in srgb, var(--brand) 70%, #fff); }
.rail .lbl { opacity: 0; transition: opacity .12s; font-weight: 500; }
.rail.wide .lbl { opacity: 1; }
.rail .sep { height: 1px; background: #2B2833; margin: 6px 4px; }
.rail .toggle { border: 1px solid #2B2833; }

main { overflow: auto; min-width: 0; grid-column: 2; }

/* ------------------------------------------------ tela inicial (ícones) */
.home { min-height: 100%; padding: 48px 24px 64px; background-color: var(--bg); background-image: radial-gradient(#D7D6DF 1px, transparent 1px); background-size: 18px 18px; }
.home h1 { text-align: center; margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.home p.sub { text-align: center; color: var(--muted); margin: 0 0 36px; }
.grid-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 28px 18px; max-width: 900px; margin: 0 auto; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 500; text-align: center; }
.app-icon { width: 72px; height: 72px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.app-icon::before { content: ''; position: absolute; width: 44px; height: 44px; border-radius: 14px 22px 14px 22px; background: var(--c); opacity: .9; transform: translate(-6px, -4px) rotate(-8deg); }
.app-icon::after { content: ''; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--c2); opacity: .85; transform: translate(14px, 12px); }
.app-icon svg { position: relative; z-index: 1; width: 30px; height: 30px; color: #fff; stroke-width: 2.1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
.app-tile:hover .app-icon { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(20,18,28,.12); }
.empty-home { text-align: center; color: var(--muted); padding: 40px; }

/* ------------------------------------------------ cabeçalho de app */
.app-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 24px; display: flex; align-items: center; gap: 24px; height: 52px; position: sticky; top: 0; z-index: 5; }
.app-head h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.app-head h2 .chip-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.app-head h2 .chip-ico svg { width: 16px; height: 16px; }
.app-menu { display: flex; gap: 2px; height: 100%; overflow-x: auto; }
.app-menu a { display: flex; align-items: center; padding: 0 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.app-menu a.on { color: var(--ink); border-color: var(--brand); }
.page { padding: 20px 24px 48px; }

/* ------------------------------------------------ componentes */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h3 { margin: 0 12px 0 0; font-size: 18px; }
.toolbar .count { color: var(--muted); }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: #CFCDD8; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: none; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--surface); min-width: 240px; }
.search input { border: 0; outline: none; flex: 1; background: none; }
.search svg { color: var(--muted); width: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg a, .seg button { display: grid; place-items: center; width: 36px; height: 34px; color: var(--muted); border: 0; background: none; cursor: pointer; }
.seg .on { background: var(--brand-soft); color: var(--brand); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.grid th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFAFC; white-space: nowrap; }
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr.click { cursor: pointer; }
table.grid tbody tr.click:hover td { background: #FAFAFD; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--ink); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: color-mix(in srgb, var(--brand) 80%, #000); }
.badge.ok { background: #D1FAE5; color: #065F46; }
.badge.off { background: #F1F1F4; color: var(--muted); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.muted { color: var(--muted); }
.empty { padding: 48px; text-align: center; color: var(--muted); }

/* formulário */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 1100px; }
.form-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.form-head h3 { margin: 0; font-size: 18px; }
.crumb { color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); }
.form-body { padding: 8px 20px 20px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: #46434F; }
.field label .req { color: var(--danger); }
.input, .field input, .field select, .field textarea { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; background: var(--surface); outline: none; width: 100%; }
.field input[type=checkbox], .field input[type=radio] { width: auto; height: auto; padding: 0; box-shadow: none; }
.field input[type=color] { width: 64px; padding: 3px; cursor: pointer; }
.field textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input[readonly], .field select:disabled, .field textarea[readonly] { background: #F7F7FA; color: #55525E; }
.ro-value { min-height: 38px; display: flex; align-items: center; padding: 0 2px; }
.hint { font-size: 12px; color: var(--muted); }

/* kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { width: 290px; flex-shrink: 0; background: #ECEBF1; border-radius: var(--radius); padding: 10px; min-height: 140px; }
.kcol.drop { outline: 2px dashed var(--brand); outline-offset: -2px; }
.kcol h4 { margin: 2px 4px 10px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.kcol h4 .n { color: var(--muted); font-weight: 500; }
.kcol h4 .sum { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.kcard { background: var(--surface); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: pointer; border-left: 3px solid var(--brand); }
.kcard:hover { box-shadow: var(--shadow); }
.kcard b { display: block; margin-bottom: 6px; }
.kcard .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }

/* administração */
.split { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.list-side .item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-side .item:last-child { border-bottom: 0; }
.list-side .item.on { background: var(--brand-soft); }
.list-side .item .sw { width: 10px; height: 10px; border-radius: 3px; }
.list-side .item small { display: block; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; cursor: pointer; background: var(--surface); user-select: none; }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.check input { accent-color: var(--brand); margin: 0; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; }
.matrix select { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; background: var(--surface); }
.matrix input[type=text] { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; width: 100%; min-width: 140px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }
.changed td { background: #FFFBEB; }
.order-list .row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; background: var(--surface); }
.order-list .row .grow { flex: 1; }
.order-list .row input[type=text] { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; width: 170px; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.int-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.int-card .top { display: flex; align-items: center; gap: 12px; }
.int-card .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.int-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.note { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 10px; padding: 12px 14px; color: #78350F; font-size: 13px; line-height: 1.5; }
.note.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, #fff); color: var(--ink); }
.swatch { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); padding: 2px; cursor: pointer; background: none; }

/* modal / gaveta */
.overlay { position: fixed; inset: 0; background: rgba(20, 18, 28, .38); z-index: 100; display: flex; justify-content: flex-end; }
.drawer { width: min(760px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; font-size: 17px; }
.drawer .body { flex: 1; overflow: auto; padding: 20px; }
.drawer footer { padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500; }
.toast.err { background: var(--danger); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .brand-side { background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--brand) 55%, #000) 0, var(--rail) 60%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login .brand-side h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; max-width: 460px; }
.login .brand-side p { color: #CFCBDA; max-width: 420px; line-height: 1.6; }
.login .form-side { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login .box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login .box h2 { margin: 0; font-size: 24px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; font-size: 15px; text-decoration: none; color: var(--ink); }
.gbtn:hover { background: #F8F8FB; }
.gbtn.disabled { opacity: .55; pointer-events: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.err-box { background: #FFE4E6; color: #9F1239; padding: 10px 12px; border-radius: 9px; font-size: 13px; }

@media (max-width: 900px) {
  .split, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .brand-side { display: none; }
}
@media (max-width: 680px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .sectors { order: 3; width: 100%; margin: 0; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; width: 100% !important; height: 58px; flex-direction: row; z-index: 30; padding: 8px; overflow-x: auto; }
  .rail .lbl, .rail .toggle, .rail .sep { display: none; }
  main { padding-bottom: 64px; grid-column: 1; }
  .fields { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .app-head { padding: 0 16px; gap: 12px; }
  .search { min-width: 0; flex: 1; }
  .grid-apps { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 22px 10px; }
}

/* ------------------------------------------------ CRM: filtros, kanban, registro, histórico, painel */
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.filters svg { width: 16px; height: 16px; }
#filterbar:empty { display: none; }
#filterbar { margin: -6px 0 14px; }
.filter-sel { height: 32px; width: auto; max-width: 240px; font-size: 13px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.filter-sel.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.seg-text button { width: auto; padding: 0 12px; font-weight: 600; font-size: 13px; }
.badge.warn { background: #FEF3C7; color: #92400E; }
.badge.bad { background: #FFE4E6; color: #9F1239; }
.badge.hot { background: #FFEDD5; color: #9A3412; }
.badge.hot svg { width: 12px; height: 12px; }

.kcol.kind-ganho { background: #E3F5EC; }
.kcol.kind-perdido { background: #F7E9EC; }
.kcard.hot { border-left-color: #F97316; }
.kcard.dragging { opacity: .5; }
.kfoot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.act-dot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.act-dot svg { width: 14px; height: 14px; }
.act-dot.late { color: var(--danger); }
.act-dot.today { color: #D97706; }
.act-dot.none { color: #C4C2CC; }

.record-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; max-width: 1500px; }
.record-layout.with-side { grid-template-columns: minmax(0, 1fr) 380px; }
.record-layout .form-card { max-width: none; }
.form-actions { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #FCFCFD; }
.btn.okbtn { background: #059669; border-color: #059669; color: #fff; }
.btn.danger { color: var(--danger); }
.statusbar { display: flex; flex-wrap: wrap; }
.statusbar button { border: 1px solid var(--line); background: var(--surface); height: 30px; padding: 0 14px 0 18px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; margin-left: -1px; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); }
.statusbar button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); padding-left: 12px; border-radius: 7px 0 0 7px; }
.statusbar button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.statusbar button.on.kind-ganho { background: #059669; border-color: #059669; color: #fff; }
.statusbar button.on.kind-perdido { background: var(--danger); border-color: var(--danger); color: #fff; }
.statusbar button:disabled { cursor: default; }
.statusbar button:not(.on):not(:disabled):hover { color: var(--ink); background: var(--bg); }

.related { margin-top: 16px; }
.related-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.related-head h4 { margin: 0; font-size: 15px; }

.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 64px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.side-head h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.side-head h4 svg { width: 16px; height: 16px; color: var(--brand); }
.act { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.act .grow { flex: 1; min-width: 0; }
.act b { display: block; font-size: 13px; }
.act small { color: var(--muted); font-size: 12px; }
.act-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--muted); flex-shrink: 0; }
.act-ico svg { width: 15px; height: 15px; }
.act.late .act-ico { background: #FFE4E6; color: var(--danger); }
.act.late small { color: var(--danger); }
.act.today .act-ico { background: #FEF3C7; color: #D97706; }
.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.note-form textarea { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; resize: vertical; outline: none; }
.note-form textarea:focus { border-color: var(--brand); }
.note-form .btn { align-self: flex-end; }
.timeline { display: flex; flex-direction: column; max-height: 520px; overflow: auto; }
.tl { padding: 10px 0 10px 14px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.tl::before { content: ''; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: #C4C2CC; }
.tl.note::before { background: var(--brand); }
.tl.activity::before { background: #059669; }
.tl-head { display: flex; gap: 8px; align-items: baseline; }
.tl-head span { color: var(--muted); font-size: 12px; }
.tl-body { margin-top: 3px; line-height: 1.5; }
.tl.note .tl-body { background: var(--brand-soft); padding: 7px 10px; border-radius: 8px; }
.tl-changes { margin: 4px 0 0; padding-left: 16px; }
.tl-changes li { line-height: 1.6; }
.tl-changes svg { width: 12px; height: 12px; vertical-align: -2px; }
.type-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.type-pick svg { width: 15px; height: 15px; }
.quick-dates { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.stages-ed .matrix input[type=text] { min-width: 120px; }
.stages-ed .icon-btn { display: inline-grid; vertical-align: middle; }
.stages-ed td { padding-top: 7px; padding-bottom: 7px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.alert b { color: var(--danger); }
.dash h4 { margin: 0 0 14px; font-size: 15px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 14px; background: transparent; }
.hb-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; transition: width .3s; }
.hbar:hover .hb-fill { filter: brightness(.9); }
.hb-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; background: var(--surface); }
.chip-link:hover { border-color: var(--brand); }
@media (max-width: 1100px) { .record-layout.with-side { grid-template-columns: 1fr; } .side { position: static; } }
@media (max-width: 680px) { .hbar { grid-template-columns: 90px 1fr; } .hb-val { grid-column: 2; } }

/* ver como / atalhos do topo */
.top-btn { width: 36px; height: 36px; border-radius: 10px; text-decoration: none; }
.top-btn svg { width: 18px; height: 18px; }
.viewas-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-radius: 10px; background: #FEF3C7; color: #78350F; font-size: 13px; white-space: nowrap; }
.viewas-pill svg { width: 16px; height: 16px; }
.viewas-pill button { border: 0; background: #78350F; color: #fff; border-radius: 7px; height: 26px; padding: 0 10px; font-weight: 600; cursor: pointer; }
.viewas-pop { width: 340px; }
.viewas-pop .btn { width: auto; justify-content: center; }
.viewas-pop .btn.primary { color: var(--brand-ink); }
.viewas-pop .btn.primary:hover { background: var(--brand); }
.viewas-pop .who span { display: block; margin-top: 4px; line-height: 1.45; }
@media (max-width: 900px) { .viewas-pill b { display: none; } }

/* tela inicial do administrador: apps agrupados por setor */
.home-group { max-width: 900px; margin: 0 auto 34px; }
.home-group h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.home-group h2 svg { width: 16px; height: 16px; color: var(--brand); }
.home-hint { display: flex; align-items: center; justify-content: center; gap: 6px; }
.home-hint svg { width: 16px; height: 16px; }

/* ------------------------------------------------ topo preto com a logo Big4Tech */
:root { --chrome: #0A0A0A; --chrome-2: #1A1A1F; --chrome-line: #26262C; --chrome-ink: #B9B7C2; }
.topbar { background: var(--chrome); border-bottom-color: var(--chrome-line); color: #fff; }
.rail { background: var(--chrome); border-right: 1px solid var(--chrome-line); }
.rail button:hover, .rail a:hover { background: var(--chrome-2); }
.rail .sep, .rail .toggle { border-color: var(--chrome-line); }
.rail .sep { background: var(--chrome-line); }
.logo-img { height: 30px; display: block; }
.logo .emp-chip { font-size: 11px; font-weight: 600; color: var(--chrome-ink); border-left: 1px solid var(--chrome-line); padding-left: 12px; margin-left: 2px; display: flex; align-items: center; gap: 6px; letter-spacing: 0; }
.logo .emp-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-tile); }
.topbar .sectors { background: var(--chrome-2); }
.topbar .sectors button { color: var(--chrome-ink); }
.topbar .sectors button.on { background: #2E2E36; color: #fff; box-shadow: none; }
.topbar .empresa-pick { background: var(--chrome-2); border-color: var(--chrome-line); color: #fff; }
.topbar .empresa-pick select { color: #fff; }
.topbar .empresa-pick select option { color: #111; }
.topbar .empresa-pick .dot { background: var(--brand-tile); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-tile) 30%, transparent); }
.topbar .top-btn { background: var(--chrome-2); border-color: var(--chrome-line); color: var(--chrome-ink); }
.topbar .top-btn:hover { color: #fff; }
.topbar .avatar { border-color: var(--chrome); box-shadow: 0 0 0 1px var(--chrome-line); }
.topbar .menu-pop { color: var(--ink); }

/* ------------------------------------------------ meu perfil */
.me-drawer { width: min(440px, 100%); }
.me-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.me-head b { display: block; }
.me-head span { color: var(--muted); font-size: 13px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; cursor: default; }
.me-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.me-sec h4 { margin: 0 0 10px; font-size: 14px; }
.me-row { display: flex; gap: 8px; align-items: center; }
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-pick button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; color: var(--ink); font-weight: 500; }
.theme-pick button.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.theme-pick svg { width: 16px; height: 16px; }
.th-prev { width: 100%; height: 44px; border-radius: 7px; display: flex; overflow: hidden; border: 1px solid var(--line); }
.th-prev i { width: 26%; background: #0A0A0A; }
.th-prev s { flex: 1; text-decoration: none; }
.th-prev.dark s { background: #1B1B21; }
.th-prev.light s { background: #F1F1F4; }
.accent-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.accent-pick button, .custom-sw { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; display: grid; place-items: center; color: #fff; position: relative; }
.accent-pick button svg { width: 15px; height: 15px; opacity: 0; }
.accent-pick button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.accent-pick button.on svg { opacity: 1; }
.accent-pick .brand-opt::after { content: 'marca'; position: absolute; top: 33px; font-size: 9px; color: var(--muted); font-weight: 600; }
.custom-sw { border-radius: 7px; overflow: hidden; }
.custom-sw input { opacity: 0; position: absolute; inset: 0; cursor: pointer; }
.menu-pop button:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------ tema escuro (páginas; topo e menu já são pretos) */
:root[data-theme="dark"] {
  --bg: #121216; --surface: #1B1B21; --ink: #ECEBF1; --muted: #9C9AA8; --line: #2C2C34;
  --brand-soft: color-mix(in srgb, var(--brand) 20%, #1B1B21);
  color-scheme: dark;
}
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] .home { background-image: radial-gradient(#2A2A31 1px, transparent 1px); }
:root[data-theme="dark"] table.grid th { background: #202027; }
:root[data-theme="dark"] table.grid tbody tr.click:hover td { background: #22222A; }
:root[data-theme="dark"] .kcol { background: #17171C; }
:root[data-theme="dark"] .kcol.kind-ganho { background: #13241D; }
:root[data-theme="dark"] .kcol.kind-perdido { background: #2A161B; }
:root[data-theme="dark"] .form-actions { background: #1E1E25; }
:root[data-theme="dark"] .field label { color: #C9C7D2; }
:root[data-theme="dark"] .field input[readonly], :root[data-theme="dark"] .field select:disabled, :root[data-theme="dark"] .field textarea[readonly] { background: #16161B; color: #B5B3BF; }
:root[data-theme="dark"] .badge { background: #26262E; color: var(--ink); }
:root[data-theme="dark"] .badge.ok { background: #0F3326; color: #6EE7B7; }
:root[data-theme="dark"] .badge.bad { background: #3B1520; color: #FDA4AF; }
:root[data-theme="dark"] .badge.warn, :root[data-theme="dark"] .badge.hot { background: #3A2A10; color: #FCD34D; }
:root[data-theme="dark"] .badge.off { background: #24242B; color: var(--muted); }
:root[data-theme="dark"] .badge.brand { color: color-mix(in srgb, var(--brand) 60%, #fff); }
:root[data-theme="dark"] .note { background: #2D2410; border-color: #4A3B12; color: #FCD34D; }
:root[data-theme="dark"] .note.info { background: var(--brand-soft); border-color: #33333C; color: var(--ink); }
:root[data-theme="dark"] .changed td { background: #2A2412; }
:root[data-theme="dark"] .menu-pop { box-shadow: 0 12px 40px rgba(0,0,0,.5); }
:root[data-theme="dark"] .menu-pop button:hover { background: #24242B; }
:root[data-theme="dark"] .act-ico { background: #24242B; }
:root[data-theme="dark"] .overlay { background: rgba(0,0,0,.55); }
:root[data-theme="dark"] .btn:hover { border-color: #3A3A44; }
:root[data-theme="dark"] .kcard { box-shadow: none; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ------------------------------------------------ plugin Definições */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 108px); }
.settings-nav { border-right: 1px solid var(--line); background: var(--surface); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .sn-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 10px 6px; }
.settings-nav .sn-group:first-child { padding-top: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.settings-nav a svg { width: 16px; height: 16px; color: var(--muted); }
.settings-nav a:hover { background: var(--bg); }
.settings-nav a.on { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.settings-nav a.on svg { color: var(--brand); }
.settings-nav .sn-soon { margin-top: auto; padding: 16px 10px 4px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.settings-page { min-width: 0; }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } .settings-nav { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; } .settings-nav .sn-soon { display: none; } }

/* árvore de plugins > páginas > ações nos perfis */
.plug-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.plug { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.plug > label { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.plug > label svg { width: 16px; height: 16px; color: var(--brand); }
.plug .pages { margin: 8px 0 0 24px; display: flex; flex-direction: column; gap: 5px; }
.plug .pages label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.plug input { accent-color: var(--brand); }
.plug.off .pages { opacity: .4; pointer-events: none; }
.act-checks { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.act-checks label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; border: 1px solid var(--line); border-radius: 7px; padding: 3px 7px; cursor: pointer; white-space: nowrap; }
.act-checks label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* atividades automáticas por etapa */
.stages-ed .btn.has-acts { border-color: var(--brand); color: var(--ink); }
.stages-ed .btn svg { width: 14px; height: 14px; }
.acts-row > td { background: var(--bg); }
.acts-box { padding: 6px 4px; text-align: left; }
.act-auto { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.act-auto select, .act-auto input[type=text] { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: var(--surface); }
.act-auto input[type=text] { flex: 1; min-width: 200px; }
.act-auto .dias { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.act-auto .dias input { width: 58px; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; background: var(--surface); }
.field .act-auto select { width: 140px; flex: 0 0 140px; height: 32px; }
.field .act-auto input[type=text] { width: auto; flex: 1; height: 32px; }
.field .act-auto .dias input { width: 64px; height: 32px; }
.field .stages-ed select, .field .stages-ed input[type=text] { height: 32px; }

/* abas por setor na tela inicial do administrador */
.home-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; width: max-content; max-width: 100%; margin: 0 auto 40px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); }
.home-tabs button { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.home-tabs button svg { width: 16px; height: 16px; }
.home-tabs button:hover { color: var(--ink); }
.home-tabs button.on { background: var(--brand); color: var(--brand-ink); }

/* ------------------------------------------------ Meu dia: aba do sol + painel lateral */
body { --md-left: 0px; }
body.has-rail { --md-left: 64px; }
body.has-rail.rail-wide { --md-left: 228px; }
.myday-tab { position: fixed; top: 122px; left: var(--md-left); z-index: 40; width: 36px; height: 46px; border: 0; border-radius: 0 12px 12px 0; background: #0A0A0A; color: #FACC15; display: grid; place-items: center; cursor: pointer; box-shadow: 2px 2px 10px rgba(0,0,0,.18); transition: width .15s, left .18s; }
.myday-tab svg { width: 24px; height: 24px; stroke-width: 2.4; }
.myday-tab:hover { width: 42px; }
.myday-tab.on { display: none; }
.myday-panel { position: fixed; top: 56px; bottom: 0; left: var(--md-left); width: min(640px, calc(100vw - var(--md-left))); z-index: 45; background: var(--bg); border-right: 1px solid var(--line); box-shadow: 12px 0 40px rgba(0,0,0,.16); animation: mdIn .18s ease; }
.myday-panel.full { right: 0; width: auto; box-shadow: none; animation: none; }
@keyframes mdIn { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.md-scroll { height: 100%; overflow: auto; }
.md-edge { position: absolute; top: 50%; right: -16px; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.md-edge button { width: 32px; height: 56px; border-radius: 0 12px 12px 0; border: 1px solid var(--line); border-left: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 4px 0 12px rgba(0,0,0,.08); }
.md-edge button:hover { color: var(--brand); }
.myday-panel.full .md-edge { right: 0; }
.myday-panel.full .md-edge button { border-radius: 12px 0 0 12px; border-left: 1px solid var(--line); border-right: 0; box-shadow: -4px 0 12px rgba(0,0,0,.08); }

.md-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.md-head h2 { margin: 0; font-size: 18px; }
.md-head span { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.md-sun { width: 36px; height: 36px; border-radius: 10px; background: #0A0A0A; color: #FACC15; display: grid; place-items: center; }
.md-sun svg { width: 20px; height: 20px; stroke-width: 2.4; }
.md-head .filter-sel { height: 34px; }
.md-body { padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.md-body.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1500px; }
.md-body.grid .span2 { grid-column: 1 / -1; }
.md-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.md-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.md-card-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.md-card-head small { color: var(--muted); font-size: 12px; }
.md-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.md-ico svg { width: 18px; height: 18px; }
.md-metas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; }
.md-metas.two { grid-template-columns: 1fr 1fr; }
.md-meta { padding: 4px 16px 4px 0; margin-right: 16px; border-right: 1px solid var(--line); }
.md-meta:last-child { border-right: 0; }
.md-meta .mm-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.md-meta .mm-top small.ok { color: var(--ok); font-weight: 700; }
.md-meta b { font-size: 22px; font-variant-numeric: tabular-nums; }
.md-bar { display: block; height: 6px; border-radius: 99px; background: var(--bg); margin: 8px 0 4px; overflow: hidden; }
.md-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.md-checkin { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.md-checkin textarea { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--surface); resize: vertical; }
.md-last-checkin { display: flex; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--muted); background: var(--bg); padding: 8px 10px; border-radius: 8px; }
.md-last-checkin svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.md-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.md-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.md-kpi span:not(.md-ico) { display: block; font-size: 13px; color: var(--muted); }
.md-kpi b { font-size: 22px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.md-kpi.blue .md-ico { background: #DBEAFE; color: #1D4ED8; }
.md-kpi.green .md-ico { background: #D1FAE5; color: #047857; }
.md-kpi.purple .md-ico { background: #EDE9FE; color: #6D28D9; }
.md-kpi.amber .md-ico { background: #FEF3C7; color: #B45309; }
.md-kpi.gray .md-ico { background: var(--bg); color: var(--muted); }
.md-total { font-size: 20px; }
.md-google { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; background: var(--bg); padding: 9px 11px; border-radius: 9px; margin-bottom: 8px; color: var(--muted); }
.md-google svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.md-event { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.md-event .md-time { color: var(--brand); font-weight: 600; font-size: 13px; min-width: 92px; font-variant-numeric: tabular-nums; }
.md-event .grow { flex: 1; min-width: 0; }
.md-event b { display: block; }
.md-event small { color: var(--muted); font-size: 12px; }
.md-filters { margin-bottom: 6px; }
.md-card .act a.grow { text-decoration: none; color: var(--ink); }
:root[data-theme="dark"] .md-kpi.blue .md-ico { background: #172554; color: #93C5FD; }
:root[data-theme="dark"] .md-kpi.green .md-ico { background: #052E22; color: #6EE7B7; }
:root[data-theme="dark"] .md-kpi.purple .md-ico { background: #2E1065; color: #C4B5FD; }
:root[data-theme="dark"] .md-kpi.amber .md-ico { background: #3A2A10; color: #FCD34D; }
@media (max-width: 900px) { .md-body.grid { grid-template-columns: 1fr; } .md-meta { border-right: 0; margin-right: 0; padding-right: 0; } }
@media (max-width: 680px) { body.has-rail, body.has-rail.rail-wide { --md-left: 0px; } .myday-panel { width: 100vw; } .md-edge { display: none; } }

/* metas e comissões */
.mc-tabs button { gap: 6px; display: inline-flex; align-items: center; height: 36px; }
.mc-tabs svg { width: 15px; height: 15px; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mc-card { padding: 16px; display: flex; flex-direction: column; }
.mc-head { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mc-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.mc-head .badge { margin-left: auto; font-size: 11px; }
.mc-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.mc-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 3px 0; }
.mc-row b { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; font-size: 12px; }
.mc-vers { font-size: 12px; color: var(--muted); margin-top: 8px; }
.mc-vers summary { cursor: pointer; }
.mc-vers div { padding: 3px 0 0 12px; }
.mc-foot { margin-top: auto; padding-top: 14px; text-align: right; }
.mc-h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 15px; }
.mc-h4 svg { width: 17px; height: 17px; color: var(--brand); }
.mc-sim { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mc-sim > div { background: var(--bg); border-radius: 9px; padding: 10px 12px; }
.mc-sim small { display: block; color: var(--muted); font-size: 12px; }
.mc-sim b { font-size: 18px; }
.mc-sim .ok b { color: var(--ok); }
.mc-metas input[type=text] { min-width: 110px; text-align: right; }

/* Meu dia como item do menu lateral (quando há um plugin aberto) */
body.has-rail .myday-tab { display: none; }
.rail .rail-myday svg { color: #FACC15; stroke-width: 2.3; }
.rail .rail-myday.on { background: rgba(250, 204, 21, .16); color: #FDE68A; }

/* ------------------------------------------------ topo/menu na cor da marca + seletor de várias marcas */
:root { --chrome-strong: #fff; --rail-ink: var(--chrome-ink); }
.rail button:hover, .rail a:hover { color: var(--chrome-strong); }
.topbar .sectors button.on { background: var(--chrome-line); color: var(--chrome-strong); }
.topbar .top-btn:hover { color: var(--chrome-strong); }
.logo-img { height: 30px; max-width: 220px; object-fit: contain; object-position: left center; }
.logo-word { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--chrome-strong); white-space: nowrap; }
.topbar .empresa-pick { cursor: pointer; font-weight: 600; color: var(--chrome-strong); gap: 8px; padding: 0 10px; }
.topbar .empresa-pick svg { width: 15px; height: 15px; opacity: .7; }
.empresa-pick .dots { display: inline-flex; }
.empresa-pick .dots .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--chrome-2); margin-left: -4px; box-shadow: none; }
.empresa-pick .dots .dot:first-child { margin-left: 0; }
.myday-tab { background: var(--chrome); }
.emp-pop { width: 300px; right: 60px; }
.emp-pop .who span { display: block; margin-top: 4px; line-height: 1.45; }
.emp-opt { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 8px; cursor: pointer; flex: 1; }
.emp-opt:hover { background: var(--bg); }
.emp-opt input { accent-color: var(--brand); }
.emp-opt .dot { width: 10px; height: 10px; border-radius: 50%; }
.emp-opt.all { font-weight: 600; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 4px; }
.emp-row { display: flex; align-items: center; }
.emp-row .only { width: auto !important; font-size: 12px; color: var(--muted); padding: 4px 8px !important; opacity: 0; }
.emp-row:hover .only { opacity: 1; }
.emp-row .only:hover { color: var(--brand); }

/* tela Marcas */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.brand-card { overflow: hidden; }
.brand-card.off { opacity: .6; }
.bc-body { padding: 14px 16px 16px; }
.bc-colors { display: flex; gap: 10px; margin-top: 12px; }
.bc-colors label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bc-colors input[type=color] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); cursor: pointer; }
.bc-logo { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.brand-prev { background: var(--bg); border-bottom: 1px solid var(--line); }
.bp-top { height: 44px; background: var(--m); display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.bp-top img { height: 22px; max-width: 170px; object-fit: contain; object-position: left; }
.bp-word { color: #fff; font-weight: 800; font-size: 15px; mix-blend-mode: difference; }
.bp-dots { margin-left: auto; display: flex; gap: 5px; }
.bp-dots i { width: 18px; height: 18px; border-radius: 6px; background: color-mix(in srgb, var(--m) 80%, #fff); }
.bp-body { display: flex; height: 92px; }
.bp-rail { width: 34px; background: var(--m); display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 10px; }
.bp-rail i { width: 16px; height: 16px; border-radius: 5px; background: color-mix(in srgb, var(--m) 75%, #fff); }
.bp-rail i.on { opacity: .8; }
.bp-page { flex: 1; display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.bp-tile { width: 52px !important; height: 52px !important; border-radius: 13px !important; }
.bp-tile::before { width: 32px !important; height: 32px !important; }
.bp-tile::after { width: 18px !important; height: 18px !important; transform: translate(10px, 9px) !important; }
.bp-tile svg { width: 22px !important; height: 22px !important; }
.bp-btn { color: #fff; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 8px; }

/* ------------------------------------------------ chaves (switch) e editor de permissões */
.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: #D9D7E0; position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
:root[data-theme="dark"] .switch { background: #3A3A44; }
.flag { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.flag b { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.flag b svg { width: 16px; height: 16px; color: var(--muted); }
.flag b .dot { width: 9px; height: 9px; border-radius: 50%; }
.flag span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.flag.main { background: var(--bg); }
.flag.dis { opacity: .55; }
.flag.diff { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.flag em, .tag-ajustado { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 5px; }
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.flag-grid.two { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.flag-group { margin-bottom: 18px; }
.flag-group h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.flag-group h5 svg { width: 15px; height: 15px; color: var(--brand); }
.perm-ed { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.perm-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; border-right: 1px solid var(--line); padding-right: 12px; }
.perm-nav button, .perm-nav a { display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font-weight: 500; text-decoration: none; }
.perm-nav button span, .perm-nav a span { flex: 1; }
.perm-nav svg { width: 16px; height: 16px; color: var(--muted); }
.perm-nav small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.perm-nav button:hover { background: var(--bg); }
.perm-nav button.on { background: var(--brand-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.perm-nav button.on svg { color: var(--brand); }
.perm-nav .perm-fields { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 12px; color: var(--muted); font-size: 13px; }
.perm-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.perm-head h4 { margin: 0; font-size: 17px; }
.perm-head span { color: var(--muted); font-size: 13px; }
.perm-head .btn { margin-left: auto; }
.perm-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.perm-top label { font-weight: 600; font-size: 13px; }
.perm-top select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--brand-soft); font-weight: 600; min-width: 200px; }
.inner-tabs { padding: 0 20px; margin-bottom: 0; align-items: center; }
.inner-tabs .tab-link { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.inner-tabs .tab-link svg { width: 15px; height: 15px; }
.ppane { padding: 18px 20px 22px; }
.sw.lg { width: 14px; height: 14px; border-radius: 4px; }
.drawer.wide { width: min(1080px, 100%); }
.drawer.wide .body { padding: 0 0 20px; }
.drawer.wide #upane { padding: 18px 20px; }
.bp-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* janela central + etapas (novo usuário) */
.overlay.center { justify-content: center; align-items: center; padding: 20px; }
.dialog { width: min(760px, 100%); max-height: 92vh; background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.dialog header { display: flex; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.dialog header h3 { margin: 0; font-size: 19px; }
.dialog .body { flex: 1; overflow: auto; padding: 0 0 20px; }
.dialog footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.steps { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 22px; border-bottom: 1px solid var(--line); color: var(--muted); }
.steps > svg { width: 16px; height: 16px; }
.steps span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.steps i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.steps .on { color: var(--brand); font-weight: 600; }
.steps .on i, .steps .done i { background: var(--brand); color: var(--brand-ink); }
.wiz-body { max-width: 480px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 14px; padding: 0 22px; }
.wiz-body.wide { max-width: none; display: block; }
@media (max-width: 800px) { .perm-ed { grid-template-columns: 1fr; } .perm-nav { position: static; border-right: 0; padding-right: 0; flex-direction: row; flex-wrap: wrap; } }
/* mais espaço para o editor de permissões */
.split { grid-template-columns: 240px minmax(0, 1fr); }
.perm-ed { grid-template-columns: 190px minmax(0, 1fr); }
.flag-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ================================================== Treinamentos (LMS) */
.lms-page { max-width: 1240px; margin: 0 auto; }
.lms-page.narrow { max-width: 820px; }
.lms-page.wide { max-width: none; }
.lms-title h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.lms-title p { margin: 0 0 18px; color: var(--muted); }
.lms-h { margin: 28px 0 12px; font-size: 17px; }
.eyebrow { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs svg { width: 14px; height: 14px; }
.lms-bar { display: inline-block; width: 100%; max-width: 160px; height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; vertical-align: middle; }
.lms-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.lc-prog { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.lc-prog .lms-bar { max-width: none; flex: 1; }
.lc-prog.big { font-size: 13px; margin-top: 14px; }
.lc-prog.big .lms-bar { height: 8px; }

/* capa */
.lms-cover { aspect-ratio: 16 / 9; background: center / cover no-repeat var(--bg); border-radius: 10px; }
.lms-cover.gen { display: flex; align-items: flex-end; justify-content: space-between; padding: 14px; color: #fff;
  background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--brand-tile) 70%, #fff) 0, transparent 40%), linear-gradient(135deg, var(--brand-tile), color-mix(in srgb, var(--brand-tile) 35%, #0A0A0A)); }
.lms-cover.gen span { font-size: 34px; font-weight: 800; letter-spacing: -.03em; opacity: .95; }
.lms-cover.gen svg { width: 30px; height: 30px; opacity: .55; }
.lms-cover.sm { width: 220px; flex-shrink: 0; }
.lms-cover.hero { border-radius: 14px; }

/* cards */
.lms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.lms-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.lms-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.lc-body { padding: 10px 8px 6px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lc-num { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.lms-card b { font-size: 15.5px; line-height: 1.3; margin-top: 4px; }
.lms-card small { color: var(--muted); font-size: 13px; }
.lc-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; color: var(--muted); font-size: 12.5px; }
.lc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lc-meta svg { width: 14px; height: 14px; }

/* meu aprendizado */
.lms-hero-row { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.lms-continue { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; gap: 20px; align-items: center; }
.lcn-body { flex: 1; min-width: 0; }
.lcn-body h2 { margin: 0 0 6px; font-size: 22px; }
.lcn-body p { margin: 0 0 10px; color: var(--muted); }
.lcn-body .btn { margin-top: 14px; }
.lms-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lms-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.lms-stats b { display: block; font-size: 26px; }
.lms-stats span { color: var(--muted); font-size: 13px; }
.lms-stats .alert b { color: var(--danger); }
.lms-stats.inline { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.lms-trail-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lms-trail-mini .card { padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.lms-trail-mini span { color: var(--muted); font-size: 13px; }
.lms-trail-mini .lms-bar { max-width: none; }

/* catálogo */
.lms-search { max-width: 640px; height: 46px; border-radius: 999px; padding: 0 18px; margin-bottom: 14px; }
.lms-filters { margin-bottom: 18px; }

/* página do treinamento */
.lms-course-hero { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 24px; }
.lch-left { display: flex; flex-direction: column; gap: 14px; }
.btn.lg { height: 46px; justify-content: center; font-size: 15px; border-radius: 12px; }
.lch-right h1 { margin: 10px 0 6px; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.lch-right .lead { font-size: 16px; color: var(--ink); margin: 0 0 8px; }
.lch-right p { color: var(--muted); line-height: 1.6; }
.lch-meta { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.lch-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lch-meta svg { width: 15px; height: 15px; }
.lms-band { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; background: var(--chrome); color: #fff; border-radius: 16px; padding: 26px 28px; }
.lms-band h3 { margin: 0 0 10px; font-size: 16px; padding-left: 12px; border-left: 3px solid var(--brand-tile); }
.lms-band p, .lms-band li { color: color-mix(in srgb, #fff 78%, var(--chrome)); line-height: 1.6; font-size: 14px; }
.lms-band > div > h3:not(:first-child) { margin-top: 20px; }
.lms-rules { padding-left: 18px; margin: 0; }
.lms-prog-block { margin-bottom: 12px; }
.lpb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.lpb-head small { color: color-mix(in srgb, #fff 60%, var(--chrome)); }
.lpb-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; color: #fff; text-decoration: none; font-size: 14px; }
.lpb-item:hover { background: rgba(255,255,255,.07); }
.lpb-item span { flex: 1; }
.lpb-item small { color: color-mix(in srgb, #fff 55%, var(--chrome)); font-size: 12px; }
.lpb-item svg { width: 16px; height: 16px; }
.lpb-item.prova { font-weight: 600; }
.lpb-item.final { margin-top: 6px; border: 1px dashed rgba(255,255,255,.25); }
.st { display: inline-grid; color: var(--muted); }
.st.ok { color: #10B981; }
.lms-band .st { color: color-mix(in srgb, #fff 50%, var(--chrome)); }
.lms-band .st.ok { color: #34D399; }
.lms-intro-video { margin: 24px auto 0; max-width: 820px; }
.lms-video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.lms-video iframe, .lms-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* sala de aula */
.lms-room { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.lr-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lr-head { display: flex; align-items: flex-start; gap: 14px; }
.lr-head > div { flex: 1; }
.lr-head h2 { margin: 2px 0 4px; font-size: 24px; }
.lr-head p { margin: 0; }
.lr-text { padding: 20px 24px; line-height: 1.7; font-size: 15px; }
.lr-text p { margin: 0 0 12px; }
.lr-text ul { margin: 0 0 12px; padding-left: 20px; }
.lr-mats h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; }
.lr-mats h4 svg, .lr-mats .chip-link svg { width: 15px; height: 15px; }
.lr-mats .chip-link { margin: 0 6px 6px 0; gap: 6px; align-items: center; }
.lr-quiz { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-left: 4px solid var(--brand); }
.lr-quiz > div { flex: 1; }
.lr-quiz b { display: flex; align-items: center; gap: 6px; }
.lr-quiz b svg { width: 16px; height: 16px; color: var(--brand); }
.lr-quiz span { color: var(--muted); font-size: 13px; }
.lr-nav { display: flex; justify-content: space-between; gap: 10px; }
.lr-side { position: sticky; top: 70px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 140px); }
.lr-prog b { display: block; font-size: 14px; }
.lr-prog span { color: var(--muted); font-size: 12px; display: block; margin: 2px 0 6px; }
.lr-prog .lms-bar { max-width: none; }
.lr-side .search { min-width: 0; }
.lr-list { overflow: auto; margin: 0 -6px; padding: 0 6px; }
.lr-block { margin-bottom: 10px; }
.lrb-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 13.5px; }
.lrb-head .n { width: 22px; height: 22px; border-radius: 6px; background: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.lrb-head b { flex: 1; }
.lrb-head small { color: var(--muted); font-size: 12px; }
.lr-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13.5px; border-left: 2px solid transparent; }
.lr-item:hover { background: var(--bg); }
.lr-item.on { background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }
.lr-item svg { width: 16px; height: 16px; }
.lr-item.prova { font-weight: 600; color: var(--muted); }
.lr-item.final { border: 1px dashed var(--line); }

/* quiz */
.lq-head { display: flex; align-items: flex-start; gap: 12px; }
.lq-head > div { flex: 1; }
.lq-head h2 { margin: 0 0 4px; }
.lq-steps { display: flex; gap: 6px; margin: 14px 0; }
.lq-steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.lq-steps i.done { background: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.lq-steps i.on { background: var(--brand); }
.lq-card { padding: 22px 24px; }
.lq-card h3 { margin: 0 0 16px; font-size: 18px; line-height: 1.4; }
.lq-opt { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.lq-opt:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.lq-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.lq-opt input { accent-color: var(--brand); width: 18px; height: 18px; }
.lq-card + .lr-nav { margin-top: 14px; }
.lq-result { border-radius: 16px; padding: 24px 26px; margin-bottom: 8px; }
.lq-result.ok { background: color-mix(in srgb, #10B981 14%, var(--surface)); border: 1px solid color-mix(in srgb, #10B981 40%, var(--line)); }
.lq-result.bad { background: color-mix(in srgb, #F59E0B 12%, var(--surface)); border: 1px solid color-mix(in srgb, #F59E0B 40%, var(--line)); }
.lq-result.ok .eyebrow { color: #059669; }
.lq-result.bad .eyebrow { color: #B45309; }
.lq-result h2 { margin: 2px 0 6px; font-size: 28px; }
.lq-result p { margin: 0 0 6px; }
.lq-result svg { width: 16px; height: 16px; vertical-align: -3px; }
.lq-actions { display: flex; gap: 10px; margin-top: 14px; }
.lq-fix { padding: 14px 18px; margin-bottom: 10px; }
.lq-fix > b { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.lq-fix > b svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.lq-fix.ok > b svg { color: #10B981; }
.lq-fix.bad > b svg { color: var(--danger); }
.lq-alt { padding: 6px 10px; border-radius: 7px; font-size: 14px; color: var(--muted); }
.lq-alt.right { background: color-mix(in srgb, #10B981 14%, var(--surface)); color: var(--ink); font-weight: 600; }
.lq-alt.wrong { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--ink); text-decoration: line-through; }
.lq-alt small { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-left: 6px; text-decoration: none; display: inline-block; }
.lq-fix p { margin: 8px 0 0; font-size: 13.5px; }

/* trilhas */
.lms-trail { padding: 18px; margin-bottom: 18px; }
.lt-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 14px; }
.lt-head > div:first-child { flex: 1; }
.lt-head h3 { margin: 0 0 4px; font-size: 19px; }
.lt-head p { margin: 0; }
.lt-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-width: 220px; font-size: 13px; color: var(--muted); }
.lt-side .lms-bar { max-width: 220px; }
.lt-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

/* histórico e certificado */
.lms-certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lms-cert-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.lms-cert-card > svg { width: 30px; height: 30px; color: #D97706; }
.lms-cert-card span { display: block; color: var(--muted); font-size: 12.5px; }
.lms-certificate { background: #fff; color: #111; border: 10px solid #0A0A0A; outline: 2px solid #EA0D44; outline-offset: -18px; border-radius: 6px; padding: 54px 40px; text-align: center; }
.lms-certificate img { height: 34px; margin-bottom: 26px; filter: invert(1) hue-rotate(180deg); }
.lms-certificate h1 { font-size: 34px; margin: 6px 0 10px; }
.lms-certificate h2 { font-size: 24px; margin: 6px 0 14px; color: #EA0D44; }
.lms-certificate p { margin: 4px 0; }
.lms-certificate .code { display: inline-block; margin: 16px 0; font-family: ui-monospace, monospace; background: #F4F4F7; padding: 6px 12px; border-radius: 6px; }
.lms-certificate small { display: block; color: #666; }
@media print { body * { visibility: hidden; } .lms-certificate, .lms-certificate * { visibility: visible; } .lms-certificate { position: fixed; inset: 20px; } }

/* editor */
.ed-bar h3 { margin: 0; }
.ed-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.ed-tree { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; position: sticky; top: 64px; max-height: calc(100vh - 160px); overflow: auto; }
.ed-tree button { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 13.5px; width: 100%; }
.ed-tree button svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.ed-tree button small { margin-left: auto; color: var(--muted); font-size: 11px; }
.ed-tree button:hover { background: var(--bg); }
.ed-tree button.on { background: var(--brand-soft); font-weight: 600; }
.ed-tree button.sub { padding-left: 28px; }
.ed-tree button.add { color: var(--brand); font-weight: 600; }
.ed-tree button.add svg { color: var(--brand); }
.ed-block { border-top: 1px solid var(--line); padding: 4px 0; }
.ed-form h3 { margin-top: 0; }
.ed-cover { display: flex; align-items: center; gap: 10px; }
.ed-cover .lms-cover { width: 200px; }
.q-ed { display: flex; flex-direction: column; gap: 10px; }
.q-card { padding: 14px 16px; }
.q-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.q-alts { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.q-alt { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.q-alt input[type=text] { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.q-alt input[type=radio] { width: 18px; height: 18px; accent-color: #10B981; }
.lms-trail-ed { margin-bottom: 14px; }

/* portal uni: só treinamentos, sem menu lateral */
.uni-tag { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0A0A0A; background: #FACC15; padding: 3px 8px; border-radius: 6px; margin-left: 10px; }
body.portal-uni .rail, body.portal-uni .myday-tab, body.portal-uni #viewAsBtn, body.portal-uni .sectors { display: none !important; }
body.portal-uni #app main { grid-column: 1 / -1; }

@media (max-width: 1000px) {
  .lms-room, .lms-course-hero, .lms-band, .lms-hero-row, .ed-layout { grid-template-columns: 1fr; }
  .lr-side, .ed-tree { position: static; max-height: none; }
  .lms-continue { flex-direction: column; align-items: stretch; }
  .lms-cover.sm { width: 100%; }
  .lms-stats.inline { grid-template-columns: 1fr 1fr; }
}
.lpb-item > span.st { flex: 0 0 auto; }
.lr-item > span.st { flex: 0 0 auto; }
.lr-item > span:not(.st) { flex: 1; }
body.portal-uni #empresaBtn { display: none !important; }

/* menu do plugin no topo, ao lado da logo */
.top-app { display: none; align-items: center; gap: 6px; height: 100%; min-width: 0; margin-right: auto; }
.topbar.in-app .top-app { display: flex; }
.topbar.in-app .sectors { display: none; }
.topbar:not(.in-app) .top-right { margin-left: auto; }
.ta-name { display: flex; align-items: center; gap: 8px; padding: 0 14px 0 16px; margin-left: 4px; border-left: 1px solid var(--chrome-line); height: 28px; color: var(--chrome-strong); text-decoration: none; font-weight: 700; white-space: nowrap; }
.ta-name svg { width: 18px; height: 18px; color: var(--brand-tile); }
.ta-menu { display: flex; height: 100%; overflow-x: auto; scrollbar-width: none; }
.ta-menu a { display: flex; align-items: center; padding: 0 12px; height: 100%; color: var(--chrome-ink); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.ta-menu a:hover { color: var(--chrome-strong); }
.ta-menu a.on { color: var(--chrome-strong); border-bottom-color: var(--brand); font-weight: 600; }
.ta-crumb { color: var(--chrome-ink); font-size: 13px; white-space: nowrap; }
.settings-layout { min-height: calc(100vh - 56px); }
@media (max-width: 680px) { .ta-name span { display: none; } .ta-name { padding: 0 8px; } }
.side { top: 16px; } .lr-side { top: 16px; max-height: calc(100vh - 88px); } .ed-tree { top: 16px; }

/* banners de divulgação */
.lms-banners { position: relative; margin-bottom: 18px; }
.lms-banners:empty { display: none; }
.lms-banner { position: relative; min-height: 170px; border-radius: 16px; overflow: hidden; display: flex; align-items: center; padding: 26px 30px; color: #fff;
  background: linear-gradient(90deg, var(--bc) 0%, color-mix(in srgb, var(--bc) 82%, transparent) 45%, color-mix(in srgb, var(--bc) 20%, transparent) 100%), var(--bi, linear-gradient(120deg, var(--bc), color-mix(in srgb, var(--bc) 55%, var(--brand-tile)))) center / cover no-repeat; }
.lb-text { max-width: 560px; position: relative; }
.lms-banner .eyebrow { color: #FACC15; }
.lms-banner h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.lms-banner p { margin: 0 0 14px; color: rgba(255,255,255,.85); }
.lb-btn { background: #fff; color: #111; border-color: #fff; }
.lb-btn:hover { background: #F4F4F7; }
.lb-dots { position: absolute; bottom: 12px; right: 18px; display: flex; gap: 6px; }
.lb-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; }
.lb-dots button.on { background: #fff; width: 22px; border-radius: 99px; }
.bn-card { margin-bottom: 16px; overflow: hidden; }
.bn-prev .lms-banner { border-radius: 0; min-height: 140px; }
.bn-fields { padding: 14px 18px 16px; }
.bn-row { flex-direction: row !important; align-items: center; gap: 8px; flex-wrap: wrap; }
.bn-row .check input { width: auto; height: auto; }
.ta-sectors { padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--chrome-line); height: 100%; }
.ta-sectors a { gap: 7px; }
.ta-sectors a svg { width: 16px; height: 16px; }
.ta-sectors a.on svg { color: var(--brand-tile); }
.home { padding-top: 40px; }
.ta-name, .ta-name svg { color: var(--brand-tile); }

/* conteúdo formatado das aulas (material da Academia Comercial) */
.lms-video-soon { display: flex; align-items: center; justify-content: center; gap: 10px; aspect-ratio: 16 / 9; max-height: 300px; border-radius: 14px; background: var(--chrome); color: color-mix(in srgb, #fff 70%, var(--chrome)); font-size: 14px; }
.lms-video-soon svg { width: 26px; height: 26px; color: var(--brand-tile); }
.rich { font-size: 15px; line-height: 1.65; }
.rich h2 { font-size: 20px; margin: 28px 0 10px; letter-spacing: -.01em; }
.rich h2:first-child { margin-top: 0; }
.rich h3 { font-size: 16.5px; margin: 22px 0 8px; }
.rich h4 { margin: 0 0 4px; font-size: 15.5px; }
.rich p { margin: 0 0 12px; }
.rich ul, .rich ol { margin: 0 0 14px 22px; padding: 0; }
.rich li { margin-bottom: 6px; }
.rich a { color: var(--brand); }
.rich table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 6px 0 18px; font-size: 14px; display: table; }
.rich th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1.5px solid var(--ink); background: var(--surface); }
.rich td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rich tr:last-child td { border-bottom: 0; }
.rich td small { color: var(--muted); font-size: 12.5px; }
.rich .lead { font-size: 17px; color: var(--muted); margin-bottom: 20px; }
.rich .say { background: var(--brand-soft); border-radius: 12px; padding: 14px 18px; margin: 10px 0 16px; font-weight: 500; }
.rich .say .t, .rich .note .t, .rich .dark .t, .rich .obj .t, .rich .pair .t { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; color: var(--brand); }
.rich .say small { color: var(--muted); }
.rich .dark { background: var(--chrome); color: #fff; border-radius: 14px; padding: 20px 24px; margin: 14px 0 18px; }
.rich .dark .q { font-size: 19px; font-weight: 700; line-height: 1.35; }
.rich .dark .q em { color: var(--brand-tile); font-style: normal; }
.rich .note { border-left: 3px solid var(--brand); background: var(--bg); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 10px 0 16px; }
.rich .endstage { display: flex; gap: 14px; align-items: center; border: 1.5px dashed var(--brand); border-radius: 12px; padding: 12px 16px; margin: 24px 0 8px; font-size: 14px; }
.rich .endstage .tag { flex: none; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px; border-radius: 20px; }
.rich .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.rich .card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.rich .card p { font-size: 14px; color: var(--muted); margin: 0; }
.rich .card .big { font-size: 32px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; line-height: 1.1; }
.rich .pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; background: var(--bg); margin-bottom: 8px; }
.rich .pill.o { background: var(--brand); color: var(--brand-ink); }
.rich .flow { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 20px; }
.rich .flow a, .rich .flow > div { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; color: var(--ink); font-weight: 600; text-decoration: none; }
.rich .flow .n { width: 28px; height: 28px; border-radius: 50%; background: var(--chrome); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.rich .flow .sdr .n { background: var(--bg); color: var(--ink); }
.rich .flow .who { margin-left: auto; font-size: 12px; color: var(--muted); }
.rich .flow .entry { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rich .video { background: var(--chrome); border-radius: 14px; aspect-ratio: 16 / 9; max-height: 280px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: color-mix(in srgb, #fff 65%, var(--chrome)); margin: 4px 0 22px; font-size: 14px; gap: 10px; }
.rich .video .play { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--brand-tile); display: flex; align-items: center; justify-content: center; }
.rich .video .play::after { content: ''; border-left: 15px solid var(--brand-tile); border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.rich .chk li { list-style: none; margin-left: -22px; padding-left: 30px; position: relative; }
.rich .chk li::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 4px; }
.rich ul.x li { list-style: none; margin-left: -22px; padding-left: 26px; position: relative; }
.rich ul.x li::before { content: '✕'; position: absolute; left: 0; color: var(--danger); font-weight: 800; }
.rich .ph { color: var(--muted); font-style: italic; }
.rich .obj { display: flex; gap: 14px; align-items: baseline; background: var(--chrome); color: #fff; border-radius: 12px; padding: 13px 18px; margin: 6px 0 14px; font-weight: 600; }
.rich .obj .t { flex: none; margin: 0; }
.rich .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.rich .pair > div { border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.rich .pair .err { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-left: 3px solid var(--danger); }
.rich .pair .err .t { color: var(--danger); }
.rich .pair .okk { background: color-mix(in srgb, #10B981 12%, var(--surface)); border-left: 3px solid #10B981; }
.rich .pair .okk .t { color: #059669; }
.code-area { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
@media (max-width: 900px) { .rich .pair, .rich .flow .entry { grid-template-columns: 1fr; } .rich table { display: block; overflow-x: auto; } }
