*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
}

.container-main {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  padding: 40px 30px;
  margin: 20px auto;
  width: 95%;
  max-width: 1200px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(31, 78, 120, 0.12);
  border-left: 6px solid #1f4e78;
  position: relative;
  overflow: hidden;
}

.container-main::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.img-main {
  margin-bottom: 20px;
}

.img-main img {
  max-width: 100%;
  height: auto;
  width: 80px;
  filter: drop-shadow(0 4px 8px rgba(31, 78, 120, 0.1));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-main img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 12px rgba(31, 78, 120, 0.15));
}

h1 {
  background: linear-gradient(135deg, #1f4e78 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5em;
  margin: 10px 0 5px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.titulo p {
  color: #666;
  font-size: 1.05em;
  margin: 0;
}

/* === FILTROS === */
.filtros {
  width: 100%;
  margin: 20px 0 0 0;
  padding: 0;
}

.filtros input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  color: #1a1a1a;
  background-color: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filtros input::placeholder {
  color: #999;
}

.filtros input:focus {
  outline: none;
  border-color: #4facfe;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* === DASHBOARD DE ESTATÍSTICAS === */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  width: 95%;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(31, 78, 120, 0.08);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 5px solid #4facfe;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(79, 172, 254, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(31, 78, 120, 0.15);
}

.stat-icon {
  font-size: 2.5em;
  min-width: 60px;
  text-align: center;
  color: #1f4e78;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.stat-info {
  flex: 1;
}

.stat-info h3 {
  color: #1f4e78;
  font-size: 0.95em;
  margin: 0 0 8px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 2.2em;
  font-weight: 800;
  background: linear-gradient(135deg, #1f4e78 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* === BOTÕES DE AÇÃO === */
.botoes-acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 15px;
  margin: 25px auto;
  padding: 0 20px;
  width: 95%;
  max-width: 1200px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  color: #fff;
  white-space: nowrap;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button:active::before {
  width: 300px;
  height: 300px;
}

.gerar-pdf,
.bttn-add-ocorrencia {
  background: linear-gradient(135deg, #1f4e78 0%, #3a6fa8 100%);
}

.gerar-pdf:hover,
.bttn-add-ocorrencia:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 78, 120, 0.25);
}

.gerar-pdf:active,
.bttn-add-ocorrencia:active {
  transform: translateY(0);
}

button i {
  font-size: 1.1em;
}

/* === CONTAINER DA TABELA === */
.tabela-ocorrencias {
  width: 95%;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0;
  background-color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(31, 78, 120, 0.12);
  overflow: hidden;
}

/* === TABELA === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  min-width: 700px;
}

thead {
  background: linear-gradient(135deg, #1f4e78 0%, #3a6fa8 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  padding: 16px 12px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: none;
}

tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody tr:hover {
  background-color: #f9fafb;
  box-shadow: inset 0 0 0 1px #e0e0e0;
}

tbody tr:last-child {
  border-bottom: none;
}

td {
  padding: 14px 12px;
  text-align: left;
  font-size: 0.95rem;
  color: #1a1a1a;
  border: none;
}

td:last-child {
  text-align: center;
}

/* === BADGES DE CATEGORIA === */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.badge-ausencia {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: #fff;
}

.badge-comportamento {
  background: linear-gradient(135deg, #ffd93d 0%, #ffb300 100%);
  color: #333;
}

.badge-celular {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}

/* === AÇÕES NA TABELA === */
.acoes-cell {
  display: flex;
  justify-content: center;
  gap: 8px;
}

td button {
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #1f4e78;
}

td button:hover {
  background-color: #f0f0f0;
  color: #d62828;
}

td button i {
  font-size: 1em;
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.painel-add-ocorrencias {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 8px 24px rgba(31, 78, 120, 0.15);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 6px solid #4facfe;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === FORMULÁRIO === */
#form-ocorrencia {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#form-ocorrencia h3 {
  background: linear-gradient(135deg, #1f4e78 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5em;
  margin: 0 0 15px 0;
  font-weight: 800;
}

#form-ocorrencia label {
  display: block;
  color: #1f4e78;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  color: #1a1a1a;
  background-color: #f9fafb;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]::placeholder,
input[type="date"]::placeholder,
select::placeholder,
textarea::placeholder {
  color: #999;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4facfe;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f4e78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 40px;
}

/* === MODAL BUTTONS === */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.add-bttn {
  background: linear-gradient(135deg, #06a77d 0%, #048860 100%);
}

.add-bttn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(6, 167, 125, 0.3);
}

.cancel-bttn {
  background: linear-gradient(135deg, #c2c2c2 0%, #a8a8a8 100%);
  color: #333;
}

.cancel-bttn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(162, 162, 162, 0.3);
}

/* === SCROLLBAR CUSTOMIZADO === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f7fa;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #1f4e78 0%, #4facfe 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #3a6fa8 0%, #00f2fe 100%);
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
  .container-main {
    padding: 30px 20px;
    margin: 15px auto;
  }

  h1 {
    font-size: 2em;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-number {
    font-size: 2em;
  }

  .botoes-acoes {
    flex-direction: column;
    gap: 10px;
  }

  button {
    width: 100%;
    padding: 12px 16px;
  }

  .painel-add-ocorrencias {
    max-width: 100%;
  }

  #form-ocorrencia {
    gap: 14px;
  }

  .modal-buttons {
    flex-direction: column-reverse;
  }

  .add-bttn,
  .cancel-bttn {
    width: 100%;
  }

  table {
    min-width: 100%;
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 10px 8px;
  }

  th {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .container-main {
    padding: 20px 15px;
    border-radius: 10px;
  }

  h1 {
    font-size: 1.5em;
  }

  .img-main img {
    width: 65px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px auto;
  }

  .stat-card {
    padding: 15px;
    gap: 15px;
  }

  .stat-icon {
    font-size: 2em;
  }

  .stat-info h3 {
    font-size: 0.85em;
  }

  .stat-number {
    font-size: 1.8em;
  }

  .botoes-acoes {
    width: 100%;
    padding: 0;
    margin: 15px auto;
  }

  .painel-add-ocorrencias {
    padding: 20px;
  }

  #form-ocorrencia h3 {
    font-size: 1.2em;
  }

  table {
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 8px 6px;
  }

  .modal {
    padding: 10px;
  }

  .badge {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}