.cell-best {
  background-color: #c8f7c5;
}
.cell-average {
  background-color: #fffac8;
}
.cell-worst {
  background-color: #ffffff;
}
.modal .close-download-modal {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
}
.modal .close-download-modal:hover {
  color: #000;
}
#map {
  height: 600px;
  width: 100%;
  margin-top: 10px;
}
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #f5f5f5;
  color: #333;
}
h1 {
  color: white;
  margin: 0;
  padding: 0 1.5rem;
}
.app-container {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-direction: row;
  min-height: calc(100vh - 72px);
  overflow: hidden;
}
.left-panel {
  flex: 0 0 350px;
  padding: 1rem;
  background: white;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  position: sticky;
}
.left-panel form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.left-panel form label {
  margin: 0.5rem 0 0.2rem;
  font-weight: bold;
}
.left-panel form input,
.left-panel form select,
.left-panel form textarea {
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  width: calc(100% - 1rem);
}
.left-panel form input[type="radio"],
.left-panel form input[type="checkbox"] {
  width: auto;
  font-weight: normal;
}
.left-panel form .radio-box label,
.left-panel form .checkbox label {
  font-weight: normal;
}
.left-panel form textarea {
  resize: vertical;
  min-height: 420px;
  font-family: monospace;
}
.wind-table tr:nth-child(odd) {
  background-color: rgba(0, 0, 0, 0.02);
  /* ca. 5% Grau */
}
.wind-table tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.08);
  /* 20% Grau */
}
button {
  margin-top: 1rem;
  padding: 0.6rem;
  background: #4CAF50;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  background: #3d8b40;
}
button.btn-organge {
  background: #faae0a;
}
button.btn-organge:hover {
  background: #cd8d04;
}
button.btn-blue {
  background: #3737b5;
}
button.btn-blue:hover {
  background: #2b2b8e;
}
button.btn-red {
  background: #950000;
}
button.btn-red:hover {
  background: #620000;
}
button.btn-green {
  background: #2e7d32;
}
button.btn-green:hover {
  background: #205823;
}
button.btn-gray {
  background: #607d8b;
}
button.btn-gray:hover {
  background: #4b626d;
}
button a {
  color: white;
  text-decoration: none;
}
.second-panel {
  flex: 0 0 260px;
  padding: 1rem;
  background: white;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  margin-right: 1rem;
}
#result {
  margin-top: 1rem;
  background: #f9f9f9;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}
