/* ==========================================================================
   HUB de Prestadores - identidade visual base
   ========================================================================== */
:root {
  --hub-ink: #1c2f45;
  --hub-ink-soft: #29486c;
  --hub-ink-line: rgba(255, 255, 255, 0.08);
  --hub-accent: #4c76a8;
  --hub-accent-dark: #365e8d;
  --hub-bg: #f3f6fa;
  --hub-surface: #ffffff;
  --hub-border: #dbe3ee;
  --hub-text: #27364a;
  --hub-muted: #6d7b8d;
  --hub-success: #10b981;
  --hub-warning: #f59e0b;
  --hub-danger: #ef4444;
  --hub-sidebar-width: 170px;
  --hub-sidebar-collapsed: 60px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

a {
  color: var(--hub-accent);
}

a:hover {
  color: var(--hub-accent-dark);
}

/* ------------------------------- Login ---------------------------------- */
.login-page {
  min-height: 100vh;
  background: var(--hub-ink);
}

.login-layout {
  display: flex;
  min-height: 100vh;
}

.login-brand-panel {
  flex: 1 1 56%;
  background: linear-gradient(150deg, #1c2f45 0%, #29486c 48%, #4c76a8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 48px;
}

.brand-inner {
  max-width: 520px;
}

.brand-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 28px;
}

.brand-benefits {
  display: grid;
  gap: 18px;
}

.brand-benefit {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.brand-benefit-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.brand-benefit-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  line-height: 1.45;
}

.brand-benefit-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.login-form-panel {
  flex: 1 1 44%;
  background: var(--hub-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.login-box {
  width: 100%;
  max-width: 420px;
}

.login-box-logo {
  width: 230px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 20px;
}

.login-box h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.login-subtitle {
  color: var(--hub-muted);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.login-box .form-group,
.signup-card .form-group {
  margin-bottom: 18px;
}

.login-box label,
.signup-card label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.login-box .form-control,
.signup-card .form-control {
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--hub-border);
  font-size: 0.95rem;
}

.login-box .form-control:focus,
.signup-card .form-control:focus {
  border-color: var(--hub-accent);
  box-shadow: 0 0 0 3px rgba(76, 118, 168, 0.16);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 0.88rem;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hub-muted);
  margin: 0;
  cursor: pointer;
}

.btn-hub {
  background: var(--hub-accent);
  border-color: var(--hub-accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.btn-hub:hover,
.btn-hub:focus {
  background: var(--hub-accent-dark);
  border-color: var(--hub-accent-dark);
  color: #fff;
}

.login-submit {
  height: 46px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.login-support {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--hub-border);
  text-align: center;
}

/* ------------------------ Auto-cadastro do prestador ---------------------- */
.signup-page {
  background: var(--hub-bg);
}

.signup-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.signup-hero {
  text-align: center;
  margin-bottom: 24px;
}

.signup-hero-logo {
  width: 240px;
  max-width: 74%;
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

.signup-hero-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--hub-ink);
  margin: 0 0 20px;
}

.signup-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  text-align: left;
}

.signup-benefit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.signup-benefit .brand-benefit-icon {
  background: rgba(76, 118, 168, 0.12);
  color: var(--hub-accent);
}

.signup-benefit .brand-benefit-text {
  color: var(--hub-muted);
  font-size: 0.88rem;
}

.signup-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  padding: 24px;
}

.signup-card-subtitle {
  text-align: center;
  color: var(--hub-muted);
  font-size: 1rem;
  margin-bottom: 20px;
}

.signup-section {
  background: #f8fafc;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  padding: 16px 16px 4px;
  margin-bottom: 14px;
}

.signup-section .form-group {
  margin-bottom: 14px;
}

.signup-block-title {
  color: var(--hub-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.signup-hint {
  color: var(--hub-muted);
  font-size: 0.78rem;
  margin: 0 0 14px;
}

.login-signup {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--hub-border);
  text-align: center;
}

.login-signup-hint {
  display: block;
  color: var(--hub-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.login-signup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--hub-accent);
  color: var(--hub-accent);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-signup-btn:hover,
.login-signup-btn:focus {
  background: var(--hub-accent);
  border-color: var(--hub-accent);
  color: #fff;
}

.brand-cta {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-cta-hint {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.brand-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: 8px;
  background: #fff;
  border-color: #fff;
  color: var(--hub-ink);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-cta-btn:hover,
.brand-cta-btn:focus {
  background: #eef3f9;
  border-color: #eef3f9;
  color: var(--hub-ink);
}

.empresa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 18px;
}

.empresa-grid .form-check {
  margin: 0;
  padding-left: 1.6rem;
}

.empresa-grid .form-check-label {
  cursor: pointer;
}

.login-support-title {
  color: var(--hub-muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

.login-support-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    flex: 1 1 100%;
  }
}

/* --------------------- Layout do portal (base) -------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--hub-sidebar-width);
  background: linear-gradient(180deg, var(--hub-ink) 0%, var(--hub-ink-soft) 100%);
  color: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.18s ease;
  z-index: 1030;
}

.sidebar.collapsed {
  width: var(--hub-sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 8px;
}

.sidebar-header button {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: #fff;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  cursor: pointer;
}

.sidebar.collapsed .sidebar-heading,
.sidebar.collapsed .link-text {
  display: none;
}

.sidebar-heading {
  padding: 10px 16px 8px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 1.0rem;
  border-left: 3px solid transparent;
}

.sidebar-nav a i {
  flex: 0 0 18px;
  text-align: center;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-nav a.is-active {
  background: rgba(76, 118, 168, 0.2);
  border-left-color: var(--hub-success);
  color: #fff;
}

/* Botao (form POST) com a mesma cara dos links do menu. */
.sidebar-nav .sidebar-form {
  margin: 0;
}

.sidebar-nav .sidebar-form button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.0rem;
  text-align: left;
  cursor: pointer;
}

.sidebar-nav .sidebar-form button i {
  flex: 0 0 18px;
  text-align: center;
}

.sidebar-nav .sidebar-form button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-nav .sidebar-divisor {
  margin: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-nav a.is-disabled {
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}

.sidebar-nav a.is-disabled .soon-badge {
  margin-left: auto;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
}

.sidebar.collapsed .sidebar-nav a.is-disabled .soon-badge {
  display: none;
}

.sidebar-nav a .link-tag {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--hub-accent);
  border-radius: 4px;
  padding: 2px 6px;
}

.sidebar.collapsed .sidebar-nav a .link-tag {
  display: none;
}

/* ---- Grupos do menu (Operacao, Financeiro, Cadastros) ----
   Menu aberto: sanfona. Menu recolhido (desktop): flyout ao lado do icone. */
.sidebar-grupo-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.0rem;
  text-align: left;
  cursor: pointer;
}

.sidebar-grupo-toggle > i:first-child {
  flex: 0 0 18px;
  text-align: center;
}

.sidebar-grupo-toggle:hover,
.sidebar-grupo.is-current > .sidebar-grupo-toggle {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-grupo-toggle:focus {
  outline: none;
}

.sidebar-grupo-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -2px;
}

.sidebar-grupo-seta {
  margin-left: auto;
  font-size: 0.65rem;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.sidebar-grupo.is-open > .sidebar-grupo-toggle .sidebar-grupo-seta {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-grupo-seta {
  display: none;
}

.sidebar-nav ul.sidebar-submenu {
  display: none;
  padding: 2px 0 6px;
  background: rgba(0, 0, 0, 0.14);
}

.sidebar-grupo.is-open > .sidebar-submenu {
  display: block;
}

.sidebar-nav .sidebar-submenu a {
  padding: 9px 12px 9px 26px;
  font-size: 0.9rem;
  gap: 10px;
}

.sidebar-nav .sidebar-submenu a i {
  flex: 0 0 16px;
  font-size: 0.85rem;
}

.sidebar-submenu-titulo {
  display: none;
}

@media (min-width: 769px) {
  .sidebar.collapsed .sidebar-grupo.is-current > .sidebar-grupo-toggle {
    background: rgba(76, 118, 168, 0.2);
    border-left-color: var(--hub-success);
  }

  .sidebar.collapsed .sidebar-nav .sidebar-grupo > .sidebar-submenu {
    display: none;
    position: fixed;
    left: var(--hub-sidebar-collapsed);
    min-width: 210px;
    padding: 4px 0 6px;
    background: var(--hub-ink);
    border-radius: 0 10px 10px 0;
    box-shadow: 6px 8px 24px rgba(15, 23, 42, 0.28);
    z-index: 1040;
  }

  .sidebar.collapsed .sidebar-nav .sidebar-grupo:hover > .sidebar-submenu,
  .sidebar.collapsed .sidebar-nav .sidebar-grupo.is-flyout > .sidebar-submenu {
    display: block;
  }

  .sidebar.collapsed .sidebar-submenu-titulo {
    display: block;
    padding: 8px 16px 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .sidebar.collapsed .sidebar-nav .sidebar-submenu a {
    padding: 9px 16px;
  }

  .sidebar.collapsed .sidebar-nav .sidebar-submenu a .link-tag {
    display: inline-block;
  }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  z-index: 1020;
}

.content-wrapper {
  margin-left: var(--hub-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.18s ease;
}

.content-wrapper.collapsed {
  margin-left: var(--hub-sidebar-collapsed);
}

.header {
  min-height: 96px;
  background: var(--hub-surface);
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 10px;
  position: sticky;
  top: 0;
  z-index: 1010;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--hub-text);
}

.header-logo {
  width: 108px;
  height: 90px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prestador-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.prestador-switch label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--hub-muted);
  white-space: nowrap;
}

.prestador-switch select {
  height: 34px;
  min-width: 190px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.85rem;
  background: var(--hub-surface);
  color: var(--hub-text);
}

.header-admin-link {
  width: 36px;
  height: 36px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hub-muted);
}

.header-admin-link:hover {
  border-color: var(--hub-accent);
  color: var(--hub-accent);
  text-decoration: none;
}

@media (max-width: 768px) {
  .prestador-switch label {
    display: none;
  }

  .prestador-switch select {
    min-width: 140px;
  }
}

.user-area i {
  font-size: 1.6rem;
  color: var(--hub-muted);
}

.user-info-text {
  line-height: 1.15;
}

.user-info-text div {
  font-size: 0.88rem;
  font-weight: 600;
}

.user-info-text small {
  color: var(--hub-muted);
  font-size: 0.72rem;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--hub-border);
  color: var(--hub-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.logout-btn:hover {
  border-color: var(--hub-danger);
  color: var(--hub-danger);
}

.main-content {
  flex: 1 1 auto;
  padding: 24px;
}

.footer {
  border-top: 1px solid var(--hub-border);
  background: var(--hub-surface);
  padding: 14px 24px;
  color: var(--hub-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer p {
  margin: 0;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hub-muted);
}

.status-item.is-online .status-dot {
  background: var(--hub-success);
}

.status-item.is-offline .status-dot {
  background: var(--hub-danger);
}

.status-item.is-neutro .status-dot {
  background: var(--hub-warning);
}

.status-item .status-valor {
  color: var(--hub-text);
  font-weight: 600;
}

/* ------------------------------ Cards ----------------------------------- */
.page-heading {
  margin-bottom: 20px;
}

.page-heading h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.page-heading p {
  color: var(--hub-muted);
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.hub-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  padding: 18px;
  height: 100%;
}

/* Cards empilhados na mesma coluna nao devem herdar a altura total da coluna. */
.hub-card.is-auto {
  height: auto;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Coroa do VIP no topo (ao lado do usuario) */
.header-vip {
  width: 36px;
  height: 36px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hub-muted);
  opacity: 0.55;
}

.header-vip.is-ativo {
  color: var(--hub-warning);
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  opacity: 1;
}


/* Cards clicaveis (atalhos para servicos/despesas) */
a.hub-card.stat-card {
  color: inherit;
  text-decoration: none;
}

a.hub-card.stat-card:hover,
a.hub-card.stat-card:focus {
  color: inherit;
  text-decoration: none;
  border-color: var(--hub-accent);
  box-shadow: 0 2px 10px rgba(14, 28, 47, 0.08);
}

/* Cards da pagina inicial: valor principal + linhas de detalhe menores. */
.kpi-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 16px;
}

a.kpi-card {
  color: inherit;
  text-decoration: none;
}

a.kpi-card:hover,
a.kpi-card:focus {
  color: inherit;
  text-decoration: none;
  border-color: var(--hub-accent);
  box-shadow: 0 2px 10px rgba(14, 28, 47, 0.08);
}

.kpi-topo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.kpi-topo .stat-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 0.9rem;
  border-radius: 8px;
}

.kpi-titulo {
  color: var(--hub-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-valor {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--hub-ink);
}

.kpi-valor small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hub-muted);
}

.kpi-detalhes {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px dashed var(--hub-border);
  font-size: 0.84rem;
  color: var(--hub-muted);
}

.kpi-detalhes li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.kpi-detalhes li strong {
  color: var(--hub-ink);
  font-weight: 600;
  white-space: nowrap;
}

.kpi-detalhes li.is-alerta strong {
  color: var(--hub-warning);
}

/* Receita prevista (inicial e relatorios): barra empilhada + legenda. */
.previsao-total {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--hub-ink);
}

.previsao-barra {
  display: flex;
  height: 14px;
  margin: 10px 0 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--hub-bg);
}

