/* water.css */
html, body { height: 100%; margin: 0; padding: 0; font-family: sans-serif; display: flex; flex-direction: column; overflow: hidden; background-color: #f8f9fa; }

#loginScreen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); z-index: 3000; display: flex; justify-content: center; align-items: center; flex-direction: column; }
.login-box { background: white; padding: 30px 20px; border-radius: 12px; width: 85%; max-width: 320px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.login-input { width: 90%; padding: 12px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 6px; font-size: 16px; box-sizing: border-box; }
.login-btn { background: #1565C0; color: white; border: none; padding: 14px; width: 90%; border-radius: 6px; font-size: 16px; font-weight: bold; cursor: pointer; }

.control-panel { position: absolute; top: 0; left: 0; width: 100%; box-sizing: border-box; padding: 10px; background-color: transparent; z-index: 10; display: flex; justify-content: center; box-shadow: none; pointer-events: none; }
.control-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; pointer-events: auto; }

.ctrl-btn { padding: 8px 12px; font-size: 12px; font-weight: bold; cursor: pointer; border-radius: 5px; box-sizing: border-box; }

#map { flex-grow: 1; width: 100%; }

input[type="text"], input[type="password"], input[type="date"], input[type="number"], select, textarea { padding: 8px; font-size: 16px; border-radius: 5px; border: 1px solid #aaa; box-sizing: border-box; width: 100%; }
.form-label { display: block; font-size: 14px; color: #555; margin-bottom: 5px; font-weight: bold; margin-top: 10px; text-align: left; }

#modal { display: none; position: fixed; z-index: 9999; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal-content { background: #fff; color: #333; padding: 20px; border-radius: 12px; width: 90%; max-width: 400px; max-height: 85vh; overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.3); text-align: left; }

.polygon-label { text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; font-weight: bold; font-size: 12px; }

/* 簡易版農業CAD（給水口） */
#waterCadOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: #111;
  flex-direction: column;
}
#waterCadOverlay.open { display: flex; }
#waterCadHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #1a237e;
  color: #fff;
  flex-shrink: 0;
}
#waterCadMapWrap {
  flex: 1;
  position: relative;
  min-height: 0;
}
#waterCadMap { width: 100%; height: 100%; }
#waterCadPanel {
  background: #1e1e1e;
  color: #eee;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  flex-shrink: 0;
  border-top: 1px solid #333;
}
.water-cad-btn {
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
}
.water-cad-btn:disabled { opacity: 0.5; cursor: default; }
.water-cad-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.water-cad-btn-row .water-cad-btn { flex: 1; min-width: 90px; }