#result h2 {
  margin-top: 0;
  color: #4CAF50;
}
#result p {
  margin: 0.2rem 0;
}
#result b {
  color: #000;
}
.right-panel {
  flex: 1;
  position: relative;
}
.right-panel #map {
  height: calc(100vh - 220px);
  width: 100%;
}
.input-full {
  display: block;
}
.right {
  float: right;
}
.main-header {
  padding: 0.5rem 1rem;
}
header,
footer {
  display: flex;
  gap: 1rem;
  background: #4CAF50;
  color: white;
  margin: 0;
  border-bottom: 2px solid #3d8b40;
  display: block;
}
footer {
  text-align: center;
  padding: 1rem;
  border-top: 2px solid #3d8b40;
}
footer p,
footer a,
footer span {
  color: white;
}
.main-header a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.main-header a:hover {
  background: rgba(255, 255, 255, 0.15);
}
.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5em;
}
.input-group button {
  margin-right: 0.5em;
}
.input-group .input-group-title {
  font-weight: bold;
  margin-bottom: 0.5em;
}
.input-group > label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
input[type="date"],
input[type="time"],
input[type="text"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.inline {
  display: flex;
  margin-bottom: 0.8rem;
}
.inline button {
  margin-top: 0 !important;
  margin-right: 12px;
}
#start_lat,
#start_lon {
  width: 90px;
  margin-right: 12px;
}
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .left-panel {
    height: auto;
    border-right: none;
    border-bottom: 1px solid #ccc;
    min-height: 100vh;
  }
  .right-panel {
    width: 100%;
    height: auto;
    position: inherit;
  }
  .right-panel #map {
    display: block;
    height: 400px;
    width: 100%;
    min-height: 300px;
    position: inherit;
  }
  .left-panel,
  .right-panel {
    flex: none;
    margin: 0;
  }
  .stammdaten {
    top: 0;
  }
}
.wind-table {
  border-collapse: collapse;
  margin-top: 1rem;
  overflow: scroll;
}
.wind-table th,
.wind-table td {
  padding: 0;
  border: 1px solid #ccc;
  text-align: center;
  height: 20px;
}
.wind-table .odd {
  background: #f8f8f8;
}
.wind-table .even {
  background: #ffffff;
}
.wind-table .highlight {
  background-color: #d9fdd3 !important;
  font-weight: bold;
}
.wind-matrix {
  overflow-x: auto;
  white-space: nowrap;
}
.wind-table input {
  max-width: 80px;
  border: 0;
  background: transparent;
  text-align: right;
  -webkit-appearance: none;
  appearance: textfield;
  padding: 2px 4px;
}
@media (max-width: 1024px) {
  .wind-table input {
    font-size: 16px;
  }
}
#openConfig {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
}
#configModal {
  display: none;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  z-index: 1000;
}
#zoom-level-display {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: #fff;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}
.modal.hidden {
  display: none;
}
.modal {
  position: fixed;
  top: 20%;
  left: 20%;
  width: 60%;
  background: white;
  padding: 1rem;
  border: 1px solid #ccc;
  z-index: 1000;
}
.modal-content input {
  width: 100%;
  margin-bottom: 0.5rem;
}
.content {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.content .left,
.content .right {
  flex: 1 1 100%;
}
@media (min-width: 768px) {
  .content .left {
    flex: 1 1 min-content;
    max-width: 230px;
  }
  .content .right {
    flex: 1 1 auto;
  }
}
#coordMap {
  height: 350px;
  margin-top: 1em;
  margin-bottom: 1em;
}
#wind-table-container {
  max-height: 40vh;
  overflow-y: auto;
}
#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #323232;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  pointer-events: none;
  font-size: 14px;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
