/* GLOBAL RESET */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: url("dark-grey.jpg") no-repeat center center fixed;
  background-size: cover;
}

/* GLOBAL BASE FONT SIZE */
body {
  font-size: 12px;
}

/* FIX GRAPH LABEL SIZE */
canvas {
  font-size: 10px !important;
}

.header {
  background-color: #dcdcdc;
  border: 3px solid #ff7a00;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin: 20px 20px 10px 20px;
  border-radius: 12px;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.header::before {
  content: none !important;
}

.header img,
.logo-left,
.logo-right {
  position: relative;
  z-index: 5;
}


.logo-left,
.logo-right {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.header-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0;
}

/* MAIN DASHBOARD LAYOUT */
.dashboard {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 100px);
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

/* LEFT COLUMN */
.left-column {
  flex: 0.8;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 10%, #f0f1f3 0%, transparent 38%),
    radial-gradient(circle at 85% 75%, #d5d8dd 0%, transparent 35%),
    linear-gradient(135deg, #f0f1f3 0%, #b5b8bd 35%, #7b8087 65%, #4a4f55 100%);
}

.left-column::after {
  content: "";
  position: absolute;
  left: -10%;
  bottom: 5%;
  width: 120%;
  height: 180px;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.65),
    rgba(220, 225, 230, 0.35) 25%,
    rgba(100, 105, 112, 0.15) 60%,
    transparent
  );
  transform: rotate(-8deg);
  box-shadow:
    0 -8px 20px rgba(255, 255, 255, 0.25),
    0 15px 40px rgba(40, 45, 55, 0.4);
}

/* CUSTOMER BOXES */
.customer-box {
  background: radial-gradient(circle at 25% 8%, rgba(255,255,255,0.22) 0%, transparent 28%),
              radial-gradient(circle at 80% 85%, rgba(120,130,140,0.18) 0%, transparent 40%),
              linear-gradient(135deg, #555a60 0%, #30353b 45%, #171a1e 100%);
  border: 2px solid #ff7a00;   /* ⭐ same orange as right-top boxes */
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.customer-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.customer-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: white;
}

.device-item,
.sensor-item {
  font-size: 11px;
  color: white;
  padding: 3px 0;
  margin-left: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.customer-box strong {
  font-size: 12px;
  color: white;
  display: block;
  margin-top: 4px;
  margin-bottom: 2px;
}

/* RIGHT SIDE */
.right-side {
  flex: 2.2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* RIGHT TOP */
.right-top {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;

  height: 400px;        /* fixed, tall like before */
  overflow-y: auto;     /* scroll inside */
  flex-shrink: 0;

  background-image: url("Nafas background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
border: 3px solid #ff7a00; 
  border-radius: 12px;  
}


/* RIGHT BOTTOM — unified map box */
.right-bottom {
  display: block;          /* ⭐ stop flex split */
  width: 100%;             /* full width of right side */
  height: 380px;           /* ⭐ visible height */
  box-sizing: border-box;
}
.bottom-box {
  background: #f4f4f4;
  border: 2px solid #ff7a00;
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
#map {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #e9e9e9;   /* ⭐ light gray background */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}


/* DEVICE + SENSOR ROWS */
.device-row,
.sensor-row {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 10px;
}

.device-box {
  background: #333333;
  border: 2px solid #ff7a00;
  border-radius: 12px;
  overflow: hidden;
  padding: 8px 10px;     /* ⭐ compact padding */
  color: white;
  min-width: 250px;
  min-height: 130px;
  backdrop-filter: blur(4px);
  margin-bottom: 6px;    /* ⭐ reduce gap below */
}
.device-title,
.device-status-row,
.device-voltage,
.device-amp,
.device-maintenance-text {
  margin-bottom: 4px;     /* ⭐ reduce spacing between items */
}

.maintenance-bar {
  height: 6px;            /* ⭐ thinner bar */
  margin-top: 4px;
}

.device-controls {
  margin-top: 6px;        /* ⭐ smaller gap before buttons */
}

/* SENSOR BOX */
.sensor-box {
  background: #333333;
  border: 2px solid #ff7a00;
  border-radius: 12px;
  padding: 15px;
  color: white;
  min-width: 250px;
  backdrop-filter: blur(4px);
  min-height: 100px;
  margin-top: -px;   /* ⭐ main fix: reduce gap */
}
/* SENSOR CHART HEIGHT */
.sensor-box canvas {
  height: 80px !important;
  max-height: 80px !important;
}

.customer-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;   /* ⭐ MUCH smaller gap */
  color: white;
  line-height: 1.1;     /* ⭐ reduces vertical space even more */
}

/* DEVICE CONTROLS */
.device-box .device-controls {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.device-box .device-controls button {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: none;
  font-size: 9px !important;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: 0.2s ease;
}

.device-box .power-btn.on { background: #00c853; }
.device-box .power-btn.off { background: #d50000; }
.device-box .reset-btn { background: #757575; }

/* STATUS INDICATORS */
.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-on { background-color: #00ff4c; }
.status-off { background-color: #ff3b3b; }

.device-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* MAINTENANCE BAR */
.maintenance-bar {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, #00ff4c, #ff3b3b);
  margin-top: 4px;
}

/* DEVICE BOX FONT SIZE */
.device-box * {
  font-size: 11px !important;
}

.device-box.empty {
  background: rgba(0, 0, 0, 0.35);   /* ⭐ keep blur working */
  border: none;
  padding: 10px;                    /* ⭐ reveals rounded corners */
  min-width: 0;
  min-height: 130px;
  border-radius: 12px;              /* ⭐ preserve shape */
  overflow: hidden;                 /* ⭐ children respect radius */
  visibility: hidden;               /* ⭐ hide content but keep box */
}
.device-row {
  align-items: flex-start;   
  overflow: visible;   
margin-top: -4px;      
}
.sensor-row {
  align-items: flex-start;
flex-wrap: wrap;
}
.right-bottom,
.right-column,
.device-sensor-wrapper {
  gap: 0px;
  margin: 0px;
  padding: 0px;
}
/* GREEN — device ON */
.radar-pulse-green {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(0, 255, 120, 0.9);
  color: rgba(0, 255, 120, 1); /* ⭐ REQUIRED */
  border-radius: 50%;
  animation: pulseExpand 1.6s ease-out infinite;
  pointer-events: none;
}

/* ORANGE — warning */
.radar-pulse-orange {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 150, 0, 0.9);
  color: rgba(255, 150, 0, 1); /* ⭐ REQUIRED */
  border-radius: 50%;
  animation: pulseExpand 1.6s ease-out infinite;
  pointer-events: none;
}

/* RED — device OFF */
.radar-pulse-red {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 0, 0, 0.9);
  color: rgba(255, 0, 0, 1); /* ⭐ REQUIRED */
  border-radius: 50%;
  animation: pulseExpand 1.6s ease-out infinite;
  pointer-events: none;
}
/* Shared animation */
@keyframes pulseExpand {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
    box-shadow: 0 0 6px currentColor;
  }
  50% {
    transform: scale(1.8);
    opacity: 0.4;
    box-shadow: 0 0 22px currentColor;
  }
  100% {
    transform: scale(4.2);
    opacity: 0;
    box-shadow: 0 0 0px currentColor;
  }
}
/* ⭐ Logout icon styling — safe */
.logout-icon {
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 9999;        /* stays above logos + title */
  pointer-events: auto; /* ensures cursor always shows */
}

.logout-icon:hover {
  transform: scale(1.15);
}

/* ⭐ Prevent title from overlapping icon */
.header-title {
  line-height: 1.1;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}

/* ⭐ Right group stays flex (but does NOT override your header) */
.right-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ⭐ Hide old logout button */
.logout-btn {
  display: none !important;
}