.previsao-barra span + span {
  border-left: 2px solid var(--hub-surface);
}

.previsao-legenda {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.previsao-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  color: var(--hub-text);
  text-decoration: none;
}

.previsao-item:hover {
  background: var(--hub-bg);
  color: var(--hub-ink);
  text-decoration: none;
}

.previsao-item strong {
  grid-column: 2;
  font-size: 1rem;
  color: var(--hub-ink);
}

.previsao-rotulo {
  font-size: 0.78rem;
  color: var(--hub-muted);
}

.previsao-cor {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.previsao-barra .is-recebido, .previsao-cor.is-recebido { background: var(--hub-success); }
.previsao-barra .is-contas, .previsao-cor.is-contas { background: var(--hub-accent); }
.previsao-barra .is-sem-conta, .previsao-cor.is-sem-conta { background: var(--hub-warning); }
.previsao-barra .is-andamento, .previsao-cor.is-andamento { background: #9fb3cc; }

@media (max-width: 992px) {
  .previsao-legenda {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Seletor de periodo da inicial (Este mes / Mes passado / Ultimos 3 meses). */
.periodo-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
}

.periodo-switch-item {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--hub-muted);
  text-decoration: none;
  white-space: nowrap;
}

.periodo-switch-item:hover {
  color: var(--hub-ink);
  background: var(--hub-bg);
  text-decoration: none;
}

.periodo-switch-item.is-active {
  background: var(--hub-accent);
  color: #fff;
}

.kpi-valor-legenda {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--hub-muted);
}

.kpi-detalhes li.is-perigo,
.kpi-detalhes li.is-perigo strong {
  color: var(--hub-danger);
}

.kpi-rodape {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--hub-accent);
}

