@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap');

:root {
  --green-light: #E7F7EC;
  --green-medium: #3A7E55;
  --green-dark: #255D3C;
  --gray-text: #8491A9;
  --gray-light: #F4F6F7;
  --background-card-product: #F8FCF9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Estilos base */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Inter', sans-serif, 'Quicksand', sans-serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

h1, h2, h3 {
  color: #2c3e50;
  margin-top: 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ==================== */
/* ESTILOS DEL DASHBOARD */
/* ==================== */

.dashboard-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1200px;
  height: 320px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

.dashboard-illustration {
  top: -90px;
  left: -20px;
  max-width: 600px;
  width: 100%;
  height: auto;
  background-color: transparent; /* Eliminado el fondo */
  border-radius: 10px;
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  color: #7f8c8d;
  font-size: 18px;
}

.dashboard-illustration img {
  max-width: 1300px;
  width: 100%;
  height: auto;
}

.dashboard-container {
  top: 10px;
  right: 100px;
  max-width: 450px;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.dashboard-title {
  font-size: 1.8rem;
  color: #2c3e50;
  margin-bottom: 30px;
  text-align: center;
}

.latest-values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

.latest-values-grid .timestamp-card {
  grid-column: -1;
  margin-left: auto;
}

.value-card {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  border-left: 4px solid #3498db;
}

.value-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.value-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #3498db;
  font-size: 1.1rem;
}

.value-card .value {
  font-size: 1.8rem;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 5px;
}

.timestamp-card {
  padding: 15px;
  background: #2c3e50;
  color: white;
  border-radius: 8px;
  text-align: center;
  min-width: 180px;
  height: fit-content;
}

.timestamp-card .label {
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #ecf0f1;
}

.timestamp-card .value {
  font-size: 1.1rem;
  font-weight: bold;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

.chart-card {
  padding: 15px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #eee;
}

.chart-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 1.1rem;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.chart-wrapper {
  position: relative;
  height: 250px;
  width: 100%;
}

.updating {
  animation: pulseUpdate 1.5s;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  margin: 5px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.btn-primary {
  background-color: #4DA871;
  color: white;
}

.btn-primary:hover {
  background-color: #3A7E55;
}

.btn-success {
  background-color: #4DA871;
  color: white;
}

.btn-success:hover {
  background-color: #3A7E55;
}


.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-filters {
    display: flex;
    gap: 10px;
}

.btn-filter {
    padding: 8px 15px;
    border-radius: 5px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid #ddd;
}

.btn-filter.active {
    background: var(--green-medium);
    color: white;
    border-color: var(--green-dark);
}

.btn-filter:hover {
    background: #e0e0e0;
}

.btn-filter.active:hover {
    background: var(--green-dark);
}

.dashboard-card-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-card.completed {
    opacity: 0.8;
    border: 1px dashed #aaa;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 12px;
}

.status-badge.completed {
    background: #6c757d;
}

.complete-form {
    margin-top: 10px;
    text-align: center;
}

.btn-complete {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-complete:hover {
    background: #e0a800;
}

/* Header y acciones */
.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
  width: 100%;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
  width: 100%;
}

/* Alertas */
.alert {
  padding: 15px 20px;
  margin-bottom: 25px;
  border: 1px solid transparent;
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  width: 100%;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 300%;
  background-color: rgba(0,0,0,0.5);
  margin-top: -50px;
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 15px;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  animation: modalFadeIn 0.2s;
}

@keyframes modalFadeIn {
  from {opacity: 0; transform: translateY(-30px);}
  to {opacity: 1; transform: translateY(0);}
}

.close {
  color: #aaa;
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #555;
}

/* Formularios */
.form-group {
  margin-bottom: 15px;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #495057;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
  outline: none;
}


/* ==================== */
/* ESTILOS PARA MEDICIONES */
/* ==================== */

.measurements-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.checkbox-group {
    margin: 12px 0;
    padding: 10px;
    background: white;
    border-radius: 5px;
    transition: all 0.3s;
}

.checkbox-group:hover {
    background: #e9ecef;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

/* Estilos para el grid de mediciones */
.measurements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.measurement-option button {
    width: 100%;
    padding: 12px;
    background: #E7F7EC;
    color: #8491A9;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.measurement-option button:hover {
    color: white;
    background: #3A7E55;
    transform: translateY(-2px);
}

/* Dashboard Page */
.dashboard-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  background-color: #fdfdfd;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  width: 100%;
}

.dashboard-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  color: #1e272e;
  margin-bottom: 50px;
  position: relative;
}

.dashboard-title::after {
  content: "";
  width: 80px;
  height: 4px;
  background-color: #4DA871;
  display: block;
  margin: 18px auto 0;
  border-radius: 4px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  justify-content: center;
  width: 100%;
}

.dashboard-card {
  width: 100%;
  max-width: 450px;
  min-height: 180px;
  padding: 25px 20px;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  background: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #4DA871;
  text-decoration: none;
  color: #2c3e50;
}

.dashboard-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border-color: #3A7E55;
}

.dashboard-icon {
  margin-bottom: 20px;
}

.dashboard-icon svg {
  width: 50px;
  height: 50px;
  fill: #3A7E55;
  transition: fill 0.3s ease;
}

.dashboard-card:hover .dashboard-icon svg {
  fill: #255D3C;
}

.dashboard-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d3436;
}

.dashboard-card p {
  font-size: 0.95rem;
  color: #636e72;
  margin: 0;
}

.no-dashboards {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.1rem;
  color: #95a5a6;
  padding: 50px 0;
}


/* Responsive */
@media (max-width: 768px) {
  
  .container {
    padding: 0 15px;
  }

  .header-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .latest-values-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-content {
    width: 95%;
    margin: 15% auto;
  }

}

@media (max-width: 480px) {
  
  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .latest-values-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrapper {
    height: 200px;
  }

  .value-card .value {
    font-size: 1.5rem;
  }

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

  .dashboard-card {
    min-height: 150px;
  }
}



.reactivate-form, .complete-form {
    text-align: center;
    margin-top: 5px;
}

.reactivate-btn {
    padding: 8px 15px;
    background: var(--green-medium);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.reactivate-btn:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.complete-btn {
    padding: 8px 15px;
    background: var(--green-medium);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.complete-btn:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6c757d;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}


/* Ajuste para páginas dentro de proyecto-crud */
.crud-page-content,
.py-4 {
    margin-top: 150px;
}

@media (max-width: 768px) {
    .crud-page-content,
    .py-4 {
        margin-top: 110px;
    }
}