* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#loginArea, #supervisorArea, #funcionarioArea,
#cadastroArea, #submenuTarefas, #telaDashboard {
  display: none;
}

.logo-container {
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.logo-isaflow {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.brand-wrap {
  text-align: center;
  margin-bottom: 16px;
}

.topo-brand {
  font-family: 'Comfortaa', sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.brand-isa {
  color: #ff2079;
}
.brand-flow {
  color: #8b2ff7;
  font-size: 60px;
}

.topo-slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.slogan-linha {
  color: #ff2079;
  font-weight: bold;
}

.slogan-texto {
  color: white;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════
   CORES ISAFLOW
   Primary:   #c2186c (pink)
   Secondary: #7b2ff7 (roxo)
   Dark:      #3a1a6e (roxo escuro)
   Gradient:  linear-gradient(135deg, #c2186c, #7b2ff7)
══════════════════════════════════════ */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #c2186c, #7b2ff7);
  min-height: 100dvh;
  /* safe area para notch / home indicator */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ══════════════════════════════════════
   TOPO
══════════════════════════════════════ */
.topo {
  background: none;
  padding: 16px 16px 8px;
  text-align: center;
}

.topo h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 2px;
}

.topo span {
  font-size: 11px;
  opacity: 0.9;
}

.logo-spi {
  width: 90px;
  height: auto;
}

#supervisorArea {
  margin: 0;
  width: 100%;
  max-width: 480px;
}

/* ══════════════════════════════════════
   CONTAINER
══════════════════════════════════════ */
.container {
  width: 100%;
  min-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 6vh 16px 24px;
  box-sizing: border-box;
}

#loginArea {
  margin-top: 0;
}

.container-login {
  width: 100%;
  min-height: calc(100dvh - 80px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 16px;
  box-sizing: border-box;
}

/* ══════════════════════════════════════
   CARD BASE
══════════════════════════════════════ */
.card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 12px 32px rgba(123,47,247,0.18);
  text-align: left;
  box-sizing: border-box;
}

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.loginArea {
  background: #ffffff;
  padding: 36px 28px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 32px rgba(194,24,108,0.2);
  text-align: center;
}

.loginArea h2 {
  margin-bottom: 20px;
  color: #3a1a6e;
  font-size: 20px;
}

.loginArea input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1.5px solid #e0d4f7;
  border-radius: 10px;
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s;
}

.loginArea input:focus {
  border-color: #7b2ff7;
}

.loginArea button {
  width: 100%;
  padding: 13px;
  margin-top: 14px;
  background: linear-gradient(90deg, #c2186c, #7b2ff7);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  transition: opacity 0.2s;
}

.loginArea button:hover {
  opacity: 0.9;
}

.footer-text {
  margin-top: 14px;
  font-size: 12px;
  color: #9a7ec8;
}

/* ══════════════════════════════════════
   INPUTS GLOBAIS
══════════════════════════════════════ */
input {
  width: 100%;
  padding: 10px 12px;
  margin: 8px 0;
  border: 1.5px solid #e0d4f7;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: #7b2ff7;
}

/* ══════════════════════════════════════
   BOTÕES GLOBAIS
══════════════════════════════════════ */
button {
  width: 100%;
  padding: 11px;
  margin-top: 10px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #c2186c, #7b2ff7);
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
  /* melhor toque no mobile */
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  opacity: 0.92;
}

button:active {
  transform: scale(0.98);
}

.hidden {
  display: none;
}

/* ══════════════════════════════════════
   MENU PRINCIPAL
══════════════════════════════════════ */
.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu button {
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #c2186c, #7b2ff7);
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  font-weight: 600;
  min-height: 44px;
}

.menu button:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

/* ══════════════════════════════════════
   SUBMENU TAREFAS
══════════════════════════════════════ */
.submenuTarefas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submenuTarefas button {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #c2186c, #7b2ff7);
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  min-height: 44px;
}

.submenuTarefas button:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

/* ══════════════════════════════════════
   BOTÕES ESPECIAIS
══════════════════════════════════════ */
.btnLogout {
  margin-top: 16px;
  padding: 12px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #e53935;
  color: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
  min-height: 44px;
}

.btnLogout:hover {
  background: #c62828;
}

.btnvoltar {
  margin-top: 0;
  padding: 10px 16px;
  width: auto;
  border: none;
  border-radius: 10px;
  background: #e53935;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.btnvoltar:hover {
  background: #c62828;
}

#btnVoltarPainel {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #e53935;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

#btnVoltarPainel:hover {
  background: #c62828;
}

/* ══════════════════════════════════════
   TOPO-USER (saudação)
══════════════════════════════════════ */
.topo-user {
  text-align: right;
  font-size: 13px;
  margin-bottom: 10px;
  color: #9a7ec8;
  font-style: italic;
}

/* ══════════════════════════════════════
   TÍTULOS
══════════════════════════════════════ */
h2 {
  color: #3a1a6e;
  margin-bottom: 16px;
  font-size: 18px;
}

h3 {
  color: #3a1a6e;
  margin-bottom: 12px;
  font-size: 16px;
}

/* ══════════════════════════════════════
   CADASTRO FUNCIONÁRIO
══════════════════════════════════════ */
#cadastroFuncionario {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(123,47,247,0.15);
}

