/* ==========================================================================
   SIGTEL - Dashboard.css
   Estilos específicos da dashboard
   Base global em /assets/css/base.css
   ========================================================================== */

.dashboard-page{
  padding:0;
}

.dashboard-page .topbar{
  margin-bottom:22px;
}

.dashboard-page .title h2{
  font-size:30px;
  letter-spacing:-.03em;
}

.dashboard-page .title p{
  max-width:780px;
}

/* ==========================================================================
   GRID PRINCIPAL
   ========================================================================== */
.dashboard-grid-top{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:18px;
  margin-bottom:18px;
}

.dashboard-sections{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:18px;
}

.dashboard-grid-2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}

.dashboard-grid-3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:18px;
}

/* ==========================================================================
   CARD BASE DO DASHBOARD
   ========================================================================== */
.dashboard-card{
  background:linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
  border:1px solid var(--border);
  border-radius:22px;
  padding:20px;
  box-shadow:var(--shadow);
}

.dashboard-card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.dashboard-card-title{
  margin:0;
  font-size:18px;
  line-height:1.2;
  font-weight:800;
  color:var(--text);
  letter-spacing:-.01em;
}

.dashboard-card-subtitle{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.dashboard-card-body{
  min-width:0;
}

.dashboard-card-footer{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

/* ==========================================================================
   CARDS DE MÉTRICAS
   ========================================================================== */
.stat-card{
  min-height:152px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
}

.stat-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.stat-card h3{
  margin:0;
  font-size:15px;
  line-height:1.3;
  font-weight:800;
  color:var(--textSoft);
}

.stat-card .muted{
  margin-top:6px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.stat-num{
  font-size:42px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.04em;
  color:var(--text);
}

.stat-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.stat-foot .small{
  font-size:12px;
  color:var(--muted);
}

/* ==========================================================================
   CHIPS E BADGES
   ========================================================================== */
.dashboard-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
}

.dashboard-chip.primary{
  background:var(--primarySoft);
  border-color:rgba(0,113,227,.14);
  color:var(--primary);
}

.dashboard-chip.ok{
  background:var(--okSoft);
  border-color:rgba(52,199,89,.14);
  color:var(--okHover);
}

.dashboard-chip.warn{
  background:var(--warnSoft);
  border-color:rgba(255,159,10,.14);
  color:var(--warnHover);
}

.dashboard-pill-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:31px;
  padding:0 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid transparent;
  white-space:nowrap;
}

.dashboard-pill-status.ok{
  background:var(--okSoft);
  color:var(--okHover);
  border-color:rgba(52,199,89,.18);
}

.dashboard-pill-status.warn{
  background:var(--warnSoft);
  color:var(--warnHover);
  border-color:rgba(255,159,10,.18);
}

.dashboard-pill-status.bad{
  background:var(--badSoft);
  color:var(--badHover);
  border-color:rgba(255,59,48,.18);
}

.dashboard-pill-status.neutral{
  background:#f7f7f8;
  color:var(--muted);
  border-color:var(--border);
}

/* ==========================================================================
   AÇÕES
   ========================================================================== */
.dashboard-actions,
.acoes-linha{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.dashboard-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:0 16px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.dashboard-btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadowSoft);
  text-decoration:none;
}

.dashboard-btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}

.dashboard-btn.primary:hover{
  background:var(--primaryHover);
  border-color:var(--primaryHover);
  color:#fff;
}

.dashboard-btn.danger{
  background:var(--badSoft);
  border-color:rgba(255,59,48,.16);
  color:var(--badHover);
}

.dashboard-btn.danger:hover{
  background:rgba(255,59,48,.14);
  border-color:rgba(255,59,48,.22);
}

.dashboard-btn.ghost{
  background:#fff;
  border-color:var(--border);
  color:var(--textSoft);
}

.dashboard-btn.sm{
  min-height:38px;
  padding:0 12px;
  border-radius:12px;
  font-size:12px;
}

/* ==========================================================================
   BLOCOS DE INFORMAÇÃO
   ========================================================================== */
