/* AVOCAT – Tema Praia (paleta céu/mar/areia/vegetação) */

/* ================================
   Estilo para Tela de Tarefas - AVOCAT
   ================================ */

/* Tabela harmonizada */
.table {
    font-size: 0.95rem;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background-color: #1c3f4d;
    color: white;
    font-weight: 600;
    vertical-align: middle;
}

.table tbody tr:nth-child(odd) {
    background-color: #f3f2ea;
}

.table tbody tr:nth-child(even) {
    background-color: #e3edf0;
}

.table tbody tr:hover {
    background-color: #d6e7ec;
}

.table th, .table td {
    vertical-align: middle;
    padding: 10px 12px;
    border-color: #c9c6ab;
}

/* Destaques por status */
.tarefa-pendente {
    border-left: 5px solid #ffc107 !important; /* amarelo */
}

.tarefa-andamento {
    border-left: 5px solid #799eb0 !important; /* azul */
}

.tarefa-concluida {
    border-left: 5px solid #28a745 !important; /* verde */
}

/* Botões dentro da tabela */
.table .btn {
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* Melhoria visual dos ícones */
.table i {
    font-size: 1rem;
}

/* Cabeçalho da tabela fixo opcional */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* Aumenta o espaçamento da primeira linha */
.table thead th:first-child {
    border-top-left-radius: 6px;
}
.table thead th:last-child {
    border-top-right-radius: 6px;
}

/* === Refinamento de proporções – Minhas Tarefas (desktop) === */

.page-tarefas .table {
  table-layout: auto !important;
  width: 100%;
}

.page-tarefas th,
.page-tarefas td {
  vertical-align: middle !important;
  word-break: break-word;
}

/* Datas compactas */
.page-tarefas th:nth-child(1),
.page-tarefas td:nth-child(1),
.page-tarefas th:nth-child(2),
.page-tarefas td:nth-child(2) {
  width: 120px;
  min-width: 110px;
  text-align: center;
  white-space: nowrap;
}

/* Status centralizado e curto */
.page-tarefas th:nth-child(4),
.page-tarefas td:nth-child(4) {
  width: 100px;
  text-align: center;
  white-space: nowrap;
}

/* Processo curto */
.page-tarefas th:nth-child(7),
.page-tarefas td:nth-child(7) {
  width: 130px;
  text-align: center;
  white-space: nowrap;
}

/* Ações compactas */
.page-tarefas th:last-child,
.page-tarefas td:last-child {
  width: 110px;
  text-align: center;
  white-space: nowrap;
}

/* Cliente e Descrição absorvem o restante */
.page-tarefas th:nth-child(3),
.page-tarefas td:nth-child(3),
.page-tarefas th:nth-child(6),
.page-tarefas td:nth-child(6) {
  width: auto;
  white-space: normal;
}

/* ==================================
   TAREFAS – MOBILE (iPhone)
   ================================== */
@media (max-width: 576px) {

  /* Bloco “Informe do Dia” mais estreito e sem esmagar o título ao lado */
  .page-tarefas .alert.alert-primary {
    width: 100%;
    margin: 0 0 10px 0;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  /* Cards da lista (modo mobile) com hierarquia mais clara */
  .page-tarefas .card { border-radius: 12px; }
  .page-tarefas .card .card-title {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }
  .page-tarefas .card .card-text {
    font-size: 0.98rem;
    line-height: 1.3;
  }

  /* Grupo de botões (+1/+3/+7) quebrar em linha e não “grudar” na borda */
  .page-tarefas .btn-group { gap: 6px; flex-wrap: wrap; }
  .page-tarefas .btn-group .btn {
    min-width: 78px;
    padding: 6px 10px;
  }

  /* Se houver tabelas em dispositivos pequenos (casos específicos),
     evita esmagamento das colunas “Clientes”, “Descrição” etc. */
  .page-tarefas table.table {
    table-layout: fixed;               /* evita colunas “gigantes” */
    width: 100%;
  }
  .page-tarefas table.table th,
  .page-tarefas table.table td {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
  }
  /* Mantém datas curtinhas e alinhadas quando aparecerem em tabela */
  .page-tarefas table.table td.text-nowrap {
    white-space: nowrap !important;
  }

  /* Espaço entre filtros e lista */
  .page-tarefas form.row.g-3 { row-gap: 8px; }
}

/* ==================================
   TAREFAS – DESKTOP (garantia das duas primeiras colunas)
   ================================== */
@media (min-width: 768px) {
  .page-tarefas table.table colgroup col:nth-child(1) { width: 80px; }
  .page-tarefas table.table colgroup col:nth-child(2) { width: 100px; }
  .page-tarefas table.table { table-layout: fixed; }
  .page-tarefas table.table td,
  .page-tarefas table.table th {
    word-break: break-word;
  }
  .page-tarefas table.table td.text-nowrap { white-space: nowrap !important; }
}
@media (max-width: 576px) {
  .page-tarefas .alert.alert-primary {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .page-tarefas .alert.alert-primary ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    margin: 0;
    padding-left: 0;
    list-style: none;
  }
}
@media (max-width: 576px) {
  .page-tarefas form button[type="submit"] {
    height: 44px;
    font-weight: 600;
  }
}
@media (max-width: 576px) {
  .page-tarefas .card .d-flex.gap-2 {
    justify-content: space-between;
  }

  .page-tarefas .card .btn {
    flex: 1 1 auto;
  }
}
/* =====================================================
   TAREFAS — DESKTOP COMPACTO (notebooks 14" / 15")
   ===================================================== */
@media (min-width: 992px) and (max-width: 1399.98px) {

  /* Tabela mais previsível */
  .page-tarefas table.table {
    table-layout: fixed;
    width: 100%;
  }

  /* Evita quebra bizarra de palavras */
  .page-tarefas th,
  .page-tarefas td {
    word-break: normal !important;
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 0.88rem;
  }

  /* Datas mais compactas */
  .page-tarefas th:nth-child(1),
  .page-tarefas td:nth-child(1),
  .page-tarefas th:nth-child(2),
  .page-tarefas td:nth-child(2) {
    width: 90px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* STATUS compacto */
  .page-tarefas th:nth-child(4),
  .page-tarefas td:nth-child(4) {
    width: 90px;
    text-align: center;
    white-space: nowrap;
  }

  /* CATEGORIA — limitar altura (não estourar linha) */
  .page-tarefas th:nth-child(5),
  .page-tarefas td:nth-child(5) {
    width: 140px;
    max-width: 140px;
  }

  /* DESCRIÇÃO é prioridade */
  .page-tarefas th:nth-child(6),
  .page-tarefas td:nth-child(6) {
    width: auto;
    min-width: 260px;
  }

  /* PROCESSO — esconder (não cabe em notebook) */
  .page-tarefas th:nth-child(7),
  .page-tarefas td:nth-child(7) {
    display: none;
  }

  /* AÇÕES compactas */
  .page-tarefas th:last-child,
  .page-tarefas td:last-child {
    width: 110px;
    white-space: nowrap;
  }

  /* Botões de adiar viram ícones */
  .page-tarefas td:last-child .btn-secondary {
    padding: 4px 6px;
    font-size: 0.75rem;
  }
}
/* =====================================================
   TAREFAS — AÇÕES ULTRA COMPACTAS (14" / 15")
   ===================================================== */
@media (min-width: 992px) and (max-width: 1399.98px) {

  /* Coluna AÇÕES ainda mais estreita */
  .page-tarefas th:last-child,
  .page-tarefas td:last-child {
    width: 90px !important;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
  }

  /* Ícones principais (editar / excluir / concluir) */
  .page-tarefas td:last-child .btn-link,
  .page-tarefas td:last-child .btn-outline-success,
  .page-tarefas td:last-child .btn-warning {
    padding: 2px 4px;
    font-size: 0.85rem;
  }

  /* Grupo de adiar vira “chips” */
  .page-tarefas td:last-child .btn-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
  }

  .page-tarefas td:last-child .btn-group .btn {
    padding: 2px 4px;
    font-size: 0.68rem;
    line-height: 1.1;
    border-radius: 6px;
  }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
  .page-tarefas td:last-child {
    vertical-align: middle;
  }
}
/* =====================================================
   TAREFAS — EVOLUÇÃO: DROPDOWN "ADIAR"
   ===================================================== */

.page-tarefas .tarefa-adiar-dropdown .dropdown-menu{
  min-width: 220px;
}

/* Notebook 14"/15": manter ações compactas e previsíveis */
@media (min-width: 992px) and (max-width: 1399.98px){

  .page-tarefas th:last-child,
  .page-tarefas td:last-child{
    width: 95px !important;
    min-width: 95px;
    max-width: 95px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
  }

  .page-tarefas .tarefa-adiar-dropdown .dropdown-toggle{
    padding: 2px 6px;
    font-size: 0.78rem;
    border-radius: 8px;
    white-space: nowrap;
  }

  .page-tarefas .tarefa-adiar-dropdown .dropdown-menu{
    min-width: 210px;
  }

  .page-tarefas .tarefa-adiar-dropdown .dropdown-item{
    font-size: 0.88rem;
    padding: .35rem .8rem;
  }
}

/* Mobile: dropdown ocupa largura e fica “tocável” */
@media (max-width: 576px){
  .page-tarefas .tarefa-adiar-dropdown .dropdown-toggle{
    height: 42px;
    font-weight: 600;
  }
  .page-tarefas .tarefa-adiar-dropdown .dropdown-menu{
    min-width: 100%;
  }
}

#modalPublicacaoTexto{
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: .95rem;
    line-height: 1.55rem;
}
#modalPublicacaoTexto mark{
    padding: 0 .15rem;
    border-radius: .25rem;
}
.hit{
    background: #fff3cd;
    padding: 0 .15rem;
    border-radius: .25rem;
}
.hit.active{
    outline: 2px solid #6f95a6;
    background: #d6e7ec;
}
/* KPI compacto (melhor que alert com lista) */
.av-kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  margin: 8px 0 14px 0;
}

.av-kpi{
  background: #ffffff;
  border: 1px solid #dbe6ea;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.av-kpi small{ display:block; opacity:.75; font-weight:600; }
.av-kpi strong{ display:block; font-size: 1.25rem; line-height:1.1; }

.av-kpi--danger{ border-left: 4px solid #dc3545; }
.av-kpi--warning{ border-left: 4px solid #ffc107; }
.av-kpi--info{ border-left: 4px solid #0dcaf0; }

@media (max-width: 768px){
  .av-kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.page-tarefas .table thead th{
  padding: 12px 12px;
  letter-spacing: .2px;
}
.page-tarefas tr.table-secondary td{
  background: #eaf2f4;
  border-top: 1px solid #cfe0e6;
  border-bottom: 1px solid #cfe0e6;
}
