* { box-sizing: border-box; }
body { margin: 0; padding: 0; background-color: #646464; max-height: 100%; display: flex; flex-direction: column; position: relative; font-family: Arial, Helvetica, sans-serif; }
.hidden { display: none !important; }
button { cursor: pointer; }

.login-tab {
  font-family: Arial, Helvetica, sans-serif;
  position: fixed;
  max-width: 90%;
  width: 400px;
  min-height: 300px;
  background: rgba(230, 235, 250, .94);
  border: 1px solid black;
  border-radius: 20px;
  padding: 20px;
  margin: auto;
  inset: 0;
  z-index: 2000;
}
.login-tab form { display: grid; gap: 12px; }
.login-tab h1 { margin: 0; font-size: 24px; }
.login-tab label { display: grid; gap: 6px; font-weight: bold; }
.login-tab input { min-height: 36px; border: 1px solid #777; border-radius: 8px; padding: 8px; }
.login-tab button, .admin-panel button {
  background-color: #3C6FCD;
  color: white;
  border: none;
  padding: 9px 14px;
  border-radius: 4px;
}
#loginError { color: #b42318; min-height: 20px; margin: 0; }

.topmenu {
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(10px + .3vw);
  color: black;
  z-index: 900;
  align-items: center;
  left: 10px;
  right: 10px;
  top: 10px;
  background: rgba(230, 235, 250, .905);
  display: inline-flex;
  position: fixed;
  border-radius: 18px;
  padding: 15px;
  gap: 10px;
}
#leading_text { color: black; font-weight: bold; margin: 0; white-space: nowrap; }
.top-spacer { padding-left: 2%; }
.input {
  height: 3.5vh;
  min-height: 32px;
  width: min(430px, 42vw);
  background: rgba(248, 253, 255, .062);
  white-space: nowrap;
  font-weight: bold;
  font-family: Arial, sans-serif;
  line-height: 1.2;
  border: 2px solid currentColor;
  color: currentColor;
  border-radius: 10px;
  padding: 0 9px;
}
.input::placeholder { color: rgb(150, 150, 150); opacity: 1; font-size: 13px; }
.icon-button { border: 0; background: rgba(255,255,255,.7); border-radius: 12px; min-height: 30px; padding: 0 10px; }
.login, .hideshow, .info {
  cursor: pointer;
  display: flex;
  border-radius: 15px;
  background-color: white;
  width: 30px;
  height: 30px;
  border: 0;
  align-items: center;
  justify-content: center;
}
.login img, .hideshow img, .info img { opacity: .7; width: 24px; height: 24px; object-fit: contain; }

#hint {
  overflow-y: auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(10px + .3vw);
  color: black;
  z-index: 900;
  top: 90px;
  left: 50px;
  min-height: 20px;
  max-height: 400px;
  background: rgba(230, 235, 250, .905);
  border-radius: 4px;
  position: fixed;
  padding: 10px;
  display: none;
}
#rowhint { text-align: left !important; background-color: transparent; border: 0; border-radius: 0; width: 100%; padding-bottom: 5px; display: block; }
#rowhint:hover { background-color: #b6b6b6; }

.rightmenu::-webkit-scrollbar-thumb, .report::-webkit-scrollbar-thumb, #popup-window::-webkit-scrollbar-thumb, #hint::-webkit-scrollbar-thumb {
  background-color: gray;
  border: 4px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}