#cadastroFuncionario input {
  width: 100%;
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 10px;
  border: 1.5px solid #e0d4f7;
}

/* ══════════════════════════════════════
   MENSAGENS
══════════════════════════════════════ */
.mensagem {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mensagem.ativa {
  display: block;
}

.mensagem.erro {
  background-color: #ffe5f0;
  color: #b30047;
  border: 1px solid #ffb3d1;
}

.mensagem.sucesso {
  background-color: #f0e6ff;
  color: #5a1fa5;
  border: 1px solid #c9a8f5;
}

/* ══════════════════════════════════════
   BUSCA FUNCIONÁRIO
══════════════════════════════════════ */
#buscaFuncionario {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(123,47,247,0.12);
}

#listaFuncionarios {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

#listaFuncionarios li {
  padding: 10px 12px;
  border-bottom: 1px solid #f0e6ff;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

#listaFuncionarios li:hover {
  background: #f5eeff;
}

#detalheFuncionario {
  margin-top: 20px;
  padding: 14px;
  background: #faf5ff;
  border-radius: 10px;
  border: 1px solid #e0d4f7;
}

#detalheFuncionario p {
  margin: 6px 0;
  color: #3a1a6e;
}

/* ══════════════════════════════════════
   CADASTRO TAREFA (com dias)
══════════════════════════════════════ */
#cadastroTarefa {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(123,47,247,0.12);
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: none;
}

#cadastroTarefa input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  margin: 10px 0 15px;
  border-radius: 10px;
  border: 1.5px solid #e0d4f7;
}

#cadastroTarefa::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