/* ------------------------------ Abas ------------------------------------ */
.hub-tabs {
  border-bottom: 1px solid var(--hub-border);
  margin-bottom: 18px;
}

.hub-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--hub-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 14px;
}

.hub-tabs .nav-link:hover {
  color: var(--hub-accent);
}

.hub-tabs .nav-link.active {
  color: var(--hub-accent-dark);
  border-bottom-color: var(--hub-accent);
  background: transparent;
}

.stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: rgba(76, 118, 168, 0.12);
  color: var(--hub-accent);
}

.stat-icon.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--hub-success);
}

.stat-icon.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: var(--hub-warning);
}

.stat-icon.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--hub-danger);
}

.stat-icon.is-ink {
  background: rgba(14, 28, 47, 0.1);
  color: var(--hub-ink);
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  color: var(--hub-muted);
  font-size: 0.82rem;
}

.stat-meta {
  color: var(--hub-muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.stat-card-compact {
  gap: 10px;
  padding: 14px;
}

.stat-card-compact .stat-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  font-size: 0.95rem;
}

.stat-card-compact .stat-label {
  font-size: 0.74rem;
}

.stat-card-compact .stat-value {
  font-size: 1.08rem;
}

.stat-card-compact .stat-meta {
  font-size: 0.72rem;
}

.admin-action {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  background: var(--hub-bg);
}

.admin-action.is-disabled {
  opacity: 0.6;
}

.admin-action-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-action-text {
  color: var(--hub-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 4px 0 10px;
}

.admin-hint-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--hub-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.admin-hint-list li + li {
  margin-top: 8px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.hub-table thead th {
  text-align: left;
  color: var(--hub-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hub-border);
}

.hub-table tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--hub-border);
  vertical-align: middle;
}

.hub-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Variante compacta (listas longas, ex.: servicos). */
.hub-table.hub-table-sm {
  font-size: 0.8rem;
}

.hub-table.hub-table-sm thead th {
  font-size: 0.68rem;
  padding: 6px 8px;
}

.hub-table.hub-table-sm tbody td {
  padding: 6px 8px;
}

.hub-table.hub-table-sm small {
  font-size: 0.72rem;
}

.hub-table.hub-table-sm .hub-table-badge {
  min-width: 88px;
  min-height: 24px;
  padding: 2px 8px;
  font-size: 0.66rem;
}

.hub-table.hub-table-sm .btn-icon {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
}

.badge-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--hub-bg);
  color: var(--hub-muted);
  border: 1px solid var(--hub-border);
}