.rightmenu::-webkit-scrollbar, .report::-webkit-scrollbar, #popup-window::-webkit-scrollbar, #hint::-webkit-scrollbar { width: 16px; }
.rightmenu {
  overflow-y: auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: black;
  z-index: 900;
  right: 14px;
  top: 92px;
  width: 22%;
  min-width: 260px;
  max-width: 360px;
  max-height: calc(100svh - 116px);
  background: rgba(230, 235, 250, .905);
  display: block;
  border-radius: 18px;
  position: fixed;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.rightmenu.side-hidden { display: none; }
.rightmenu #generateSelectedHeatmap { width: 35px; border: none; background-color: transparent; cursor: pointer; padding: 0; float: right; margin-left: 4px; }
.rightmenu #gridbutton { width: 35px; background-color: transparent; }
.close-right {
  float: right;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  font-weight: bold;
}
.container { width: 100%; max-width: 600px; margin: 0 auto; padding: 2px; }
.row { width: 100%; min-height: 26px; clear: both; }
.col1 { width: 32%; float: left; margin-right: 2%; min-height: 24px; font-weight: 600; }
.col2 { width: 63%; float: left; margin-right: 2%; min-height: 24px; overflow-wrap: anywhere; }
.col2:last-child { margin-right: 0; }
.collegend { width: 8%; float: left; margin-right: 5%; min-height: 18px; }
.collegend img { width: 16px; height: 16px; transform: scale(1.5); margin-left: 5px; }
.legenda { margin-top: 12px; border-top: 1px solid rgba(0,0,0,.18); padding-top: 10px; }
.legend-title { margin-bottom: 9px; }
.stats-title { margin-top: 8px; }
.tecno1 { color: red; }
.tecno2 { color: green; }
.tecno3 { color: blue; }

.menu.up { animation: up .3s ease-in forwards; }
.menu.down { animation: down .3s ease-out forwards; }
@keyframes up { 0% { bottom: -270px; } 100% { bottom: 5px; } }
@keyframes down { 0% { bottom: 5px; } 100% { bottom: -270px; } }
.menu {
  font-family: Calibri, "Trebuchet MS", sans-serif;
  z-index: 900;
  align-items: center;
  justify-content: center;
  bottom: -270px;
  height: 75px;
  margin-top: 0;
  background: rgba(230, 235, 250, .905);
  border-radius: 19px;
  position: fixed;
  padding: 10px;
  display: flex;
  width: 60%;
  max-width: 600px;
  min-width: min(530px, 94vw);
  left: 50%;
  transform: translateX(-50%);
}
.menu.profile-open {
  height: 238px;
  width: min(760px, 94vw);
  max-width: 760px;
  display: block;
  padding: 10px 14px 12px;
}
.profile-close {
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  font-weight: bold;
}
#myChart { width: 100% !important; max-width: none; height: 155px !important; max-height: 155px; display: none; border-radius: 20px; padding-right: 24px; }
#innermenu { display: flex; width: 100%; max-width: none; min-width: 0; position: static; }
#menu1 { display: flex; width: 100%; text-align: end; background-color: transparent; color: black; padding: 8px 4px 0; position: relative; }
.menu-part1 { display: flex; flex-direction: column; width: 50%; box-sizing: border-box; margin: 5px 0; text-align: left; }
.menu-part1 p { margin: 0 0 6px; }
#separator { width: 1px; background: rgba(0,0,0,.25); margin: 0 10px; }

#map { min-width: 80%; height: 100svh; }

.report, #popup-window {
  overflow-y: auto;
  position: fixed;
  max-width: 90%;
  width: 850px;
  height: 700px;
  background: rgba(230, 235, 250, .905);
  border: 1px solid black;
  border-radius: 20px;
  padding: 10px;
  margin: auto;
  inset: 0;
  z-index: 1000;
  display: none;
}
#popup-window { width: 600px; }
.report p { font-family: Arial, Helvetica, sans-serif; display: inline-block; }
.report ul { list-style: none; padding: 0 6px; margin: 0; max-height: calc(100% - 44px); overflow: auto; }
.report li { border-bottom: 1px solid rgba(0,0,0,.35); padding: 12px 0; }
.report-grid { display: grid; grid-template-columns: 92px 1fr 92px 1fr; gap: 6px 10px; align-items: center; font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
.report-label { font-weight: 700; }
.report-value { overflow-wrap: anywhere; }
.report-value img { height: 12px; width: 12px; object-fit: contain; margin-left: 5px; vertical-align: middle; }
.report-tech-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.report-tech-dot.is-next { background: #1d4ed8; }
.report-tech-dot.is-waveg { background: #16a34a; }
.report-tech-dot.is-wave { background: #dc2626; }
.report-tech-dot.is-unknown { background: #6b7280; }
.texttitle { font-size: 20px; font-family: Arial, Helvetica, sans-serif; padding: 10px; }
.textinfo { font-size: 14px; font-family: Arial, Helvetica, sans-serif; padding: 0 10px 10px; }
.close-button { margin-top: 20px; height: 40px; width: 570px; max-width: 100%; border-radius: 15px; display: block; }

.admin-panel {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  background: #fff;
  font-family: Arial, sans-serif;
}
.admin-panel.open { display: flex; }
.admin-menu {
  width: 300px;
  background-color: #3C6FCD;
  min-height: 100svh;
  padding: 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-menu a {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: #fff;
  border-radius: 4px;
}
.admin-menu a:hover, .admin-menu a.active { background-color: #A8BFF0; }
.admin-content { flex: 1; padding: 20px; overflow: auto; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-panel form {
  max-width: 720px;
  background-color: #A8BFF0;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,.1);
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.admin-panel label, .admin-panel input, .admin-panel select { display: block; }
.admin-panel input[type="text"], .admin-panel input[type="number"], .admin-panel input[type="date"], .admin-panel input[type="file"], .admin-panel input:not([type]), .admin-panel select {
  width: calc(100% - 20px);
  padding: 8px;
  border: 1px solid #A6D8D4;
  border-radius: 4px;
  font-size: 14px;
}
.inline-form { display: flex !important; max-width: none !important; flex-wrap: wrap; align-items: end; }
.inline-form input, .inline-form select { width: 220px !important; }
.admin-toolbar { display: flex; gap: 8px; margin: 12px 0; }
.table-wrap { overflow: auto; border: 1px solid #A6D8D4; border-radius: 4px; }
table { width: 100%; border-collapse: collapse; margin-top: 0; }
th, td { border: 1px solid #A6D8D4; padding: 8px; text-align: left; vertical-align: top; }
th { background-color: #A8BFF0; color: #fff; }
pre { white-space: pre-wrap; background: #1f2937; color: #f9fafb; padding: 10px; border-radius: 6px; max-height: 260px; overflow: auto; }

@media (max-width: 500px) {
  #leading_text { display: none; }
  #input { width: calc(10px + 90vw - 150px); }
}
@media (max-width: 700px) {
  .rightmenu { right: min(-15.3%, -170px); }
  .legenda { display: none; }
  .rightmenu.show { animation: show .3s ease-in forwards; }
  .rightmenu.zhide { animation: zhide .3s ease-out forwards; }
  @keyframes show { 0% { right: min(-15.3%, -170px); } 100% { right: 10px; } }
  @keyframes zhide { 0% { right: 10px; } 100% { right: min(-15.3%, -170px); } }
  .topmenu { padding: 10px; gap: 6px; }
  .icon-button { padding: 0 7px; font-size: 12px; }
  .rightmenu {
    top: 92px;
    width: 58vw;
    min-width: 190px;
    max-width: none;
    max-height: calc(100svh - 140px);
    font-size: 12px;
    padding: 10px;
  }
  .rightmenu.show { right: 8px; }
  .close-right { display: block; }
  .report { width: calc(100vw - 16px); height: calc(100svh - 30px); max-width: none; }
  .report-grid { grid-template-columns: 86px 1fr; }
  .menu.profile-open {
    width: calc(100vw - 12px);
    height: 224px;
    padding: 8px 10px 10px;
  }
  #myChart { height: 135px !important; max-height: 135px; }
  #menu1 { padding-top: 6px; font-size: 12px; }
  .menu-part1 { margin: 2px 0; }
  .admin-panel.open { flex-direction: column; }
  .admin-menu { width: 100%; min-height: auto; flex-direction: row; overflow-x: auto; padding: 10px; }
  .admin-menu b { display: none; }
  .admin-content { padding: 10px; }
}
