/**
 * tandor-app.css — Estilos da aplicação Tandor
 * Carregado APÓS tandor-theme2.css (tokens --tandor-* / --gym-* devem estar definidos)
 * NÃO redefinir cores de btn-primary aqui — fonte única: tandor-theme2.css
 */

/* ═════════════════════════════════════════════════════════════════════ */
/* RESET MÍNIMO                                                          */
/* ═════════════════════════════════════════════════════════════════════ */

html, body { margin: 0; padding: 0; }

body {
  background: var(--gym-bg);
  color: var(--gym-text);
  font-family: var(--gym-font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ═════════════════════════════════════════════════════════════════════ */
/* TIPOGRAFIA                                                            */
/* ═════════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--gym-font);
  font-weight: 700;
  color: var(--gym-text);
  margin-bottom: 10px;
  line-height: 1.25;
}

h1 { font-size: 30px; letter-spacing: -.5px; }
h2 { font-size: 24px; letter-spacing: -.3px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
h5 { font-size: 15px; }
h6 { font-size: 13px; font-weight: 600; }

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gym-text);
  margin-bottom: 4px;
  letter-spacing: -.3px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--gym-text-2);
  margin-bottom: 20px;
}

/* ═════════════════════════════════════════════════════════════════════ */
/* NAVBAR                                                                */
/* ═════════════════════════════════════════════════════════════════════ */

.navbar {
  background: var(--gym-primary);
  border-bottom: none;
  padding: 0;
  box-shadow: 0 2px 12px rgba(21, 38, 38, 0.35); /* petróleo — corrigido do azul legado */
  position: relative;
  z-index: 1030;
}

.navbar-brand {
  font-family: var(--gym-font);
  font-size: 17px;
  font-weight: 700;
  color: #fff !important;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  transition: var(--gym-transition);
}

.navbar-brand:hover { color: rgba(255,255,255,.85) !important; }
.navbar-brand i { font-size: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; }
.brand-sub  { font-size: 10px; color: rgba(255,255,255,.6); font-weight: 400; }

.navbar .nav-link {
  font-family: var(--gym-font);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.85) !important;
  padding: 15px 13px !important;
  transition: var(--gym-transition);
  border-bottom: 3px solid transparent;
  margin: 0 1px;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #fff !important;
  border-bottom-color: var(--tandor-gold-lt, #fdd07d);
  background: rgba(255,255,255,.08);
}

.navbar .navbar-collapse { align-items: stretch; }

.navbar .dropdown-menu {
  background: var(--gym-surface);
  border: 1px solid var(--gym-border-mid);
  border-radius: var(--gym-radius);
  box-shadow: var(--gym-shadow-lg);
  padding: 6px;
  margin-top: 4px;
  z-index: 1040;
}

.navbar .dropdown-item {
  font-family: var(--gym-font);
  font-size: 13.5px;
  color: var(--gym-text);
  padding: 8px 14px;
  border-radius: var(--gym-radius-sm);
  transition: var(--gym-transition);
}

.navbar .dropdown-item:hover {
  background: var(--gym-blue-tint);
  color: var(--gym-primary);
}

.navbar .dropdown-item i { color: var(--gym-primary-lt); margin-right: 6px; }
.navbar .dropdown-item:hover i { color: var(--gym-primary); }
.navbar .dropdown-divider { border-color: var(--gym-border); margin: 4px 0; }

.empresa-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: rgba(255,255,255,.9);
  font-family: var(--gym-font);
  font-weight: 500;
}

/* ═════════════════════════════════════════════════════════════════════ */
/* NAVBAR TOGGLER + BOTÃO FULLSCREEN                                     */
/* ═════════════════════════════════════════════════════════════════════ */

.navbar-toggler {
  border: 1px solid rgba(255,255,255,.4);
  padding: 6px 10px;
  border-radius: var(--gym-radius-sm);
  transition: var(--gym-transition);
}

.navbar-toggler:focus { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.btn-fs {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--gym-radius-sm);
  color: rgba(255,255,255,.75);
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: var(--gym-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-fs:hover,
.btn-fs:focus {
  border-color: rgba(255,255,255,.8);
  color: #fff;
  background: rgba(255,255,255,.1);
  outline: none;
  box-shadow: none;
}

/* ═════════════════════════════════════════════════════════════════════ */
/* CARDS                                                                 */
/* ═════════════════════════════════════════════════════════════════════ */

.card {
  border: 1px solid var(--gym-border);
  border-radius: var(--gym-radius);
  background: var(--gym-surface);
  box-shadow: var(--gym-shadow);
  transition: var(--gym-transition);
  padding: var(--gym-spacing);
}

/* Hover sutil (borda) para todos os cards — theme2.css acrescenta cor dourada */
.card:hover {
  border-color: var(--gym-blue-50);
}

/* Hover elevado: apenas cards interativos (módulos e links) */
.module-card:hover,
a > .card:hover,
a.card:hover {
  box-shadow: var(--gym-shadow-md);
  transform: translateY(-2px);
}

.module-card {
  text-align: center;
  padding: 36px 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
}

.module-card .module-icon {
  font-size: 52px;
  color: var(--gym-primary);
  margin-bottom: 16px;
  transition: var(--gym-transition);
}

.module-card:hover .module-icon {
  color: var(--gym-primary-lt);
  transform: scale(1.08);
}

.module-card h5 { font-size: 17px; margin-bottom: 8px; }

.module-card.disabled { opacity: .5; cursor: not-allowed; }
.module-card.disabled .module-icon { color: var(--gym-text-3); }

/* Cards de módulo com switch (Admin → Empresa → Segmento e Módulos) */
.module-toggle-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  margin: 0;
  transition: var(--gym-transition);
}
.module-toggle-card:hover {
  border-color: var(--tandor-gold, #e8953c);
  box-shadow: var(--gym-shadow-md);
  transform: translateY(-2px);
}
.module-toggle-card .mtc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.module-toggle-card .mtc-icon {
  font-size: 26px;
  line-height: 1;
  color: var(--tandor-primary, #2a4545);
  transition: var(--gym-transition);
}
.module-toggle-card .mtc-title { font-weight: 600; font-size: 15px; color: var(--gym-text); }
.module-toggle-card .mtc-desc { font-size: 12.5px; color: var(--gym-text-2); line-height: 1.35; }
/* Estado ativo: realce dourado do tema */
.module-toggle-card.is-active {
  border-color: var(--tandor-gold, #e8953c);
  background: var(--tandor-gold-tint, #fff8eb);
  box-shadow: 0 0 0 1px var(--tandor-gold, #e8953c) inset;
}
.module-toggle-card.is-active .mtc-icon { color: var(--tandor-gold-deep, #b86820); }
.cr-opcoes { background: var(--gym-surface); }

/* card-header: sentence case — elimina text-uppercase legado nos templates */
.card-header { text-transform: none; }

/* ═════════════════════════════════════════════════════════════════════ */
/* BUTTONS                                                               */
/* Cores de btn-primary: exclusivamente em tandor-theme2.css            */
/* ═════════════════════════════════════════════════════════════════════ */

.btn {
  font-family: var(--gym-font);
  font-weight: 600;
  border-radius: var(--gym-radius-sm);
  padding: 9px 20px;
  font-size: 13.5px;
  transition: var(--gym-transition);
  letter-spacing: .1px;
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--gym-primary);
  color: var(--gym-primary);
}

/* hover de btn-outline-primary: theme2.css sobrescreve com gold-tint (correto) */

.btn-secondary {
  background: var(--gym-text-2);
  border-color: var(--gym-text-2);
  color: white;
}

.btn-secondary:hover {
  background: var(--gym-text);
  border-color: var(--gym-text);
  color: white;
}

.btn-warning {
  background: transparent;
  border-color: #f59e0b;
  color: #92400e;
}

.btn-warning:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.btn-sm { padding: 5px 14px; font-size: 12.5px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* ═════════════════════════════════════════════════════════════════════ */
/* FORM CONTROLS                                                         */
/* ═════════════════════════════════════════════════════════════════════ */

.form-label {
  font-family: var(--gym-font);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gym-text);
  margin-bottom: 5px;
  letter-spacing: .2px;
}

.form-control, .form-select {
  border: 1.5px solid var(--gym-border-mid);
  border-radius: var(--gym-radius-sm);
  padding: 9px 12px;
  font-family: var(--gym-font);
  font-size: 14px;
  transition: var(--gym-transition);
  background: var(--gym-surface);
  color: var(--gym-text);
}

/* focus ring: tema2.css define dourado — não sobrescrever aqui com azul */
.form-control:focus, .form-select:focus {
  border-color: var(--gym-primary-lt);
  outline: none;
  /* box-shadow: definido exclusivamente em tandor-theme2.css (dourado) */
}

.form-control::placeholder { color: var(--gym-text-3); }

.input-group-text {
  border: 1.5px solid var(--gym-border-mid);
  background: var(--gym-blue-tint);
  color: var(--gym-primary);
  border-right: none;
  font-family: var(--gym-font);
  font-weight: 500;
}

.input-group .form-control { border-left: none; }

/* ═════════════════════════════════════════════════════════════════════ */
/* TABLES                                                                */
/* ═════════════════════════════════════════════════════════════════════ */

.table {
  font-family: var(--gym-font);
  border-collapse: collapse;
}

.table thead { background: var(--gym-primary); }

.table thead th {
  font-family: var(--gym-font);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  background: var(--gym-primary) !important;
  color: rgba(255,255,255,.9) !important;
  border: none;
  padding: 13px 14px;
  text-align: left;
}

.table tbody tr {
  border-bottom: 1px solid var(--gym-border);
  transition: var(--gym-transition);
}

.table tbody tr:hover { background: var(--gym-blue-tint); }

.table td {
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--gym-text);
  vertical-align: middle;
  border-bottom: 1px solid var(--gym-border);
}

.table-light { background: var(--gym-bg); }

/* ═════════════════════════════════════════════════════════════════════ */
/* BADGES                                                                */
/* ═════════════════════════════════════════════════════════════════════ */

.badge {
  font-family: var(--gym-font);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 12px;
}

.badge-ativo    { background: #dcfce7; color: #166534; }
.badge-inativo  { background: #fee2e2; color: #991b1b; }
.badge-trancado { background: #fef9c3; color: #854d0e; }
.badge-suspenso { background: #f1f5f9; color: #475569; }

/* ═════════════════════════════════════════════════════════════════════ */
/* ALERTS                                                                */
/* ═════════════════════════════════════════════════════════════════════ */

.alert {
  border-width: 1px;
  border-radius: var(--gym-radius);
  font-family: var(--gym-font);
  font-size: 14px;
  padding: 12px 16px;
}

.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-danger  { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

/* ═════════════════════════════════════════════════════════════════════ */
/* LAYOUT                                                                */
/* ═════════════════════════════════════════════════════════════════════ */

.content-wrapper {
  padding: 28px 0;
  min-height: calc(100vh - 180px);
}

footer {
  background: var(--gym-primary-dark);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 16px 0;
  font-size: 11.5px;
  font-family: var(--gym-font);
  margin-top: 48px;
}

/* ═════════════════════════════════════════════════════════════════════ */
/* UTILITIES                                                             */
/* ═════════════════════════════════════════════════════════════════════ */

.text-gold       { color: var(--gym-accent); }
.text-navy       { color: var(--gym-primary); }
.bg-dark-premium { background: var(--gym-primary-dark); }
.border-gold     { border-color: var(--gym-blue-50) !important; }

.container-fluid {
  padding-left: 24px;
  padding-right: 24px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ═════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — Tablet  ≤ 992px                                         */
/* ═════════════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .container-fluid { padding-left: 24px; padding-right: 24px; }
  .content-wrapper { padding: 22px 0; }
  .module-card { padding: 26px 18px; min-height: 210px; }
  footer { margin-top: 36px; }
}

/* ═════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — Phone  ≤ 768px                                          */
/* ═════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  body { font-size: 14.5px; }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }
  h4 { font-size: 15px; }
  h5, h6 { font-size: 13.5px; }

  .page-title    { font-size: 18px; margin-bottom: 2px; }
  .page-subtitle { font-size: 12.5px; margin-bottom: 10px; }

  .container-fluid { padding-left: 12px; padding-right: 12px; }
  .content-wrapper { padding: 14px 0; }

  .card { padding: 12px; }
  .card:hover { transform: none; box-shadow: var(--gym-shadow); }

  .module-card { padding: 18px 12px; min-height: 155px; }
  .module-card .module-icon { font-size: 38px; margin-bottom: 10px; }
  .module-card h5 { font-size: 14px; margin-bottom: 5px; }

  .navbar { padding: 0; }
  .navbar-brand { padding: 12px 0; gap: 8px; }
  .navbar-brand i { font-size: 20px; }
  .brand-name { font-size: 15px; }
  .brand-sub  { display: none; }

  .empresa-badge {
    font-size: 10px;
    padding: 4px 8px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .table thead th { padding: 9px 8px; font-size: 11px; }
  .table td        { padding: 8px 8px; font-size: 13px; }

  .btn    { padding: 9px 14px; font-size: 13px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }

  .btn, .nav-link, .form-control, .form-select { min-height: 40px; }

  .form-control, .form-select { padding: 9px 11px; font-size: 14.5px; }
  .form-label { font-size: 11px; margin-bottom: 4px; }

  .row.g-2 { --bs-gutter-y: 0.3rem; }
  .row.g-3 { --bs-gutter-y: 0.45rem; }

  footer { padding: 10px 0; margin-top: 16px; font-size: 10px; }
}

/* ═════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — Small phone  ≤ 480px                                    */
/* ═════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .container-fluid { padding-left: 8px; padding-right: 8px; }
  .card { padding: 10px; }
  .page-title    { font-size: 16px; }
  .page-subtitle { font-size: 11px; }
  .table thead th { padding: 7px 6px; font-size: 10px; }
  .table td        { padding: 7px 6px; font-size: 12px; }
  .btn    { padding: 8px 12px; font-size: 12px; }
  .module-card { padding: 14px 10px; min-height: 135px; }
  .module-card .module-icon { font-size: 32px; }
  .module-card h5 { font-size: 13px; }
}

/* ═════════════════════════════════════════════════════════════════════ */
/* TOUCH DEVICES — desabilitar hover-transforms em touchscreen           */
/* ═════════════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
  .card:hover     { transform: none; box-shadow: var(--gym-shadow); border-color: var(--gym-border); }
  .module-card:hover,
  a > .card:hover,
  a.card:hover    { transform: none; box-shadow: var(--gym-shadow); }
  .btn:hover      { transform: none; }
  .btn-primary:hover { box-shadow: none; transform: none; }
  .btn, .nav-link { -webkit-tap-highlight-color: transparent; }
}

/* ═════════════════════════════════════════════════════════════════════ */
/* SIDEBAR LAYOUT                                                        */
/* ═════════════════════════════════════════════════════════════════════ */

:root {
  --sidebar-w:           220px;
  --sidebar-collapsed-w: 60px;
  --topbar-h:            56px;
}

body.sidebar-collapsed {
  --sidebar-w: var(--sidebar-collapsed-w);
}

/* ─── Topbar ─────────────────────────────────────────────────────────── */

.tandor-topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--tandor-surface);
  border-bottom: 1px solid var(--tandor-border);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  transition: left 200ms cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 1px 4px rgba(42,69,69,.08);
}

.tandor-toggle-btn {
  background: transparent;
  border: none;
  color: var(--tandor-text-2);
  font-size: 18px;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: var(--tandor-radius-sm);
  line-height: 1;
  flex-shrink: 0;
  transition: var(--tandor-transition);
}
.tandor-toggle-btn:hover {
  background: var(--tandor-gold-tint);
  color: var(--tandor-primary);
}

.tandor-topbar-brand {
  display: flex; align-items: center; gap: 13px;
  text-decoration: none; color: var(--tandor-primary-dark);
  font-family: var(--tandor-font); font-weight: 700;
  font-size: 20px; letter-spacing: -.3px;
  flex: 1; min-width: 0;
}
.tandor-topbar-brand:hover { color: var(--tandor-primary); text-decoration: none; }

.tandor-topbar-brand img {
  width: 40px; height: 40px;
  border-radius: 10px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(42,69,69,.2);
}

.tandor-topbar-empresa {
  font-size: 12px; font-weight: 500;
  color: var(--tandor-text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-left: 2px;
}

/* ─── User menu na topbar ────────────────────────────────────────────── */

.tandor-user-menu .dropdown-toggle {
  background: transparent;
  border: 1px solid var(--tandor-border-mid);
  border-radius: var(--tandor-radius-sm);
  color: var(--tandor-text);
  font-family: var(--tandor-font); font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: var(--tandor-transition);
  white-space: nowrap;
}
.tandor-user-menu .dropdown-toggle::after { margin-left: 4px; }
.tandor-user-menu .dropdown-toggle:hover {
  background: var(--tandor-gold-tint);
  border-color: var(--tandor-gold);
  color: var(--tandor-primary);
}

/* Suporte remoto (plano 2026-11-11 suporte-remoto, fase 3): botão "Pedir suporte",
   mesmo desenho do botão do usuário. Escondido até o JS confirmar computador + getDisplayMedia. */
.tandor-suporte-btn {
  background: transparent;
  border: 1px solid var(--tandor-border-mid);
  border-radius: var(--tandor-radius-sm);
  color: var(--tandor-text);
  font-family: var(--tandor-font); font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: var(--tandor-transition);
  white-space: nowrap;
}
.tandor-suporte-btn:hover {
  background: var(--tandor-gold-tint);
  border-color: var(--tandor-gold);
  color: var(--tandor-primary);
}
.tandor-suporte-btn[hidden] { display: none; }

.tandor-user-menu .dropdown-menu {
  background: var(--tandor-surface);
  border: 1px solid var(--tandor-border-mid);
  border-radius: var(--tandor-radius);
  box-shadow: var(--tandor-shadow-lg);
  padding: 6px; min-width: 200px;
  z-index: 1050;
}
.tandor-user-menu .dropdown-item {
  font-family: var(--tandor-font); font-size: 13.5px;
  color: var(--tandor-text); padding: 8px 14px;
  border-radius: var(--tandor-radius-sm);
  transition: var(--tandor-transition);
}
.tandor-user-menu .dropdown-item:hover {
  background: var(--tandor-gold-tint); color: var(--tandor-primary);
}
.tandor-user-menu .dropdown-item i { margin-right: 8px; color: var(--tandor-primary-lt); }
.tandor-user-menu .dropdown-item:hover i { color: var(--tandor-primary); }
.tandor-user-menu .dropdown-divider { border-color: var(--tandor-border); margin: 4px 0; }

/* ─── Sidebar ────────────────────────────────────────────────────────── */

.tandor-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--tandor-gradient-brand);
  z-index: 1040;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width 200ms cubic-bezier(0.4,0,0.2,1);
  box-shadow: 2px 0 12px rgba(21,38,38,.18);
}

.tandor-sidebar-header {
  padding: 0 16px;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tandor-sidebar-logo {
  width: 42px; height: 42px;
  border-radius: 11px; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(253,208,125,.55), 0 4px 12px rgba(0,0,0,.3);
}

.tandor-sidebar-title {
  font-family: var(--tandor-font); font-size: 20px; font-weight: 700;
  color: var(--tandor-gold-lt); letter-spacing: -.3px;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
  transition: opacity 200ms ease;
}
body.sidebar-collapsed .tandor-sidebar-title { opacity: 0; }

/* Área de scroll */
.tandor-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.tandor-nav::-webkit-scrollbar { width: 4px; }
.tandor-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

/* Label de seção */
.tandor-nav-section {
  font-family: var(--tandor-font); font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.6); letter-spacing: 1px;
  text-transform: uppercase; padding: 16px 20px 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 200ms ease, max-height 200ms ease, padding 200ms ease;
  max-height: 40px;
}
body.sidebar-collapsed .tandor-nav-section {
  opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0;
}

/* Grupos retráteis do menu */
.tandor-nav-group { margin-bottom: 2px; }

.tandor-nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 16px); margin: 4px 8px 0;
  padding: 16px 12px 4px;
  background: transparent; border: none;
  cursor: pointer; text-align: left;
  border-radius: var(--tandor-radius-sm);
  transition: background 150ms ease;
}
.tandor-nav-group-toggle:hover {
  background: rgba(255,255,255,.08);
}
.tandor-nav-group-toggle .tandor-nav-section-label {
  font-family: var(--tandor-font); font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.6); letter-spacing: 1px;
  text-transform: uppercase;
}
.tandor-nav-chevron {
  font-size: 11px; color: rgba(255,255,255,.45);
  flex-shrink: 0; margin-left: 6px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.tandor-nav-group-toggle[aria-expanded="true"] .tandor-nav-chevron {
  transform: rotate(180deg);
}

.tandor-nav-group-body {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 250ms ease, opacity 200ms ease;
  opacity: 1;
}
.tandor-nav-group.is-collapsed .tandor-nav-group-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .tandor-nav-group.is-collapsed .tandor-nav-group-body {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
}
body.sidebar-collapsed .tandor-nav-chevron {
  opacity: 0; max-width: 0; overflow: hidden;
}
body.sidebar-collapsed .tandor-nav-group-toggle {
  opacity: 0; max-height: 0; padding: 0; margin: 0;
  pointer-events: none; overflow: hidden;
}

/* Separador */
.tandor-nav-divider {
  height: 1px; background: rgba(255,255,255,.15);
  margin: 6px 16px;
  transition: opacity 200ms ease;
}

/* Item de navegação
   Usa seletor composto para superar especificidade de
   a:not(.btn):not(.nav-link):not(.dropdown-item) em tandor-theme2.css */
.tandor-sidebar .tandor-nav-item,
.tandor-sidebar a.tandor-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  margin: 1px 8px;
  border-radius: var(--tandor-radius-sm);
  color: #e8e4de !important; /* branco quente — alto contraste no fundo petróleo */
  text-decoration: none;
  font-family: var(--tandor-font); font-size: 13.5px; font-weight: 500;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap; overflow: hidden;
}
.tandor-sidebar .tandor-nav-item:hover,
.tandor-sidebar a.tandor-nav-item:hover {
  background: rgba(255,255,255,.12);
  color: #fff !important;
  text-decoration: none;
}
.tandor-sidebar .tandor-nav-item.active,
.tandor-sidebar a.tandor-nav-item.active {
  background: rgba(253,208,125,.2);
  color: var(--tandor-gold-lt) !important; /* #fdd07d */
  font-weight: 600;
}
.tandor-nav-item i {
  font-size: 17px; flex-shrink: 0; width: 20px; text-align: center;
  transition: color 150ms ease;
}
.tandor-nav-item.active i { color: var(--tandor-gold-lt); }

/* Label do item */
.tandor-nav-label {
  overflow: hidden; white-space: nowrap;
  transition: opacity 200ms ease, max-width 200ms ease;
  max-width: 160px;
}
body.sidebar-collapsed .tandor-nav-label {
  opacity: 0; max-width: 0;
}

/* ─── Área de conteúdo principal ─────────────────────────────────────── */

.tandor-main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left 200ms cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}

/* ─── Mobile (≤992px) — sidebar off-canvas ───────────────────────────── */

@media (max-width: 992px) {
  .tandor-sidebar {
    left: -220px;
    width: 220px !important; /* sempre expandida no mobile */
    transition: left 200ms cubic-bezier(0.4,0,0.2,1);
  }
  .tandor-sidebar.mobile-open { left: 0; }

  .tandor-topbar { left: 0 !important; }
  .tandor-main   { margin-left: 0 !important; }

  .tandor-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(21,38,38,.45); z-index: 1039;
  }
  .tandor-overlay.active { display: block; }

  .tandor-topbar-empresa { display: none; }
}

/* ─── Print ──────────────────────────────────────────────────────────── */

@media print {
  .tandor-sidebar, .tandor-topbar { display: none !important; }
  .tandor-main { margin-left: 0 !important; padding-top: 0 !important; }
  #tandorVirtualRoot, .tv-root { display: none !important; }
}

/* ─── NFS-e grid + trilho (Fase A) ───────────────────────────────────── */

.nfse-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.nfse-main { flex: 1; min-width: 0; }
.nfse-rail {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 4.5rem;
  background: var(--tandor-surface, #fff);
  border: 1px solid var(--tandor-border, #dee2e6);
  border-radius: var(--tandor-radius, .5rem);
  padding: .75rem;
}
.nfse-rail-block { margin-bottom: .85rem; }
.nfse-rail-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tandor-text-2, #6c757d);
  margin-bottom: .35rem;
}
.nfse-row { cursor: pointer; }
/* Nota selecionada/aberta não pode se perder no meio das demais */
.nfse-row.table-active > td {
  --bs-table-bg-state: var(--bs-primary-bg-subtle);
  font-weight: 600;
}
.nfse-row.table-active > td:first-child { box-shadow: inset 4px 0 0 var(--bs-primary); }
@media (max-width: 992px) {
  .nfse-wrap { flex-direction: column; }
  .nfse-rail { width: 100%; position: static; }
}
.nfse-modal-frame {
  width: 100%;
  min-height: 65vh;
  border: 0;
  display: block;
}
.nfse-modal-nota .modal-body {
  min-height: 70vh;
}
.nfse-detalhe-frame {
  width: 100%;
  min-height: 75vh;
  border: 0;
  display: block;
}
.nfse-modal-detalhe .modal-body {
  min-height: 75vh;
}


/* ─── Grid com cabeçalho travado (visão anual, grade de frequência) ───── */
/* Substitui .table-responsive: cria um scrollport nos dois eixos, para que
   o thead grude na vertical e a coluna do nome na horizontal. A altura é
   ajustada por JS (ver visao_anual.html); o valor abaixo é só o fallback. */

.td-grid-scroll {
  max-height: calc(100vh - var(--td-grid-reserva, 300px));
  max-height: calc(100dvh - var(--td-grid-reserva, 300px));
  overflow: auto;
}

.td-grid-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--td-grid-head-bg, #f8f9fa);
  /* inset em vez de border: com border-collapse: separate a borda do thead
     ficaria para tras na rolagem */
  box-shadow: inset 0 -2px 0 var(--td-grid-head-border, #e8ecf0);
}

/* Célula de interseção: trava nos dois eixos e fica acima do resto */
.td-grid-scroll thead th.col-aluno {
  left: 0;
  z-index: 4;
}

/* Telas pequenas: a fileira de botões quebra e a reserva estoura —
   volta ao comportamento do .table-responsive (só rolagem horizontal). */
@media (max-width: 768px) {
  .td-grid-scroll { max-height: none; }
  .td-grid-scroll thead th { position: static; }
}

@media print {
  .td-grid-scroll {
    max-height: none !important;
    overflow: visible !important;
  }
  /* static devolve ao navegador a repetição do cabeçalho em cada página */
  .td-grid-scroll thead th { position: static !important; }
}

/* ─── Suporte remoto (plano 2026-11-11 suporte-remoto, fase 4) ─────── */
.suporte-fila-linha { cursor: pointer; }
.suporte-video-area {
  position: relative;
  background: var(--tandor-surface);
  border: 1px solid var(--tandor-border);
  border-radius: var(--tandor-radius-sm);
  min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.suporte-video-estado { color: var(--tandor-text-2); padding: 12px; text-align: center; }
.suporte-video-estado:empty { display: none; }
.suporte-video {
  display: block; width: 100%; max-width: 100%;
  max-height: calc(100vh - var(--topbar-h) - 150px);
  background: #000; border-radius: var(--tandor-radius-sm);
}
.suporte-video[hidden] { display: none; }

/* Janelinha do compartilhamento (/suporte-remoto/janela): página avulsa, sem menu. */
.suporte-janela .suporte-janela-main { margin: 0; padding: 16px; min-height: 100vh; }
.suporte-video:fullscreen { max-height: none; border-radius: 0; }
/* Compartilhando: janelinha pequena no canto, só a mensagem e o Parar. */
.suporte-janela--pequena .suporte-janela-main { padding: 6px 8px; min-height: 0; }
.suporte-janela--pequena .page-title { display: none; }
.suporte-janela--pequena .td-msg { margin: 0 0 6px; padding: .35rem .5rem; font-size: .8rem; }

/* ─── Quadro de conversa do suporte remoto (ajuste de 2026-11-11) ──── */
.suporte-chat {
  position: fixed; right: 16px; bottom: 16px; z-index: 1040;
  width: 340px; height: 300px; min-width: 240px; min-height: 160px;
  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  display: flex; flex-direction: column;
  background: var(--tandor-surface);
  border: 1px solid var(--tandor-border-mid);
  border-radius: var(--tandor-radius-sm);
  box-shadow: 0 6px 24px rgba(42,69,69,.18);
  resize: both; overflow: hidden;
}
.suporte-chat[hidden] { display: none; }
.suporte-chat-cab {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; cursor: move; user-select: none; touch-action: none;
  background: var(--tandor-primary); color: #fff; font-weight: 600; font-size: 13px;
}
.suporte-chat-titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suporte-chat-mini { border: 0; background: transparent; color: inherit; padding: 0 4px; line-height: 1; }
.suporte-chat-msgs { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.suporte-chat-msg { max-width: 85%; padding: 5px 8px; border-radius: var(--tandor-radius-sm); font-size: 13px; }
.suporte-chat-msg--minha { align-self: flex-end; background: var(--tandor-gold-tint); }
.suporte-chat-msg--outra { align-self: flex-start; background: var(--tandor-ok-bg); }
.suporte-chat-meta { font-size: 11px; color: var(--tandor-text-2); }
.suporte-chat-texto { white-space: pre-wrap; word-break: break-word; color: var(--tandor-text); }
.suporte-chat-rodape { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--tandor-border); }
.suporte-chat-rodape[hidden] { display: none; }
.suporte-chat-campo { resize: none; }
.suporte-chat--mini { height: auto !important; min-height: 0; resize: none; }
.suporte-chat--mini .suporte-chat-msgs,
.suporte-chat--mini .suporte-chat-rodape { display: none; }

/* Imagem colada na conversa e o relatório do suporte encerrado (ajuste de 2026-11-11). */
.suporte-chat-img { display: block; max-width: 180px; max-height: 140px; margin-top: 4px;
  border-radius: var(--tandor-radius-sm); border: 1px solid var(--tandor-border); cursor: zoom-in; }
.suporte-relatorio-conversa { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.suporte-relatorio-dados dd { margin-bottom: 2px; }

/* Recados de associados (RA4, plano 2026-11-15) — envelope no topo da barra
   lateral; pulsa enquanto há não lidos. Sem animação para quem pede menos movimento. */
.tandor-sidebar .tandor-nav-recados { position: relative; }
.tandor-recados-badge { margin-left: auto; font-size: 11px; }
body.sidebar-collapsed .tandor-recados-badge {
  position: absolute; top: 2px; right: 6px; margin-left: 0; font-size: 9px; padding: 2px 5px;
}
.tandor-recados-pulso > i { color: #dc3545; animation: tandor-recados-pulso 1.4s ease-in-out infinite; }
@keyframes tandor-recados-pulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .tandor-recados-pulso > i { animation: none; }
}