.badge-status.is-primary {
  background: rgba(76, 118, 168, 0.12);
  color: var(--hub-accent-dark);
  border-color: rgba(76, 118, 168, 0.25);
}

.badge-status.is-success {
  background: rgba(16, 185, 129, 0.12);
  color: #0b7a56;
  border-color: rgba(16, 185, 129, 0.25);
}

.badge-status.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #a16207;
  border-color: rgba(245, 158, 11, 0.28);
}

.badge-status.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}

/* Financeiro: resumo do total na tela de gerar conta. */
.conta-total {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--hub-bg);
  border: 1px solid var(--hub-border);
  font-size: 0.9rem;
}

.conta-total-valor {
  font-size: 1.25rem;
}

.badge-faturado {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #0b7a56;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  color: var(--hub-muted);
  padding: 34px 10px;
  font-size: 0.9rem;
}

.empty-state i {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* --------------------- Listagens / formularios -------------------------- */
.badge-status.is-ink {
  background: rgba(14, 28, 47, 0.1);
  color: var(--hub-ink);
  border-color: rgba(14, 28, 47, 0.2);
}

.hub-table-badge {
  min-width: 108px;
  min-height: 30px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hub-table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.filter-toggle {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--hub-accent);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-toggle:hover {
  color: var(--hub-accent-dark);
}

.hub-table .row-clickable {
  cursor: pointer;
}

.hub-table tbody tr.row-clickable:hover {
  background: rgba(76, 118, 168, 0.06);
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-tile {
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  padding: 10px;
  height: 100%;
}

.file-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--hub-border);
}

.file-link {
  display: inline-block;
  padding: 6px 0;
}

/* ------------------ Conferencia (foto / preco / nota) ------------------- */
.conf-icones {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.conf-icone {
  font-size: 0.95rem;
}

.conf-icone.is-ok {
  color: var(--hub-success);
}

.conf-icone.is-falta {
  color: var(--hub-danger);
}

.conf-legenda {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--hub-muted);
}

.conf-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.conf-box {
  flex: 1 1 200px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.conf-box.is-ok {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.25);
}

.conf-box.is-falta {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.25);
}

