/* Menu lateral — padrão visual TecSkill (favoritos + leve degradê, como Fórum Apucarana / Operis HDA).
   Carregado depois do app.css; só sobrepõe o necessário. */

/* Painel azul com degradê (padrão Operis): azul-royal no topo descendo para o azul-noite */
.ts-app .ts-sidebar {
  border: 1px solid rgba(8,16,48,.65);
  background:
    radial-gradient(120% 40% at 30% -6%, rgba(120,170,255,.28) 0%, rgba(0,0,0,0) 62%),
    linear-gradient(180deg, #2b5aa3 0%, #1a3d80 26%, #0f2759 55%, #07123a 80%, #040b28 100%);
  box-shadow: 0 14px 36px -14px rgba(6,16,60,.7), inset 0 1px 0 rgba(255,255,255,.22);
}
.ts-app .ts-sidebar__logo { border-bottom-color: rgba(255,255,255,.12); }
.ts-app .ts-nav__section, .ts-app .ts-nav__group-title { color: rgba(214,228,255,.72); }
.ts-app .ts-nav a { color: #e7efff; }
.ts-app .ts-nav a:hover { background: rgba(255,255,255,.10); box-shadow: inset 0 0 0 1px rgba(160,195,255,.22); }
/* Item ativo: pílula azul clara com contorno e barra lateral (Operis) */
.ts-app .ts-nav a.is-active,
.ts-app .ts-nav .ts-indicator {
  background: linear-gradient(90deg, rgba(53,112,235,.62), rgba(37,84,196,.5));
  box-shadow: inset 0 0 0 1px rgba(125,175,255,.75), 0 6px 16px rgba(4,12,50,.35);
}
.ts-app .ts-nav .ts-indicator::after { background: #6fa8ff; width: 3px; top: 22%; bottom: 22%; }
.ts-app .ts-nav a.is-active i.fas { color: #fff; }

/* Estrela de favorito */
.ts-app .ts-nav li.mf-item { position: relative; }
.ts-app .ts-nav li > .mf-star {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 26px; height: 26px; min-height: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px;
  background: transparent; color: #c5c3e6; font-size: 11px; opacity: 0; cursor: pointer; transition: opacity .15s, color .15s, background .15s;
}
.ts-app .ts-nav li > .mf-star i { width: auto; flex: 0 0 auto; font-size: 11px; }
.ts-app .ts-nav li.mf-item:hover > .mf-star, .ts-app .ts-nav li > .mf-star:focus-visible { opacity: .9; }
.ts-app .ts-nav li > .mf-star:hover { opacity: 1; background: rgba(255,255,255,.2); box-shadow: none; }
.ts-app .ts-nav li > .mf-star.is-on { color: #f5b942; opacity: 1; }
.ts-app .ts-nav li > .mf-star:focus-visible, .mf-toggle:focus-visible { outline: 2px solid #8db8ff; outline-offset: 2px; }
.ts-app .ts-nav li.mf-item:hover .ts-nav__badge, .ts-app .ts-nav li.mf-item:hover .ts-nav__active-mark { opacity: 0; }

/* Bloco «Favoritos» no topo do menu */
.ts-nav .mf-bloco { list-style: none; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--sidebar-hairline); }
.ts-nav .mf-bloco[hidden] { display: none; }
.ts-nav .mf-bloco .ts-nav__section { padding-top: 4px; display: flex; align-items: center; gap: 7px; }
.ts-nav .mf-bloco .ts-nav__section i { color: #f5b942; font-size: 10px; }
.ts-nav .mf-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ts-nav .mf-vazio { font-size: 12px; line-height: 1.5; color: var(--sidebar-section-ink); padding: 6px 10px; }
.ts-nav.mf-so > li:not(.mf-bloco):not(.ts-indicator) { display: none; }
.ts-nav.mf-so .mf-bloco { border-bottom: 0; }

/* Chave «Só favoritos» */
.mf-tools { margin: 4px 0 6px; }
.mf-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; min-height: 36px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: var(--sidebar-ink);
  font: 500 12px/18px var(--font-sans); text-align: left; cursor: pointer;
}
.mf-toggle:hover { background: rgba(255,255,255,.12); }
.mf-toggle > span:first-child { display: flex; align-items: center; gap: 10px; }
.mf-toggle i { width: 17px; text-align: center; color: #f5b942; font-size: 13px; }
.mf-chave { position: relative; flex: 0 0 auto; width: 34px; height: 19px; border-radius: 99px; background: rgba(255,255,255,.28); transition: background .2s; }
.mf-chave::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mf-toggle[aria-checked="true"] .mf-chave { background: #f5b942; }
.mf-toggle[aria-checked="true"] .mf-chave::after { transform: translateX(15px); }

/* Menu recolhido: só ícones */
.ts-app.is-collapsed .ts-nav li > .mf-star:not(.is-on), .ts-app.is-collapsed .ts-nav li > .mf-star.is-on,
.ts-app.is-collapsed .mf-chave, .ts-app.is-collapsed .mf-toggle__txt, .ts-app.is-collapsed .mf-vazio { display: none; }
.ts-app.is-collapsed .mf-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
.ts-app.is-collapsed .mf-toggle[aria-checked="true"] { background: rgba(245,185,66,.18); border-color: rgba(245,185,66,.5); }
.ts-app.is-collapsed .ts-nav .mf-bloco .ts-nav__section { display: none; }
@media (max-width: 767px) { .ts-app .ts-nav li > .mf-star { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .mf-chave, .mf-chave::after, .ts-app .ts-nav li > .mf-star { transition: none; } }

/* Logos oficiais: horizontal branca no menu (símbolo quando recolhido); roxa/branca no login conforme o tema */
.ts-app .ts-sidebar__logo { height: 128px; min-height: 128px; }
.ts-app .ts-sidebar__logo img.ts-sidebar__wordmark { width: 176px; height: auto; max-width: 100%; max-height: none; display: block; }
.ts-app .ts-sidebar__logo img.ts-sidebar__symbol, .ts-app.is-collapsed .ts-sidebar__logo img.ts-sidebar__symbol { display: none; }
/* Recolhido: a mesma logo branca, cortada para mostrar só o símbolo (sem duplicar) */
.ts-app.is-collapsed .ts-sidebar__logo img.ts-sidebar__wordmark { width: 54px; height: 40px; max-width: none; object-fit: cover; object-position: left center; }
.ts-auth__logo { display: block; width: 240px; max-width: 80%; height: auto; margin: 0 auto 6px; }
.ts-auth__logo--dark { display: none; }
[data-theme="dark"] .ts-auth__logo--light { display: none; }
[data-theme="dark"] .ts-auth__logo--dark { display: block; }

/* ---------- Login em tela dividida (painel de marca + formulário) ---------- */
.lg-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fafafc; }
.lg-split__brand {
  position: relative; display: flex; align-items: center; overflow: hidden; color: #fff; padding: 48px 8%;
  background:
    radial-gradient(70% 55% at 100% 0%, rgba(124,58,237,.55) 0%, rgba(0,0,0,0) 70%),
    radial-gradient(60% 45% at 40% 108%, rgba(52,45,180,.55) 0%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, #0b0a1c 0%, #090917 100%);
}
.lg-split__brand::before { /* grade sutil */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask: radial-gradient(90% 90% at 30% 40%, #000 20%, transparent 85%); mask: radial-gradient(90% 90% at 30% 40%, #000 20%, transparent 85%);
}
.lg-split__brand-inner { position: relative; max-width: 460px; }
.lg-split__logo { width: 300px; max-width: 80%; height: auto; display: block; }
.lg-split__bar { display: block; width: 68px; height: 4px; border-radius: 4px; margin: 44px 0 36px; background: linear-gradient(90deg, #7c3aed, #6366f1); }
.lg-split__eyebrow { margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.62); font-weight: 500; }
.lg-split__headline { margin: 0 0 16px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.lg-split__lead { margin: 0; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.78); }

.lg-split__form { display: flex; align-items: center; justify-content: center; padding: 48px 8%; }
.lg-split__form-inner { width: 100%; max-width: 420px; }
.lg-split__title { margin: 0 0 28px; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: #0f172a; }
.lg-split__label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #2a2550; }
.lg-split__input { min-height: 52px; border-radius: 12px; font-size: 16px; }
.lg-split__submit { min-height: 52px; border-radius: 12px; font-size: 16px; font-weight: 600; background: linear-gradient(90deg, #7c3aed, #5b4bdb); color: #fff; border: 0; }
.lg-split__foot { margin: 28px 0 0; font-size: 12px; color: #7a7a96; }
[data-theme="dark"] .lg-split { background: #0d0e1a; }
[data-theme="dark"] .lg-split__title { color: #f6f7fb; }
[data-theme="dark"] .lg-split__label { color: #d6d6e8; }
@media (max-width: 860px) {
  .lg-split { grid-template-columns: 1fr; }
  .lg-split__brand { padding: 32px 24px; }
  .lg-split__bar { margin: 24px 0 20px; }
  .lg-split__logo { width: 220px; }
  .lg-split__headline { font-size: 26px; }
  .lg-split__form { padding: 32px 24px 48px; }
}

/* Janelinha do menu recolhido (grupo + item) */
#menuFlyout { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 2px; min-width: 150px; max-width: 260px; padding: 9px 14px; border-radius: 12px;
  background: rgba(10,28,72,.92); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.2); color: #fff; box-shadow: 0 12px 32px rgba(10,6,30,.4), inset 0 1px 0 rgba(255,255,255,.18); pointer-events: none; font: 600 13px/18px var(--font-sans); }
#menuFlyout[hidden] { display: none; }
#menuFlyout small { color: #9cc2ff; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
#menuFlyout::before { content: ''; position: absolute; left: -6px; top: 50%; width: 11px; height: 11px; margin-top: -5px; background: inherit; border-left: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); transform: rotate(45deg); border-radius: 0 0 0 3px; }

/* Banner (hero) em azul translúcido com vidro fosco, no mesmo azul do menu lateral */
.ts-app .ts-hero {
  position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.35);
  background:
    radial-gradient(90% 140% at 8% -20%, rgba(150,195,255,.55) 0%, rgba(150,195,255,0) 60%),
    linear-gradient(135deg, rgba(43,90,163,.80) 0%, rgba(26,61,128,.78) 45%, rgba(10,28,84,.84) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 18px 40px -18px rgba(10,28,84,.6), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(255,255,255,.12);
}
.ts-app .ts-hero::after { /* reflexo de vidro no topo */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 45%);
}
.ts-app .ts-hero > * { position: relative; z-index: 1; }

/* Aviso de personificação (admin vendo como cliente) */
.imp-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 30px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 14px;
  background: rgba(15,23,42,.92); color: #e2e8f0; font: 500 12px/1.2 var(--font-sans, system-ui); border-bottom: 1px solid rgba(245,158,11,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.imp-bar strong { font-weight: 600; color: #fff; }
.imp-bar__dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; animation: imp-pulse 1.6s ease-in-out infinite; flex: 0 0 auto; }
.imp-bar__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-bar__sub { font-weight: 400; opacity: .7; }
.imp-bar form { margin: 0; }
.imp-bar__btn { white-space: nowrap; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: transparent; color: #fff; font: 600 11.5px/1 var(--font-sans, inherit); cursor: pointer; }
.imp-bar__btn:hover { background: rgba(255,255,255,.12); }
.imp-bar__btn:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
@keyframes imp-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .imp-bar__dot { animation: none; } }
@media (max-width: 760px) { .imp-bar__sub { display: none; } }
/* Empurra o shell para baixo do aviso */
html.is-impersonating body { padding-top: 30px; }
html.is-impersonating .ts-app > .ts-sidebar { top: calc(var(--sidebar-inset) + 30px); height: calc(100vh - (var(--sidebar-inset) * 2) - 30px); }
html.is-impersonating .ts-app .ts-header { top: calc(var(--sidebar-inset) + 30px); }
html.is-impersonating .ac-rail { top: 30px; height: calc(100vh - 30px); }
@media (max-width: 900px) { html.is-impersonating .ac-rail { top: auto; height: 64px; } }
@media (max-width: 767px) { html.is-impersonating .ts-app > .ts-sidebar { top: calc(8px + 30px); bottom: 8px; height: auto; } html.is-impersonating .ts-app .ts-header { top: calc(8px + 30px); } }

/* Termos de uso / aceite eletrônico (primeiro acesso) */
.tm-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 60% at 20% -10%, rgba(120,170,255,.35), transparent 60%), linear-gradient(180deg, #0f2759, #07123a); }
.tm-card { width: min(760px, 100%); display: flex; flex-direction: column; background: var(--ts-surface, #fff); color: var(--ts-text, #14213d); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px -24px rgba(2,8,40,.8); }
[data-theme="dark"] .tm-card { background: #101a36; color: #e6edff; }
.tm-head { padding: 26px 28px 18px; background: linear-gradient(180deg, #2554c4, #1a3d80); color: #fff; }
.tm-logo { display: block; margin-bottom: 14px; }
.tm-eyebrow { margin: 0; font: 700 11px/1 var(--font-sans, inherit); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.tm-head h1 { margin: 6px 0 4px; font-size: 22px; letter-spacing: -.01em; }
.tm-sub { margin: 0; font-size: 13.5px; opacity: .85; }
.tm-body { max-height: 42vh; overflow: auto; padding: 18px 28px; font-size: 14px; line-height: 1.6; border-bottom: 1px solid rgba(120,140,190,.25); }
.tm-body h2 { margin: 14px 0 4px; font-size: 14.5px; }
.tm-body h2:first-child { margin-top: 0; }
.tm-body p { margin: 0; opacity: .92; }
.tm-body:focus-visible { outline: 2px solid #4d8bff; outline-offset: -2px; }
.tm-form { display: grid; gap: 14px; padding: 18px 28px 8px; }
.tm-check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.tm-check input { width: 20px; height: 20px; accent-color: #1d4fc0; }
.tm-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.tm-field input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(120,140,190,.45); background: transparent; color: inherit; font: 500 15px/1 var(--font-sans, inherit); }
.tm-field input:focus-visible { outline: 2px solid #4d8bff; outline-offset: 1px; }
.tm-legal { margin: 0; font-size: 12px; opacity: .7; }
.tm-actions { display: flex; justify-content: flex-end; }
.tm-btn { min-height: 46px; padding: 0 22px; border: 0; border-radius: 12px; font: 700 14.5px/1 var(--font-sans, inherit); cursor: pointer; }
.tm-btn--primary { background: linear-gradient(180deg, #2f6df0, #1d4fc0); color: #fff; box-shadow: 0 10px 20px -10px rgba(29,79,192,.8); }
.tm-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.tm-out { padding: 0 28px 20px; text-align: center; }
.tm-link { border: 0; background: transparent; color: inherit; opacity: .65; font-size: 12.5px; text-decoration: underline; cursor: pointer; }
@media (max-width: 600px) { .tm-head, .tm-body, .tm-form, .tm-out { padding-left: 18px; padding-right: 18px; } .tm-body { max-height: 38vh; } }

/* Logo animado no painel do login */
.lg-split__logo { animation: lg-logo-in .9s cubic-bezier(.2,.8,.2,1) 1.2s both, lg-logo-float 5s ease-in-out 2.2s infinite; filter: drop-shadow(0 8px 24px rgba(120,150,255,.35)); }
.lg-split__bar { transform-origin: left center; animation: lg-bar-in .8s ease 1.6s both; }
@keyframes lg-logo-in { from { opacity: 0; transform: scale(.88) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lg-logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes lg-bar-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .lg-split__logo, .lg-split__bar { animation: none; } }

/* Verificação anti-robô do login (quebra-cabeça de arrastar) — discreta */
.cp { margin-top: 2px; }
.cp__box { display: grid; gap: 8px; }
.cp__stage { position: relative; width: 100%; max-width: 260px; aspect-ratio: 2 / 1; border-radius: 12px; overflow: hidden; border: 1px solid rgba(120,130,190,.22); background: #f1f3ff; user-select: none; -webkit-user-select: none; }
.cp__inner { position: absolute; inset: 0; }
.cp__bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: .9; }
.cp__piece { position: absolute; height: auto; display: block; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(30,41,90,.28)); }
.cp__stage.is-bad { border-color: rgba(239,68,68,.7); animation: cp-shake .35s; }
.cp__track { position: relative; height: 32px; width: 100%; max-width: 260px; border-radius: 999px; background: rgba(60,60,90,.07); }
.cp__label { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 36px; font: 500 12.5px/1 var(--font-sans, inherit); color: rgba(60,60,90,.55); pointer-events: none; }
.cp__handle { position: absolute; top: 2px; width: 40px; height: 28px; border: 0; border-radius: 999px; background: #fff; color: #6b7280; font-size: 11px; box-shadow: 0 1px 3px rgba(20,25,60,.25), 0 0 0 .5px rgba(20,25,60,.08); cursor: grab; touch-action: none; display: grid; place-items: center; transition: box-shadow .15s; }
.cp__handle:active { cursor: grabbing; box-shadow: 0 2px 8px rgba(20,25,60,.3), 0 0 0 .5px rgba(20,25,60,.1); }
.cp__handle:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.cp__hint { margin: 0; min-height: 0; font-size: 12px; color: rgba(60,60,90,.6); }
.cp__hint:empty { display: none; }
.cp__done { display: inline-flex; align-items: center; gap: 8px; font: 500 13px/1 var(--font-sans, inherit); color: #15803d; }
.cp__done i { font-size: 15px; }
.lg-split__submit:disabled { opacity: .5; cursor: not-allowed; }
@keyframes cp-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .cp__stage.is-bad { animation: none; } }

/* Botão de mostrar/ocultar senha */
.lg-split__form .relative { position: relative; }
.lg-split__input--eye { padding-right: 52px; }
.lg-split__eye { position: absolute; top: 0; bottom: 0; right: 6px; width: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #64748b; font-size: 16px; cursor: pointer; border-radius: 10px; }
.lg-split__eye:hover { color: #6366f1; }
.lg-split__eye:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
.lg-split__eye i { width: 20px; text-align: center; }
/* Aceite no celular: alvos de toque confortáveis */
.tm-link { min-height: 44px; padding: 0 12px; }
.tm-check { min-height: 44px; }
.tm-doc > summary { min-height: 44px; display: flex; align-items: center; }
