/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}
body {
  background: #f0f4f9;
  color: #333;
}
/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2563eb;
  padding: 12px 20px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar .logo {
  font-size: 20px;
  font-weight: bold;
}
.navbar .menu {
  display: flex;
  gap: 15px;
}
.navbar .menu a {
  color: white;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.3s;
}
.navbar .menu a:hover {
  background: rgba(255, 255, 255, 0.2);
}
/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  background: #1e3a8a;
  color: white;
  min-height: 100vh;
  padding: 15px;
  position: fixed;
  top: 0;
  left: 0;
}
.sidebar h2 {
  font-size: 18px;
  margin-bottom: 20px;
}
.sidebar a {
  display: block;
  color: white;
  padding: 10px;
  margin: 5px 0;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s;
}
.sidebar a:hover {
  background: #2563eb;
}
/* ===== CONTENT & TOPBAR ===== */
.content {
  margin-left: 220px;
  background: #f0f4f9;
  min-height: 100vh;
}
.topbar {
  background: #2563eb;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* ===== CONTAINER ===== */
.container {
  width: 97%;
  max-width: 1400px;
  margin: 30px auto;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
/* ===== FORM ===== */
form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
form input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.3s;
}
form input:focus {
  border-color: #2563eb;
}
button, .btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}
button:hover, .btn:hover {
  background: #1d4ed8;
}
.error {
  color: red;
  margin-bottom: 10px;
  text-align: center;
}
/* ===== CARD ===== */
.card {
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 10px;
  transition: box-shadow 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.card h3 {
  margin-bottom: 10px;
  font-size: 15px;
  color: #555;
}
.card canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 350px;
  background: white;
  border-radius: 10px;
}
/* ===== GRID DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}
.left-panel .card {
  margin-bottom: 20px;
}
.right-panel {
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== BIG GRID: TRAFFIC + NETWATCH + LOG ===== */
.big-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
/* ===== LOG BOX ===== */
.log-box {
  max-height: 250px;
  overflow-y: auto;
  font-size: 13px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}
.log-box div {
  padding: 6px 8px;
  margin-bottom: 3px;
  border-left: 3px solid #2563eb;
  background: #fff;
  font-family: monospace;
  font-size: 12px;
}
.log-box div:nth-child(even) {
  background: #f3f4f6;
}
.log-box.auto-scroll {
  animation: autoscroll 2s linear infinite;
  scroll-behavior: smooth;
}
.log-box div.new {
  background: #e0ecff;
  transition: background 1s ease;
}
@keyframes autoscroll {
  0% { scroll-behavior: smooth; }
  100% { scroll-behavior: smooth; }
}
/* ===== MAPS ===== */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#map {
  width: 100%;
  height: 100vh;
}
/* ===== SEARCH BOX ===== */
.search-box {
  margin: 10px 0 15px 0;
  text-align: left;
}
.search-box input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  min-width: 250px;
  transition: all 0.3s ease;
}
.search-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.4);
  outline: none;
}
.search-box button {
  padding: 8px 15px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-left: 8px;
  transition: background 0.3s ease;
}
.search-box button:hover {
  background: #1d4ed8;
}
/* ===== LEGEND ===== */
.legend {
  background: white;
  padding: 10px;
  line-height: 20px;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: absolute;
  bottom: 20px;
  left: 240px;
  z-index: 1000;
}
.legend h4 {
  margin: 0 0 5px;
  font-size: 14px;
}
.legend span {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
}
/* ===== POPUP ===== */
.popup-info {
  font-size: 13px;
  line-height: 1.5;
}
.popup-info b {
  color: #2563eb;
}
/* ===== MAP CONTROLS ===== */
.map-controls button {
  margin-right: 5px;
  padding: 5px 10px;
  border: none;
  background: #2563eb;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}
.map-controls button:hover {
  background: #1e40af;
}
/* ===== FILTERS ===== */
#mapControls {
  position: absolute;
  top: 10px;
  left: 240px;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#ontStatusFilter, #searchBox {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}
/* ===== ANIMATIONS ===== */
.blink {
  animation: blink 1s infinite;
}
@keyframes blink {
  0% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.1; }
  100% { stroke-opacity: 1; }
}
.leaflet-popup-input {
    width: 100%;
    padding: 5px;
    margin: 3px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}