.conf-box-icon {
  font-size: 1.05rem;
  margin-top: 1px;
}

.conf-box.is-ok .conf-box-icon {
  color: var(--hub-success);
}

.conf-box.is-falta .conf-box-icon {
  color: var(--hub-danger);
}

.conf-box-rotulo {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hub-text);
}

.conf-box-texto {
  font-size: 0.78rem;
  color: var(--hub-muted);
}

/* ------------------------------- Rota ---------------------------------- */
.rota-mapa {
  display: block;
  width: 100%;
  max-height: 220px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.04);
}

.rota-legenda {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--hub-muted);
}

.rota-ponto {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.rota-ponto.is-inicio {
  background: var(--hub-success);
}

.rota-ponto.is-fim {
  background: var(--hub-danger);
}

.rota-ponto.is-atual {
  background: var(--hub-accent);
}

.rota-ponto.is-foco {
  background: var(--hub-ink);
}

.hub-card .form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--hub-sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  /* No celular o menu abre como gaveta: mostra os nomes (com os grupos, so icone confunde). */
  .sidebar.collapsed .link-text {
    display: inline;
  }

  .sidebar.collapsed .sidebar-heading {
    display: block;
  }

  .sidebar.collapsed .sidebar-grupo-seta,
  .sidebar.collapsed .sidebar-nav a .link-tag {
    display: inline-block;
  }

  .content-wrapper,
  .content-wrapper.collapsed {
    margin-left: 0;
  }

  .user-info-text {
    display: none;
  }

  .main-content {
    padding: 16px;
  }
}

