body {
    margin: 0;
    font-family: "Poppins", sans-serif;

    /* Unified background color */
    background-color: #f5f7fa;

    /* EMC Background */
    background-image: url("../images/bg.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
  }

    /* PAGE CONTENT WRAPPER */
    .center-wrapper {
      flex: 1; 
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
    }

    .container {
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(10px);
      padding: 28px 30px 30px;
      border-radius: 18px;
      box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
      max-width: 900px;
      width: 90%;
      animation: fadeIn 0.8s ease;
    }

    .top-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 18px;
    }

    .title-block h1 {
      font-size: 24px;
      font-weight: 700;
      margin: 0;
      color: #111;
    }

    .welcome-text {
      font-size: 14px;
      color: #555;
      margin-top: 4px;
    }

    .welcome-text span {
      font-weight: 600;
    }

    .signout-btn {
      border: none;
      border-radius: 999px;
      padding: 8px 16px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      background: #e5e7eb;
      color: #111827;
      transition: background 0.2s, transform 0.06s;
    }

    .signout-btn:hover {
      background: #d1d5db;
    }

    .signout-btn:active {
      transform: translateY(1px);
    }

    .main-grid {
      display: flex;
      gap: 50px; 
      margin-top: 10px;
      align-items: stretch;
    }

    .left-panel {
      flex: 0 0 20%;
    }

    .right-panel {
      flex: 1;
      border-radius: 16px;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      padding: 20px 22px;
      font-size: 13px;
      color: #4b5563;
    }

    .right-panel-title {
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 8px;
      color: #111827;
    }

    h2 {
      font-size: 16px;
      margin: 0 0 10px;
      font-weight: 600;
      color: #111827;
    }

    .btn {
      display: block;
      width: 100%;
      padding: 12px 18px;
      margin: 8px 0;
      font-size: 14px;
      font-weight: 600;
      border-radius: 12px;
      border: none;
      cursor: pointer;
      transition: 0.25s;
      text-decoration: none;
      color: white;
      text-align: center;
    }

    .btn-primary { background: #004aad; }
    .btn-primary:hover { background: #003a8d; }

    .btn-secondary { background: #1e75c8; }
    .btn-secondary:hover { background: #155ea3; }

    .btn-green { background: #2e9e47; }
    .btn-green:hover { background: #227a37; }

    .btn-purple { background: #7e44e3; }
    .btn-purple:hover { background: #622bb8; }

    .btn-brown { background: #422604; }
    .btn-brown:hover { background: #361e02; }

    .btn-dark {
      background: #333;
    }
    .btn-dark:hover {
      background: #222;
    }

    .btn-yellow { background: #d7d717; }
    .btn-yellow:hover { background: #cece04; }

    /* Dashboard filters */
    .dashboard-filters {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 14px;
      align-items: flex-end;
      margin-bottom: 12px;
    }

    .dashboard-filter-group {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 12px;
    }

    .dashboard-filter-group label {
      color: #6b7280;
    }

    .dashboard-filter-group input[type="date"] {
      font-family: inherit;
      font-size: 12px;
      padding: 6px 8px;
      border-radius: 6px;
      border: 1px solid #d1d5db;
      background: #ffffff;
    }

    .btn-compact {
      width: auto;
      padding: 8px 14px;
      font-size: 13px;
      margin: 0;
    }

    .dashboard-msg {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 8px;
    }

    .dashboard-error {
      color: #b91c1c;
    }

    /* Stats layout */
    .stats-layout {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 4px;
    }

    .stats-row {
      display: flex;
      gap: 10px;
    }

    .stats-row-three {
      justify-content: space-between;
    }

    .stats-row-three .stat-card {
      flex: 1 1 0;
    }

    .stat-card {
      border-radius: 12px;
      padding: 10px 12px;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .stat-card-main {
      background: linear-gradient(135deg, #004aad, #1e75c8);
      color: #f9fafb;
      border: none;
      padding: 12px 14px;
    }

    .stat-label {
      font-size: 12px;
      color: #6b7280;
    }

    .stat-card-main .stat-label {
      color: #dbeafe;
    }

    .stat-value {
      font-size: 20px;
      font-weight: 700;
      color: #111827;
    }

    .stat-card-main .stat-value {
      color: #ffffff;
    }

    .stat-description {
      font-size: 11px;
      color: #6b7280;
    }

    .stat-card-main .stat-description {
      color: #e5e7eb;
    }

    .chart-block {
      margin-top: 8px;
      padding-top: 6px;
      border-top: 1px dashed #e5e7eb;
    }

    .chart-title {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 4px;
      color: #111827;
    }

    /* New: keep chart small */
    .chart-wrapper {
      width: 100%;
      height: 130px;          
      position: relative;
    }

    .chart-wrapper canvas {
      width: 100% !important;
      height: 100% !important;
    }

    @keyframes fadeIn {
      0% { opacity: 0; transform: translateY(20px); }
      100% { opacity: 1; transform: translateY(0); }
    }

    /* FOOTER */
    footer {
      padding: 18px;
      font-size: 13px;
      color: #666;
      text-align: center;
    }

    @media (max-width: 768px) {
      .container {
        padding: 24px 20px 26px;
      }
      .main-grid {
        flex-direction: column;
      }
      .left-panel {
        flex: 1 1 auto;
      }
    }

    /* ===== Dashboard lock overlay & blur ===== */

.right-panel {
  position: relative;
}

/* Blurred content when locked */
.right-panel-inner.locked {
  filter: blur(6px);
  pointer-events: none;
}

/* Clickable overlay while locked */
.dashboard-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  z-index: 5;
  cursor: pointer;
  text-align: center;
}

.lock-box {
  padding: 16px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.lock-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.lock-text-main {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  margin-bottom: 2px;
}

.lock-text-sub {
  font-size: 12px;
  color: #6b7280;
}

/* ===== PIN modal ===== */

.pin-modal {
  position: fixed;
  inset: 0;
  display: none; /* flex when visible */
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  z-index: 50;
}

.pin-modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 26px 20px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.pin-modal-content h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.pin-modal-content p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #4b5563;
}

#dashboardPinInput {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 18px;
  letter-spacing: 0.3em;
  text-align: center;
  outline: none;
}

#dashboardPinInput:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.pin-error {
  margin-top: 8px;
  min-height: 18px;
  font-size: 12px;
  color: #b91c1c;
}

.pin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}