/* Tabs UI */
.tabs {
  margin-top: 1rem;
}
.tab-buttons {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #ddd;
  overflow-x: auto;
}
.tab-btn {
  margin-top: 0;
  border: 1px solid #ddd;
  border-bottom: none;
  background: #f6f6f6;
  padding: 0.4rem 0.7rem;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  color: #000;
}
.tab-btn:hover {
  background: #eee;
}
.tab-btn.active {
  background: #fff;
  border-color: #ccc;
  color: #000;
  font-weight: bold;
}
.tab-panels {
  border: 1px solid #ccc;
  border-top: none;
  background: #fff;
  border-radius: 0 0 6px 6px;
  padding: 0.8rem;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
/* Stammdaten fix oben innerhalb der linken Spalte */
.stammdaten {
  position: sticky;
  top: 0;
  z-index: 5;
  background: white;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}
.stammdaten form.inline label {
  margin: 0 !important;
}
/* Optional: schoenes Panel fuer „Optimales Resultat“ */
.optimal-result {
  margin-top: 1rem;
  background: #f9f9f9;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef3ff, #f8fff4);
}
.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  max-width: 300px;
  width: 100%;
  margin: 1rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
.login-card h1 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #4CAF50;
  text-align: center;
  background-color: transparent;
}
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-card label {
  font-weight: bold;
  font-size: 1rem;
  color: #333;
}
.login-card input[type="password"] {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
.login-card input[type="password"]:focus {
  border-color: #4CAF50;
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}
.login-card button[type="submit"] {
  padding: 0.6rem;
  background: #4CAF50;
  border: none;
  color: white;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
}
.login-card button[type="submit"]:hover {
  background: #3d8b40;
}
.login-card p {
  margin-top: 1rem;
  font-size: 1rem;
  text-align: center;
}
.login-card a {
  color: #4CAF50;
  text-decoration: none;
}
.login-card a:hover {
  text-decoration: underline;
}
/* === Admin Page Look === */
.admin-wrap {
  max-width: 1100px;
  padding: 0 1rem;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 {
  margin: 0 0 0.75rem 0;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  border: 1px solid #e5e7eb;
  padding: 0.6rem 0.7rem;
}
.table th {
  background: #f8fafc;
  text-align: left;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.link-logout {
  text-decoration: none;
}
.btn-inline {
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}
.btn-inline:hover {
  background: #f8fafc;
}
/* Fehlerbox (auch fuer Logins) */
.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin: 0.5rem 0 0.75rem;
}
.link-logout {
  margin-left: 8px;
  text-decoration: none;
}
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wind-table input,
editTable input {
  max-width: 50px;
  border: 0;
  background: transparent;
  font-size: 1em;
}
.wind-table th,
editTable th,
.wind-table td,
editTable td {
  text-align: left;
}
.wind-table input,
editTable input {
  text-align: right;
}
.container {
  max-width: 1100px;
  padding: 1rem;
  background: #fff;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.success {
  margin-top: 0.5rem;
  color: #2e7d32;
}
div.left-panel form#configForm fieldset.stammdaten div.form.inline input {
  width: calc(100% - 16rem);
  margin-left: 12px;
}
div.left-panel form#configForm fieldset.stammdaten div.form.inline button {
  margin-left: 12px;
}
.opt-times {
  width: 100%;
}
.wm-wrap {
  max-width: 1100px;
  padding: 1rem;
}
.wm-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.wm-title {
  font-size: 2rem;
  margin: 0 0 0.75rem;
}
.wm-topbar {
  margin-bottom: 1rem;
}
.wm-topbar label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wm-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.wm-list {
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
}
.wm-bullet {
  margin-right: 0.4rem;
}
.wm-arrow {
  width: 1em;
  position: inherit;
  text-align: left;
  display: inline-block;
}
.wm-meta {
  margin: 0.25rem 0 0.5rem;
}
.wm-table input {
  border-collapse: collapse;
  font: 18px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.wm-table th,
.wm-table td {
  border-bottom: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  text-align: right;
  line-height: 1;
}
.wm-table thead th {
  background: #f7f7f7;
}
.wm-table tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, 0.03);
}
.wm-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0);
}
.wm-table .num {
  text-align: right;
}
.wm-dir {
  white-space: nowrap;
  position: sticky;
}
.wm-table .dir-val {
  display: inline-block;
  width: 3ch;
  text-align: right;
}
/* Mini-Löschen-Icon für wm-table (sichtbar nur bei Hover) */
.wm-table td {
  position: relative;
}
.wm-table .row-del {
  position: absolute;
  right: -22px;
  transform: translateY(-23px);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  color: #666;
  background: transparent;
  border: 0;
}
.wm-table tr:hover .row-del {
  opacity: 1;
}
.wm-table .row-del:hover {
  color: #c00;
  background: #fdecec;
}
.wm-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-blue {
  background: #1976d2;
  color: #fff;
  border: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}
.btn-gray {
  background: #607d8b;
  color: #fff;
  border: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}
/* --- Tiny row delete button, visible only on row hover --- */
.wind-table td {
  position: relative;
}
.wind-table .row-del {
  position: absolute;
  right: 4px;
  top: 0;
  transform: translateY(-14px);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  color: #666;
  background: transparent;
  border: 0;
}
.wind-table tr:hover .row-del {
  opacity: 1;
}
.wind-table .row-del:hover {
  color: #c00;
  background: #fdecec;
}
#timeModal {
  width: 100%;
  max-width: 386px;
}
