body, html {
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f7f9fb 0%, #e3e6f3 100%);
  color: #232946;
  min-height: 100vh;
}

.topbar {
  /* position: fixed; */
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 1000;
  background: linear-gradient(90deg, rgba(35,41,70,0.92) 0%, rgba(44,62,80,0.88) 100%);
  box-shadow: 0 8px 32px 0 rgba(44,62,80,0.18);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 0 36px 8px 36px;
  border-radius: 0 0 24px 24px;
  border-bottom: 1.5px solid rgba(238,191,99,0.13);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: box-shadow 0.22s, background 0.22s;
}

.topbar:hover {
  box-shadow: 0 12px 36px 0 rgba(238,191,99,0.10);
  background: linear-gradient(90deg, rgba(35,41,70,0.97) 0%, rgba(44,62,80,0.93) 100%);
}

.topbar-logos {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  margin-right: 20%;
  background: rgba(255,255,255,0.92);
  border-radius: 32px;
  box-shadow: 0 2px 12px rgba(44,62,80,0.10);
  padding: 7px 26px;
  margin-top: 0;
  min-width: 0;
  margin-right: 20%;
  border: 1px solid #eaeaea;
  transition: background 0.18s, box-shadow 0.18s;
}
.topbar-logos:hover {
  background: #fff;
  box-shadow: 0 4px 18px rgba(238,191,99,0.10);
}

.topbar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  background: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.10));
  transition: transform 0.18s, filter 0.18s;
  border-radius: 12px;
  padding: 2px 0;
}
.topbar-logo:hover {
  transform: scale(1.10) rotate(-2deg);
  filter: drop-shadow(0 2px 8px rgba(238,191,99,0.18));
  background: #f7f7fa;
}

.topbar-title {
  font-size: 1.7rem;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.13);
  margin: 0 0 0 0;
  text-align: left;
  margin-left: 10%;
  line-height: 1.2;
  flex: 1 1 auto;
  padding-left: 8px;
  user-select: none;
}

/* --- Layout --- */
.dashboard-main {
  padding-top: 110px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
  /* Responsive padding handled below */
}

.dashboard-flex {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.left-panel {
  flex: 1 1 320px;
  min-width: 220px;
  max-width: 400px;
}

.right-panel {
  flex: 2 1 600px;
  min-width: 220px;
  max-width: 900px;
  gap: 18px;
}

/* Responsive panels and dashboard */
@media (max-width: 900px) {
  .dashboard-main {
    padding-top: 74px;
    padding-left: 1vw;
    padding-right: 1vw;
  }
  .dashboard-flex {
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
  }
  .left-panel, .right-panel {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .right-panel {
    margin-top: 0;
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .dashboard-main {
    padding-top: 52px;
    padding-left: 0;
    padding-right: 0;
  }
  .left-panel, .right-panel {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }
  .dashboard-flex {
    gap: 8px;
  }
}

/* --- Cards --- */
.card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.09);
  padding: 20px 18px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1.5px solid #eaeaea;
  transition: box-shadow 0.18s;
}
.card:active, .card:focus-within {
  box-shadow: 0 6px 24px rgba(238,191,99,0.13);
  border-color: #eebf63;
}
.card h3 {
  margin: 0 0 10px 0;
  font-size: 1.13rem;
  color: #232946;
  font-weight: 600;
}
@media (max-width: 600px) {
  .card {
    padding: 10px 2vw 10px 2vw;
    border-radius: 10px;
  }
}

/* --- Forms & Inputs --- */
form label {
  font-weight: 500;
  margin-top: 8px;
  font-size: 0.98em;
}
input[type="file"],
input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  margin-bottom: 10px;
  border-radius: 7px;
  border: 1.5px solid #d1d5db;
  background: #f7f7fa;
  font-size: 1em;
  transition: border 0.15s;
}
input[type="file"]:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border: 1.5px solid #eebf63;
  outline: none;
}

/* --- Buttons --- */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background-color: #232946;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.18s, color 0.18s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
button:disabled {
  background: #bdbdbd;
  color: #fff;
  cursor: not-allowed;
}
button:hover:enabled {
  background: #eebf63;
  color: #232946;
}

