/* ==========================================================
   Intranet Wiisecure
   Design system replicado de www.wiisecure.com
   ========================================================== */

:root {
  --primary: #3bbfad;
  --secondary: #005e85;
  --dark: #004256;
  --white: #ffffff;
  --black: #000000;
  --light: #f2f6f8;
  --border: #d9e2e7;
  --muted: #6b8a96;
  --warn: #f0a500;
  --danger: #c0392b;
  --success: #2e9e6b;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--light);
  font-family: 'Nunito', sans-serif;
  color: var(--secondary);
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1, h2, h3, h4, h5 {
  color: var(--dark);
  font-weight: 800;
}

a {
  color: var(--primary);
}

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-dark { color: var(--dark) !important; }
.text-muted-wii { color: var(--muted) !important; }

/* ----- Navbar ----- */

.navbar-portal {
  background-color: var(--white);
  box-shadow: 0 2px 12px rgba(0, 66, 86, .08);
  padding-top: .7rem;
  padding-bottom: .7rem;
}

.navbar-portal .brand-text {
  font-weight: 800;
  color: var(--dark);
  font-size: 1rem;
  line-height: 1.1;
}

.navbar-portal .nav-link {
  color: var(--secondary);
  font-weight: 700;
  font-size: .92rem;
  margin: 0 .2rem;
  transition: .3s all ease-in-out;
}

.navbar-portal .nav-link:hover,
.navbar-portal .nav-link.active {
  color: var(--primary);
}

.navbar-portal .dropdown-menu {
  border: 0;
  border-radius: .8rem;
  box-shadow: 0 10px 30px rgba(0, 66, 86, .15);
}

.user-chip {
  background-color: var(--light);
  color: var(--dark);
  font-weight: 700;
  font-size: .85rem;
  padding: .35rem .9rem;
  border-radius: 50rem;
}

.dept-chip {
  background-color: rgba(59, 191, 173, .15);
  color: var(--dark);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .25rem .7rem;
  border-radius: 50rem;
}

.btn-sair {
  background-color: var(--secondary);
  color: var(--white);
  font-weight: 700;
  transition: .3s all ease-in-out;
}

.btn-sair:hover {
  background-color: var(--dark);
  color: var(--white);
}

/* ----- Botões ----- */

.btn-primary,
.btn-wii {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  font-weight: 700;
  border-radius: 50rem;
  padding: .55rem 1.6rem;
  transition: .3s all ease-in-out;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-wii:hover, .btn-wii:focus {
  background-color: var(--secondary) !important;
  border-color: var(--secondary) !important;
  color: var(--white);
}

.btn-outline-wii {
  border: 2px solid var(--secondary);
  color: var(--secondary);
  font-weight: 700;
  border-radius: 50rem;
  padding: .45rem 1.4rem;
  transition: .3s all ease-in-out;
  background: transparent;
}

.btn-outline-wii:hover {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-onedrive {
  background-color: var(--white);
  border: 2px solid var(--primary);
  color: var(--dark);
  font-weight: 700;
  border-radius: 50rem;
  padding: .4rem 1.2rem;
  font-size: .85rem;
  transition: .3s all ease-in-out;
}

.btn-onedrive:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* ----- Cartões ----- */

.card {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 66, 86, .07);
}

.card-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  border-radius: 1rem 1rem 0 0 !important;
  font-weight: 800;
  color: var(--dark);
}

.card-container {
  transition: .3s all ease-in-out;
}

.card-container:hover {
  transform: translateY(-6px);
}

.card-stat {
  border-top: 4px solid var(--primary);
}

.card-stat .stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

.card-stat .stat-label {
  color: var(--muted);
  font-weight: 700;
  font-size: .85rem;
}

.card-stat.stat-warn { border-top-color: var(--warn); }
.card-stat.stat-danger { border-top-color: var(--danger); }
.card-stat.stat-secondary { border-top-color: var(--secondary); }

/* ----- Formulários ----- */

.form-label {
  font-weight: 700;
  color: var(--dark);
}

.form-control, .form-select {
  border-color: var(--border);
  border-radius: .6rem;
  padding: .55rem .9rem;
  color: var(--secondary);
}

.form-control:focus, .form-select:focus {
  box-shadow: none;
  border-color: var(--primary);
}

::placeholder {
  color: var(--muted) !important;
  opacity: .7;
}

/* ----- Tabelas ----- */

.table {
  color: var(--secondary);
}

.table thead th {
  background-color: var(--dark);
  color: var(--white);
  font-weight: 700;
  border: 0;
  white-space: nowrap;
  font-size: .85rem;
}

.table tbody tr {
  transition: .2s background-color ease-in-out;
}

.table-hover tbody tr:hover {
  background-color: rgba(59, 191, 173, .08);
}

/* ----- Badges de estado ----- */

.badge {
  font-weight: 700;
  padding: .45em .9em;
}

.badge-aberto, .badge-pendente, .badge-projeto, .badge-pedido { background-color: var(--primary); color: var(--white); }
.badge-tratamento, .badge-em_curso, .badge-em_producao, .badge-agendado, .badge-testes, .badge-producao { background-color: var(--warn); color: var(--white); }
.badge-resolvido, .badge-concluida, .badge-aprovada, .badge-ganha, .badge-pronto, .badge-publicado, .badge-instalado, .badge-entregue { background-color: var(--success); color: var(--white); }
.badge-rejeitada, .badge-perdida, .badge-parada { background-color: var(--danger); color: var(--white); }
.badge-pausa, .badge-em_execucao { background-color: var(--secondary); color: var(--white); }

/* ----- Login ----- */

.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 60%, #007ba8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 1.2rem;
  background: var(--white);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  padding: 2.5rem;
}

