/* Vidya — design system
   Inspiração: HIG da Apple — superfícies claras, tipografia SF-like, muito respiro, um acento. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --line: rgba(0,0,0,.08);
  --line-2: rgba(0,0,0,.12);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0,113,227,.10);
  --green: #34c759; --green-soft: rgba(52,199,89,.14);
  --orange: #ff9500; --orange-soft: rgba(255,149,0,.14);
  --red: #ff3b30; --red-soft: rgba(255,59,48,.12);
  --gray-soft: rgba(142,142,147,.14);
  --green-text: #1f8a3b; --orange-text: #b36200; --red-text: #c0271e;
  --radius: 18px; --radius-sm: 12px; --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.05), 0 16px 40px rgba(0,0,0,.09);
  --sidebar-w: 240px;
  --ease: cubic-bezier(.25,.1,.25,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e;
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
    --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.16);
    --accent: #0a84ff; --accent-hover: #409cff; --accent-soft: rgba(10,132,255,.18);
    --green: #30d158; --orange: #ff9f0a; --red: #ff453a;
    --green-text: #4cd964; --orange-text: #ffb340; --red-text: #ff6961;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.5), 0 16px 40px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e;
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
    --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.16);
    --accent: #0a84ff; --accent-hover: #409cff; --accent-soft: rgba(10,132,255,.18);
    --green: #30d158; --orange: #ff9f0a; --red: #ff453a;
    --green-text: #4cd964; --orange-text: #ffb340; --red-text: #ff6961;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.5), 0 16px 40px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 30px; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--gray-soft); padding: 2px 6px; border-radius: 6px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); position: sticky; top: 0; height: 100vh;
  padding: 24px 14px; display: flex; flex-direction: column; gap: 4px;
  background: color-mix(in srgb, var(--bg) 70%, var(--surface)); border-right: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 26px; height: 26px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #5ac8fa); box-shadow: 0 4px 12px rgba(0,113,227,.35); }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: 14.5px; transition: background .15s var(--ease);
}
.nav a:hover { background: var(--gray-soft); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .ico { width: 22px; text-align: center; font-size: 22px; opacity: .9; }
.sidebar .spacer { flex: 1; }
.sidebar .user { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .user b { color: var(--text); font-weight: 600; display: block; }
.main { flex: 1; min-width: 0; padding: 36px 44px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 4px; font-size: 15px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.topbar { display: none; }
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .main { padding: 20px 16px 90px; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line);
  }
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-2); min-width: 56px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a .ico { font-size: 24px; }
  h1 { font-size: 26px; }
}
@media (min-width: 901px) { .tabbar { display: none; } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; border: 1px solid var(--line);
}
.card + .card { margin-top: 16px; }
.card.pad-0 { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-main { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1000px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; }

/* Person card */
.person {
  display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: inherit; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.person:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.person .info { flex: 1; min-width: 0; }
.person .name { font-weight: 600; font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .role { color: var(--text-2); font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; color: #fff; letter-spacing: .02em; background-size: cover; background-position: center;
}
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--gray-soft); color: var(--text-2); white-space: nowrap;
}
.pill.pos { background: var(--green-soft); color: var(--green-text); }
.pill.att { background: var(--orange-soft); color: var(--orange-text); }
.pill.neg { background: var(--red-soft); color: var(--red-text); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.dot-tone { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot-tone.positivo { background: var(--green); } .dot-tone.atencao { background: var(--orange); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  background: var(--accent); color: #fff; transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: transparent; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 15px; }
.btn.full-w { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .spinner { display: none; }
.btn.loading .spinner { display: inline-block; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.secondary .spinner, .btn.ghost .spinner { border-color: rgba(0,0,0,.15); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-xs); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 500; transition: all .15s var(--ease); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.tone-positivo input:checked + span { background: var(--green); border-color: var(--green); }
.chip.tone-atencao input:checked + span { background: var(--orange); border-color: var(--orange); }
.chip.tone-neutro input:checked + span { background: var(--text-2); border-color: var(--text-2); }
.segmented { display: inline-flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.segmented .active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented a:hover { text-decoration: none; }

/* ---------- Lists / timeline ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.list-item:first-child { border-top: 0; padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .text { color: var(--text); white-space: pre-wrap; margin-top: 2px; }
.list-item .meta { font-size: 12.5px; color: var(--text-3); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.type-ico { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: var(--gray-soft); flex: 0 0 auto; }
.type-ico.positivo { background: var(--green-soft); } .type-ico.atencao { background: var(--orange-soft); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline .t-item { position: relative; padding: 0 0 22px; }
.timeline .t-item::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.timeline .t-item.positivo::before { background: var(--green); }
.timeline .t-item.atencao::before { background: var(--orange); }
.timeline .t-item.feedback::before { background: var(--accent); width: 14px; height: 14px; left: -24px; }
.timeline .t-date { font-size: 12px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- Alerts / flash ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.flash a { text-decoration: underline; color: inherit; }
.flash.success { background: var(--green-soft); color: var(--green-text); }
.flash.error { background: var(--red-soft); color: var(--red-text); }
.flash.info { background: var(--accent-soft); color: var(--accent); }
.flash.warn { background: var(--orange-soft); color: var(--orange-text); }
.alert-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.alert-item:first-child { border-top: 0; padding-top: 0; }
.alert-item .lvl { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.alert-item .lvl.warn { background: var(--orange); } .alert-item .lvl.info { background: var(--accent); } .alert-item .lvl.muted { background: var(--text-3); }

/* ---------- Stats ---------- */
.stat { padding: 18px 20px; }
.grid.stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 700px) { .grid.stats { gap: 8px; } .grid.stats .card { padding: 14px 12px; } .grid.stats .n { font-size: 24px; } .grid.stats .l { font-size: 11.5px; } }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat .l { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* Barras mensais (saldo positivo/atenção) */
.bars { display: flex; gap: 10px; align-items: flex-end; height: 90px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.bars .b i { display: block; border-radius: 3px; min-height: 0; }
.bars .b i.pos { background: var(--green); } .bars .b i.att { background: var(--orange); } .bars .b i.neu { background: var(--text-3); opacity: .5; }
.bars-labels { display: flex; gap: 10px; margin-top: 6px; }
.bars-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--text-3); }

/* Escala de competência (1-5) */
.score { display: inline-flex; gap: 4px; }
.score i { width: 22px; height: 6px; border-radius: 3px; background: var(--line-2); }
.score i.on { background: var(--accent); }
.score.s1 i.on, .score.s2 i.on { background: var(--orange); }
.score.s4 i.on, .score.s5 i.on { background: var(--green); }
.score-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.score-row:first-child { border-top: 0; }
.score-row .nm { flex: 1; font-weight: 500; }
.score-row .delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); } .delta.same { color: var(--text-3); }

/* ---------- Feedback / roteiro ---------- */
.prose ul { margin: 6px 0 0; padding-left: 20px; }
.prose li { margin: 3px 0; }
.block { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.block + .block { margin-top: 10px; }
.block h4 { font-size: 15px; margin-bottom: 4px; }
.block .sug { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.step { display: flex; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.step .num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 14px; }
.step .body { flex: 1; }
.step .obj { color: var(--text-2); font-size: 14px; }
.step .q { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--accent-soft); color: var(--text-2); font-style: italic; font-size: 14px; }
.step .dur { font-size: 12px; color: var(--text-3); }
.agreement-row { display: grid; grid-template-columns: 1fr 150px 150px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 700px) { .agreement-row { grid-template-columns: 1fr; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth .card { width: 100%; max-width: 380px; padding: 32px; }
.auth .brand { justify-content: center; padding-bottom: 12px; font-size: 24px; }

/* ---------- Misc ---------- */
.kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--text-3); }
.fade-in { animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
details summary { cursor: pointer; font-weight: 500; color: var(--accent); list-style: none; }
details summary::-webkit-details-marker { display: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.status-ativo { color: var(--green); } .status-afastado { color: var(--orange); } .status-desligado { color: var(--text-3); }

@media print {
  .sidebar, .tabbar, .topbar, .no-print { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- Tema (auto / claro / escuro) ---------- */
.theme-toggle { display: inline-flex; background: var(--gray-soft); border-radius: 999px; padding: 3px; gap: 2px; }
.theme-toggle button { width: 28px; height: 24px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: 13px; color: var(--text-2); line-height: 1; }
.theme-toggle button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* ---------- Relação hierárquica ---------- */
.avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.rel-badge {
  position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff;
  border: 2px solid var(--surface); line-height: 1;
}
.rel-badge.subordinado { background: var(--green); }
.rel-badge.par { background: #5e5ce6; }
.rel-badge.superior { background: var(--orange); }
.avatar-wrap.lg .rel-badge { width: 24px; height: 24px; font-size: 13px; right: -2px; bottom: -2px; }
.avatar-wrap.sm .rel-badge { width: 14px; height: 14px; font-size: 9px; border-width: 1.5px; }
.pill.rel-par { background: rgba(94,92,230,.14); color: #5e5ce6; }
.pill.rel-superior { background: var(--orange-soft); color: var(--orange-text); }
.pill.rel-subordinado { background: var(--green-soft); color: var(--green-text); }

/* ---------- Recorte de foto ---------- */
.cropper { display: none; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.cropper.on { display: flex; }
.crop-frame {
  width: 220px; height: 220px; border-radius: 50%; overflow: hidden; position: relative; background: var(--surface-2);
  border: 1px solid var(--line-2); cursor: grab; touch-action: none; user-select: none; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; max-width: none; }
.crop-controls { display: flex; flex-direction: column; gap: 10px; min-width: 200px; }
.crop-controls input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- Marca ---------- */
.brand img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.brand .emoji { font-size: 24px; line-height: 1; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); padding: 2px; cursor: pointer; }

/* ---------- Ícones (Material Symbols) ---------- */
.ms {
  font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; vertical-align: middle;
}
.nav a.active .ms, .tabbar a.active .ms { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.btn .ms { font-size: 18px; }

/* ---------- Avatares grandes no painel ---------- */
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-wrap.xl .rel-badge { width: 22px; height: 22px; font-size: 12px; }
.person.big { padding: 20px; gap: 16px; }
.person.big .avatar { box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 6px 0 8px; grid-column: 1 / -1; }

/* ---------- Organograma ---------- */
.org { overflow-x: auto; padding: 8px 0 24px; }
.org-zone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 12px; margin: 0 auto 10px; min-height: 64px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; transition: background .15s, border-color .15s; }
.org-zone .zone-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); width: 100%; text-align: center; }
.org-zone.over, .org-node.over > .org-card { background: var(--accent-soft); border-color: var(--accent); }
.org-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); min-width: 190px; max-width: 230px; cursor: grab; color: inherit; user-select: none; transition: box-shadow .15s, transform .15s;
}
.org-card:hover { box-shadow: var(--shadow-hover); text-decoration: none; }
.org-card.dragging { opacity: .4; }
.org-card .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-card .rl { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-card.you { background: var(--accent); color: #fff; border-color: transparent; cursor: default; }
.org-card.you .rl { color: rgba(255,255,255,.8); }
.org-mid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin: 6px 0; }
@media (max-width: 700px) { .org-mid { grid-template-columns: 1fr; justify-items: center; } }
.org-mid .org-zone { margin: 0; min-height: 80px; width: 100%; }
.org-connector { width: 2px; height: 22px; background: var(--line-2); margin: 0 auto; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.org-tree ul { padding-top: 22px; position: relative; }
.org-tree li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--line-2); }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid var(--line-2); }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid var(--line-2); border-radius: 0 6px 0 0; }
.org-tree li:first-child::after { border-radius: 6px 0 0 0; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 22px; background: var(--line-2); }
.org-tree > li { padding-top: 0; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-node { display: flex; flex-direction: column; align-items: center; }
.org-empty-hint { font-size: 12px; color: var(--text-3); padding: 8px 12px; border: 1.5px dashed var(--line-2); border-radius: 10px; }

/* ---------- Login com fundo e logotipo ---------- */
.auth-stack { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.auth-stack .card { width: 100%; }
.company-logo img { max-height: 72px; max-width: 260px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,.25)); }
.auth.has-bg .auth-foot { color: rgba(255,255,255,.9); text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* ---------- Admin: grades de cor e ícones ---------- */
.color-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 14px; align-items: center; font-size: 14px; }
.color-grid .h { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.color-grid input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); padding: 2px; cursor: pointer; }
.icon-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.icon-row:first-child { border-top: 0; }
.icon-row .prev { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon-row .prev .ms { font-size: 24px; }
.icon-row label { width: 110px; font-size: 13px; color: var(--text-2); flex: 0 0 auto; }
.icon-row input { flex: 1; padding: 6px 10px; font-size: 14px; font-family: ui-monospace, Menlo, monospace; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.icon-pick button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; color: var(--text-2); }
.icon-pick button:hover { background: var(--accent-soft); color: var(--accent); }
.icon-pick .ms { font-size: 20px; }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; background: repeating-conic-gradient(var(--gray-soft) 0 25%, transparent 0 50%) 0 0/12px 12px; border: 1px solid var(--line); }
.thumb.wide { width: 120px; object-fit: cover; }
.ev-link { font-size: 11px; color: var(--text-3); text-decoration: none; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 4px; vertical-align: middle; }
.ev-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.sci { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13.5px; margin-top: 4px; }
.sci b { color: var(--text-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-bg.on { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-hover); width: 100%; max-width: 520px; padding: 24px; animation: fade .2s var(--ease); }