.dashboard-empty-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.dashboard-empty-box strong{
  display:block;
  font-size:15px;
  line-height:1.3;
  color:var(--text);
  margin-bottom:4px;
}

.dashboard-empty-box p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.sem-dados{
  text-align:center;
  color:var(--muted);
  padding:24px 12px;
}

/* ==========================================================================
   LISTAS / ITENS
   ========================================================================== */
.dashboard-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.dashboard-list-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  transition:background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dashboard-list-item:hover{
  background:#fcfcfd;
  box-shadow:var(--shadowSoft);
}

.dashboard-list-main{
  min-width:0;
}

.dashboard-list-title{
  margin:0 0 4px;
  font-size:14px;
  font-weight:800;
  color:var(--text);
  line-height:1.35;
}

.dashboard-list-meta{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.dashboard-list-side{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* ==========================================================================
   BARRAS DE PROGRESSO
   ========================================================================== */
.dashboard-bar{
  width:100%;
  height:10px;
  background:#ececef;
  border-radius:999px;
  overflow:hidden;
}

.dashboard-bar-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, #8e8e93 0%, #c7c7cc 100%);
}

.dashboard-bar-fill.primary{
  background:linear-gradient(90deg, var(--primary) 0%, #69a7f0 100%);
}

.dashboard-bar-fill.ok{
  background:linear-gradient(90deg, var(--ok) 0%, #86efac 100%);
}

.dashboard-bar-fill.warn{
  background:linear-gradient(90deg, var(--warn) 0%, #fdba74 100%);
}

.dashboard-bar-fill.bad{
  background:linear-gradient(90deg, var(--bad) 0%, #fca5a5 100%);
}

/* ==========================================================================
   TABELA DO DASHBOARD
   ========================================================================== */
.dashboard-table-wrap{
  width:100%;
  overflow-x:auto;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadowSoft);
}

.dashboard-table-wrap table{
  width:100%;
  min-width:920px;
  border-collapse:collapse;
}

.dashboard-table-wrap thead th{
  text-align:left;
  padding:15px 16px;
  font-size:12px;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:var(--muted);
  border-bottom:1px solid var(--border);
  background:#f8f8fa;
  font-weight:800;
  white-space:nowrap;
}

.dashboard-table-wrap tbody td{
  padding:15px 16px;
  font-size:14px;
  color:var(--textSoft);
  border-bottom:1px solid #efeff1;
  vertical-align:middle;
}

.dashboard-table-wrap tbody tr:hover td{
  background:#fcfcfd;
}

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

/* ==========================================================================
   RESUMOS RÁPIDOS
   ========================================================================== */
.dashboard-resumo{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}

.dashboard-resumo-item{
  padding:16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff 0%,#fafafa 100%);
}

.dashboard-resumo-label{
  margin:0 0 8px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.dashboard-resumo-value{
  margin:0;
  color:var(--text);
  font-size:26px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.03em;
}

.dashboard-resumo-help{
  margin:8px 0 0;
  color:var(--muted);
  font-size:12px;
}

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width: 1180px){
  .dashboard-grid-top{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid-3{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .dashboard-resumo{
    grid-template-columns:1fr;
  }
}

@media (max-width: 860px){
  .dashboard-grid-top,
  .dashboard-grid-2,
  .dashboard-grid-3{
    grid-template-columns:1fr;
  }

  .dashboard-card{
    border-radius:20px;
    padding:16px;
  }

  .dashboard-btn{
    min-height:42px;
  }

  .stat-num{
    font-size:34px;
  }

  .dashboard-empty-box,
  .dashboard-list-item{
    flex-direction:column;
    align-items:flex-start;
  }

  .dashboard-list-side{
    width:100%;
    justify-content:flex-start;
  }
}

@media (max-width: 640px){
  .dashboard-page .title h2{
    font-size:26px;
  }

  .dashboard-card-title{
    font-size:17px;
  }

  .stat-num{
    font-size:30px;
  }

  .dashboard-actions,
  .acoes-linha{
    flex-direction:column;
    align-items:stretch;
  }

  .dashboard-btn{
    width:100%;
  }
}