.login-card .logo {
  height: 60px;
}

.login-hint {
  background: var(--light);
  border-radius: .6rem;
  padding: .7rem .9rem;
  font-size: .78rem;
  color: var(--muted);
}

/* ----- Footer ----- */

.footer-portal {
  background-color: var(--dark);
  color: var(--white);
  font-size: .9rem;
}

/* ----- Hero ----- */

.hero-portal {
  background: linear-gradient(120deg, var(--dark), var(--secondary));
  color: var(--white);
  border-radius: 1.2rem;
  padding: 2rem 2.2rem;
}

.hero-portal h1 { color: var(--white); }
.hero-portal .text-accent { color: var(--primary); }

@media (max-width: 575px) {
  .hero-portal { padding: 1.5rem; }
}

/* ----- Widgets do dashboard geral ----- */

.widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget-list li {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}

.widget-list li:last-child { border-bottom: 0; }

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--light);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .85rem;
  flex-shrink: 0;
  border: 2px solid var(--primary);
}

.chip-hoje {
  background: var(--primary);
  color: var(--white);
  font-size: .68rem;
  font-weight: 800;
  padding: .15rem .5rem;
  border-radius: 50rem;
}

/* ----- Gráficos ----- */

.chart-box {
  position: relative;
  height: 260px;
}

.chart-box.chart-sm { height: 200px; }

/* ----- Quick actions (área pessoal) ----- */

.quick-action {
  display: block;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: .25s all ease-in-out;
}

.quick-action:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.quick-action .qa-icon {
  font-size: 1.6rem;
}

.quick-action .qa-title {
  color: var(--dark);
  font-weight: 800;
  display: block;
  margin-top: .4rem;
}

/* ----- Kanban comercial ----- */

.kanban-col {
  background: var(--light);
  border-radius: 1rem;
  padding: .8rem;
  min-height: 200px;
}

.kanban-col h6 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 800;
}

.kanban-card {
  background: var(--white);
  border-radius: .7rem;
  padding: .7rem .8rem;
  margin-bottom: .6rem;
  box-shadow: 0 2px 8px rgba(0, 66, 86, .08);
  font-size: .85rem;
}

.kanban-card .valor {
  font-weight: 800;
  color: var(--dark);
}

/* ----- Timeline de fases (Engenharia) ----- */

.fase-timeline { list-style: none; margin: 0; padding: 0; }

.fase-timeline li {
  position: relative;
  padding: .3rem 0 1.1rem 2rem;
  border-left: 2px solid var(--border);
  margin-left: .6rem;
}

.fase-timeline li:last-child { border-left-color: transparent; }

.fase-timeline li::before {
  content: '';
  position: absolute;
  left: -.55rem;
  top: .35rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--white);
}

.fase-timeline li.fase-concluida::before { background: var(--success); }
.fase-timeline li.fase-em_curso::before { background: var(--warn); }

/* ----- Calendário semanal ----- */

.cal-table th, .cal-table td {
  vertical-align: top;
  min-width: 150px;
}

.cal-tarefa {
  background: rgba(59, 191, 173, .12);
  border-left: 3px solid var(--primary);
  border-radius: .4rem;
  padding: .35rem .5rem;
  margin-bottom: .35rem;
  font-size: .78rem;
}

.cal-tarefa .cal-obra {
  font-weight: 800;
  color: var(--dark);
  display: block;
}

/* ----- Linhas dinâmicas de formulário ----- */

.linha-material .btn-remover {
  color: var(--danger);
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
}

/* ----- Documento restrito ----- */

.lock-banner {
  background: rgba(0, 66, 86, .06);
  border: 1px dashed var(--muted);
  border-radius: .8rem;
  padding: 1.2rem;
  color: var(--muted);
  text-align: center;
}
