/* =========================================================================
   Views A — Painel do gestor, Empresas, Tarefas da empresa, Notificações
   Complementa app.css (carregado depois dele).
   ========================================================================= */
.text-danger { color: var(--danger) !important; }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.btn-ghost.text-danger:hover { background: var(--danger-bg); }
.req { color: var(--danger); }
.push-left { margin-right: auto; }
.card > .card-body + .card-body { border-top: 1px solid var(--gray-100); }

/* ------------------------------------------------------- Painel do gestor */
.mg-filters .mg-select { width: auto; min-width: 150px; }
.mg-custom { display: inline-flex; align-items: center; gap: 6px; }
.mg-custom .input { width: 148px; }
.mg-row { margin-bottom: 14px; }
.mg-loading { display: flex; flex-direction: column; gap: 14px; }
.indicator .progress { height: 5px; margin: 2px 0; }
.alert.clickable { cursor: pointer; transition: filter .12s; }
.alert.clickable:hover { filter: brightness(.97); }
.alert .i { margin-top: 1px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { min-width: 0; display: flex; flex-direction: column; }
.person-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-text small { color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-rank-body { padding: 12px 0 4px; }
.mg-rank-table .table th:first-child, .mg-rank-table .table td:first-child { padding-left: 16px; }
.mg-rank-table .table th:last-child, .mg-rank-table .table td:last-child { padding-right: 16px; }
.rank-cards { display: none; }
.rank-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.rank-card:hover { border-color: var(--gray-300); }
.rank-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rank-card-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rank-card-nums div { background: var(--gray-50); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.rank-card-nums b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-card-nums span { font-size: 11px; color: var(--gray-500); }
.rank-card-nums .danger b { color: var(--danger); }
.bottleneck-grid { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr) minmax(0, 1.2fr); gap: 18px; }
.bn-col { min-width: 0; }
.bn-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); font-weight: 650; margin-bottom: 6px; }
.bn-kpis { display: flex; flex-direction: column; gap: 10px; }
.bn-kpi { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--gray-25); width: 100%; }
button.bn-kpi:hover { border-color: var(--gray-300); background: #fff; }
.bn-kpi .k { font-size: 12.5px; font-weight: 600; color: var(--gray-500); }
.bn-kpi b { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bn-kpi small { color: var(--gray-500); }
.bn-more { font-size: 12px; color: var(--gray-500); padding: 6px 4px 0; }
.mg-list { display: flex; flex-direction: column; }
.mg-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--gray-100); cursor: pointer; border-radius: 6px; min-width: 0; }
.mg-item:last-child { border-bottom: 0; }
.mg-item:hover { background: var(--gray-25); }
.mg-item:hover strong { color: var(--brand-700); }
.mg-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mg-item-body strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-item-body small { color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-item .tag { flex-shrink: 0; }

/* ---------------------------------------------------------------- Empresas */
.companies-toolbar { gap: 14px; }
.company-card:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.company-card.is-inactive { opacity: .7; }
.company-card.is-inactive .company-logo { background: var(--gray-400); }
.cc-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.cc-title { flex: 1; min-width: 0; }
.cc-title h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-title small { display: block; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-owner { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-600); min-width: 0; }
.cc-owner span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-owner .avatar { box-shadow: none; }

/* ------------------------------------------------------ Tarefas da empresa */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--gray-500); font-weight: 550; font-size: 13px; margin-top: 8px; }
.back-link:hover { color: var(--gray-900); }
.cd-head { align-items: center; }
.cd-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cd-title-text { min-width: 0; }
.cd-title-text h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: break-word; }
.company-logo.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; }
.cd-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--gray-600); }
.cd-meta > * { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cd-meta a:hover { color: var(--brand-700); }
.cd-meta .i { color: var(--gray-400); }
.cd-meta .avatar { box-shadow: none; }
.stat-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cd-tasks > .tabs { padding: 4px 12px 0; margin-bottom: 0; }
.cd-tasks > .card-body { padding-top: 6px; }
.cd-sk .sk-rows { border: 0; padding: 8px 0; }
.cd-more { padding-top: 12px; text-align: center; }
.cd-more .link { display: inline-flex; align-items: center; gap: 4px; }
.cd-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.assignee-dist { display: flex; flex-direction: column; gap: 4px; }
.ad-row { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 6px; border-radius: 8px; text-align: left; width: 100%; }
.ad-row:hover { background: var(--gray-50); }
.ad-row .avatar { box-shadow: none; }
.ad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ad-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-num { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; }
.ad-num b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ad-num small { font-size: 11.5px; color: var(--gray-500); white-space: nowrap; }
.kv-list { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--gray-100); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--gray-500); }
.kv b { font-weight: 600; text-align: right; word-break: break-word; }
.cd-notes p { white-space: pre-wrap; word-break: break-word; margin-top: 6px; color: var(--gray-700); line-height: 1.55; }
.timeline { display: flex; flex-direction: column; }
.tl-day { font-size: 12px; font-weight: 650; color: var(--gray-500); text-transform: lowercase; padding: 12px 0 4px; border-bottom: 1px solid var(--gray-100); }
.tl-day::first-letter { text-transform: uppercase; }
.tl-day:first-child { padding-top: 4px; }
.tl-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--gray-100); }
.tl-item:last-child { border-bottom: 0; }
.tl-item .avatar { box-shadow: none; margin-top: 1px; }
.tl-body { flex: 1; min-width: 0; font-size: 13px; }
.tl-line { color: var(--gray-700); word-break: break-word; }
.tl-line b { color: var(--gray-900); font-weight: 600; }
.tl-line .change del { color: var(--gray-400); }
.tl-line .change ins { text-decoration: none; color: var(--gray-900); font-weight: 550; }
.tl-task { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--gray-500); font-size: 12.5px; cursor: pointer; max-width: 100%; }
.tl-task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-task:hover { color: var(--brand-700); }
.tl-item time { font-size: 12px; color: var(--gray-400); font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ------------------------------------------------------------ Notificações */
.notif-card { overflow: hidden; }
.notif-day { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); padding: 10px 14px 6px; background: var(--gray-50); border-bottom: 1px solid var(--gray-100); }
.notif-day:not(:first-child) { border-top: 1px solid var(--gray-100); }
.notif-card .notif-list .notif:last-child { border-bottom: 0; }
.notif-more { padding: 12px; text-align: center; border-top: 1px solid var(--gray-100); }
.notif-pop header strong { font-size: 14px; }
.np-readall:disabled { color: var(--gray-400); cursor: default; text-decoration: none; }
.np-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px 16px; color: var(--gray-500); font-size: 13px; text-align: center; }

/* -------------------------------------------------------------- Responsivo */
@media (max-width: 1200px) {
  .stat-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottleneck-grid { grid-template-columns: 1fr 1fr; }
  .bn-kpis { grid-column: span 2; flex-direction: row; }
}
@media (max-width: 860px) {
  .mg-filters { width: 100%; }
  .mg-filters .mg-select { flex: 1 1 140px; min-width: 0; }
  .mg-custom { width: 100%; }
  .mg-custom .input { flex: 1; width: auto; min-width: 0; }
  .mg-rank-table { display: none; }
  .rank-cards { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 8px; }
  .bottleneck-grid { grid-template-columns: 1fr; }
  .bn-kpis { grid-column: auto; flex-direction: column; }
  .stat-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .companies-toolbar .input-icon { width: 100%; }
  .cd-head .page-actions { width: 100%; }
  .cd-head .page-actions .btn { flex: 1; }
  .company-logo.lg { width: 44px; height: 44px; font-size: 16px; }
  .rank-card-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