/* ----------------- Modais (rolagem em telas menores) -------------------- */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-header,
.modal-dialog-scrollable .modal-content > form > .modal-footer {
  flex-shrink: 0;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* ------------------- Paginas institucionais (politicas) ------------------ */
.legal-page {
  min-height: 100vh;
  background: var(--hub-bg);
  padding: 32px 16px 56px;
}

.legal-shell {
  max-width: 820px;
  margin: 0 auto;
}

.legal-header {
  text-align: center;
  margin-bottom: 22px;
}

.legal-header-logo {
  height: 46px;
  width: auto;
  margin-bottom: 14px;
}

.legal-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--hub-ink);
  margin: 0 0 6px;
}

.legal-header p {
  color: var(--hub-muted);
  font-size: 0.85rem;
  margin: 0;
}

.legal-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  padding: 28px 30px;
}

.legal-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hub-ink);
  margin: 26px 0 8px;
}

.legal-card h2:first-child {
  margin-top: 0;
}

.legal-card p,
.legal-card li {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--hub-text);
}

.legal-card ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.legal-card li {
  margin-bottom: 5px;
}

.legal-resumo {
  border: 1px solid var(--hub-border);
  border-radius: 10px;
  background: rgba(76, 118, 168, 0.05);
  padding: 14px 16px;
  margin-bottom: 22px;
}

.legal-resumo p {
  margin: 0 0 6px;
  font-size: 0.86rem;
}

.legal-resumo p:last-child {
  margin-bottom: 0;
}

.legal-contato {
  border-top: 1px solid var(--hub-border);
  margin-top: 26px;
  padding-top: 16px;
  font-size: 0.86rem;
  color: var(--hub-muted);
}

.legal-footer {
  text-align: center;
  color: var(--hub-muted);
  font-size: 0.76rem;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .legal-page {
    padding: 20px 12px 40px;
  }

  .legal-card {
    padding: 20px 18px;
  }
}