/* Inline button group for manual process */
.btn-group-inline {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
}
.btn-group-inline button {
  flex: 1;
  max-width: calc(33.33% - 10px);
  min-width: 0;
  box-sizing: border-box;
}
#manualProcessBtns {
  overflow: hidden;
  width: 100%;
}
#manualProcessBtns button {
  font-size: 0.9rem;
  padding: 8px 14px;
}

/* --- Progress Bar --- */
#progressBarContainer {
  width: 100%;
  background-color: #eaeaea;
  margin-top: 10px;
  height: 18px;
  border-radius: 8px;
  overflow: hidden;
}
#progressBar {
  height: 100%;
  width: 0%;
  background-color: #eebf63;
  transition: width 0.3s ease;
}

/* --- Logs --- */
#log {
  white-space: pre;
  background: #181818;
  color: #eebf63;
  padding: 1em;
  margin-top: 12px;
  height: 350px;
  overflow-y: auto;
  border-radius: 10px;
  font-size: 1em;
  font-family: 'Fira Mono', 'Consolas', monospace;
}
@media (max-width: 600px) {
  #log {
    height: 90px;
    font-size: 0.93em;
  }
}

/* --- 3D Viewer --- */
.viewer-section {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
#viewer3d {
  width: 100% !important;
  max-width: 100vw;
  min-width: 0;
  height: 45vw;
  min-height: 140px;
  max-height: 70vh;
  margin-top: 10px;
  border: 1.5px solid #eaeaea;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.09);
  background: #f7f7fa;
  overflow: hidden;
}
@media (max-width: 900px) {
  #viewer3d {
    height: 220px;
    max-width: 100%;
  }
}
@media (max-width: 600px) {
  #viewer3d {
    height: 140px;
  }
}

/* --- Cracks List --- */
.cracks-list {
  margin-top: 18px;
  max-height: 180px;
  overflow-y: auto;
  background: #f7f7fa;
  padding: 14px;
  border-radius: 10px;
  font-size: 1.01em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1.5px solid #eaeaea;
}
.cracks-list p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #232946;
}
.cracks-list li {
  cursor: pointer;
  padding: 7px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  color: #232946;
  background: #eaeaea;
  transition: background 0.15s, color 0.15s;
}
.cracks-list li:hover {
  background-color: #eebf63;
  color: #232946;
  font-weight: 600;
}

/* --- Weather Modal & Map --- */
#weatherEventsModal {
  display: none;
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1.5px solid #eebf63;
  padding: 24px 20px;
  z-index: 1000;
  max-width: 400px;
  box-shadow: 0 2px 18px rgba(0,0,0,0.13);
  border-radius: 14px;
}
#weatherEventsModal h4 { margin-top: 0; }
#weatherEventsModal form label { margin-top: 10px; }
#weatherEventsModal form input {
  width: 100%;
  padding: 7px;
  box-sizing: border-box;
  border-radius: 7px;
  border: 1.5px solid #d1d5db;
  background: #f7f7fa;
}
#weatherEventsList {
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
  border-top: 1.5px solid #eebf63;
  padding-top: 10px;
}
#map {
  height: 400px;
  width: 100%;
  margin-top: 0;
  border-radius: 10px;
  border: 1.5px solid #eaeaea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
@media (max-width: 900px) {
  #map { height: 220px; max-width: 100vw; }
}
@media (max-width: 600px) {
  #map { height: 140px; max-width: 100vw; }
}

/* --- Video Duration Slider --- */
#videoDurationSliderContainer {
  position: relative;
  width: 100%;
  height: 40px;
  margin-bottom: 10px;
}
#videoDurationSliderContainer input[type=range] {
  position: absolute;
  pointer-events: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: transparent;
  margin: 0;
  padding: 0;
}
#videoDurationSliderContainer input[type=range]::-webkit-slider-thumb,
#videoDurationSliderContainer input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  position: relative;
  z-index: 1;
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #eebf63;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.5);
}
#sliderTrack {
  position: absolute;
  height: 8px;
  border-radius: 5px;
  background: #eaeaea;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  z-index: 0;
}
#sliderRange {
  position: absolute;
  height: 8px;
  border-radius: 5px;
  background: #eebf63;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}
#timeDisplays {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}