.scroll-indicator {
  position: sticky;
  bottom: 10px;
  float: right;
  font-size: 20px;
  color: #7b2ff7;
  opacity: 0.7;
  animation: bounce 1.5s infinite;
  pointer-events: none;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.dias-semana {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.dias-semana label {
  display: grid;
  grid-template-columns: 20px 80px 1fr 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.dias-semana span {
  width: 80px;
  color: #3a1a6e;
  font-size: 14px;
}

.hora {
  width: 90px;
}

.dias-semana input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: #7b2ff7;
}

/* ══════════════════════════════════════
   TOPO AÇÃO (botões topo das telas)
══════════════════════════════════════ */
.topo-acoes {
  margin-bottom: 10px;
}

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

/* ══════════════════════════════════════
   GRUPO DE CAMPO (form)
══════════════════════════════════════ */
.grupo-campo {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.grupo-campo label {
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
  color: #3a1a6e;
}

.grupo-campo input,
.grupo-campo select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0d4f7;
  border-radius: 10px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.grupo-campo input:focus,
.grupo-campo select:focus {
  border-color: #7b2ff7;
}

/* ══════════════════════════════════════
   LISTA DE TAREFAS / CARDS
══════════════════════════════════════ */
.lista-tarefas {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-tarefa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #faf5ff;
  border: 1px solid #e0d4f7;
  min-height: 65px;
  transition: background 0.15s;
}

.card-tarefa:hover {
  background: #f5eeff;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.card-id {
  font-size: 11px;
  color: #9a7ec8;
}

.card-nome {
  font-size: 14px;
  font-weight: bold;
  color: #3a1a6e;
  line-height: 1.2;
}

.card-detalhes {
  font-size: 12px;
  color: #7b5ea7;
}

.card-acoes {
  display: flex;
  gap: 8px;
  margin-left: 10px;
}

.btn-acao {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  padding: 3px;
  width: auto;
  margin-top: 0;
  min-height: unset;
}

/* ══════════════════════════════════════
   CONTAINER LISTA (scroll)
══════════════════════════════════════ */
.container-lista {
  width: 100%;
  max-width: 500px;
  max-height: calc(100dvh - 200px);
  margin: 0 auto;
  overflow-y: auto;
  padding-right: 5px;
}

.container-lista::-webkit-scrollbar {
  width: 6px;
}

.container-lista::-webkit-scrollbar-thumb {
  background: #c9a8f5;
  border-radius: 10px;
}

.titulo-lista {
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  color: #3a1a6e;
  margin-bottom: 14px;
}

/* ══════════════════════════════════════
   CONTAINER TELA
══════════════════════════════════════ */
.container-tela {
  width: 100%;
  padding: 15px;
  box-sizing: border-box;
}

.topo-tela {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.btn-voltar {
  border: 1.5px solid #7b2ff7;
  background: white;
  color: #7b2ff7;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  width: fit-content;
  margin-top: 0;
  transition: all 0.2s;
  min-height: unset;
}

.btn-voltar:hover {
  background: #7b2ff7;
  color: white;
}

/* ══════════════════════════════════════
   DASHBOARD
══════════════════════════════════════ */
.btn-periodo {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid #7b2ff7;
  background: #fff;
  color: #7b2ff7;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  width: auto;
  margin-top: 0;
  min-height: unset;
}

.btn-periodo.ativo {
  background: linear-gradient(90deg, #c2186c, #7b2ff7);
  color: #fff;
  border-color: transparent;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-kpi {
  background: #faf5ff;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  border-left: 4px solid #7b2ff7;
}

.dash-kpi.verde { border-left-color: #2e7d32; }
.dash-kpi.vermelho { border-left-color: #c2186c; }
.dash-kpi.laranja { border-left-color: #e65100; }

.dash-kpi-valor {
  font-size: 28px;
  font-weight: 800;
  color: #3a1a6e;
}

.dash-kpi-label {
  font-size: 12px;
  color: #9a7ec8;
  margin-top: 2px;
}

.dash-section {
  margin-bottom: 18px;
}

.dash-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #3a1a6e;
  margin-bottom: 10px;
  border-bottom: 1.5px solid #e0d4f7;
  padding-bottom: 6px;
}

.dash-rank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #faf5ff;
  border-radius: 8px;
  margin-bottom: 6px;
  border-left: 3px solid #7b2ff7;
}

.dash-rank-nome {
  font-size: 13px;
  font-weight: 600;
  color: #3a1a6e;
}

.dash-rank-val {
  font-size: 13px;
  font-weight: 700;
  color: #7b2ff7;
  background: #f0e6ff;
  padding: 2px 10px;
  border-radius: 12px;
}

.dash-bar-wrap {
  background: #e0d4f7;
  border-radius: 6px;
  height: 8px;
  margin-top: 4px;
}

.dash-bar {
  height: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #c2186c, #7b2ff7);
  transition: width 0.5s;
}

.dash-empty {
  text-align: center;
  color: #c9a8f5;
  font-size: 13px;
  padding: 12px 0;
}

/* ══════════════════════════════════════
   TABELA TAREFAS
══════════════════════════════════════ */
.tabela-tarefas {
  width: 100%;
  border-collapse: collapse;
}

.tabela-tarefas th,
.tabela-tarefas td {
  border: 1px solid #e0d4f7;
  padding: 8px;
  text-align: left;
  color: #3a1a6e;
}

/* ══════════════════════════════════════
   RESPONSIVO — TELAS PEQUENAS (≤ 400px)
══════════════════════════════════════ */
@media (max-width: 400px) {
  .topo-brand {
    font-size: 40px;
  }
  .brand-flow {
    font-size: 50px;
  }
  .topo-slogan {
    font-size: 12px;
  }
  .container {
    padding: 6px 10px 20px;
  }
  .card {
    border-radius: 14px;
  }
  .menu button {
    font-size: 14px;
    padding: 10px 12px;
  }
  .dash-kpi-valor {
    font-size: 22px;
  }
  .logo-container {
    width: 100px;
    height: 100px;
  }
  .logo-spi {
    width: 70px;
  }
}