/* LobeRH — design system
   Identidade: rail azul-marinho, superfícies claras, Manrope, acentos azul Lobe + dourado. */

:root {
  --rail: #0e1730;
  --rail-2: #172447;
  --rail-text: #97a3c0;
  --rail-active: #ffffff;

  --brand: #1f56d6;
  --brand-deep: #143a96;
  --brand-soft: #e8eefc;

  --bg: #f2f4f8;
  --surface: #ffffff;
  --ink: #182135;
  --ink-soft: #5f6b81;
  --line: #e3e7ef;

  --ok: #0f8a60;
  --ok-soft: #def2e9;
  --warn: #b97e14;
  --warn-soft: #f8ecd4;
  --danger: #cc4237;
  --danger-soft: #fae4e1;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  font-size: 15px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ================= Estrutura: rail + conteúdo ================= */
.nav-toggle { display: none; }
.shell { display: flex; min-height: 100vh; }

.rail {
  width: 236px; flex-shrink: 0;
  background: var(--rail);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 18px 14px 14px;
  z-index: 60;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2f66ea, #143a96);
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-word { font-size: 19px; font-weight: 500; color: #cdd6ea; letter-spacing: .2px; }
.brand-word b { font-weight: 800; color: #fff; }

.rail-nav { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rail-2) transparent; }
.rail-nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px; border-radius: 10px;
  color: var(--rail-text); font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.rail-nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.rail-nav a:hover { background: var(--rail-2); color: #dfe6f5; text-decoration: none; }
.rail-nav a.active { background: var(--rail-2); color: var(--rail-active); }
.rail-nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #4d7ef7;
}
.rail-sep {
  margin: 16px 12px 8px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: #5b6884;
}
.rail-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.04);
  transition: background .15s;
}
.rail-user:hover { background: var(--rail-2); text-decoration: none; }
.rail-user-info { min-width: 0; display: flex; flex-direction: column; }
.rail-user-name { color: #e8edf8; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-role { color: #7c89a8; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 26px; height: 58px;
}
.topbar-context { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .07em; }
.topbar .spacer, .page-head .spacer { flex: 1; }

.hamburger { display: none; cursor: pointer; padding: 6px; margin-left: -6px; border-radius: 8px; color: var(--ink); }
.hamburger svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hamburger:hover { background: var(--bg); }
.scrim { display: none; }

main.content { flex: 1; padding: 26px 34px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }
.topbar-inner { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 1240px; margin: 0 auto; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 0; }

/* ================= Componentes ================= */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 800; letter-spacing: -.1px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--brand); color: #fff; border: 1.5px solid transparent; cursor: pointer;
  padding: 8px 20px; border-radius: 999px; font-size: 14px; font-weight: 700;
  font-family: inherit; line-height: 1.3; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16,24,40,.1), inset 0 1px 0 rgba(255,255,255,.14);
  transition: background .15s, transform .06s, box-shadow .15s;
}
.btn:hover { background: var(--brand-deep); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--brand); border-color: var(--brand); box-shadow: none; }
.btn.secondary:hover { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a83329; }
.btn.small { padding: 4px 14px; font-size: 12.5px; }
.btn.ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 800; flex-shrink: 0;
  letter-spacing: .02em; user-select: none;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28);
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
  background: var(--brand-soft); color: var(--brand-deep);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #eaedf3; color: var(--ink-soft); }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=number], input[type=time], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-weight: 500; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 86, 214, .14);
}
textarea { min-height: 92px; resize: vertical; }
label.field { display: block; margin-bottom: 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
label.field > input, label.field > select, label.field > textarea { margin-top: 6px; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; min-width: 0; }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td, table.list tr:hover td { background: #f7f9fc; }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .p-name { font-weight: 700; font-size: 14px; }
.person .p-sub { font-size: 12px; color: var(--ink-soft); }

.progress { height: 8px; background: #e8ebf2; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width .3s ease; }

.empty-state { text-align: center; color: var(--ink-soft); padding: 34px 16px; font-size: 14px; }
.flash { padding: 13px 18px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.flash.success { background: var(--ok-soft); color: #0b5c41; border-color: #bfe6d6; }
.flash.error { background: var(--danger-soft); color: #8c2f2c; border-color: #f2c8c2; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a {
  padding: 10px 16px; color: var(--ink-soft); font-weight: 700; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--brand); }

.stat { text-align: center; padding: 10px 8px; }
.stat .stat-n { font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: var(--brand-deep); font-variant-numeric: tabular-nums; }
.stat .stat-l { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }

.feed-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; padding-bottom: 4px; }
.feed-body { flex: 1; min-width: 0; }
.feed-meta { font-size: 12px; font-weight: 500; color: var(--ink-soft); }

/* ---- Topbar: notificações e conta ---- */
.icon-btn {
  position: relative; background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: 8px; border-radius: 10px; display: inline-flex;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notif-dot {
  position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 5px; line-height: 1.4;
  box-shadow: 0 0 0 2px #fff;
}
.account { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 8px; border-radius: 10px; }
.account:hover { background: var(--bg); }
.account-name { font-weight: 700; font-size: 14px; }
.account .chev { width: 14px; height: 14px; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

details.dropdown { position: relative; }
details.dropdown summary { list-style: none; cursor: pointer; }
details.dropdown summary::-webkit-details-marker { display: none; }
details.dropdown .menu {
  position: absolute; right: -8px; top: calc(100% + 10px); z-index: 70;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); min-width: 320px; max-height: 440px; overflow: auto; padding: 8px;
}
.menu-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); padding: 8px 12px 6px; }
.menu a.menu-item { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.menu a.menu-item:hover { background: var(--bg); text-decoration: none; }
.menu .menu-item.unread { background: var(--brand-soft); }
.menu .menu-item.unread:hover { background: #dbe6fb; }
.menu .menu-item .feed-meta { margin-top: 2px; }

/* ---- Início (layout estilo Qulture, cores Lobe) ---- */
.home-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; align-items: start; }
.home-side { position: sticky; top: 14px; }

.profile-card { display: flex; align-items: center; gap: 14px; }
.pc-info { min-width: 0; }
.pc-name { font-weight: 800; font-size: 13px; letter-spacing: .02em; line-height: 1.3; }
.pc-email { font-size: 11.5px; color: var(--ink-soft); margin: 2px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn.pill {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--brand); border: 1.5px solid var(--brand);
  border-radius: 999px; padding: 7px 18px; font-size: 13px; font-weight: 700;
}
.btn.pill:hover { background: var(--brand-soft); text-decoration: none; }

.side-title { font-size: 16.5px; font-weight: 800; margin: 20px 2px 10px; }
.side-list { padding: 14px; }
.side-person {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; color: inherit;
}
.side-person:hover { background: var(--bg); text-decoration: none; }
.side-person b { display: block; font-size: 12px; letter-spacing: .02em; }
.side-person small { display: block; font-size: 11px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }

.home-section-title { font-size: 19px; font-weight: 800; margin: 26px 2px 12px; }
.hs-count { font-weight: 600; color: var(--ink-soft); font-size: 16px; }

.hey-cards { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.hey-card {
  flex: 0 0 auto; width: 218px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; justify-content: space-between;
}
.hey-text { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.hey-card .btn.pill { align-self: flex-start; }

.empty-state .empty-illus, .empty-illus {
  display: block; width: 40px; height: 40px; margin: 6px auto 10px;
  fill: none; stroke: var(--ink); stroke-width: 1.4;
}
.card-more { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; text-align: right; }
.card-more a { font-weight: 700; font-size: 13px; color: var(--brand); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
}
.chip.read { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }
.chip.unread { background: #fdf3d7; color: #8a6408; border: 1px solid #f0dfa8; }
.chip.alert { background: var(--danger-soft); color: var(--danger); border: 1px solid #f2c7c2; }
.chip.okc { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe5d6; }

/* ---- 1:1 (estilo Qulture, cores Lobe) ---- */
.ooo-table th { white-space: nowrap; }
.ooo-person-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--bg); }
.strip-fact { text-align: right; min-width: 120px; }
.strip-fact small { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.strip-fact b { font-size: 13.5px; }

.ooo-meet-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.ooo-meet-date { font-size: 21px; font-weight: 800; margin-top: 4px; }

.ooo-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ooo-col { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.ooo-col-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ooo-col-head b { display: block; font-size: 13.5px; }
.ooo-col-head small { display: block; font-size: 11.5px; color: var(--ink-soft); }

.ooo-sug-title { font-size: 12px; font-weight: 800; color: var(--ink-soft); margin: 8px 0 4px; }
.ooo-sug {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px dashed var(--line); font-size: 13px;
}
.btn.pill.small-pill, .ooo-sug .btn.pill { padding: 3px 12px; font-size: 12px; flex: none; }

.ooo-topic { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ooo-topic:last-of-type { border-bottom: none; }
.ooo-topic form { display: flex; align-items: center; }
.ooo-add { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.ooo-add .btn.pill { flex: none; }

.ooo-tasks { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.ooo-footer {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 14px;
}

@media (max-width: 800px) {
  .ooo-columns { grid-template-columns: 1fr; }
  .strip-fact { text-align: left; min-width: 0; }
}

/* ---- Liderança (estilo Qulture, cores Lobe) ---- */
.ldr-update {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--brand-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px;
}
.ldr-update:last-child { margin-bottom: 0; }
.ldr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }

.ldr-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ldr-headline { color: var(--brand-deep); font-weight: 800; font-size: 14.5px; line-height: 1.45; }
.ldr-insight-text { font-size: 13.5px; }
.ldr-recs { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg); }
.ldr-rec {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.ldr-rec:last-child { margin-bottom: 0; }

.ldr-score { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 22px; }
.ldr-score-value { font-size: 34px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.ldr-point { font-size: 13px; font-weight: 700; padding: 3px 0; }
.ldr-point.ok { color: var(--ok); }
.ldr-point.warn { color: var(--warn); }

.ldr-chart { display: flex; gap: 8px; align-items: flex-end; height: 190px; padding-top: 18px; }
.ldr-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.ldr-bar-val { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.ldr-bar {
  flex: 1; width: 26px; display: flex; flex-direction: column-reverse;
  background: var(--bg); border-radius: 6px; overflow: hidden;
}
.ldr-bar > span { display: block; width: 100%; background: var(--brand); }
.ldr-bar.stacked > span { border-radius: 0; }
.ldr-bar-col small { font-size: 9.5px; color: var(--ink-soft); white-space: nowrap; transform: rotate(-28deg); margin-top: 8px; }

/* avaliação da 1:1 */
.rate-row { display: flex; gap: 8px; margin-top: 8px; }
.rate-opt { flex: 1; cursor: pointer; }
.rate-opt input { position: absolute; opacity: 0; }
.rate-opt span {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 4px; font-size: 24px;
  transition: border-color .12s, background .12s;
}
.rate-opt span b { font-size: 12px; color: var(--ink-soft); }
.rate-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.tag-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-check { cursor: pointer; }
.tag-check input { position: absolute; opacity: 0; }
.tag-check span {
  display: inline-block; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  transition: all .12s;
}
.tag-check.ok input:checked + span { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.tag-check.warn input:checked + span { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

@media (max-width: 900px) {
  .ldr-insights, .ldr-score { grid-template-columns: 1fr; }
  .rate-row { flex-wrap: wrap; }
}

.comm-row { display: block; color: inherit; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.comm-row:last-of-type { border-bottom: none; }
.comm-row:hover { background: var(--bg); text-decoration: none; border-radius: 10px; }
.comm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comm-preview { margin-top: 4px; }
.upper-name { font-size: 12.5px; letter-spacing: .02em; }

@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-side { position: static; }
}

/* ---- Organograma (layout estilo Qulture, cores Lobe) ---- */
main.page-organograma { max-width: none; }
.org-board { padding: 14px; position: relative; }

.org-viewport {
  overflow: auto; cursor: grab; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
  height: calc(100vh - 290px); min-height: 440px;
}
.org-viewport.dragging { cursor: grabbing; user-select: none; }
.org-canvas { display: inline-block; min-width: 100%; padding: 34px 40px 60px; }

.org-chart, .org-chart ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.org-chart ul { position: relative; padding-top: 26px; }
.org-chart ul::before {
  content: ''; position: absolute; top: 0; left: 50%;
  border-left: 2px solid var(--line); height: 26px;
}
.org-chart li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 10px 0; }
.org-chart li::before, .org-chart li::after {
  content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 26px;
  border-top: 2px solid var(--line);
}
.org-chart li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
.org-chart li:first-child::before { border-top: none; }
.org-chart li:last-child::after { border-top: none; border-left: none; }
.org-chart li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 10px 0 0; }
.org-chart li:first-child::after { border-radius: 10px 0 0 0; }
.org-chart li:only-child::before { display: none; }
.org-chart li:only-child::after {
  border-top: none; border-radius: 0; width: 0;
  border-left: 2px solid var(--line); height: 26px;
}
.org-chart > li::before, .org-chart > li::after { display: none; }
.org-chart > li { padding-top: 0; }
.org-chart li.collapsed > ul { display: none; }

.org-company {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; border-radius: 10px;
  padding: 10px 22px; font-weight: 800; font-size: 15px;
  box-shadow: 0 3px 10px rgba(31,86,214,.3);
}
.org-company b { font-weight: 800; opacity: .85; }
.org-company .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255,255,255,.2); font-size: 13px;
}

.org-card {
  position: relative; width: 196px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px 9px; box-shadow: 0 1px 3px rgba(16,24,40,.08); text-align: left;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.org-card:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(31,86,214,.14); }
.oc-top { display: flex; align-items: center; gap: 9px; }
.oc-name { font-weight: 700; font-size: 12.5px; line-height: 1.3; color: var(--ink); }
.oc-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 9px; }
.org-chart.hide-tags .oc-tags { display: none; }
.oc-tag {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 4px;
  letter-spacing: .02em; white-space: nowrap;
}
.oc-tag.lider { color: var(--brand); border: 1px solid #9db9ec; background: #fff; }
.oc-tag.dept { color: var(--ink-soft); border: 1px solid var(--line); background: var(--bg); }

.org-toggle {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 0;
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--ink-soft);
  font-family: inherit;
}
.org-toggle:hover { color: var(--brand); }
.org-toggle svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; transition: transform .15s; }
.org-chart li:not(.collapsed) > .org-card .org-toggle svg { transform: rotate(180deg); }

/* controles flutuantes de zoom (círculos, canto inferior esquerdo) */
.org-controls {
  position: absolute; left: 30px; bottom: 34px;
  display: flex; flex-direction: column; gap: 10px; z-index: 5;
}
.org-controls button {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(31,86,214,.35);
  transition: background .15s, transform .1s;
}
.org-controls button:hover { background: var(--brand-deep); }
.org-controls button:active { transform: scale(.94); }
.org-controls svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* switch "Exibir tags" */
.switch-line {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink); user-select: none;
}
.switch-line input { position: absolute; opacity: 0; pointer-events: none; }
.switch-line .switch {
  width: 40px; height: 22px; border-radius: 999px; background: #c8cdd8;
  position: relative; transition: background .18s; flex: none;
}
.switch-line .switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: left .18s;
  box-shadow: 0 1px 3px rgba(16,24,40,.3);
}
.switch-line input:checked + .switch { background: var(--brand); }
.switch-line input:checked + .switch::after { left: 21px; }

/* painel lateral (drawer) */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(14,23,48,.32); z-index: 110;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.org-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 500px; max-width: 94vw;
  background: var(--surface); z-index: 120; overflow-y: auto;
  box-shadow: -14px 0 44px rgba(16,24,40,.2);
  transform: translateX(102%); transition: transform .25s ease;
  padding: 20px 22px 32px;
}
.org-drawer.open { transform: none; }
.drawer-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px; border: none; cursor: pointer;
  background: none; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: var(--bg); color: var(--ink); }
.drawer-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; }

.dw-head { display: flex; gap: 14px; align-items: center; margin: 4px 26px 0 0; }
.dw-name { font-weight: 800; font-size: 16.5px; line-height: 1.25; }
.dw-role { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-soft); margin-top: 2px; }
.dw-more { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.dw-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 4px; overflow-x: auto; }
.dw-tab {
  padding: 9px 13px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.dw-tab:hover { color: var(--ink); text-decoration: none; }
.dw-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.dw-section { font-size: 12px; font-weight: 800; color: var(--ink-soft); margin: 18px 0 8px; }
.dw-box {
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px;
  background: var(--surface); min-width: 0;
}
.dw-box + .dw-box, .dw-grid { margin-top: 10px; }
.dw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dw-grid.three { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
.dw-box-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 800; color: var(--brand); margin-bottom: 8px;
}
.dw-go { margin-left: auto; color: var(--ink-soft); font-size: 12px; }
.dw-go:hover { color: var(--brand); text-decoration: none; }
.dw-strong { font-weight: 700; font-size: 13.5px; }
.dw-muted { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.dw-count { font-size: 12.5px; }
.dw-count b { font-size: 16px; font-weight: 800; }
.dw-bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.dw-bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.dw-pct { text-align: right; font-weight: 800; font-size: 14px; margin-top: 6px; }

@media (max-width: 700px) {
  .org-drawer { width: 100vw; max-width: 100vw; padding: 16px 14px 28px; }
  .org-controls { left: 20px; bottom: 20px; gap: 8px; }
  .org-controls button { width: 36px; height: 36px; }
  .org-viewport { height: calc(100vh - 330px); min-height: 320px; }
  .org-canvas { padding: 22px 18px 44px; }
  .org-card { width: 176px; }
  .dw-grid { grid-template-columns: 1fr; }
  .dw-grid.three { grid-template-columns: 1fr 1fr; }
}

/* ---- Escala de avaliação ---- */
.scale { display: flex; gap: 8px; flex-wrap: wrap; }
.scale label {
  flex: 1; min-width: 120px; text-align: center;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 6px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-soft);
  background: #fff; transition: border-color .12s, background .12s, color .12s;
}
.scale label:hover { border-color: var(--brand); color: var(--brand-deep); }
.scale input { display: none; }
.scale label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); box-shadow: inset 0 0 0 1px var(--brand); }
.scale.enps label { min-width: 40px; flex: 1 0 40px; padding: 9px 2px; font-size: 13px; }

/* ================= Login ================= */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 600px at 80% -10%, #24408f 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #1c2f66 0%, transparent 55%),
              var(--rail);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 38px 36px; width: 400px; max-width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.login-brand .brand-word { font-size: 24px; color: var(--ink); }
.login-brand .brand-word b { color: var(--brand); }
.login-card .sub { text-align: center; color: var(--ink-soft); font-size: 13.5px; margin-bottom: 26px; }

/* ================= Responsivo ================= */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: none;
  }
  .nav-toggle:checked ~ .shell .rail { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .nav-toggle:checked ~ .shell .scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(13, 20, 38, .5); cursor: pointer;
  }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 16px; }
  main.content { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .page-head h1 { font-size: 20px; }
  table.list { display: block; overflow-x: auto; }
  .account-name, .account .chev { display: none; }
  details.dropdown .menu { min-width: 280px; max-width: calc(100vw - 24px); }
  .scale label { min-width: 90px; }
}
@media (max-width: 400px) {
  .topbar-context { display: none; }
}
