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

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

body {
  background-color: #e9f8f4;
  min-height: 100vh;
}

/* Loader styles */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #e9f8f4;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 70px;
  height: 70px;
  border: 6px solid #cfd9df;
  border-top: 6px solid #1e8c72;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body.loaded #loader {
  display: none;
}

/* HEADER */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: #1e8c72;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 30px;
  z-index: 1000;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e8c72;
  color: white;
  padding: 15px 40px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-circle {
  width: 45px;
  height: 45px;
  background-color: white;
  color: #1e8c72;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
}

header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

.header-right i {
  font-size: 22px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.header-right i:hover {
  color: #c9f2e6;
}

.clock {
  font-size: 18px;
  font-weight: 600;
  background: #e9f8f4;
  color: #1e8c72;
  padding: 5px 10px;
  border-radius: 5px;
}

.menu-container {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background-color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  z-index: 1000;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
}

.dropdown-menu a:hover {
  background-color: #f0f0f0;
}

.show {
  display: block;
}

/* DASHBOARD GRID */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;

  /* Center horizontally with equal distance from left and right */
  max-width: 1200px;
  margin: 100px auto 40px auto; /* top margin avoids fixed header */
  padding: 0 20px; /* padding for small screens */
  box-sizing: border-box;
}

/* CARD STYLES */
.card {
  min-width: 200px;
  max-width: 100%; /* responsive */
  min-height: 100px;
  max-height: 200px;
  border-style: none;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.5s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: scale(1.07);
}

.card .button_header {
  display: flex;
  justify-content: flex-end;
  align-items: center; 
}

.card i {
  align-items: right;  
  font-size: 48px;
  color: #1e8c72;
}

.card h1 {
  text-align: left;
  margin: 10px 0;
}

.card p {
  text-align: left;
  font-size: 14px;
  color: #555;
  margin: 10px 0;
}

.card .button_details {
  display: flex;
  justify-content: right; 
  align-items: center;            
  width: 100%;                    
  margin-top: 15px;
}

.card .a {
  color: #0077cc;
  font-weight: 500;
  text-decoration: none;
  text-align: right;              
}

.card .a:hover {
  text-decoration: underline;
}

/* RESPONSIVE DESIGN */

/* Tablets */
@media (max-width: 1024px) {
  .dashboard {
    gap: 30px;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr; /* single column */
    gap: 20px;
    padding: 0 15px;
  }

  header h1 {
    font-size: 18px;
  }

  .header-right i {
    font-size: 18px;
  }

  .clock {
    font-size: 14px;
    padding: 3px 6px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .header {
    padding: 10px 15px;
  }

  .logo-circle {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  header h1 {
    font-size: 16px;
  }

  .dashboard {
    padding: 0 10px;
  }

  .card {
    padding: 15px;
  }

  .card h1 {
    font-size: 18px;
  }

  .card p {
    font-size: 13px;
  }
}
